We're announcing 🧑‍🚀 inter-galactic shipping ✨ for 3025!
Cosmo Cargo Inc.
Shipment API

Shipment Management

Server

Endpoints for creating, tracking, updating, and managing shipments.


Filter shipments

GET
https://c1cf69108515455da09b5a33ff336111-oas.api.mockbin.io
/shipments
Bearer (JWT)
or
X-API-Key (header)

Search and filter shipments using various criteria

Filter shipments › query Parameters

status
​string[] · required · style: form · explode: true

Filter by shipment status

Enum values:
CREATED
IN_TRANSIT
DELIVERED
EXCEPTION
tags
​string[]

Filter by tags

Enum values:
FRAGILE
EXPRESS
INTERNATIONAL
CUSTOMS_REQUIRED
​object · style: deepObject · explode: true

Filter by creation date range

​object

Filter by address criteria

limit
​integer · min: 1 · max: 100

Maximum number of results to return

Default: 20
offset
​integer · min: 0

Number of results to skip

Default: 0

Filter shipments › Responses

Shipments retrieved successfully

​Shipment[]
total
​integer

Total number of shipments matching the filter

limit
​integer
offset
​integer

Create a new shipment

POST
https://c1cf69108515455da09b5a33ff336111-oas.api.mockbin.io
/shipments
Bearer (JWT)
or
X-API-Key (header)

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:

TypeScriptCode
import { CosmoCargoClient } from '@cosmo-cargo/sdk'; const client = new CosmoCargoClient({ key: process.env.COSMO_API_KEY }); const shipment = await client.shipments.create(config); console.log(`Shipment created: ${shipment.trackingNumber}`);

Note: Use the X-Request-Priority header to expedite processing for urgent shipments.

Create a new shipment › Headers

X-Correlation-ID
​string · uuid

Unique identifier for tracking requests across multiple services

Idempotency-Key
​string · uuid

Unique key to ensure idempotency of the request

X-API-Version
​string | null · enum

API version requested by the client

Enum values:
2024-01
2023-12
Default: 2024-01
X-Request-Priority
​string · enum

Priority level for processing the shipment request

Enum values:
high
normal
low
Default: normal

Create a new shipment › Request Body

​Address · required
​Address · required
​Package[] · minItems: 1 · maxItems: 50 · unique · required
id
​string · uuid
recipientEmail
​string · email
​Comment[]

Notes about the shipment

status
​string | null · enum
Enum values:
CREATED
IN_TRANSIT
DELIVERED
EXCEPTION
createdAt
​string · date-time
​Comment[] · maxItems: 100
tags
​string[]
Enum values:
FRAGILE
EXPRESS
INTERNATIONAL
CUSTOMS_REQUIRED
facilities
​string[]
Enum values:
LAX1
JFK2
ORD3
DFW4
SEA5
​array

Array of custom data items that can be of any type

metadata
​object

Empty object for future extensibility

​object

Dictionary of custom string fields that can be added to the shipment

Example: {"customerReference":"CUST-123","internalNotes":"Handle with care","specialInstructions":"Leave at front desk"}
​object

Dictionary 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"}}
​TrackingDetails

Real-time tracking information for this shipment

​

Tracking details for return shipment if applicable

Create a new shipment › Responses

Shipment created successfully

​Address · required
​Address · required
​Package[] · minItems: 1 · maxItems: 50 · unique · required
id
​string · uuid
recipientEmail
​string · email
​Comment[]

Notes about the shipment

status
​string | null · enum
Enum values:
CREATED
IN_TRANSIT
DELIVERED
EXCEPTION
createdAt
​string · date-time
​Comment[] · maxItems: 100
tags
​string[]
Enum values:
FRAGILE
EXPRESS
INTERNATIONAL
CUSTOMS_REQUIRED
facilities
​string[]
Enum values:
LAX1
JFK2
ORD3
DFW4
SEA5
​array

Array of custom data items that can be of any type

metadata
​object

Empty object for future extensibility

​object

Dictionary of custom string fields that can be added to the shipment

Example: {"customerReference":"CUST-123","internalNotes":"Handle with care","specialInstructions":"Leave at front desk"}
​object

Dictionary 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"}}
​TrackingDetails

Real-time tracking information for this shipment

​

Tracking details for return shipment if applicable


Track a shipment

GET
https://c1cf69108515455da09b5a33ff336111-oas.api.mockbin.io
/shipments/{trackingNumber}
Bearer (JWT)
or
X-API-Key (header)

Get the current status and tracking information for a shipment

Track a shipment › path Parameters

trackingNumber
​string · required
Default: SH123456789

Track a shipment › query Parameters

includeHistory
​boolean

Include detailed tracking history and events in the response

Default: false

Track a shipment › Headers

X-Correlation-ID
​string · uuid

Unique identifier for tracking requests across multiple services

X-API-Version
​string | null · enum

API version requested by the client

Enum values:
2024-01
2023-12
Default: 2024-01
X-Cache-Control
​string · enum

Caching behavior for the tracking response

Enum values:
no-cache
max-age=60
Default: max-age=60

Track a shipment › Responses

Shipment tracking information retrieved successfully

​Address · required
​Address · required
​Package[] · minItems: 1 · maxItems: 50 · unique · required
id
​string · uuid
recipientEmail
​string · email
​Comment[]

Notes about the shipment

status
​string | null · enum
Enum values:
CREATED
IN_TRANSIT
DELIVERED
EXCEPTION
createdAt
​string · date-time
​Comment[] · maxItems: 100
tags
​string[]
Enum values:
FRAGILE
EXPRESS
INTERNATIONAL
CUSTOMS_REQUIRED
facilities
​string[]
Enum values:
LAX1
JFK2
ORD3
DFW4
SEA5
​array

Array of custom data items that can be of any type

metadata
​object

Empty object for future extensibility

​object

Dictionary of custom string fields that can be added to the shipment

Example: {"customerReference":"CUST-123","internalNotes":"Handle with care","specialInstructions":"Leave at front desk"}
​object

Dictionary 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"}}
​TrackingDetails

Real-time tracking information for this shipment

​

Tracking details for return shipment if applicable


Cancel shipment

DELETE
https://c1cf69108515455da09b5a33ff336111-oas.api.mockbin.io
/shipments/{trackingNumber}
Bearer (JWT)
or
X-API-Key (header)

Cancel a shipment that hasn't been picked up yet.

Cancel shipment › path Parameters

trackingNumber
​string · required

Cancel shipment › Responses

200

Shipment cancelled successfully

status
​string · enum
Enum values:
CANCELLED
refundAmount
​number · float
currency
​string

Hold shipment

PUT
https://c1cf69108515455da09b5a33ff336111-oas.api.mockbin.io
/shipments/{shipmentId}/hold
Bearer (JWT)
or
X-API-Key (header)

Place a shipment on hold at a facility

Hold shipment › path Parameters

shipmentId
​string · uuid · required

Hold shipment › query Parameters

holdDuration
​string · date-time

Duration to hold the shipment

Hold shipment › Headers

X-Hold-Operator
​string · enum

Operator requesting the hold

Enum values:
SYSTEM
ADMIN
CUSTOMER
AGENT

Hold shipment › cookie Parameters

preferredLocation
​string

User's preferred facility location

Hold shipment › Request Body

holdUntil
​string · date-time · required
reason
​string · enum
Enum values:
RECIPIENT_REQUEST
CUSTOMS_HOLD
WEATHER_DELAY
ADDRESS_VERIFICATION
PAYMENT_PENDING
facilityId
​string · enum
Enum values:
LAX1
JFK2
ORD3
DFW4
SEA5

Hold shipment › Responses

200

Shipment placed on hold successfully

status
​string · enum
Enum values:
ON_HOLD
HOLD_PENDING
HOLD_REJECTED
holdLocation
​string · enum
Enum values:
LAX1 - Los Angeles Hub
JFK2 - New York Hub
ORD3 - Chicago Hub
DFW4 - Dallas Hub
SEA5 - Seattle Hub
holdUntil
​string · enum · date-time
Enum values:
2025-01-15T17:00:00Z
2025-01-16T09:00:00Z
2025-01-17T14:00:00Z

Update shipment priority

PUT
https://c1cf69108515455da09b5a33ff336111-oas.api.mockbin.io
/shipments/{shipmentId}/priority
Bearer (JWT)
or
X-API-Key (header)

Update the priority level of a shipment

Update shipment priority › path Parameters

shipmentId
​string · uuid · required

Update shipment priority › Request Body

priority
​string · enum · required

New priority level for the shipment

Enum values:
URGENT
HIGH
NORMAL
LOW

Update shipment priority › Responses

Shipment priority updated

No data returned

Get available service levels

GET
https://c1cf69108515455da09b5a33ff336111-oas.api.mockbin.io
/shipments/{shipmentId}/service-levels
Bearer (JWT)
or
X-API-Key (header)

Get all available service levels for a shipment with their details

Get available service levels › path Parameters

shipmentId
​string · uuid · required

Get available service levels › Responses

200

Available service levels

​object[]

Create a lost shipment claim

POST
https://c1cf69108515455da09b5a33ff336111-oas.api.mockbin.io
/shipments/{shipmentId}/claims
Bearer (JWT)
or
X-API-Key (header)

Submit a claim for a lost or damaged shipment. This endpoint accepts multipart/form-data to allow uploading photos and other evidence files along with the claim details.

Supported File Types

  • Images: JPEG, PNG, GIF, WebP (max 10MB each)
  • Documents: PDF (max 25MB each)

Maximum Files

You can upload up to 10 files per claim.

Create a lost shipment claim › path Parameters

shipmentId
​string · uuid · required

The unique identifier of the shipment

Create a lost shipment claim › Headers

X-Correlation-ID
​string · uuid

Unique identifier for tracking requests across multiple services

Idempotency-Key
​string · uuid

Unique key to ensure idempotency of the request

Create a lost shipment claim › Request Body

claimType
​string · enum · required

The type of claim being filed

Enum values:
LOST
DAMAGED
DELAYED
MISSING_CONTENTS
description
​string · minLength: 20 · maxLength: 5000 · required

Detailed description of the issue and circumstances

claimantEmail
​string · email · required

Email address for claim correspondence

claimantPhone
​string · pattern: ^\+[1-9]\d{1,14}$

Phone number for claim correspondence (E.164 format)

declaredValue
​number · float · min: 0

Declared value of the shipment contents in USD

incidentDate
​string · date

Date when the incident was discovered

photos
​string[] · application/octet-stream · maxItems: 10

Photos of damaged package or contents (JPEG, PNG, GIF, WebP)

documents
​string[] · application/octet-stream · maxItems: 5

Supporting documents such as receipts, invoices, or police reports (PDF only)

Create a lost shipment claim › Responses

Claim created successfully

claimId
​string · uuid

Unique identifier for the claim

shipmentId
​string · uuid

The shipment this claim is associated with

claimNumber
​string · pattern: ^CLM-[A-Z0-9]{8}$

Human-readable claim reference number

claimType
​string · enum
Enum values:
LOST
DAMAGED
DELAYED
MISSING_CONTENTS
status
​string · enum

Current status of the claim

Enum values:
SUBMITTED
UNDER_REVIEW
ADDITIONAL_INFO_REQUIRED
APPROVED
DENIED
SETTLED
declaredValue
​number · float
​object[]
createdAt
​string · date-time
estimatedResolutionDate
​string · date

Expected date for claim resolution


GraphQL endpoint

POST
https://c1cf69108515455da09b5a33ff336111-oas.api.mockbin.io
/graphql
Bearer (JWT)
or
X-API-Key (header)

Query the Cosmo Cargo registry via GraphQL. Test live against the public Rick and Morty universe schema.