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:
- Authorization from the selling partner for whom you are making calls. For more information, refer to Authorizing Selling Partner API applications.
- The Direct-to-Consumer Shipping (Restricted) role assigned to your developer profile.
- The Direct-to-Consumer Shipping (Restricted) role selected in the app registration page for your application.
Step 1. Call the cancelShipment operation
cancelShipment operationCall 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
- Call the
getShipmentoperation and specify theShipmentIdvalue for the canceled shipment. - Get the cancellation status from the status element returned by the
getShipmentoperation.
Errors
The service returns the
LabelCancelWindowExpirederror if the allotted time period for canceling a label has expired. Refer to Error codes.
Updated 6 days ago
