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