Skip to main content
DELETE
/
api
/
shipments
/
{id}
curl -X DELETE \
  'https://platform.returnqueen.dev/api/shipments/123e4567-e89b-12d3-a456-426614174000' \
  -H 'X-API-KEY: your-api-key'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "order_number": "ORDER-123",
  "status": "cancelled",
  "cancelled_at": "2024-01-15T10:30:00Z",
  "cancelled_by_id": "api-key-uuid",
  "cancelled_reason": "Partner requested cancellation via API",
  "shipment_type": "delivery",
  "shipment_date": "2023-11-07T10:00:00Z",
  "complete_at_start": "2023-11-07T14:00:00Z",
  "complete_at_end": "2023-11-07T18:00:00Z",
  "carrier_id": "660e8400-e29b-41d4-a716-446655440000",
  "carrier_service_level_id": "550e8400-e29b-41d4-a716-446655440000",
  "pickup_id": "770e8400-e29b-41d4-a716-446655440000",
  "timezone": "America/New_York",
  "inserted_at": "2023-11-07T10:00:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}

Request Parameters

Path Parameters

id
string
required
Shipment ID to cancel
curl -X DELETE \
  'https://platform.returnqueen.dev/api/shipments/123e4567-e89b-12d3-a456-426614174000' \
  -H 'X-API-KEY: your-api-key'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "order_number": "ORDER-123",
  "status": "cancelled",
  "cancelled_at": "2024-01-15T10:30:00Z",
  "cancelled_by_id": "api-key-uuid",
  "cancelled_reason": "Partner requested cancellation via API",
  "shipment_type": "delivery",
  "shipment_date": "2023-11-07T10:00:00Z",
  "complete_at_start": "2023-11-07T14:00:00Z",
  "complete_at_end": "2023-11-07T18:00:00Z",
  "carrier_id": "660e8400-e29b-41d4-a716-446655440000",
  "carrier_service_level_id": "550e8400-e29b-41d4-a716-446655440000",
  "pickup_id": "770e8400-e29b-41d4-a716-446655440000",
  "timezone": "America/New_York",
  "inserted_at": "2023-11-07T10:00:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}

Response Fields

id
string
Unique identifier for the shipment (UUID format)
order_number
string
Order reference number
status
string
Shipment status (will be cancelled)
cancelled_at
string
When the shipment was cancelled (ISO 8601 format)
cancelled_by_id
string
ID of the entity that cancelled the shipment
cancelled_reason
string
Reason for cancellation
shipment_type
string
Type of shipment: delivery, return, or exchange
shipment_date
string
Original shipment date in ISO 8601 format
complete_at_start
string
Start of pickup window in ISO 8601 format
complete_at_end
string
End of pickup window in ISO 8601 format
carrier_id
string
Carrier identifier (UUID format)
carrier_service_level_id
string
Carrier service level identifier (UUID format)
pickup_id
string
Pickup identifier (UUID format)
timezone
string
IANA timezone identifier
label_url
string
URL to the shipping label
metadata
object
Additional shipment metadata
inserted_at
string
When the shipment was created (ISO 8601 format)
updated_at
string
When the shipment was last updated (ISO 8601 format)
Only shipments in pending or scheduled status can be cancelled. Attempting to cancel a shipment in any other state will result in a 409 Conflict error.