Idempotent Order creation

Highlighted
New Member
2 0 0

I am trying to create an DraftOrder using the Admin graphql api and wanted to know if there is a way to guarantee that the orders can be uniquely identified during creation time. More broadly, how does Idempotency work  with the admin apis.

 

I stumbled on this Post: https://community.shopify.com/c/Shopify-APIs-SDKs/Idempotency-of-Admin-API-Requests-specifically-Inv...

This is an older post, wondering if anything has changed recently or if there is a workaround I can use in the interim.

 

0 Likes
Shopify Staff
Shopify Staff
472 35 90

Hi @cur8d,

 

There are no idempotent operations in the Shopify API.  You can not guarantee the draft order is uniquely identified prior to creation.  Simply when you make the call the return value will have the unique ID and name.

 

Hope that helps,

Ryan

 

Developer Experience @ Shopify
0 Likes
New Member
2 0 0

Thanks for the confirmation. Are there any plans on supporting this?

A pretty common pattern is to allow the api caller specify an optional Idempotent key, that can be used prevent duplicates. Is this something being considered?

 

Thanks!

0 Likes
Shopify Staff
Shopify Staff
472 35 90

I don't think there are any plans currently to implement idempotent keys, however it is something that can definitely change in the future.

Developer Experience @ Shopify
0 Likes