How to delay a shipment for a week using shopify API?

I am going to delay a shipment for a week using API, i used order UPDATE api

https://storename.myshopify.com/admin/api/2023-04/orders/11111111.json

with body:

{
    "order": {
        "id": orderID,
        "fulfillment_status": "null",
        "fulfillments": [
            {
                "id": ID,
                "location_id": ID,
                "tracking_number": "XXXXXXXXXXXXXXXX",
                "tracking_url": "https://tools.usps.com/go/TrackConfirmAction.action?tLabels=XXXXXXXXXXXXXXXXXXXX",
                "status": "delayed",
                "delayed_until": "2023-05-29T00:00:00Z"
            }
        ],
        "line_items": [
            {
                "id": ID,
                "fulfillment_status": "null"
            }
        ]
    }
}

but it didn’t work, what is the exact API and body i should used to update the order with shipment fulfillment status or any other status and it would be delayed for a week.

Hey @Abdul_Qayyum thanks for getting in touch- at the moment, all fulfillment/shipping data would be managed through our fulfillments API rather than the Orders API. A good place to start is this documentation on building a fulfillment service app. In terms of a specific REST API endpoint you’d need to use, you would want to look into using Fulfillment Orders.

You can update the fulfillment order like this, provided your app has the right fulfillment scopes on the shop:

POST https://your-store.myshopify.com/admin/api/2023-04/fulfillment_orders/1046000816/reschedule.json

{
“fulfillment_order”: {
“new_fulfill_at”: “2024-03-02 14:24 UTC”
}
}

Hope this helps!

RESCHEDULE endpoint updates the fulfill_at time of a scheduled fulfillment order. what if the status is OPEN? do we have to schedule it first? or should we use HOLD and RELEASE endpoints?

Hey @Abdul_Qayyum - that would be a decent workaround. If you needed to definitively delay a fulfillment - using the HOLD endpoint would change the status explicitly to an “ON_HOLD” status, and then once you are sure you want to process the fulfillment you could use the RELEASE endpoint to move the fulfillment to either an “OPEN” status or “SCHEDULED” once the order is confirmed ready to be shipped.

Hope this helps!

Al | Shopify Developer Support