I’m trying to PUT /admin/checkouts/{token}.json
When I make requests I get the below response. I have set the private app to allow checkout read/write settings as seen in the screenshot.
Also, trying to make a GET request gives me a similar error, but for “read_checkouts.”
Any ideas?
// shopify checkout creation webhook
module.exports.checkoutCreation = function(req, res) {
let checkout = req.body
let checkoutToken = checkout.token
request(
{
method: 'PUT',
preambleCRLF: true,
postambleCRLF: true,
headers: {
"X-Shopify-Access-Token": process.env.SHOPIFY_APP_PASSWORD,
"Host": process.env.SHOPIFY_DNS,
"Content-Type": "application/json"
},
uri: `[https://${process.env.SHOPIFY_APP_API}:${process.env.SHOPIFY_APP_PASSWORD}@${process.env.SHOPIFY_DNS}/admin/checkouts/${checkoutToken}.json](https://${process.env.SHOPIFY_APP_API}:${process.env.SHOPIFY_APP_PASSWORD}@${process.env.SHOPIFY_DNS}/admin/checkouts/${checkoutToken}.json)`,
"json":{
"checkout": {
"token": checkoutToken,
"shipping_line": {
"handle": "shopify-Standard%20Shipping-10.99"
}
}
}
}, (err, httpResponse, body) => {
if(err) {
console.log(err)
res.sendStatus(400)
} else {
console.log(JSON.stringify(httpResponse, undefined, 2))
res.sendStatus(200)
}
}
)
}
"statusCode": 403,
"body": {
"errors": "[API] This action requires merchant approval for write_checkouts scope."
},