Headless commerce and custom storefronts with Shopify APIs and SDKs
I recently ran into a problem where I was trying to implement the queue functionality for high-traffic sales in a mobile app using the storefront API. It seems like it was recently added with the 2021-07 version, and using the schema provided by shopify for the storefront API I have found how to submit it and how to retrieve it, but there is no documentation available on how to poll it.
From my understanding if a queue is active the storefront api will return a throttled_during_checkout error, from which you can retrieve the token. But my question is do I just keep submitting this token again and again (Thus "polling" it, though that does not seem right) till it bypasses the queue? Or is there a different mutation I should be using? I know how to submit it, but I just do not know how to poll the checkout.
Any help is appriciated.
Thanks for raising this regarding the queueToken - I can clarify a few things here regarding it's use.
The use of the polling mechanism is gated on shop level and isn't available to be called for all stores. I acknowledge that when Version 2021-07 was released, this point wasn't mentioned in the docs which would be misleading. We're getting a doc change pushed into the documentation as I write.
To mitigate the throttling on Checkout (and negate the need for a queueToken) we do have the Cart Storefront API. It's newly released - albeit on the unstable version - but will be becoming stable early next year. I'd recommend to stay abreast for any further announcements concerning it's transition to the stable API via the Developer changelog.
Hope this helps - please let me know if you have any further questions!
Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...By Ollie May 25, 2023
Summary of EventsBeginning in January of 2023, some merchants reported seeing a large amo...By Trevor May 15, 2023
With 2-Factor Authentication being required to use Shopify Payments, we’re here to help yo...By Imogen Apr 26, 2023