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

# Retrieve order



## OpenAPI

````yaml GET /orders/{id}/
openapi: 3.0.3
info:
  title: Piriod API
  version: 1.0.0
  description: >
    Piriod API for billing, payments, procurement and collections.


    All requests require:

    - `Authorization: Token <api_token>` header.

    - `x-simple-workspace: <workspace_id>` header (the account/workspace
    identifier).

    - Optionally `x-piriod-test-mode: true` to operate against test-mode data.


    See the Documentation tab for getting started, integration flows,
    authentication,

    error handling and pagination/filtering guides.
servers:
  - url: https://api.piriod.com
    description: Production
security:
  - TokenAuth: []
paths:
  /orders/{id}/:
    parameters:
      - $ref: '#/components/parameters/IdPath'
      - $ref: '#/components/parameters/WorkspaceHeader'
      - $ref: '#/components/parameters/TestModeHeader'
    get:
      tags:
        - Procurement
      summary: Retrieve order
      responses:
        '200':
          description: The order.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    IdPath:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Resource identifier.
    WorkspaceHeader:
      name: x-simple-workspace
      in: header
      required: true
      schema:
        type: string
      description: Workspace (account) identifier. Required for every request.
      example: acc_01H8XYZ123ABC
    TestModeHeader:
      name: x-piriod-test-mode
      in: header
      required: false
      schema:
        type: boolean
        default: false
      description: Whether to operate against test-mode data. Defaults to `false`.
  schemas:
    Order:
      type: object
      description: >
        Sales / shipping order (e.g. Chilean "guía de despacho"). Documents
        goods

        movements that may or may not constitute a sale.
      properties:
        id:
          type: integer
          readOnly: true
        customer:
          type: string
          description: Customer ID.
        document:
          type: integer
          description: Order document type.
        number:
          type: integer
          nullable: true
        date:
          type: string
          format: date
        shipping_type:
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - '4'
            - '5'
            - '6'
            - '7'
            - '8'
            - '9'
          description: >
            Shipping classification:

            `1` venta, `2` ventas por efectuar, `3` consignaciones,

            `4` entrega gratuita, `5` traslados internos, `6` otros traslados,

            `7` guía de devolución, `8` traslado para exportación, `9` venta
            para exportación.
        address:
          type: string
          maxLength: 70
          nullable: true
        state:
          type: integer
          nullable: true
        carrier_id:
          type: string
          maxLength: 10
          nullable: true
        carrier_name:
          type: string
          maxLength: 30
          nullable: true
        licence_plate:
          type: string
          maxLength: 7
          nullable: true
        note:
          type: string
          maxLength: 100
          nullable: true
        amount:
          type: integer
          nullable: true
        exempt:
          type: integer
          nullable: true
        tax:
          type: integer
          nullable: true
        tax_percent:
          type: number
          nullable: true
        total:
          type: integer
          nullable: true
        status:
          type: string
          enum:
            - draft
            - finalized
            - cancelled
          default: draft
          readOnly: true
        biller_status:
          type: string
          readOnly: true
        tax_agency:
          type: object
          readOnly: true
        local_file:
          type: string
          format: uri
          readOnly: true
          nullable: true
        imported:
          type: boolean
          readOnly: true
        test_mode:
          type: boolean
          readOnly: true
        lines:
          type: array
          items:
            $ref: '#/components/schemas/OrderLine'
        references:
          type: array
          items:
            $ref: '#/components/schemas/OrderReference'
        created:
          type: string
          format: date-time
          readOnly: true
        updated:
          type: string
          format: date-time
          readOnly: true
      required:
        - customer
        - document
        - date
        - shipping_type
        - lines
    OrderLine:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 80
        description:
          type: string
          maxLength: 200
          nullable: true
        amount:
          type: integer
        quantity:
          type: number
        exempt:
          type: boolean
          default: false
        tax:
          type: integer
          nullable: true
        tax_percent:
          type: number
          nullable: true
        total:
          type: integer
          readOnly: true
      required:
        - name
        - amount
        - quantity
    OrderReference:
      type: object
      properties:
        date:
          type: string
          format: date
        document:
          type: string
        description:
          type: string
          nullable: true
        serial:
          type: string
      required:
        - date
        - document
        - serial
    Error:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message.
      example:
        detail: Authentication credentials were not provided.
  responses:
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    TokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: |
        Use header `Authorization: Token <api_token>`.
        API tokens are obtained from the Piriod dashboard.

````