Why is the Draft Order Invoice URL showing an error page?

Why is the Draft Order Invoice URL showing an error page?

Robert_Radtke
Shopify Partner
1 0 3

We are generating Draft Orders using the REST API and then getting the Invoice URL to redirect customers to in order for them to complete their checkout.  However, recently we have noticed a dramatic increase in the number of users who get redirected to the Invoice URL but see an error page.

 

shopify_invoice_error.png

 

Is there any way to check if an invoice is ready for payment before redirecting a user to that page?

 

I found this older thread - https://community.shopify.com/c/customers-discounts-and-orders/draft-order-api-asynchronous/m-p/6022... but the even older thread referenced in here is no longer available.

Replies 3 (3)

chriswise71
Tourist
3 0 2

We use the Shopify API to create a Draft Order then, redirect the user to checkout.

 

We see this issue as well with some degree of regularity. It really is misleading to customers as well because they just need to reload the page (not go back to previous as directed). It is more than a little frustrating to find no real answers on this. Clearly the response to create the draft kicks off some asynchronous task that "takes time" to prepare the invoice.

BenHarkins
Shopify Partner
14 0 4

Hey @Robert_Radtke & @chriswise71 -

 

I ran into this too! The docs mention that Draft Orders do indeed have async operations that need to complete before the link will work. They recommend inspecting the headers for a "retry-after" value, then polling the "location" URL sent in the headers (repeating until it's ready):

 

chriswise71
Tourist
3 0 2

Thank you for pointing that out! Will implement this... not sure why I didn't see this in the docs before (new addition?)