Hi all,
we're using draft orders to calculate order cost, amongst other things. The docs mention that some draft orders may need polling to get the correct price:
https://shopify.dev/docs/admin-api/rest/reference/orders/draftorder#create-2020-07
When you create and update draft orders some calculations are done asynchronously, such as calculating shipping and taxes. There might be times when a draft order is created but these calculations haven't completed. In these cases, you need to poll the draft order until the calculations are finished.
We have never come across any draft orders that actually require polling. Can someone provide more information on the circumstances under which polling is necessary? Have others implemented polling or are you just using the draft order that comes back from the API?
Thanks in advance,
Nils
Hi tolgapaksoy, thanks for your reply.
Do you know what circumstances lead to polling being needed? We've run without polling for almost 1 year now on existing code without ever seeing a 202.
Hey @nmmlon,
As mentioned already, a 202 is only returned if shipping+tax calculations need extra time. This usually happens if a shop uses an external service for tax or shipping, or in rare cases when the Shopify platform is under heavy load. In most cases however, you can expect a 200 response.
If you want to test this, try loading up a draft order with multiple unique SKUs to increase the number of calculations that need to happen.
JB | Developer 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
User | Count |
---|---|
14 | |
12 | |
10 | |
8 | |
7 |