Solved

Unable to update shipment_status during fulfillment/fulfillmentUpdate

rexb
Shopify Partner
29 1 9

Good day!

I am Unable to update shipment_status during fulfillment/fulfillmentUpdate. Does someone encounter this issue?

$result = (new Shopify())->request('orders/'.$order_id.'/fulfillments.json',[
                        'fulfillment' => [
                            'line_items' => $line_items,
                            'location_id' =>  $location_id,
                            'tracking_number' => $tracking_number,
                            'tracking_urls' => [
                                $tracking_url
                            ],
                            'notify_customer' => $notify,
                            'tracking_company' => $tracking_company,
                            'shipment_status' => $shipment_status
                        ]
                    ], 'POST');

 

And here's the response

 

local.vdw.io_tes.png

Thank you in advance.

 

 

 

 

Accepted Solution (1)

CalD
Shopify Staff
140 22 36

This is an accepted solution.

Hey @rexb,

You should be able to update the fulfillment status through the FulfillmentEvent API: https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/fulfillmentevent#create-2...

 

CalD | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 2 (2)

CalD
Shopify Staff
140 22 36

This is an accepted solution.

Hey @rexb,

You should be able to update the fulfillment status through the FulfillmentEvent API: https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/fulfillmentevent#create-2...

 

CalD | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

bashunaimiroy1
Shopify Partner
9 1 5

Hi @CalD , thanks for explaining this. As a followup, is this available as a mutation through the Admin GraphQL API, and if not, when will it be?

My use case: I'd like to trigger the shop's "Out for Delivery" and "Delivered" notifications to the customer when a fulfillment order is Out For Delivery and Delivered.

Context: I've created an app that fulfills orders via a 3rd party shipping service, and the shipping service sends an update to my app when the order is Out for Delivery and Delivered. I'd like to convey this information to the customer. 

For example, if the shipping service sends an "out for delivery" update to my app, I'd like to be able to trigger an "Out for Delivery" notification that gets sent to the customer, and similarly with a "Delivered" notification.

 

I can't currently find any documentation that explains how to do this with the Admin GraphQL API. Is it necessary to use the Admin REST API to achieve this?

I had thought that the fulfillmentTrackingInfoUpdateV2 mutation might achieve this, but in fact it just allows me to add tracking info (company, tracking number, tracking URL) to the fulfillment.

 

Thanks in advance.

P.S. there are several Shopify Community threads asking about this use case, mostly unanswered except by other devs also asking the same thing. This suggests some interest.

https://community.shopify.com/c/shopify-apis-and-sdks/local-delivery-post-via-admin-api/td-p/823853
https://community.shopify.com/c/shopify-apis-and-sdks/update-fulfillment-displaystatus/m-p/1146117

https://community.shopify.com/c/shopify-apis-and-sdks/local-delivery-mark-as-ready-for-delivery-via-...