Cancel a shipment

Learn how to use the Merchant Fulfillment API to cancel a shipment.

Learn how to use the Merchant Fulfillment API to cancel a shipment.

Prerequisites

To complete this tutorial, you need:

Step 1. Call the cancelShipment operation

Call the cancelShipment operation and specify the ShipmentId value of the shipment you want to cancel.

This returns the details of a shipment, which includes the shipment status. It might also return one or more unexpected errors occurred during the cancelShipment operation.

Step 2. (Optional) Check the status of the canceled shipment

  1. Call the getShipment operation and specify the ShipmentId value for the canceled shipment.
  2. Get the cancellation status from the status element returned by the getShipment operation.

❗️

Errors

The service returns the LabelCancelWindowExpired error if the allotted time period for canceling a label has expired. Refer to Error codes.