Apply discountCode by Storefront API with GraphQL got error checkout dose not exist

truongnd
New Member
2 0 1

Hi All, 

I'm making private app to apply auto discount code into checkout. But i was got issue and stuck on it.

First,i created webhook listener checkout update to receive checkout info.

After that i get id from checkout info and then use graphQL to call checkoutDiscountCodeApplyV2 but alway got error "Checkout does not exist"

Can Anyone help me resolve this issue. Thanks a lot!

 

Screen Shot 2021-05-09 at 14.07.25.png

awwdam
Shopify Staff
Shopify Staff
65 6 3

Hey @truongnd, from my understanding you can only use a mutation like this on checkouts created by your private app, with the Storefront API - more info here.

awwdam | API Support @ 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 Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
mattxt
New Member
1 0 0

@awwdam Do you know what the message "Checkout does not exist" or code "INVALID" means? I am getting the same error when using the JS Buy SDK and I can't figure out what is causing the issue.

0 Likes