Discussing APIs and development related to customers, discounts, and order management.
We've noticed that the Draft Order API can return an invoice url that is not yet ready for traffic.
How long a delay do we have to add to the code before using the url returned?
Hi @stuforge ,
How often do you see this issue happening where the invoice_url is not ready yet to for traffic after the Draft Order is created? Is there a pattern of behaviour you are seeing in which invoice_url are not being instantly generated (e.g. certain times of the day, or for Draft Order with a large number of items, etc)?
The invoice_url should always be instantaneously ready and available as soon as the Draft Order is made, but I can see in rare circumstances where there is a slowdown on our platform in which the invoice_url may be slower to generate. I do not foresee this happening often, but if you have a shop ID and timeframe or a draft order ID, I could check our platform logs to investigate what might be occurring at this time to cause the invoice_url from not being always ready immediately
Lastly, there has been discussion about this before and some potential solutions discussed at this forum post, which might help you here: https://community.shopify.com/c/Shopify-APIs-SDKs/Draft-API-Error-URL-not-ready/td-p/574400
To learn more visit the Shopify Help Center or the Community Blog.
Hey @stuforge
I do not know for sure if you will get a 202 response, but I am fairly confident that if you are receiving the "Oops, something went wrong." screen from Shopify that the response code should be anything other than a 200 response - so perhaps you can be checking for that?
To learn more visit the Shopify Help Center or the Community Blog.