curl --location --request POST 'https://api.stateset.com/v1/shipments/ship_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/cancel' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_API_KEY' \ --data-raw '{ "reason": "order_cancelled", "notes": "Customer requested cancellation before shipment" }'
{ "id": "ship_0901f083-aa1c-43c5-af5c-0a9d2fc64e30", "object": "shipment", "status": "cancelled", "cancelled_at": "2024-01-19T17:00:00Z", "cancellation": { "reason": "order_cancelled", "notes": "Customer requested cancellation before shipment", "cancelled_by": "user_123" }, "refund": { "status": "processed", "amount": 1250, "currency": "USD", "processed_at": "2024-01-19T17:00:15Z", "reference": "REF-SHIP-001" }, "tracking_number": "1Z999AA10123456784", "carrier": "ups", "metadata": { "cancellation_reference": "CANCEL-2024-001" } }
Cancel a shipment and void the shipping label
shipments:write
Authorization: Bearer YOUR_API_KEY