curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.stateset.com/api/v1/shipments/{id}/cancel' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"expected_version": 1
}'
{
"carrier": "UPS",
"created_at": "2026-08-31T14:22:05Z",
"delivered_at": "2026-08-31T14:22:05Z",
"dimensions": "string",
"estimated_delivery": "2026-08-31T14:22:05Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Two-Person Tent",
"order_item_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"product_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"quantity": 2,
"shipment_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"sku": "SKU-TENT-2P-GRN"
}
],
"notes": "Two-person tent, green — replacement for damaged pole set.",
"order_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"recipient_email": "string",
"recipient_name": "Ada Lovelace",
"recipient_phone": "+1 415 555 0142",
"shipment_number": "string",
"shipped_at": "2026-08-31T14:22:05Z",
"shipping_address": "548 Market St",
"shipping_cost": "8.00",
"shipping_method": "ground",
"status": "pending",
"tracking_number": "1Z999AA10123456784",
"tracking_url": "string",
"updated_at": "2026-08-31T14:22:05Z",
"version": 1,
"weight_kg": "string"
}
Cancel before carrier handoff, retaining shipment items and tracking history.
Cancel before carrier handoff, retaining shipment items and tracking history.
POST
/
api
/
v1
/
shipments
/
{id}
/
cancel
curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.stateset.com/api/v1/shipments/{id}/cancel' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"expected_version": 1
}'
{
"carrier": "UPS",
"created_at": "2026-08-31T14:22:05Z",
"delivered_at": "2026-08-31T14:22:05Z",
"dimensions": "string",
"estimated_delivery": "2026-08-31T14:22:05Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Two-Person Tent",
"order_item_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"product_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"quantity": 2,
"shipment_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"sku": "SKU-TENT-2P-GRN"
}
],
"notes": "Two-person tent, green — replacement for damaged pole set.",
"order_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"recipient_email": "string",
"recipient_name": "Ada Lovelace",
"recipient_phone": "+1 415 555 0142",
"shipment_number": "string",
"shipped_at": "2026-08-31T14:22:05Z",
"shipping_address": "548 Market St",
"shipping_cost": "8.00",
"shipping_method": "ground",
"status": "pending",
"tracking_number": "1Z999AA10123456784",
"tracking_url": "string",
"updated_at": "2026-08-31T14:22:05Z",
"version": 1,
"weight_kg": "string"
}
Confirm your deployment before running this request. This page describes an API contract;
a published reference does not establish hosted availability. Check the dated
host report and obtain your deployment URL and credentials.
Replace the example host if your provisioned service uses a different URL.
Path parameters
string
required
Shipment ID (UUID)
Request body
CancelShipmentRequest
integer,null (int32)
Response
ShipmentResponse
string
required
string (date-time)
required
string,null (date-time)
string,null
string,null (date-time)
string (uuid)
required
ShipmentItemResponse[]
string,null
string (uuid)
required
string,null
string
required
string,null
string
required
string,null (date-time)
string
required
string,null
string
required
string
required
string,null
string,null
string (date-time)
required
integer (int32)
required
string,null
Status codes
| Code | Meaning |
|---|---|
200 | Cancelled shipment |
404 | Shipment not found |
409 | Stale shipment version |
422 | Shipment cannot be cancelled |
Using this contract
Read the source OpenAPI document for declared schemas and alternatives. This page also includes documented corrections from the spec overlays. Example IDs and values are illustrative; replace them with records from your workspace.curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.stateset.com/api/v1/shipments/{id}/cancel' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"expected_version": 1
}'
{
"carrier": "UPS",
"created_at": "2026-08-31T14:22:05Z",
"delivered_at": "2026-08-31T14:22:05Z",
"dimensions": "string",
"estimated_delivery": "2026-08-31T14:22:05Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Two-Person Tent",
"order_item_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"product_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"quantity": 2,
"shipment_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"sku": "SKU-TENT-2P-GRN"
}
],
"notes": "Two-person tent, green — replacement for damaged pole set.",
"order_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"recipient_email": "string",
"recipient_name": "Ada Lovelace",
"recipient_phone": "+1 415 555 0142",
"shipment_number": "string",
"shipped_at": "2026-08-31T14:22:05Z",
"shipping_address": "548 Market St",
"shipping_cost": "8.00",
"shipping_method": "ground",
"status": "pending",
"tracking_number": "1Z999AA10123456784",
"tracking_url": "string",
"updated_at": "2026-08-31T14:22:05Z",
"version": 1,
"weight_kg": "string"
}
Last modified on October 20, 2026