Orders API "created_at_min" missing orders

Solved
ACMA
New Member
2 1 0

We have a workflow that calls the Shopify Orders API daily to return all Orders created since "created_at_min":

https://abc.myshopify.com/admin/api/2021-10/orders.json?status=any&created_at_min=2021-09-20T04:00:0...

...but we are frequently seeing orders missing from the response!

For example, the response from the call above is missing orders (name) #1882 and #1883.

I can confirm the orders exist by directly calling them by name, like this:

https://abc.myshopify.com/admin/api/2021-10/orders.json?status=any&name=1882&fields=created_at

Which returns:

{
    "orders": [
        {
          "created_at": "2021-09-20T09:01:32+09:30"
        }
    ]
}

But when I try retrieve them using the “created_at_min” search parameter, like this:

https://abc.myshopify.com/admin/api/2021-10/orders.json?status=any&created_at_min=2021-09-20T04:00:0...

It returns:

{
    "orders": []
}

...THE ORDER IS MISSING!

0 Likes
ACMA
New Member
2 1 0

This is an accepted solution.

It appears the issue may only occur with orders that were archived (There are instances here where users have ‘archived’ orders and then ‘unarchived’ them).

In these cases, it seems to make a difference what format is used when specifying the “created_at_min” timestamp in the search query.

The following timestamp formats did not work for me:

  • “…orders.json?status=any&created_at_min=2021-09-20T04:00:00”, (This should default to the shop’s native time zone, but appears not to) or
  • “…orders.json?status=any&created_at_min=2021-09-20T04:00:00+09:30” (The Shop's UTC offset included)

However, I know a plus (+) character in a URL is interpreted as a space character, so following a suggestion in another message, I URL encoded the time zone string, which worked!

  • “…orders.json?status=any&created_at_min=2021-09-20T04:00:00%2B09:30
0 Likes