d
Topic
Posts:
3
March 08, 2013

Customer Order# Mapping to API #{id} This post is outdated

Hi,

Customer placed an order, Here received an email "Order confirmation for order 501003".

Now I want to use API to get order details, According to http://docs.shopify.com/api/order#show: Receive a single Order - GET /admin/orders/#{id}.json

When I used the request : https://{mystoreid}.myshopify.com/admin/orders/#{501003}.json , I got error 'NOT FOUND'.

Please advise if there is any way to looking order details by the order#.

 

Thanks

Muhammad

 

 

 

 

 

 

i
Replies
Posts:
2839
March 08, 2013

Get rid of the #{} characters... that is script code used by string interpolation in Ruby for example. 

Just use the order ID number itself with the .json extension.

 

Specializing in Custom Shopify Apps hunkybill@gmail.com http://www.resistorsoftware.com
Posts:
3
March 08, 2013

Hi,

I did test with https://{mystoreid}.myshopify.com/admin/orders/501003.json  but again 'not found'.

Customer support informed me that there is an internal order_id being generated of each customer, I think API takes internal order_id instead of order# given to customer in the email.

Is there a way to get internal order_id using API?

 

Thanks

Muhammad

Posts:
10
March 08, 2013

Try removing the   

Seriously about Shopify. Thousands of Shopify shop owners rely on Coolence apps to help take their shops to the next level! www.coolence.com
hj Shopify Partner sudoit.nl
Posts:
205
Last edited March 08, 2013

The number specified in the confirmation email is not the order_id, it's the Order name. Currently it's not possible to fetch one Order 'by name', you can only fetch one Order 'by id' (order_id).

But you can fetch all Orders including all Order details with:

https://{mystoreid}.myshopify.com/admin/orders/admin/orders.json

See the API docs for more details. Within the results you can look for the Order name and it's corresponding order_id.

Posts:
3
Last edited March 08, 2013

HJ,

Thanks for the help, You are right this is the limitation of the API to not get order info by 'name' field.

Not sure how soon shopify team will have that ability!

 

Thanks

Muhammad

hj Shopify Partner sudoit.nl
Posts:
205
March 08, 2013
hj Shopify Partner sudoit.nl
Posts:
205
Last edited March 14, 2013

Correct me if I'm wrong ;-), it is actually possible to find an Order 'by name'. It seems an undocumented feature and might be unsupported.

To find order #1001 use:

https://{mystoreid}.myshopify.com/admin/orders.json?name=%231001

You might need to add status=any if the Order is already closed.

https://{mystoreid}.myshopify.com/admin/orders.json?name=%231001,status=any

Log in or sign up for an account to reply.

This thread has been closed! You will not be able to reply.