> ## Documentation Index
> Fetch the complete documentation index at: https://docs.api.onechain-tms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch a shipment

> Fetch a shipment given its OneChain shipment id



## OpenAPI

````yaml openapi.json get /v1/shipments/{onechain_shipment_id}
openapi: 3.1.0
info:
  title: OneChain API
  version: 1.3.2
  x-logo:
    href: https://www.onechain-tms.com
    url: static/logo.png
servers:
  - url: localhost:8080
security: []
tags:
  - description: |-
      This API lets you fetch your data from ONECHAIN's servers.

      URL: https://api.onechain-tms.com
    name: Introduction
    x-displayName: Introduction
  - description: >-
      To safely access the resources exposed by our API, you will need to
      provide an authenticated token in your requests headers. Please reach out
      to your ONECHAIN’s Account Manager to get your token. 

        | Name of the header | Type of authentication |
        |--------------------|------------------------|
        | Authorization      | API AUTHORIZATION KEY  |

        Please note that the API authorization key must be prefixed with "Bearer "

        For example:

        `Authorization: Bearer 1234567890`
        
        
    name: Authentication
    x-displayName: Authentication
  - description: |-
      All endpoints fetching multiple items are paginated.

        Use `skip` to skip to the items you want to retrieve.

        Use `take` to define how many items you want to retrieve.

        `skip` and `take` are optional parameters.

        If you do not input them, `skip` equals to 0 and `take` equals to 10.

        Example:

        `/v1/shipments?skip=20&take=10`
        
    name: Pagination
    x-displayName: Pagination
  - name: Shipments
  - name: Purchase Orders
  - name: Documents
  - name: Locations
  - name: Invoices
  - name: Users
  - name: Reporting
  - description: <SchemaDefinition schemaRef="#/components/schemas/Shipment" />
    name: ShipmentObject
    x-displayName: ShipmentObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Tracking" />
    name: TrackingObject
    x-displayName: TrackingObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/OrderPreparation" />
    name: OrderPreparationObject
    x-displayName: OrderPreparationObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/PurchaseOrder" />
    name: PurchaseOrderObject
    x-displayName: PurchaseOrderObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/TrackingEvent" />
    name: TrackingEventObject
    x-displayName: TrackingEventObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/TrackingDate" />
    name: TrackingDateObject
    x-displayName: TrackingDateObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/TrackingStep" />
    name: TrackingStepObject
    x-displayName: TrackingStepObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Product" />
    name: ProductObject
    x-displayName: ProductObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Port" />
    name: PortObject
    x-displayName: PortObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Coordinates" />
    name: CoordinatesObject
    x-displayName: CoordinatesObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Container" />
    name: ContainerObject
    x-displayName: ContainerObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/User" />
    name: UserObject
    x-displayName: UserObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Load" />
    name: LoadObject
    x-displayName: LoadObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Document" />
    name: DocumentObject
    x-displayName: DocumentObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Invoice" />
    name: InvoiceObject
    x-displayName: InvoiceObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Location" />
    name: LocationObject
    x-displayName: LocationObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Price" />
    name: PriceObject
    x-displayName: PriceObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Quantity" />
    name: QuantityObject
    x-displayName: QuantityObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Size" />
    name: SizeObject
    x-displayName: SizeObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Volume" />
    name: VolumeObject
    x-displayName: VolumeObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/Weight" />
    name: WeightObject
    x-displayName: WeightObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/SimpleDate" />
    name: SimpleDateObject
    x-displayName: SimpleDateObject
  - description: <SchemaDefinition schemaRef="#/components/schemas/DateWithTime" />
    name: DateWithTimeObject
    x-displayName: DateWithTimeObject
paths:
  /v1/shipments/{onechain_shipment_id}:
    get:
      tags:
        - Shipments
      summary: Fetch a shipment
      description: Fetch a shipment given its OneChain shipment id
      parameters:
        - schema:
            type: string
          in: path
          name: onechain_shipment_id
          required: true
      responses:
        '200':
          description: Shipment found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Shipment'
                description: Shipment found
        '404':
          description: Shipment not found
          content:
            application/json:
              schema:
                description: Shipment not found
                type: object
components:
  schemas:
    Shipment:
      type: object
      modelName: Shipment
      tag:
        - Shipments
      properties:
        name:
          type: string
          example: June Air Export USA
        onechain_shipment_id:
          type: string
          example: CDEF
        status:
          type: string
          enum:
            - booking_request
            - awaiting_booking
            - booked
            - draft
            - in_progress
            - finished
            - cancelled
        created_at:
          $ref: '#/components/schemas/DateWithTime'
          description: Date of shipment creation
        incoterm:
          type: string
          enum:
            - exw
            - fca
            - fas
            - fob
            - cpt
            - cfr
            - cif
            - cip
            - dap
            - ddp
            - dpu
            - dat
          example: fob
        freight_mode:
          type: string
          enum:
            - air
            - ocean
            - rail
            - truck
        load_type:
          type: string
          enum:
            - fcl
            - lcl
            - both
        freight_type:
          type: string
          enum:
            - port_to_door
            - door_to_port
            - door_to_door
            - port_to_port
        route:
          type: object
          properties:
            pickup_location_id:
              type: string
              example: '23'
            origin_port_unlocode:
              type: string
              example: FR/FOS
            destination_port_unlocode:
              type: string
              example: US/NYC
            delivery_location_id:
              type: string
              example: '45'
        cargo_ready_date:
          $ref: '#/components/schemas/SimpleDate'
        desired_delivery_date:
          $ref: '#/components/schemas/SimpleDate'
        specific_instructions:
          type: string
          description: Optional field containing specific instruction given by the client
        main_forwarder:
          type: string
          example: DHL
        cargo:
          type: object
          properties:
            total_weight:
              $ref: '#/components/schemas/Weight'
              description: Shipment total weight in kg
            total_volume:
              $ref: '#/components/schemas/Volume'
              description: Shipment total volume in cbm
            total_teus:
              type: integer
              description: Shipment total of Twenty-Equivalent Units
              example: 5
            containers:
              type: array
              items:
                $ref: '#/components/schemas/Container'
            loads:
              type: array
              items:
                $ref: '#/components/schemas/Load'
        transported_goods:
          type: object
          properties:
            goods_description:
              type: string
              example: Description of the shipped goods
            is_stackable:
              type: boolean
              default: true
            is_hazardous:
              type: boolean
              default: false
            hazardous_description:
              type: string
              example: UN1993
            contains_lithium:
              type: boolean
              default: false
            lithium_packaging_type:
              type: string
              enum:
                - alone
                - contained
                - packed
            contains_magnets:
              type: boolean
              default: false
            needs_controlled_temperature:
              type: boolean
              default: false
            temperature_range_description:
              type: string
              example: 5-25°C
        commercial_value:
          $ref: '#/components/schemas/Price'
        needs_ad_valorem_insurance:
          type: boolean
          default: false
        purchase_order_references:
          type: array
          items:
            type: string
            example: 4500346155
        main_tracking_dates:
          type: object
          properties:
            pickup_date:
              $ref: '#/components/schemas/TrackingDate'
            departure_date:
              $ref: '#/components/schemas/TrackingDate'
            arrival_date:
              $ref: '#/components/schemas/TrackingDate'
            delivery_date:
              $ref: '#/components/schemas/TrackingDate'
        booking_information:
          type: object
          properties:
            carrier:
              type: string
              example: CMA CGM
            master_bill:
              type: string
              example: LHV1190703558
            house_bill:
              type: string
              example: HOUSEREF12357
            ocean_booking:
              type: object
              properties:
                booking_number:
                  type: string
                  example: TWLEH2106004
                voyage:
                  type: string
                  example: 033E
                vessel:
                  type: string
                  example: CMA CGM Jacques Saadé
            air_booking:
              type: object
              properties:
                flight_number:
                  type: string
                  example: AF256
                chargeable_weight:
                  $ref: '#/components/schemas/Weight'
                  description: Chargeable weight in kg
        invoice_status:
          type: string
          enum:
            - available
            - awaiting_invoice
            - due
            - paid
            - partially_paid
        invoice_references:
          type: array
          items:
            type: string
            example: FAC2022-9567
        accepted_quote:
          type: object
          properties:
            id:
              type: string
              example: '325'
            request_date:
              $ref: '#/components/schemas/DateWithTime'
            accepted_date:
              $ref: '#/components/schemas/DateWithTime'
    DateWithTime:
      modelName: DateWithTime
      type: string
      example: '2021-09-20T10:02:09+01:00'
    SimpleDate:
      modelName: SimpleDate
      type: string
      example: '2021-10-11'
    Weight:
      modelName: Weight
      type: object
      description: Weight
      properties:
        value:
          type: number
          format: float
          example: 350.25
        unit:
          type: string
          enum:
            - kg
            - lbs
          example: kg
    Volume:
      modelName: Volume
      type: object
      description: Unit volume in cbm
      properties:
        value:
          type: number
          format: float
          example: 10.25
        unit:
          type: string
          example: cbm
    Container:
      type: object
      modelName: Container
      properties:
        container_type:
          type: string
          enum:
            - twenty_foot_standard
            - twenty_foot_reefer
            - twenty_foot_flat_rack
            - twenty_foot_open_top
            - forty_foot_standard
            - forty_foot_reefer
            - forty_foot_flat_rack
            - forty_foot_open_top
            - forty_foot_highcube_standard
            - forty_foot_highcube_reefer
            - forty_foot_highcube_flat_rack
            - forty_foot_highcube_open_top
            - forty_five_foot_highcube_standard
        container_number:
          type: string
          example: TEMU8667058
        seal_number:
          type: string
          example: 1332641
        purchase_order_references:
          type: array
          items:
            type: string
            example: 4500346155
    Load:
      type: object
      modelName: Load
      properties:
        count:
          type: number
          example: 3
        type:
          type: string
          enum:
            - pallet
            - package
            - rigid_crate
          format: LoadType
        weight:
          $ref: '#/components/schemas/Weight'
        volume_unit:
          type: string
          example: cm
          description: (deprecated)
        length:
          $ref: '#/components/schemas/Size'
        width:
          $ref: '#/components/schemas/Size'
        height:
          $ref: '#/components/schemas/Size'
    Price:
      modelName: Price
      type: object
      properties:
        amount:
          type: number
          format: float
          example: 150357.99
        currency:
          type: string
          enum:
            - AED
            - AUD
            - BHD
            - BRL
            - CAD
            - CHF
            - CNY
            - EUR
            - GBP
            - HKD
            - IDR
            - INR
            - JPY
            - MXN
            - KRW
            - KWD
            - MYR
            - NZD
            - PLN
            - SEK
            - SGD
            - THB
            - TWD
            - USD
            - XOF
            - XPF
            - ZAR
          example: USD
    TrackingDate:
      modelName: TrackingDate
      type: object
      properties:
        date:
          $ref: '#/components/schemas/DateWithTime'
        status:
          type: string
          enum:
            - estimated
            - actual
            - planned
            - problem
    Size:
      type: object
      modelName: Size
      description: Size
      properties:
        value:
          type: number
          format: float
          example: 10.25
        unit:
          type: string
          enum:
            - cm
            - in
          example: cm

````