Retrieve multiple orders updated in milliseconds

yashrastogi2020
New Member
22 0 0

Hi Team,

Lets say I have two orders updated in the same millisecond.

If I retrieve 5 orders in each call using updated_at_min time, then there are chances that in the first call, one of the order is not retrieved, and in the subsequent call, since the seconds value is increased, we won't be able to retrieve one of the orders ever.

Shopify doesnt have milliseconds parameter in update_at_min parameter.

How can we tackle the above scenario?

 

Regards,

Yash

0 Likes
Jayvin
Shopify Partner
132 17 30

Hi,

Maybe you can use webhooks instead, https://help.shopify.com/en/manual/orders/notifications/webhooks

You can just subscribe to the order.updated webhook with the endpoint url of your app. Whenever an order is updated, your app will receive the order payload.

0 Likes
yashrastogi2020
New Member
22 0 0
Hi,
What is the option if we don't want to use webhooks?
Isn't the APIs should be flexible enough to cater to such petty requests?
0 Likes
yashrastogi2020
New Member
22 0 0

Hi,

What is the option if we don't want to use webhooks?
Isn't the APIs should be flexible enough to cater to such petty requests?
0 Likes
Kevin_A
Shopify Staff
Shopify Staff
213 27 40

Hey @yashrastogi2020 

You may want to try using pagination for your subsequent calls. 

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

0 Likes
yashrastogi2020
New Member
22 0 0
Hi Kevin,

And can you give me an example of the pagination API which retrieves order
with differences of milliseconds.

Regards,
Yash
0 Likes
Greg_Kujawa
Shopify Partner
965 80 204

Any real-time, event driven scenario such as this is begging for webhooks. Since they are available if it was me I would take advantage of them. Polling via API requests when it comes to milliseconds isn't practical. There's processing time, network response time, and too many other variables which can lead to inconsistent results.

0 Likes