FROM CACHE - en_header

Are product and order ID's unique across all stores on Shopify?

Ari9
Excursionist
35 3 8

I'm developing an app and would like to know if I can safely use an order ID/product ID as a primary key in my database?

Is it guaranteed that a product or order ID will never be the same even across stores?

 

For example, Store A has a product ID 123456, is it possible for Store B to have the same product ID?

 

I currently have an auto-incrementing ID along side the order ID because I am unsure if the order or product ID is completely unique, and being able to use the Shopify order/product ID as my PK will make things a lot more simple.

Reply 1 (1)
SBD_
Shopify Staff
Shopify Staff
1098 146 221

Hey @Ari9 

Product and order IDs are unique across all shops (not to be confused with order name).

For example, Store A has a product ID 123456, is it possible for Store B to have the same product ID?

No.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog