# Cancel a shipment Cancel a shipment. ## What happens - Shipment status is set to CANCELED - All orders are canceled - All loads are canceled - All services are canceled ## Prerequisites - Shipment must not already be delivered or canceled Endpoint: POST /shipments/{id}/cancel Version: 1.0.0 Security: BearerAuth ## Path parameters: - `id` (string, required) Resource ID (UUID) or client key Example: "550e8400-e29b-41d4-a716-446655440000" ## Query parameters: - `by` (string) Specify lookup type for faster retrieval. If omitted, defaults to looking up by ID first, then falls back to client key if not found. Use by=key when you know you're providing a client key for best performance. Enum: "id", "key" ## Request fields (application/json): - `reason` (string) Reason for cancellation ## Response 200 fields (application/json): - `id` (string, required) Example: "550e8400-e29b-41d4-a716-446655440000" - `key` (string, required) Human-readable shipment ID (e.g., "SHP-12345") Example: "SHP-12345" - `status` (string, required) Current status of the shipment lifecycle. Pre-transit: - DRAFT: Shipment being created - TENDER_PENDING: Awaiting carrier tender acceptance - TENDER_REJECTED: Carrier rejected the tender - ON_HOLD: Shipment temporarily paused - PLANNING: Being planned/scheduled - SELECTED: Carrier selected - BOOKED: Carrier confirmed booking - DISPATCHED: Dispatched to carrier In-transit: - LOADING: Loading at pickup - PICKED_UP: Picked up - IN_TRANSIT: In transit - UNLOADING: Unloading at delivery - ARRIVED_AT_DELIVERY_TERMINAL: At delivery terminal (LTL) - OUT_FOR_DELIVERY: Out for final delivery Final: - DELIVERED: Delivered - CANCELED: Canceled Enum: "DRAFT", "TENDER_PENDING", "ON_HOLD", "PLANNING", "SELECTED", "BOOKED", "DISPATCHED", "LOADING", "PICKED_UP", "IN_TRANSIT", "UNLOADING", "ARRIVED_AT_DELIVERY_TERMINAL", "OUT_FOR_DELIVERY", "DELIVERED", "CANCELED", "TENDER_REJECTED" - `customer` (object) Enhanced reference to a customer resource (returned in responses). Includes full customer details in addition to id/key. Note: Does NOT include nested references (paymentTerm, contacts, etc.) to prevent recursion. Maximum nesting depth: 1 level. - `customer.id` (string, required) Customer UUID Example: "550e8400-e29b-41d4-a716-446655440000" - `customer.key` (string,null) Client-defined reference ID if set Example: "ERP-CUSTOMER-ACME" - `customer.name` (string, required) Customer company name Example: "Acme Manufacturing Corp" - `customer.friendlyId` (string, required) Human-readable customer identifier Example: "A123456" - `customer.status` (string, required) Customer status Enum: "PROSPECT", "ACTIVE", "INACTIVE", "CHURNED" - `customer.phoneNumber` (string,null) Primary phone number Example: "+1-555-123-4567" - `customer.website` (string,null) Customer website URL Example: "https://acme-manufacturing.com" - `customer.createdAt` (string, required) When the customer was created Example: "2025-01-15T10:00:00Z" - `customer.updatedAt` (string, required) When the customer was last updated Example: "2025-01-15T14:30:00Z" - `customer.deletedAt` (string,null) When the customer was soft deleted (null if active) - `customerRep` (object) Customer representative - `customerRep.id` (string, required) User UUID Example: "550e8400-e29b-41d4-a716-446655440000" - `customerRep.email` (string, required) User's email address Example: "john.doe@example.com" - `customerRep.name` (string,null) User's full name Example: "John Doe" - `customerRep.phone` (string,null) User's phone number Example: "+1-555-123-4567" - `customerRep.phoneExt` (string,null) Phone extension Example: "123" - `customerRep.status` (string, required) User account status Enum: "PENDING", "ACTIVE", "INACTIVE" - `customerRep.avatarId` (string,null) Profile avatar document ID Example: "7c9e6679-7425-40de-944b-e07fc1f90ae7" - `customerRep.createdAt` (string, required) When the user was created Example: "2025-01-15T10:00:00Z" - `customerRep.updatedAt` (string, required) When the user was last updated Example: "2025-01-15T14:30:00Z" - `customerRep.deletedAt` (string,null) When the user was soft deleted (null if active) - `orders` (array) Orders in this shipment - `orders.key` (string,null) Friendly order ID - `orders.mode` (string) Transportation mode. - TL: Full Truckload - LTL: Less than Truckload - AIR: Air freight - OCEAN: Ocean freight - RAIL: Rail freight - INTERMODAL: Intermodal (multiple modes) - DRAYAGE: Drayage/cartage Enum: "TL", "LTL", "AIR", "OCEAN", "RAIL", "INTERMODAL", "DRAYAGE" - `orders.billingStatus` (string) Billing status for the order (AR side). - DOCS_NEEDED: Waiting for delivery documents - NOT_READY_TO_INVOICE: Not ready to invoice - READY_TO_INVOICE: Ready to generate invoice - INVOICED: Invoice generated and sent - PARTIALLY_PAID: Partial payment received - PAID: Fully paid Enum: "DOCS_NEEDED", "NOT_READY_TO_INVOICE", "READY_TO_INVOICE", "INVOICED", "PARTIALLY_PAID", "PAID" - `orders.stops` (array) Flattened stops array - `orders.stops.type` (string) Enum: "PICKUP", "DELIVERY", "CROSS_DOCK" - `orders.stops.sequence` (integer) Stop order in the route - `orders.stops.location` (object) Reference to another resource (returned in responses) - `orders.stops.location.id` (string, required) Resource UUID - `orders.stops.address` (object) Physical address/location details (nested, without id). This is an embedded object representing a Location record. The id is managed internally and not exposed in the API. - `orders.stops.address.line1` (string, required) Primary street address line Example: "123 Main St" - `orders.stops.address.line2` (string,null) Secondary address line (suite, floor, etc.) Example: "Suite 400" - `orders.stops.address.city` (string, required) City name Example: "Chicago" - `orders.stops.address.country` (string, required) Country name or code Example: "USA" - `orders.stops.address.market` (string, required) Market or region identifier Example: "CHI" - `orders.stops.address.latitude` (string,null) Latitude coordinate Example: "41.8781" - `orders.stops.address.longitude` (string,null) Longitude coordinate Example: "-87.6298" - `orders.stops.address.isAirportOrAirbase` (boolean, required) Whether this location is an airport or airbase - `orders.stops.address.isConstructionOrUtilitySite` (boolean, required) Whether this location is a construction or utility site - `orders.stops.address.isSmartyValidated` (boolean, required) Whether address has been validated by SmartyStreets Example: true - `orders.stops.address.obeysDst` (boolean, required) Whether this location observes daylight saving time Example: true - `orders.stops.address.cityId` (string,null) Reference to standardized city record (internal use) - `orders.stops.requestedStartDate` (string,null) - `orders.stops.requestedEndDate` (string,null) - `orders.stops.requestedStartTime` (string,null) - `orders.stops.requestedEndTime` (string,null) - `orders.stops.actualArrival` (string,null) - `orders.stops.actualDeparture` (string,null) - `orders.stops.appointmentRequired` (boolean) - `orders.stops.notes` (string,null) - `orders.freight` (object) - `orders.freight.handlingUnitQuantity` (integer,null) - `orders.freight.handlingUnitType` (string,null) - `orders.freight.weight` (number,null) Weight in pounds - `orders.freight.volume` (number,null) Volume in cubic feet - `orders.freight.length` (number,null) - `orders.freight.width` (number,null) - `orders.freight.height` (number,null) - `orders.freight.commodityDescription` (string,null) - `orders.freight.hazmat` (boolean) - `orders.freight.stackable` (boolean) - `orders.references` (array) - `orders.references.type` (string) Reference type (e.g., BOL_NUMBER) - `orders.references.value` (string) Reference value - `orders.charges` (array) - `orders.charges.chargeCode` (object) Reference to another resource (returned in responses) - `orders.charges.description` (string,null) - `orders.charges.amount` (number) - `orders.charges.quantity` (number) - `orders.charges.rate` (number,null) - `orders.equipment` (array) Example: [{"id":"550e8400-e29b-41d4-a716-446655440000","key":"ERP-USER-12345"}] - `orders.specialRequirements` (array) Example: [{"id":"550e8400-e29b-41d4-a716-446655440000","key":"ERP-USER-12345"}] - `orders.mileage` (number,null) - `orders.totalRevenue` (number,null) Sum of all charges - `orders.createdAt` (string) - `orders.updatedAt` (string,null) - `loads` (array) Loads for carrier execution - `loads.key` (string,null) - `loads.carriers` (array) Flattened carriers array - `loads.carriers.carrier` (object) Enhanced reference to a carrier resource (returned in responses). Includes full carrier details in addition to id/key. Note: Does NOT include nested references (contacts, etc.) to prevent recursion. Maximum nesting depth: 1 level. - `loads.carriers.carrier.id` (string, required) Carrier UUID Example: "550e8400-e29b-41d4-a716-446655440000" - `loads.carriers.carrier.name` (string, required) Carrier company name Example: "Swift Transportation" - `loads.carriers.carrier.email` (string,null) Primary email address Example: "dispatch@swifttrans.com" - `loads.carriers.carrier.createdAt` (string, required) When the carrier was created Example: "2025-01-15T10:00:00Z" - `loads.carriers.carrier.updatedAt` (string, required) When the carrier was last updated Example: "2025-01-15T14:30:00Z" - `loads.carriers.carrier.deletedAt` (string,null) When the carrier was soft deleted (null if active) - `loads.carriers.status` (string) Enum: "ACTIVE", "TONU", "BOUNCED" - `loads.carriers.bookedAt` (string,null) - `loads.carriers.dispatchedAt` (string,null) - `loads.carriers.totalCost` (number,null) - `services` (array) Vended services - `services.vendor` (object) Enhanced reference to a vendor profile. Includes full vendor details in addition to id/key. - `services.vendor.id` (string, required) Vendor UUID Example: "550e8400-e29b-41d4-a716-446655440000" - `services.vendor.friendlyId` (string, required) Human-readable vendor identifier Example: "V123456" - `services.vendor.name` (string, required) Vendor legal name Example: "ABC Warehouse Services" - `services.vendor.phone` (string,null) Primary phone number Example: "+1-555-123-4567" - `services.vendor.status` (string,null) Vendor status Example: "ACTIVE" - `services.vendor.currency` (string,null) Preferred currency code (ISO 4217) Example: "USD" - `services.vendor.createdAt` (string, required) When the vendor was created Example: "2025-01-15T10:00:00Z" - `services.vendor.updatedAt` (string, required) When the vendor was last updated Example: "2025-01-15T14:30:00Z" - `services.serviceType` (string) - `services.cost` (number,null) - `totalRevenue` (number,null) Sum of all order charges - `totalCost` (number,null) Sum of all load and service costs - `margin` (number,null) Revenue minus cost - `marginPercent` (number,null) Margin as percentage of revenue - `deliveredAt` (string,null) ## Response 400 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message ## Response 401 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message ## Response 404 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message ## Response 409 fields (application/problem+json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message