> ## 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 all purchase orders

> Fetch all purchase orders



## OpenAPI

````yaml openapi.json get /v1/purchaseOrders
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/purchaseOrders:
    get:
      tags:
        - Purchase Orders
      summary: Fetch all purchase orders
      description: Fetch all purchase orders
      parameters:
        - schema:
            default: 0
            type: integer
          in: query
          name: skip
          required: false
        - schema:
            default: 10
            maximum: 100
            type: integer
          in: query
          name: take
          required: false
      responses:
        '200':
          description: Purchase orders found
          content:
            application/json:
              schema:
                description: Purchase orders found
                items:
                  $ref: '#/components/schemas/PurchaseOrder'
                type: array
        '404':
          description: No purchase orders found
          content:
            application/json:
              schema:
                description: No purchase orders found
                type: object
components:
  schemas:
    PurchaseOrder:
      type: object
      modelName: PurchaseOrder
      properties:
        po_number:
          type: string
          example: PO5792303
        supplier_name:
          type: string
          description: Supplier name as per client convention
          example: Detroit Factory
        purchase_order_lines:
          type: array
          items:
            type: object
            properties:
              reference:
                example: 'Delivery #1'
                type: string
              product:
                type: object
                properties:
                  sku:
                    type: string
                    example: REF0123458
                  name:
                    type: string
                    example: blue t-shirt
                  hs_code:
                    type: string
                    example: '96032930'
                  description:
                    type: string
                    example: blue shirt with a T shape
                  is_hazardous:
                    type: boolean
                    default: 'false'
                  hazardous_description:
                    type: string
                    example: UN1993
                  custom_parameters:
                    type: array
                    description: Array of up to 3 custom parameters
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          example: parameter1
                        value:
                          type: string
                          example: value1
              ordered_quantity:
                type: number
                example: 500
              unit_price:
                $ref: '#/components/schemas/Price'
              assigned_order_lines:
                type: array
                items:
                  type: object
                  properties:
                    onechain_shipment_id:
                      type: string
                      example: BATE
                    shipment_status:
                      type: string
                      enum:
                        - booking_request
                        - awaiting_booking
                        - booked
                        - draft
                        - in_progress
                        - finished
                        - cancelled
                    assigned_quantity:
                      type: number
                      example: 200
                    shipped_order_lines:
                      type: array
                      items:
                        type: object
                        properties:
                          container_number:
                            type: string
                            example: HLCU1234567
                          shipped_quantity:
                            type: number
                            example: 150
                          packaging_total_volume:
                            type: number
                            example: 5
                          number_of_packages:
                            type: number
                            example: 10
                          packaging_type:
                            type: string
                            example: box
                          net_weight:
                            type: number
                            example: 100
                          gross_weight:
                            type: number
                            example: 110
                          volume_unit:
                            type: string
                            example: m3
                          weight_unit:
                            type: string
                            example: kg
        desired_ex_factory_date:
          $ref: '#/components/schemas/SimpleDate'
        desired_delivery_date:
          $ref: '#/components/schemas/SimpleDate'
        custom_parameters:
          type: array
          description: Array of up to 6 custom parameters
          items:
            type: object
            properties:
              name:
                type: string
                example: parameter1
              value:
                type: string
                example: value1
    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
    SimpleDate:
      modelName: SimpleDate
      type: string
      example: '2021-10-11'

````