Solved

Anyone else seeing delay with returns in the REST Orders API?

dhollander
Tourist
6 0 2

Over the last few weeks, we've been getting a lot of reports from our customers about orders not being imported in a timely fashion, or just sometimes not being imported at all. We've been tracking this down and have found that Shopify's webhooks are reporting that the order is available, but we'll turn around and query the (REST) API and the order will not be returned. We just did a deep dive on this with our logs and saw this happen on Oct 17:

We got this webhook:

"id": 2502285623354,
"created_at": "2020-10-17T04:01:58-05:00",
"updated_at": "2020-10-17T04:02:03-05:00",

Then we queried at 02:10, 02:15, and 02:21 and the order in question was not returned. To make it worse, at 02:21, we did receive this order:

"id": 2502285590586,
"created_at": "2020-10-17T04:01:58-05:00",
"updated_at": "2020-10-17T04:02:03-05:00",

Which was the next order number in the sequence. Notice it has the same updated_date but the first one was never returned. This caused us to move our check time cursor up and we missed the first order completely. This happened to 5 other orders over the weekend for this customer.

When we queried again, this order still shows the same update time but downloaded fine. To me, this sounds like Shopify's systems are dealing with real lag. We are running on API version 2020-07. Has anyone else been seeing anything like this?

Accepted Solution (1)

Jonathan-HA
Shopify Partner
316 24 99

This is an accepted solution.

Are you seeing delays only when the `fulfillment_status` filter is set to a specific status?

We're seeing the same issue on our side but only if `fulfillment_status` is set to a specific status.  We don't see a delay if it's set to `any`.

We learned from Shopify last month that an update was made to use elastic search for the fulfillment_status filtering, so that could be related.  We're now starting to get reports of orders getting missed because of this delay.

Here's a related post: https://community.shopify.com/c/Shopify-APIs-SDKs/REST-Order-API-2020-07-Bug-Filtering-by-fulfillmen...

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill

View solution in original post

Replies 9 (9)

Gregarican
Shopify Partner
1033 86 285

I'd recommend providing some of the Request ID's, Order ID's, etc. and hopefully a Shopify staffer can cross-reference what they are seeing on their end. There have been some discussions of missing records in API requests and webhooks from what I recall...

dhollander
Tourist
6 0 2

Thanks Greg. I do have the full logs that I'd be happy to share with any Shopify staffer, obviously don't want to post customer data here publicly. The ID's in question are above.

We've just seen this come up over and over again across a wide variety of stores over the last few weeks so it feels like a pretty widespread issue. Was wondering if others have seen this too.

Gregarican
Shopify Partner
1033 86 285

Sorry, I missed it where you posted the webhook ID's. That should hopefully help the Shopify team track things down. I'm sure some order ID's came up missing might help too. Good luck! 

CalD
Shopify Staff
140 22 36

Hey @dhollander,

Although we haven't received many reports of significantly-delayed order imports, DM me any extra info (especially any x-request-id response headers) you have and we can try to dig into more deeply.

CalD | 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

Luis_Armuelles
Visitor
2 0 0

Hi,

We present the same issue.  Recently takes a lot time to get orders with my API REST connector.  Any suggest?

Gregarican
Shopify Partner
1033 86 285

Out of curiosity have you tried querying the shop for new orders using the GraphQL API? Just wondering if that might return results faster. I do recall seeing posts on here about REST API queries of orders based on timestamp ranges, orders that involve cursor-paginated results, etc. having some inconsistencies and time lags. Perhaps the GraphQL API might be an option...

Luis_Armuelles
Visitor
2 0 0

Hi team,

I have same issue,  Orders takes a lot when try to get with my API REST connector.  Recently takes more time.   Please send me how you solved this.

Jonathan-HA
Shopify Partner
316 24 99

This is an accepted solution.

Are you seeing delays only when the `fulfillment_status` filter is set to a specific status?

We're seeing the same issue on our side but only if `fulfillment_status` is set to a specific status.  We don't see a delay if it's set to `any`.

We learned from Shopify last month that an update was made to use elastic search for the fulfillment_status filtering, so that could be related.  We're now starting to get reports of orders getting missed because of this delay.

Here's a related post: https://community.shopify.com/c/Shopify-APIs-SDKs/REST-Order-API-2020-07-Bug-Filtering-by-fulfillmen...

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill
dhollander
Tourist
6 0 2

Thanks everyone for chiming in. We've been sharing details with a Shopify dev liaison and got a confirmation back that they were able to duplicate the issue when fulfillment_status was set on the query. Leaving fulfillment_status set to null resolved the issue in the dev's testing.

Obviously it's not ideal to be unable to use that filter, but we've retooled our logic to do filtering after the query is returned (to filter out the fulfillment statuses we don't want). We've just rolled this out today and are hopeful that this will fully resolve the issue.