Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Getting order id from draft order

Getting order id from draft order

Shaun16
Tourist
4 0 0

Hi. I'm creating a draft order using the Admin REST API, and then later using the invoice_url to charge a user. This converts the draft order into an order, but the order has a different id from the draft order. How do I obtain this new order id since it was generated via this invoice_url? 

Reply 1 (1)

andrewchen
Tourist
3 0 1

Hi Shaun,

 

Was searching the Community Boards for an answer to a different but related question and came across your post.

 

Not sure if you ever figured this out, but, if not, the DraftOrder resource has a property called order_id; posted a screenshot of the property def from the Admin REST API documentation (https://shopify.dev/api/admin-rest/2022-01/resources/draftorder). 

 

Hope this helps get you pointed in the right direction.

 

Screen Shot 2022-08-04 at 10.30.31 AM.png