CargoSmart Containers API

Container tracking and event history

OpenAPI Specification

cargosmart-containers-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: CargoSmart Shipment Tracking Bookings Containers API
  description: The CargoSmart Shipment Tracking API provides real-time container tracking and shipment visibility across ocean carriers and ports. APIs return container movement events, vessel positions, ETA predictions, and port arrival/departure data for supply chain visibility platforms.
  version: 1.0.0
  contact:
    name: CargoSmart
    url: https://www.cargosmart.com/
servers:
- url: https://api.cargosmart.com
  description: CargoSmart Production API
security:
- apiKey: []
- oauth2: []
tags:
- name: Containers
  description: Container tracking and event history
paths:
  /tracking/v1/containers/{containerId}:
    get:
      operationId: trackContainer
      summary: Track container
      description: Retrieve real-time tracking information and event history for a specific container number. Returns vessel position, port events, ETA, and container status across carriers.
      tags:
      - Containers
      parameters:
      - name: containerId
        in: path
        required: true
        description: Container number (e.g., MSCU1234567)
        schema:
          type: string
          pattern: ^[A-Z]{4}\d{7}$
      responses:
        '200':
          description: Container tracking details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContainerTracking'
        '404':
          $ref: '#/components/responses/NotFound'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /tracking/v1/containers:
    get:
      operationId: listContainerTracking
      summary: Track multiple containers
      description: Retrieve tracking status for multiple containers in a single request.
      tags:
      - Containers
      parameters:
      - name: containerIds
        in: query
        required: true
        description: Comma-separated list of container numbers
        schema:
          type: string
      - name: billOfLadingNumber
        in: query
        description: Filter by bill of lading number
        schema:
          type: string
      - name: bookingNumber
        in: query
        description: Filter by booking number
        schema:
          type: string
      responses:
        '200':
          description: Container tracking results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContainerTrackingList'
components:
  schemas:
    TrackingEvent:
      type: object
      properties:
        eventId:
          type: string
        eventType:
          type: string
          enum:
          - GateIn
          - GateOut
          - Load
          - Discharge
          - Departure
          - Arrival
          - Customs
          - Delivery
          - EmptyReturn
        description:
          type: string
        location:
          $ref: '#/components/schemas/Port'
        vesselName:
          type: string
        voyageNumber:
          type: string
        eventTime:
          type: string
          format: date-time
        isActual:
          type: boolean
          description: true if actual, false if estimated
    ContainerTrackingList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ContainerTracking'
        total:
          type: integer
    Port:
      type: object
      properties:
        locode:
          type: string
          description: UN/LOCODE (e.g., USNYC)
        portName:
          type: string
        countryCode:
          type: string
        terminalName:
          type: string
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    ContainerTracking:
      type: object
      properties:
        containerId:
          type: string
          description: Container number
        containerType:
          type: string
          enum:
          - 20GP
          - 40GP
          - 40HC
          - 20RF
          - 40RF
          - 45HC
        carrierCode:
          type: string
        vesselName:
          type: string
        voyageNumber:
          type: string
        currentStatus:
          type: string
          enum:
          - Empty
          - Loaded
          - OnVessel
          - AtPort
          - InTransit
          - Delivered
        originPort:
          $ref: '#/components/schemas/Port'
        destinationPort:
          $ref: '#/components/schemas/Port'
        estimatedArrival:
          type: string
          format: date-time
        actualArrival:
          type: string
          format: date-time
        events:
          type: array
          items:
            $ref: '#/components/schemas/TrackingEvent'
        lastUpdated:
          type: string
          format: date-time
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://auth.cargosmart.com/oauth/token
          scopes:
            tracking:read: Read shipment tracking data
            bookings:read: Read booking data
            bookings:write: Create and manage bookings
            documents:read: Read shipping documents