New Shopify Certification now available: Liquid Storefronts for Theme Developers

What permissions are required to create a checkout on the storefront API

Solved
Giltee
Shopify Partner
17 3 6

I am trying generate a checkout link through the store front API and I am getting the following access error:

 

 

 GraphqlQueryError: CheckoutCreate access denied
2023-07-23 19:11:13 │ web-backend  │     at NewStorefrontClient.<anonymous> (/Users/mpmadmin/shopify/build-a-bundle/node_modules/@shopify/shopify-api/lib/clients/graphql/graphql_client.js:52:23)
2023-07-23 19:11:13 │ web-backend  │     at Generator.next (<anonymous>)
2023-07-23 19:11:13 │ web-backend  │     at fulfilled (/Users/mpmadmin/shopify/build-a-bundle/node_modules/tslib/tslib.js:166:62)
2023-07-23 19:11:13 │ web-backend  │     at processTicksAndRejections (node:internal/process/task_queues:96:5) {
2023-07-23 19:11:13 │ web-backend  │   response: { data: { checkoutCreate: null }, errors: [ [Object] ] },

 

 

I have the following scopes setup and accepted in my app / store.

 

scopes = "unauthenticated_read_selling_plans,unauthenticated_read_product_tags,unauthenticated_write_customers,unauthenticated_read_customer_tags,unauthenticated_read_product_listings,write_products,read_discounts,read_metaobjects,read_metaobject_definitions,write_metaobjects,write_metaobject_definitions,unauthenticated_write_checkouts,unauthenticated_read_metaobjects,write_checkouts"

 

 
I am able to query other Storefront End points like product without any access issues. I can also get the response I require from the graphQL explorer app. 
 
What scopes are required to use the create checkout mutation? The documentation just says the following:
Requires unauthenticated_write_checkouts access scope.
Accepted Solution (1)
Giltee
Shopify Partner
17 3 6

This is an accepted solution.

Hi SBD_

 

After sometime I found that what I was trying to do was not the best way of going about it. I really didnt need to create a custom checkout (although the api docs did seem like that was the solution to go with). All I needed to do was simply hit the /cart endpoint with the variant ids and quantity in the url and discount if needed. 


View solution in original post

Replies 3 (3)
SBD_
Shopify Staff
Shopify Staff
1671 235 345

Hey @Giltee 

 

Can you please DM me store + app details?

Scott | Developer Advocate @ Shopify 

Giltee
Shopify Partner
17 3 6

This is an accepted solution.

Hi SBD_

 

After sometime I found that what I was trying to do was not the best way of going about it. I really didnt need to create a custom checkout (although the api docs did seem like that was the solution to go with). All I needed to do was simply hit the /cart endpoint with the variant ids and quantity in the url and discount if needed. 


SBD_
Shopify Staff
Shopify Staff
1671 235 345

Glad to hear it!

Scott | Developer Advocate @ Shopify