Development discussions around Shopify APIs
Is it possible to discern the Order ID from an email receipt from a Shopify merchant? I'm trying to work out how to use the API if I only have the email receipt.
Thanks,
M
Hey there,
I wouldn't use the email receipt to retrieve an order ID since the notification can be customized to not include an order ID, or order name for that matter. Your best bet would be to subscribe to order/create webhooks to ensure order data integrity.
However, if you can trust that the email receipt will not be customized, you can use the {{ id }} liquid variable as the identifier for order ID.
- Jordan
Jordan | 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
Hi Jordan,
Thank you very much! If I understand correctly this allows me to see/retrieve the order if I am the merchant. If I am the client how do I use the order ID and the merchant URL to view my order through the API?
Thanks,
M
Hey M,
That's right. If you're the api client, you can use the order ID in a GET request like:
GET /admin/orders/#{order_id}.json
You can read more about it here.
- Jordan
Jordan | 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
Hi Jordan,
But in this scenario I am the consumer / buyer, am I able to view the order then using the Shopify API?
Thanks,
M
Hey M,
Customers don't have access to the Shopify API. They would need be registered as an api_client (i.e an app installed on the merchants shop) in order to make authenticated requests to the Shopify API.
- Jordan
Jordan | 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
Thanks Jordan.
M
User | RANK |
---|---|
10 | |
5 | |
3 | |
3 | |
3 |
Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023Summary of EventsBeginning in January of 2023, some merchants reported seeing a large amo...
By Trevor May 15, 2023With 2-Factor Authentication being required to use Shopify Payments, we’re here to help yo...
By Imogen Apr 26, 2023