Syncing orders to external system

Linaori
Visitor
1 0 0

I need to sync orders to an external system. My idea was to do this through a webhook (orders paid). The problem is that either this webhook can error enough, the connection could fail, the data could be invalid and require a re-sent to the external system, the external system could be down etc.

 

To solve this I was thinking about querying all orders from Shopify that still needed to be processed, except that it seems I can't seem to keep track of this information in Shopify and retry or send whatever wasn't processed yet. My initial approach was to use metafields as this let me set a status to communicate errors and let the user set flag to retry sending to the external system i.e. when missing information has been added to the order in Shopify.

 

The GraphQL lets me fetch the information but not filter for it. I basically want to do "get all orders where metafield X does not exist or is true" but this seems to not be possible. What would be the recommended approach to do this? I've got the feeling I have to constantly sync the order information to an app and then send it from there, but this requires me to constantly be checking ALL orders in Shopify which doesn't seem very efficient.

Replies 2 (2)

AndyX
Shopify Partner
9 0 0

Initial Full Sync via admin-reset Interface:

Recursively fetch all orders using the admin-reset API interface with sinceId and save them to your database.


Register Order-related Webhooks:

Register webhooks for order-related events to keep your database updated in real-time as changes occur.


Periodic Sync via Order Events API:

Periodically sync the local status with Shopify's status using the Events API.


By implementing these steps, you can ensure that order data is accurately captured and kept up-to-date.

gogogogogo

kjchabra
Shopify Partner
22 1 4

hey @Linaori 

 

We at Clouver simply do what you mentioned in your post using our user friend UI and the best part is no coding knowledge is required.

 

Here's a small tutorial regarding how we sync our products and inventory data for different stores in a frequency interval to Dynamo databases:
https://prcmp.app/tutorials/shopify-inventory-sync

 

We currently don't have the syncing functionality of orders avialble via our app, but if you like, I am happy to get you onboarded and have the order sync be available as an option.

 

Happy to chat if you have any questions or comments.

 

Thanks

KJ