Endpoints for creating, tracking, updating, and managing shipments.
Create a new shipment
Creates a new shipment with the provided details.
This endpoint allows you to create and register a new shipment in the Cosmo Cargo platform. The shipment will be assigned a unique trackingNumber and will enter the CREATED status.
How to use with SDK
Here's how to create a shipment using @cosmo-cargo/sdk:
Code
Note: Use the X-Request-Priority header to expedite processing for urgent shipments.
Headers
X-Correlation-IDstring · uuidUnique identifier for tracking requests across multiple services
Idempotency-Keystring · uuidUnique key to ensure idempotency of the request
X-API-Versionstring | null · enumAPI version requested by the client
Enum values:2024-012023-12Default: 2024-01X-Request-Prioritystring · enumPriority level for processing the shipment request
Enum values:highnormallowDefault: normal
Request Body
recipientAddressobject · requiredsenderAddressobject · requiredpackagesobject[] · minItems: 1 · maxItems: 50 · unique · required
idstring · uuidExample: 123e4567-e89b-12d3-a456-426614174000recipientEmailstring · emailExample: recipient@example.comnotesobject[]Notes about the shipment
statusstring | null · enumEnum values:CREATEDIN_TRANSITDELIVEREDEXCEPTIONtrackingNumberstring · pattern:^[A-Z0-9]{10,20}$createdAtstring · date-timecommentsobject[] · enum · maxItems: 100Enum values:PENDINGAPPROVEDREJECTEDtagsstring[]Enum values:FRAGILEEXPRESSINTERNATIONALCUSTOMS_REQUIREDfacilitiesstring[]Enum values:LAX1JFK2ORD3DFW4SEA5customDataarrayArray of custom data items that can be of any type
metadataobjectEmpty object for future extensibility
customFieldsobjectDictionary of custom string fields that can be added to the shipment
Example: {"customerReference":"CUST-123","internalNotes":"Handle with care","specialInstructions":"Leave at front desk"}facilityCapabilitiesobjectDictionary of facility capabilities and their status
Example: {"temperatureControl":{"enabled":true,"lastChecked":"2024-03-15T10:30:00Z"},"hazardousMaterials":{"enabled":false,"lastChecked":"2024-03-14T15:45:00Z"}}trackingobjectDetailed tracking information for a shipment
returnTrackingTracking details for return shipment if applicable
Responses
Shipment created successfully
recipientAddressobject · requiredsenderAddressobject · requiredpackagesobject[] · minItems: 1 · maxItems: 50 · unique · required
idstring · uuidExample: 123e4567-e89b-12d3-a456-426614174000recipientEmailstring · emailExample: recipient@example.comnotesobject[]Notes about the shipment
statusstring | null · enumEnum values:CREATEDIN_TRANSITDELIVEREDEXCEPTIONtrackingNumberstring · pattern:^[A-Z0-9]{10,20}$createdAtstring · date-timecommentsobject[] · enum · maxItems: 100Enum values:PENDINGAPPROVEDREJECTEDtagsstring[]Enum values:FRAGILEEXPRESSINTERNATIONALCUSTOMS_REQUIREDfacilitiesstring[]Enum values:LAX1JFK2ORD3DFW4SEA5customDataarrayArray of custom data items that can be of any type
metadataobjectEmpty object for future extensibility
customFieldsobjectDictionary of custom string fields that can be added to the shipment
Example: {"customerReference":"CUST-123","internalNotes":"Handle with care","specialInstructions":"Leave at front desk"}facilityCapabilitiesobjectDictionary of facility capabilities and their status
Example: {"temperatureControl":{"enabled":true,"lastChecked":"2024-03-15T10:30:00Z"},"hazardousMaterials":{"enabled":false,"lastChecked":"2024-03-14T15:45:00Z"}}trackingobjectDetailed tracking information for a shipment
returnTrackingTracking details for return shipment if applicable
Track a shipment
Get the current status and tracking information for a shipment
path Parameters
trackingNumberstring · requiredDefault: SH123456789
query Parameters
includeHistorybooleanInclude detailed tracking history and events in the response
Default: false
Headers
X-Correlation-IDstring · uuidUnique identifier for tracking requests across multiple services
X-API-Versionstring | null · enumAPI version requested by the client
Enum values:2024-012023-12Default: 2024-01X-Cache-Controlstring · enumCaching behavior for the tracking response
Enum values:no-cachemax-age=60Default: max-age=60
Responses
Shipment tracking information retrieved successfully
recipientAddressobject · requiredsenderAddressobject · requiredpackagesobject[] · minItems: 1 · maxItems: 50 · unique · required
idstring · uuidExample: 123e4567-e89b-12d3-a456-426614174000recipientEmailstring · emailExample: recipient@example.comnotesobject[]Notes about the shipment
statusstring | null · enumEnum values:CREATEDIN_TRANSITDELIVEREDEXCEPTIONtrackingNumberstring · pattern:^[A-Z0-9]{10,20}$createdAtstring · date-timecommentsobject[] · enum · maxItems: 100Enum values:PENDINGAPPROVEDREJECTEDtagsstring[]Enum values:FRAGILEEXPRESSINTERNATIONALCUSTOMS_REQUIREDfacilitiesstring[]Enum values:LAX1JFK2ORD3DFW4SEA5customDataarrayArray of custom data items that can be of any type
metadataobjectEmpty object for future extensibility
customFieldsobjectDictionary of custom string fields that can be added to the shipment
Example: {"customerReference":"CUST-123","internalNotes":"Handle with care","specialInstructions":"Leave at front desk"}facilityCapabilitiesobjectDictionary of facility capabilities and their status
Example: {"temperatureControl":{"enabled":true,"lastChecked":"2024-03-15T10:30:00Z"},"hazardousMaterials":{"enabled":false,"lastChecked":"2024-03-14T15:45:00Z"}}trackingobjectDetailed tracking information for a shipment
returnTrackingTracking details for return shipment if applicable
Hold shipment
Place a shipment on hold at a facility
path Parameters
shipmentIdstring · uuid · required
query Parameters
holdDurationstring · date-timeDuration to hold the shipment
Headers
X-Hold-Operatorstring · enumOperator requesting the hold
Enum values:SYSTEMADMINCUSTOMERAGENT
cookie Parameters
preferredLocationstringUser's preferred facility location
Request Body
holdUntilstring · date-time · required
reasonstring · enumEnum values:RECIPIENT_REQUESTCUSTOMS_HOLDWEATHER_DELAYADDRESS_VERIFICATIONPAYMENT_PENDINGfacilityIdstring · enumEnum values:LAX1JFK2ORD3DFW4SEA5
Responses
Shipment placed on hold successfully
statusstring · enumEnum values:ON_HOLDHOLD_PENDINGHOLD_REJECTEDholdLocationstring · enumEnum values:LAX1 - Los Angeles HubJFK2 - New York HubORD3 - Chicago HubDFW4 - Dallas HubSEA5 - Seattle HubholdUntilstring · enum · date-timeEnum values:2025-01-15T17:00:00Z2025-01-16T09:00:00Z2025-01-17T14:00:00Z