Syncing New Orders on a Schedule Basis - Which is the approved method?

Highlighted
New Member
2 0 0

My company needs to retrieve new orders on a scheduled basis (i.e. daily, hourly).  I've seen two approaches mentioned in the forums/documentation (see below).  Which of the following is the recommended/most reliable approach?

1.  Getting a count of a segment of orders by passing in the create_at_min (or updated_at_min) parameters;  determining the number of pages, and making the appropriate number of calls to get each page?  (Reference: https://community.shopify.com/c/Shopify-APIs-SDKs/How-to-fetch-all-orders-with-a-private-app-API/m-p...)

- or - 

2. Getting a segment of orders by using the get orders API and passing in created_at_min (or updated_at_min) parameters;  Then using the 'Link' in the response header to subsequently get the next page of orders, repeating as long as there is a 'next' link returned in the response header?  (Reference: https://shopify.dev/tutorials/make-paginated-requests-to-rest-admin-api)

Thanks for your help,

Dave

0 Likes
Highlighted
Shopify Partner
530 38 109

Why not just register a webhook for orders/create? That way no polling is required, no pagination quirks come into play, and no query parameter gotchas come into play.

 

https://help.shopify.com/en/manual/orders/notifications/webhooks

 

0 Likes
Highlighted
New Member
2 0 0

First, Thank you for your reply!  We are open to webhooks, but had some questions...

Are webhooks reliable? (i.e. if a call fails from Shopify, will the attempt to notify our endpoint be retried?)

Or in addition to the webhooks, will we also have to have a "true-up" or reconciliation process which ends up having to go out and get all our orders to confirm all webhook notifications were received successfully?

Please note, that "real-time" isn't a necessity for our implementation so we are looking for the path which requires the least amount of work.

Thanks,
Dave

 

 

 

 

0 Likes
Highlighted
Shopify Partner
530 38 109

This mechanism should be reliable. More details are at the links below, which also discuss the retry scenarios. I'd imagine this would be the most straightforward option for knocking this out!

 

https://shopify.dev/docs/admin-api/rest/reference/events/webhook

https://shopify.dev/tutorials/manage-webhooks#:~:text=Frequency,over%20the%20next%2048%20hours.

 

0 Likes