Hi, I’m trying to get a list of recently shipped orders. I’ve been using the Orders query with these filters:
customer_account_id, warehouse_id, updated_from (yesterday’s date), fulfillment_status: “fulfilled”
But we have come across multiple false positives (orders returned that weren’t yet shipped and had no tracking) - is there a better or more correct approach I should be using?
Thank you!
This way, you can get the order ids from the shipments created in the requested timeframe.
Bear in mind that if you have orders partially shipped, you might have a shipment in both cases, but the order won’t be as fulfilled yet, until the remaining line items are shipped.
Hey @tomasfd!
Thank you for that… I do need the order_number though, not the order_id, but using a webhook is not possible for me at the moment.
Does the ‘shipments’ query you suggested give me order_number too?
Also, could you pls help me understand what was wrong with my original approach and why was it giving me false positives? And is it possible to repair that query somehow?
Thank you @tomasfd! I’m going to try your suggestion now.
And here are two of the order numbers that were reported to me as false positives:
CS192556
CS192557
If you’re able to shed any light on what exactly went wrong, that would be great! Usually my method works very well, but recently I’ve been notified of this problem and I have no idea why it would happen…
No @tomasfd, I’m sorry I don’t have those… and it’s usually after a delay of a couple days that I hear about a problem order. But I’ve just asked our client in case they have a new case - I’ll report back to you as soon as they tell me about one.
Thank you!
Hey @tomasfd, Just wanted to mention that your example seems to have solved my problem perfectly! So far I have only done dry runs and have asked to let me know in case any issues are still noticed, but I think the problem should be gone.
Just to add, I made some slight tweaks so that I can extract order status (fulfilled or not) and client name from the same query:
Hey @tomasfd, So the client just let me know about two new ‘false positive’ shipments, that were processed using the new code we were discussing.
CS198871
CS199980
Could you pls look into these and suggest what’s happening and how to resolve?
Thank you!
CS198871 → This one is partially fulfilled, so it will show a shipment even if it is not in fulfilled status.
CS199980 → Right now this order is fulfilled so it will return a shipment. Did you by any chance save the req ID and response of these calls? I’d like to see exactly what is showing you (the response).
Hey @tomasfd,
CS198871 - Yes showing shipment is correct, but in my code I’m checking if order status = fulfilled If (j["data","shipments","data","edges",key,"node","order","fulfillment_status"] = "fulfilled")
And even though right now the status returned is “Unfulfilled FAZE”, it must’ve been returned as ‘fulfilled’ at some point.
Is there any way to find the issue by looking at the Order History:
Because that query is made hundreds of times each day and it’d be impractical to save all that info on an ongoing basis till someone tells me there’s a fresh false positive - I’d have to save output of each call and each page for days to be able to find which order in which particular instance had returned the bad output.
Unfortunately, orders won’t show as Fulfilled until they are 100% fulfilled. Even if you ship part of it, the order itself won’t get the fulfilled status until all line items are fulfilled. You will see which line items are fulfilled, though, but that is all.
Yes, I completely understand, wasn’t aware how many you were generating. We only store the request, not the response, so at this point, there is not much we can do to track what and how we sent it. Could you share the whole payload with me? I will at least try to run it from my end and see if I can generate any false positives.
On the other hand, does what I explained in my first paragraph render the whole query unusable for you?
Hey @tomasfd ! Sorry I didn’t receive a notification and didn’t see your reply sooner…
orders won’t show as Fulfilled until they are 100% fulfilled. Even if you ship part of it, the order itself won’t get the fulfilled status until all line items are fulfilled.
Actually this is perfect - that’s how I need it to be, but the problem I’m facing is that sometimes the order that is not fully fulfilled is reported as fulfilled - that’s my understanding based on what I query and an unfulfilled order number being returned.
They just told me the problem is getting much worse.
Some latest examples that were reported as false positives by SH:
CS205075
CS205074
CS205068
CS205062