Hello All,
We have 1 website, on which we will place the Shopify Buy button. And 1 Shopify store with 1-2 fixed products.
- We will send customers to our Shopify store, for checkout and payment once they click on the Shopify Buy button from our internal website.
- Before sending a customer to the Shopify store, we have to generate the unique order on our website, for sending attachments via email once that order is successful on the Shopify store.
- Once an order is successful and payment is done by the customer on the Shopify store, we are planning to implement webhook OR any APIs to exact match with our internal website and if the order is done, we will send an attachment to the customer.
Can anyone let me know, how can we achieve this? the best ways to match the order number from the Shopify store and on our internal website? OR guide me on the best way to do this?
Use the order.name* property that can be set to any string over the api. (link to content wont work because the docs are over engineered react silliness , in the order properties area click “**Show 66 hidden fields”).
Also consider order tags, note_attributes or metafields.
https://shopify.dev/api/admin-rest/2022-10/resources/order#put-orders-order-id
Keep in mind in the sequence logic things like shopify’s order numbers don’t exist until AFTER an order is created, sans draft-orders everything before that is a checkout.
*There’s ambiguity about what attributes you can change/update and when you can do that https://community.shopify.com/topic/301462 . Order ids are platform idempotent immutable statically generated data, and things like order.number and order.order_number should not be used for this
@PaulNewton
Thank you for the quick reply.
But still, I am not getting it properly.
If we use, order.name property as you mentioned but what about multiple orders?
For example, if we set the “order.name” property in our Shopify account to “documents”. so every order processed in our Shopify store will have a suffix/prefix like “documents”?
But how can we make this string dynamic? as we are storing orders first in our internal database, and suppose, 2 different users click on Buy now button from our website and redirect to Shopify for further process, then how we will know which order is processed/completed on the Shopify store?
Is there any way to pass any extra parameters to the “Buy Now” button code so we can have that parameter reference on our website? like, we can pass, the “order.name” = “document123” for 1 user and pass “order.name” = “document456” for 2 separate orders?
@PaulNewton
Can you please help? I need 1 unique string OR identifier, to uniquely identify orders from our website to on our Shopify store.