checkout api write_checkout scope error

T_8
New Member
5 0 0

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."
},

0 Likes
Alex
Shopify Staff
Shopify Staff
1555 81 306

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.

0 Likes
Footprint_Guide
Shopify Partner
2 0 0

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

0 Likes
Raj0853
New Member
2 0 0

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.

0 Likes
Markdudhatra
Tourist
3 0 1

Have you resolve this issue?

0 Likes
AslamKhan
New Member
1 0 0

$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);

0 Likes