Editing theme via API: This action requires merchant approval for write_themes scope.

Editing theme via API: This action requires merchant approval for write_themes scope.

mcohen
Shopify Partner
9 0 0

Hi.

I'm having issues with the edit theme API:

https://<store-url>/admin/api/2024-10/themes/<id>/assets.json

I know that in order to use this API I need an exemption from Shopify for the write_themes scope, which has already been granted to my App.

 

My customer authentication logic for installing the App looks pretty much like this:

const accessScopes = 'read_themes,write_themes,read_products,read_customers,read_fulfillments,read_orders';
const endpoint = `https://${shop}/admin/oauth/authorize?client_id=${clientId}&scope=${accessScopes}&redirect_uri=${redirectUri}`;
return res.redirect(endpoint);

 

However, it seems like the auth token I generate with the code doesn't have the write_themes scope.
When I try editing the theme I get this error:

{
    "errors": "[API] This action requires merchant approval for write_themes scope."
}


I investigated even further, using a OAUTH debugging tool.

 

https://marcels-devo-store.myshopify.com/admin/oauth/authorize?client_id=7a3fa12c626b17cfe7bcd7778ef...

 

Then I used the code returned to generate a token via Postman, I get this result:

{
    "access_token": "...",
    "scope": "read_customers,read_fulfillments,read_orders,read_products,read_themes"
}

So the write_themes scope is not included.

My app is already published on the app store, I see in the configs that the write_themes scope is not listed. My app is some legacy express app which doesn't have a TOML file, so how can I edit these scopes on the dashboard? I don't see the option.

mcohen_0-1728083647734.png

 

 

Shopify team claims I have the right access

 

mcohen_1-1728083687131.png

 

Any help is much appreciated, I need to get this sorted asap. 
Thank you in advance.

 

 

Replies 0 (0)