Cancel shipments
Learn how to cancel a shipment using the Shipment API before it is manifested.
Cancel a shipment
To cancel a shipment, use the Cancel Shipment endpoint. To call Cancel Shipment, send a PUT
request to https://api.sorted.com/pro/shipments/{reference}/cancel
, where {reference}
denotes the shipment you want to cancel. Once the request has been received, the Shipments platform changes the shipment’s {state}
to cancelled and returns a confirmation message.
You can only cancel a shipment prior to that shipment being manifested. Once a shipment has been manifested it can no longer be cancelled.
Once a shipment has been cancelled, then no further changes can be made to it. In order to reinstate a cancelled shipment you would need to create a new shipment with the same details.
For full reference information on the Cancel Shipment endpoint, see the Shipments API reference.
Cancel shipment example
The example below shows a successful Cancel Shipment request for shipment sp_00792815110958000332875334549504.
PUT https://api.sorted.com/pro/shipments/sp_00792815110958000332875334549504/cancel
{
"reference": "sp_00792815110958000332875334549504",
"custom_reference": "77d58d14-53f6-414c-876d-05c9b3cf079a",
"message": "Shipment sp_00792815110958000332875334549504 has been cancelled",
"_links": [
{
"href": "https://api-int.sorted.com/pro/shipments/sp_00792815110958000332875334549504",
"rel": "shipment",
"reference": "sp_00792815110958000332875334549504",
"type": "shipment"
}
]
}
Next steps
- Learn how to create, clone, and update shipments: Create Shipments
- Learn how to retrieve shipment data: Get Shipments
- Learn how to allocate shipments: Allocate Shipments