API for updating the delivery status of an order.

Krishna111
Shopify Partner
3 0 0

How to update the order status(delivery Status) using Rest API's ? 

When a seller is using a third party fulfillment service and is integrated w9th shopify using rest API , how to update the order status to shopify using API.

Replies 2 (2)
Liam
Shopify Staff
Shopify Staff
1882 202 577

Hi Krishna111,

 

To update the delivery status of an order, you can use the Order and Fulfillment REST API in Shopify. Here's a step-by-step guide:

  1. Retrieve the Order : To get the order you want to update, you can use the Order API. The endpoint for this is GET /admin/api/2023-10/orders/{order_id}.json where {order_id} is the ID of the order.

  2. Create a Fulfillment for the Order : Once you have the order, you can create a fulfillment for that order. The fulfillment is the process of packaging and shipping an order to a customer. The endpoint for this is POST /admin/api/2023-10/orders/{order_id}/fulfillments.json where {order_id} is the ID the order. In the request body, you need to provide the necessary details like location_id, tracking_numbers etc. Here is an example of a request body:

{
  "fulfill": {
    "location_id": 905684977,
    "tracking_numbers": ["123456"],
    "notify_customer": true
  }
}
  1. Update the Fulfillment : If you want to update the fulfillment like updating the tracking information, you can use the Update Fulfillment API. The endpoint for this is PUT /admin/api/2023-10/orders/{order_id}/fulfillments/{fulfillment_id}.json where {order_id} is the ID of the order and {fulfillment_id} is the ID of the fulfillment. In the request body, you can provide the updated details like trackingnumber, trackingurls etc.

Remember to replace {order_id} and {fulfillment_id} with the actual IDs in your app. 

 

Please refer to the Shopify API documentation here for more details.

 

Hope this helps!

Liam | Developer Advocate @ 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

Krishna111
Shopify Partner
3 0 0

Hi Liam can you help me with the 2nd step what exactly to provide in the body?