The Cancel Shipment API allows for an existing shipment case to be cancelled. It is a very simple call that only requires a valid Shipment ID and Disposition Reason. Note that this API cancels the entire shipment. Use the Assign Shipment API and its appropriate item assignment configuration to cancel only part of the shipment.
Note that the request body and parameter schemas outlined in this guide are the exact same as in the previous version of OMS, as the Unified Commerce platform supports backwards compatibility for this API. The only change to this request is the format of the base endpoint, as shown in the below table. Remember to provide the x-vol-tenant key for authentication in the headers.
Production URL | https://{tenantId}-translation.mozu.com/api/v2/shipment/action/cancel |
Sandbox URL | https://{tenantId}-translation.sandbox.mozu.com/api/v2/shipment/action/cancel |
Supported Formats | JSON |
HTTP Method | POST |
Example
The example case creates a cancel request with the following information:
- Shipment ID – 1010101
- Disposition Reason – Customer changed mind
Required Parameters
Canceling a shipment is simple, as it has two required parameters and only one optional:
Parameter | Type | Description |
shipmentID | integer | A unique identifier for the shipment. The minimum value is “1”. |
dispositionReason | enum | The reason for the cancellation (customer_changed_mind, created_by_mistake, etc.). See the schema for the full list of possible values. |
Optional Parameters
This optional parameter is only used to provide an additional explanation when the Disposition Reason was set to “other”.
Parameter | Type | Description |
dispositionOtherReason | string | If dispositionReason is ’other’, provide an explanation here. Minimum length is 1 and maximum length is 255. |
The Full Request
This is the entire request that will cancel the example shipment. Note how the disposition reason is defined.
{ "shipmentID": 1010101, "dispositionReason": "other", "dispositionOtherReason": "Customer changed mind" }
The returned response follows the same structure as the Get Shipment API, providing information about the shipment that was canceled.