Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

checkout api write_checkout scope error

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

Replies 5 (5)

Alex
Shopify Staff
1561 81 341

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

Raj0853
Visitor
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.

Markdudhatra
Tourist
3 0 1

Have you resolve this issue?

AslamKhan
Visitor
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);

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