Skip to main content

Filtering shipments

Pass filter parameters to narrow results:
const shipments = await client.shipments.list({
  status: 'in_transit',
  port: 'USLAX',
  carrier: 'MAEU',
  updatedAfter: '2025-01-01T00:00:00Z',
});
Available shipment filters:
FilterTypeDescription
statusstringShipment status (for example in_transit or delivered)
portstringUN/LOCODE for port of discharge
carrierstringSCAC code (for example MAEU, HLCU)
updatedAfterISO 8601Only shipments updated after this timestamp
includeContainersbooleanSet to false to omit containers from the included relationships

Filtering containers

const containers = await client.containers.list({
  status: 'discharged',
  port: 'USLAX',
  carrier: 'MAEU',
  updatedAfter: '2025-01-01T00:00:00Z',
  include: 'shipment,pod_terminal',
});
Available container filters:
FilterTypeDescription
statusstringContainer status
portstringUN/LOCODE for port of discharge
carrierstringSCAC code
updatedAfterISO 8601Only containers updated after this timestamp
includestringComma-delimited list of related resources to include
For list endpoints, avoid heavy include usage for performance. When you need deep relationships, prefer single-resource endpoints like containers.get or shipments.get.

Pagination

List methods accept pagination options with page and pageSize (page numbers are 1-based):
const page1 = await client.shipments.list({}, {
  page: 1,
  pageSize: 25,
  format: 'mapped',
});

const page2 = await client.shipments.list({}, {
  page: 2,
  pageSize: 25,
  format: 'mapped',
});
When using format: 'mapped', list results include items, links, and meta. When using format: 'raw', these live in the JSON:API response.

Common patterns

Recently updated shipments

const oneDayAgo = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();

const updated = await client.shipments.list({
  updatedAfter: oneDayAgo,
});

In-transit containers at a specific port

const containers = await client.containers.list({
  status: 'in_transit',
  port: 'USLAX',
});