Get fulfillment delivery date?

ClementG
Shopify Partner
660 0 127

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.

 

0 Likes
Josh
Shopify Staff
Shopify Staff
1131 82 191

Hey Clement, 

Have you looked into the FulfillmentEvent endpoint yet? I see it has an 'estimated_delivery_at' response parameter, so it looks like it would do the trick here.

0 Likes
ClementG
Shopify Partner
660 0 127

Thanks Josh, that sounds very promising.

Is this an undocumented field? Is it populated only for certain values of the status field?

I'm also looking for the actual delivery date. I see that there is a happened_at field. I guess that should be what I need, assuming the status is delivered?

0 Likes
Josh
Shopify Staff
Shopify Staff
1131 82 191

Hey Clement, 

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.

0 Likes
ClementG
Shopify Partner
660 0 127

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!

 

0 Likes
Josh
Shopify Staff
Shopify Staff
1131 82 191

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.

 

ClementG
Shopify Partner
660 0 127

Thanks for that.

The order id is 111055339541, fulfillment id 115980861461.

The last event has a 'delivered' status, and it has updated_at < happened_at.

I'd love to hear if you have an explanation of how an event could be updated with the time of something in the future!

0 Likes
Josh
Shopify Staff
Shopify Staff
1131 82 191

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!

 

 

0 Likes
ClementG
Shopify Partner
660 0 127

Hi Josh,

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?

0 Likes
ClementG
Shopify Partner
660 0 127

Did I make sense at all?

0 Likes