API for updating the delivery status of an order

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!