App reviews, troubleshooting, and recommendations
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi there! I have an app which allows customers to apply discount codes on the cart page using the mutation "cartDiscountCodesUpdate" provided by Storefront API. This mutation needs cart id with the following template:
{
message: "The specified cart does not exist.",
errorCode: "INVALID"
}
And you know what? There's no even such issue in the documentation of this mutation: https://shopify.dev/docs/api/storefront/2024-04/mutations/cartdiscountcodesupdate
There is INVALID code but the message is different: "The input value is invalid."
And I also found that the cart token differs on stores with the new checkout and the old one:
Z2NwLWV1cm9wZS13ZXN0MTowMUhaRjZTRlg4RzlTOEZWWUdGUUNaWTA1UA - token format on the new checkout stores
01313bbad43e0354bd635585beb0dd1c - token format on the old checkout stores
Is there anything which can help me to apply discount codes using graphql mutation? Or maybe I can recreate an id of a cart? So any ideas please! 🙏
Any luck with the mutation? I have the same issue with some stores.
We're having the same issue!
Sometimes the AJAX API (GET /cart.js)
returns tokens in the longer format (Z2NwLXVzLWVhc3QxOjAxSkpOSEhDR05IM0tENlRBV0FDMktUWlBD?key=6184a46df0a4e29cbea6cf658ae903a6)
sometimes in the shorter format (6a6d0880ec1fce20e61deaf9c6f0b188)
With the shorter tokens, when we use the `cartDiscountCodesUpdate` mutation to apply a discount to the cart via storefront API, we get a 'cart not found' error. But it works with the longer tokens.
Can someone from Shopify please help? This inconsistency in token format is breaking a key feature in our app.