API not providing same orders as Export

Highlighted
New Member
2 0 0

I help manage a store's analytics and created a quick private app to tap into the orders.json API endpoint. I'm seeing two odd behaviors though. 

1) i can only pull back about a week (11 orders are coming through)

2) the orders don't align with the export feature when i sign into the store's dashboard. only 1 order matched up between the two methods and there were several missing from each side (API vs Export)

Any reason why this would be the case?

0 Likes
Shopify Partner
857 6 142

Hi,

  1. By default you can go 60 days. Anything older than 60 days and you will need to request additional permission for your app.
  2. Are you sure you have status=any set in your API request? By default, it only GETs open order which is why you may be seeing discrepancies with CSV export where open, closed, and cancelled are exported.

Hope this helps!

I turn coffee in to code - since 1998
1 Like
New Member
2 0 0

Thank you so much Karl!! it was the status=any issue. i didn't declare status at all and so it was only providing "open" orders...This should probably be documented next to the "Retrieve all orders" example. See below:

Retrieve all orders

GET /admin/orders.json

View response

 

Should probably be:

Retrieve all OPEN orders

* set status=any to retrieve ALL orders.

GET /admin/orders.json

View response

0 Likes
Shopify Staff
Shopify Staff
36 0 4

Hey HoosierDaddy!

The parameters you can include during requests, as well as the different options and their defaults, are listed on that doc page.

You can usually find them at the top of of each endpoint's section.

Ex: https://help.shopify.com/en/api/reference/orders/order#index

0 Likes