Discussing APIs and development related to customers, discounts, and order management.
We're using the order API to download orders from a customer store. The connector polls the order API endpoint every 15 minutes and downloads the latest 50 orders. If the order already exists in our system, we skip it. That part is working fine. The issue is that the occasional order is being missed.
They have some customers that order online, and then pay via bank deposit days later (or longer) - at which time admin set the order status to "paid" manually.
Obviously our connector is missing these orders because the "created_date" is a week earlier or more - and has moved on.
We could use the "updated_at_min" operator - which should catch it when the "financial_status" changes to "paid" at which time the "updated_at" date would mean the transaction would (should?)
be caught by our scheduled download. However, it seems to me that if someone adds a comment to an older order - that would change the "update_at" date which would move it into our download "window" (when we already have this order and dont need to scrape it again).
We're not using webhooks because they tend to be unreliable.
Can someone tell me the best practise here for catching these older orders?
Solved! Go to the solution
This is an accepted solution.
Hey @aatechnology
In a case like this, I would consider using "processed_at" as the basis for your orders filter. The data typically matches that of the "created_at" data, so in most cases the output would be identical, however where it differs is in situations with deferred payment. "Processed_at" specifically handles the date of the final completed transaction associated with an order, so you should be able to use that field to pull in orders that were created days/weeks ago but only paid for in the last few minutes, without the additional stipulations that would be associated with "updated_at"
To learn more visit the Shopify Help Center or the Community Blog.
This is an accepted solution.
Hey @aatechnology
In a case like this, I would consider using "processed_at" as the basis for your orders filter. The data typically matches that of the "created_at" data, so in most cases the output would be identical, however where it differs is in situations with deferred payment. "Processed_at" specifically handles the date of the final completed transaction associated with an order, so you should be able to use that field to pull in orders that were created days/weeks ago but only paid for in the last few minutes, without the additional stipulations that would be associated with "updated_at"
To learn more visit the Shopify Help Center or the Community Blog.
you are a champion! Can you tell me - if a store admin adds a note or comment to an order - would that be considered an "update" in which case that order would then be included again in the orders downloaded? If so - does "processed_at" ignore these comment updates and only include status updates like "paid" etc ... ??