Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
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...`,
"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."
},
Hey there,
Your app needs to be a sales channel for access to the checkouts endpoint per-our documentation. The scope you're referencing is the checkout settings endpoint.
Cheers.
Alex | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Hi Alex
I am getting the issue "{"errors":"[API] This action requires merchant approval for write_checkouts scope."}". I gave all read and write checkout permissions, still i am getting the access issue.
Have you resolve this issue?
$api_key = "";
$scopes = "read_orders,write_checkouts,read_checkouts,write_products";
$redirect_uri = "http://securedevelopementserver.com/shopifyApp/token.php";
// Build install/approval URL to redirect to
$install_url = "https://" . $shop . "/admin/oauth/authorize?client_id=" . $api_key . "&scope=" . $scopes . "&redirect_uri=" . urlencode($redirect_uri);
Hi Alex,
I have also just come accross this same problem. Is it possible to make my Private App a sales channel in order to access the checkouts endpoint?
Thanks