Sometimes on the order's page, Shopify display the fulfillment's delivery date (sometimes it also says 'estimated delivery date').
How can I retrieve this date via the API?
I can check that the 'shipment_status' is 'delivered' on the shipment object but how do I get the actual delivery date? There is an 'updated_at' field, but i'm not sure if this always matches the deliery date.
It's a documented response field, full disclosure though I'm not 100% on which specific events it'll be populated for. I just did a quick test shipping label purchase but the value was still 'null'. It's not the most popular API endpoint that we have by a long shot, so I don't have tons of experience working with it.
I would definitely expect the 'happened_at' timestamp on a 'delivered' event to show when the item itself was delivered though.
Thanks Josh, althgouh where is this field documented?
It would be easier if the delivery_at and estimated_delivery_at was populated on the fulfillment object directly, rather than having to query the fulfillment events separately. If possible, please pass on this feedback.
Also, it's kind of weird, I found an fulfillment event that had a updated_at < happened_at (same timezone for both fields). That doesn't make sense!
Hey Clement, sorry for the misunderstanding - I see what you mean, I was referring to it being present in the response params in the documentation, but you're right. It looks like the only param that we didn't document a description of, which seems an oversight to me. I'll look into that.
Consider the feedback passed along as well! Mind showing me the order ID that had that weird fulfillment event? That seems strange, but I'm sure there's an explanation for it.
Hey again Clement,
I took a look at the above and made some sense of what is going on - the 'happened_at' param is when the event happened at the carrier itself. But that doesn't mean that we're notified right away to create a Fulfillment Event object for that event here.
If you grab the tracking number off of that order and look it up, you'll be able to match Fulfillment Events 'happened_at' up with tracking events from the FedEx website.
Since created_at/updated_at are set automatically when a resource like a Fulfillment Event is created/updated but happened_at can apparently be backdated to an earlier time, I actually wouldn't be hugely surprised if you find more Fulfillment Events than not end up looking like this.
I would imagine a bit of a delay before we're updated on new tracking events would be fairly typical.
Hope that helps make some sense of it all!
Thanks for looking into but this still doesn't make sense to me.
What you are saying would explain the situation if the happened_at was earlier than created_at/updated_uat.
However, I'm seeing the opposite. happened_at is later than created_at/updated_at.
Am I missing something?
Maybe the happened_at is in the wrong time zone?