Cancel Shipment

This endpoint is used to cancel a shipment that has not yet been shipped.

Please Note: The request body is optional when you use this endpoint. You can optionally provide a reason code when cancelling a shipment.

The endpoint also cancels the shipment booking with the carrier if the carrier supports it. Please note that cancellation is only supported if the shipment is not yet shipped. If a shipment is already shipped, then the endpoint will return a 400 error.

The shipment_id is used as a path parameter to identify the shipment. Alternatively the merchant provided shipment reference (partner_shipment_reference) can also be used instead of the shipment_id.

SecurityOAuth2
Request
path Parameters
shipment_id
required
string
header Parameters
x-api-key
string
tenant-id
string
Content-Type
string
Request Body schema: application/json
optional
update_reason_code
string

Any one of the standard reason codes (below) or custom reason codes defined by the merchant.

Click here for the list of Standard Reason Codes

Responses
200
400

Bad Request

post/shipments/{shipment_id}/cancel
Request samples
application/json
{
  • "update_reason_code": "string"
}
Response samples
application/json
{
  • "shipment_id": "XYZABC123",
  • "entity_type": "FORWARD",
  • "merchant": "MY_BRAND",
  • "references": {
    },
  • "carrier_account": {
    },
  • "payment": {
    },
  • "collection": {
    },
  • "delivery": {
    },
  • "pickup": {
    },
  • "dropoff": {
    },
  • "items": [
    ],
  • "freight": {
    },
  • "customs": {
    },
  • "parcels": [
    ],
  • "post_shipping_info": {
    },
  • "custom_attributes": { },
  • "order_date": "2022-01-01T09:00:00.000Z",
  • "order_type": "HOME_DELIVERY",
  • "creation_date": "2022-01-01T09:00:00.000Z",
  • "update_date": "2022-01-01T09:00:00.000Z",
  • "confirmation_date": "2022-01-01T09:00:00.000Z",
  • "estimated_process_date": "2019-08-24T14:15:22Z",
  • "promised_delivery_date": "2022-01-01T09:00:00.000Z",
  • "original_promised_delivery_date": "2022-01-01T09:00:00.000Z",
  • "estimated_shipping_cost": {
    },
  • "language": "en",
  • "rma_id": "rma_123abcXYZ"
}