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

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!

1 Like

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

Hi!

The checkoutID above seems to be base64 encoded. For the request you may try to decode it first and add it to your query then.

Best regards!