Hello! We are working on an application which creates a draft order and then completes the draft order. The problem is that we have to sleep our process in order to avoid the "This order has not finished calculating, please try again later" message.
In order to avoid this sleep, we are instead listening for the draft_order/create webhook. The problem we are facing is that the draft order metadata is not coming in the webhook payload so that we can pass a state between the initial order creation and the webhook.
Is there a way to make the draft_order/create webhook payload include the draft order metadata?
I had a closer look at your question regarding the use of draft order webhooks and wanted to confirm some details to make further suggestions.
Are you referring to webhooks created in the admin or via the API?
By metadata are you referring to appended details to the webhook payload? or metafield data from the draft order resource?
Would you be able to share an example of the documentation you are using as well as an example webhook payload body and x-shopify-webhook-id header value returned with the example payload response? Please be careful to exclude any private store info.
Happy to take a closer look once I know more. - Thx.
I actually ended up dropping our webhook based approach and went for an inline polling approach to determine when the draft order was ready for completion. This was actually the recommended approach in the API docs. The original reason for this question is no longer relevant.