Solved

since_id does not seem to be working with Order GET request

justinphull
Tourist
9 0 1

I've been working on a process to pull orders down from our Shopify store into our back end ERP system. I've been able to pull orders using status I've either open or closed. However when I tried to use the since_id parameter, it did not work . For example we currently have five orders in our store, starting with 1001 to 1005.I want to pull only orders after 1003 and I used this URL request:

https://mystore.myshopify.com/admin/api/2021-01/orders.json?since_id=1003

What happened was this url returned the same results, 4 open orders

https://home-stem.myshopify.com/admin/api/2021-01/orders.json?status=open

what I got back we're all 4 open orders. I looked through the forums and I notice that there were moments when since_id had problems so I'm wondering if this is the case because I can't see any other reason why this would not work period the request is pretty straightforward. Hoping somebody from Shopify development can see this and respond. I realized that I can do filtering in my program but I certainly would like to use this feature if and when it becomes available and is working again.

Accepted Solution (1)

samc
Excursionist
32 1 25

This is an accepted solution.

Hi, so my guess is that you are passing in order number (i.e. 1001) and not the actual order ID. Please double check as the ID are often 8-9 digits. 

Also just curious, which ERP system are you integrating to and are you building a custom application for it?

View solution in original post

Replies 5 (5)

samc
Excursionist
32 1 25

This is an accepted solution.

Hi, so my guess is that you are passing in order number (i.e. 1001) and not the actual order ID. Please double check as the ID are often 8-9 digits. 

Also just curious, which ERP system are you integrating to and are you building a custom application for it?

justinphull
Tourist
9 0 1

 Thank you for the response. You are indeed correct that I was using the order number that is displayed and not the order ID which is not. To be fair the example is a little ambiguous:

GET /admin/api/2021-04/orders.json?since_id=123

123 could be interpreted either way however when I did use the internal id it worked exactly as described. Just another number I have to store off .

I am integrating our Shopify store into the sage ERP system. We currently are active with two different ecommerce sites and starting out now with Shopify. We are building a custom app so that we can automate integration of pricing, inventory, and shipping, as well as pulling orders down into our system.  Figuring out the Shopify API has been a little bit of a learning curve but it's been an interesting project. We're doing this in C sharp and I've just been collecting examples of how to implement the admin API since there's not a lot of examples out there.   Thanks for the input and I'll consider this question answered.

 

.

samc
Excursionist
32 1 25

No problem! Yeah mistakes like this are common and that's why the forums are helpful 🙂

That sounds good! And which ERP I asked because we offer an integration platform on Shopify called Shypyard (https://apps.shopify.com/shypyard). We are a developer focused platform where you can test, build and deploy your integration solution all from the browser using Javscript.

I know you're using c# so this may not be suitable 🙂 

justinphull
Tourist
9 0 1

While this is solved, I'd like to maybe ask one related question you may have the answer to.

I can see that Shopify has two different ID's. An internal ID which is used in the example of since_ID but there is also the Shopify order number which is displayed in the admin sites and is front facing to the customer. The question, is there a way to get the internal order ID just by using the order number?

I have a process that will save both the Shopify order ID's and our ERP order number in a database but that's only after successful processing into our system. But if I wanted to grab an order knowing the order number, I wouldn't necessarily have the internal order ID available. This seems to be a minor deficiency in the Shopify API because they lack any kind of look up for this correlation between their internal ID's and things like order numbers or SK use .  At the moment the only thing I can imagine is if I got all orders , put them in an internal list and then did a look up programmatically and that seems very inefficient.

Have you ever run into a situation like this?

I did take a look at your shipyard software and it looks pretty interesting. I'm not quite sure it would cover the environment that I'm dealing with but I do like the approach.

justinphull
Tourist
9 0 1

Never mind, I actually found the answer no I agree with the person who made the post. It's not very well documented feature of the order API. You can get an order by the order number if you use the name field:

"orders.json?name=1004"