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

# List purchase order revisions

> Lists the immutable commercial revisions of the order, newest first. Each holds the terms and lines as they were at that revision. Revisions cannot be edited.



## OpenAPI

````yaml /openapi.json get /v1/purchase-orders/{id}/revisions
openapi: 3.1.0
info:
  title: Watchdog API
  version: 1.0.0
  description: >-
    The Watchdog API is served from https://api.watchdog.no. Request bodies are
    limited to 2 MiB unless an endpoint says otherwise. Files are uploaded
    directly to storage, not through the API.
servers:
  - url: https://api.watchdog.no
    description: Watchdog API
security: []
paths:
  /v1/purchase-orders/{id}/revisions:
    get:
      tags:
        - Purchase orders
      summary: List purchase order revisions
      description: >-
        Lists the immutable commercial revisions of the order, newest first.
        Each holds the terms and lines as they were at that revision. Revisions
        cannot be edited.
      operationId: listPurchaseOrderRevisions
      parameters:
        - name: X-Organization-Id
          in: header
          required: false
          schema:
            type: string
          description: >-
            The organization to act in. Required for personal API keys; list the
            organizations you can access with GET /v1/organizations.
        - name: fields
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
          style: form
          explode: false
          description: >-
            Return only these fields of each row; use dots for nested fields,
            such as terms.number. Fields: revision, recorded_at, actor, terms.
        - schema:
            type: string
            format: uuid
          required: true
          name: id
          in: path
        - schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 50
          required: false
          name: limit
          in: query
        - schema:
            type: string
            maxLength: 4096
          required: false
          name: cursor
          in: query
        - schema:
            type: array
            items:
              type: string
              pattern: ^[1-9]\d{0,8}$
            description: Only these revision numbers.
          required: false
          description: Only these revision numbers.
          style: form
          explode: false
          name: revisions
          in: query
      responses:
        '200':
          description: A page of revisions; next_cursor is null at the end.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PurchaseOrderRevision'
                    maxItems: 1000
                  next_cursor:
                    type:
                      - string
                      - 'null'
                required:
                  - data
                  - next_cursor
        '400':
          description: >-
            The request is invalid. details lists up to 20 field errors. Request
            bodies are limited to 2 MiB.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
          content:
            application/json:
              example:
                error:
                  code: validation_error
                  message: >-
                    The request is invalid. details lists up to 20 field errors.
                    Request bodies are limited to 2 MiB.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_validation_error'
        '401':
          description: The bearer token is missing or invalid.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
            WWW-Authenticate:
              schema:
                type: string
              required: false
              description: Bearer authentication challenge, when supplied.
          content:
            application/json:
              example:
                error:
                  code: invalid_token
                  message: The bearer token is missing or invalid.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_invalid_token'
        '403':
          description: >-
            Access denied. The error code says why: forbidden, token_disabled,
            organization_required, insufficient_role or mfa_required.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
          content:
            application/json:
              example:
                error:
                  code: forbidden
                  message: >-
                    Access denied. The error code says why: forbidden,
                    token_disabled, organization_required, insufficient_role or
                    mfa_required.
                  request_id: req_example
              schema:
                $ref: >-
                  #/components/schemas/Error_forbidden_token_disabled_organization_required_insufficient_role_mfa_required
        '404':
          description: The resource does not exist in the current organization.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
          content:
            application/json:
              example:
                error:
                  code: not_found
                  message: The resource does not exist in the current organization.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_not_found'
        '429':
          description: Too many requests. Wait for the Retry-After delay before retrying.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
            Retry-After:
              schema:
                type: string
                example: '60'
              required: true
              description: Seconds to wait before retrying the request.
          content:
            application/json:
              example:
                error:
                  code: rate_limit_exceeded
                  message: >-
                    Too many requests. Wait for the Retry-After delay before
                    retrying.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_rate_limit_exceeded'
        '500':
          description: >-
            Unexpected server failure. Include the request ID when contacting
            support.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
          content:
            application/json:
              example:
                error:
                  code: internal_error
                  message: >-
                    Unexpected server failure. Include the request ID when
                    contacting support.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_internal_error'
        '503':
          description: >-
            Temporarily unavailable. Retry after the Retry-After delay, when
            provided.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
            Retry-After:
              schema:
                type: string
                example: '60'
              required: true
              description: Seconds to wait before retrying the request.
          content:
            application/json:
              example:
                error:
                  code: service_unavailable
                  message: >-
                    Temporarily unavailable. Retry after the Retry-After delay,
                    when provided.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_service_unavailable'
      security:
        - ApiKeyBearer: []
components:
  schemas:
    PurchaseOrderRevision:
      allOf:
        - $ref: '#/components/schemas/PurchaseOrderRevisionSummary'
        - type: object
          properties:
            terms:
              $ref: '#/components/schemas/PurchaseOrderTerms'
          required:
            - terms
    Error_validation_error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - validation_error
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_invalid_token:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - invalid_token
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_forbidden_token_disabled_organization_required_insufficient_role_mfa_required:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - forbidden
                - token_disabled
                - organization_required
                - insufficient_role
                - mfa_required
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_not_found:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - not_found
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_rate_limit_exceeded:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - rate_limit_exceeded
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_internal_error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - internal_error
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_service_unavailable:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - service_unavailable
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    PurchaseOrderRevisionSummary:
      type: object
      properties:
        revision:
          type: integer
        recorded_at:
          type: string
          format: date-time
        actor:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - user
                user_id:
                  type: string
                api_token_id:
                  type:
                    - string
                    - 'null'
                  format: uuid
              required:
                - type
                - user_id
                - api_token_id
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - system
                    - integration
                source:
                  type:
                    - string
                    - 'null'
              required:
                - type
                - source
      required:
        - revision
        - recorded_at
        - actor
    PurchaseOrderTerms:
      type: object
      properties:
        number:
          type:
            - string
            - 'null'
        supplier:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            organization_number:
              type:
                - string
                - 'null'
            org_country:
              type:
                - string
                - 'null'
            vat_number:
              type:
                - string
                - 'null'
            vat_country:
              type:
                - string
                - 'null'
          required:
            - id
            - name
            - organization_number
            - org_country
            - vat_number
            - vat_country
          description: The party as it was at this revision.
        buyer:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            organization_number:
              type:
                - string
                - 'null'
            org_country:
              type:
                - string
                - 'null'
            vat_number:
              type:
                - string
                - 'null'
            vat_country:
              type:
                - string
                - 'null'
          required:
            - id
            - name
            - organization_number
            - org_country
            - vat_number
            - vat_country
          description: The party as it was at this revision.
        currency_code:
          type:
            - string
            - 'null'
        commitment_basis:
          type: string
          enum:
            - lines
            - amount_limit
        amount_limit:
          type:
            - string
            - 'null'
          pattern: ^-?\d+(?:\.\d+)?$
        scope_description:
          type:
            - string
            - 'null'
        issued_date:
          type:
            - string
            - 'null'
        valid_from:
          type:
            - string
            - 'null'
        valid_until:
          type:
            - string
            - 'null'
        delivery_date:
          type:
            - string
            - 'null'
        delivery:
          $ref: '#/components/schemas/PurchaseOrderDelivery'
        buyer_reference:
          type:
            - string
            - 'null'
        sales_order_reference:
          type:
            - string
            - 'null'
        contract_reference:
          type:
            - string
            - 'null'
        project_reference:
          type:
            - string
            - 'null'
        note_to_supplier:
          type:
            - string
            - 'null'
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseOrderLine'
        totals:
          type: object
          properties:
            lines_excluding_vat:
              type: string
              pattern: ^-?\d+(?:\.\d+)?$
              description: Active lines, excluding VAT.
            commitment:
              type:
                - string
                - 'null'
              pattern: ^-?\d+(?:\.\d+)?$
              description: >-
                Active lines for a lines order, amount_limit for an amount-limit
                order.
          required:
            - lines_excluding_vat
            - commitment
      required:
        - number
        - supplier
        - buyer
        - currency_code
        - commitment_basis
        - amount_limit
        - scope_description
        - issued_date
        - valid_from
        - valid_until
        - delivery_date
        - delivery
        - buyer_reference
        - sales_order_reference
        - contract_reference
        - project_reference
        - note_to_supplier
        - line_items
        - totals
    PurchaseOrderDelivery:
      type:
        - object
        - 'null'
      properties:
        name:
          type:
            - string
            - 'null'
          description: Who receives the delivery (Peppol DeliveryParty name).
        address:
          type: object
          properties:
            street:
              type:
                - string
                - 'null'
            postal_code:
              type:
                - string
                - 'null'
            city:
              type:
                - string
                - 'null'
            country_code:
              type:
                - string
                - 'null'
              description: ISO 3166-1 alpha-2.
          required:
            - street
            - postal_code
            - city
            - country_code
          description: Peppol Delivery/DeliveryLocation/Address.
      required:
        - name
        - address
      description: >-
        Where to deliver. Null delivers to the buyer's own address. Changing it
        on an opened order records a revision.
    PurchaseOrderLine:
      type: object
      properties:
        id:
          type: string
          format: uuid
        billed_amount:
          type: string
        invoice_summary:
          type:
            - object
            - 'null'
          properties:
            invoices:
              type: integer
              minimum: 0
            unit_price_min:
              type:
                - string
                - 'null'
            unit_price_max:
              type:
                - string
                - 'null'
            unit_price_difference:
              type:
                - string
                - 'null'
            price_difference_invoices:
              type:
                - integer
                - 'null'
              minimum: 0
            grouped_invoice_lines:
              type: array
              items:
                type: object
                properties:
                  invoice_id:
                    type: string
                    format: uuid
                  invoice_number:
                    type:
                      - string
                      - 'null'
                  invoice_item_id:
                    type: string
                    format: uuid
                  line_number:
                    type: integer
                  description:
                    type:
                      - string
                      - 'null'
                  purchase_order_line_ids:
                    type: array
                    items:
                      type: string
                      format: uuid
                    description: >-
                      Every order line the invoice line bills, this one
                      included.
                required:
                  - invoice_id
                  - invoice_number
                  - invoice_item_id
                  - line_number
                  - description
                  - purchase_order_line_ids
              description: >-
                Invoice lines that bill this line as part of a group, together
                with other lines of the order.
          required:
            - invoices
            - unit_price_min
            - unit_price_max
            - unit_price_difference
            - price_difference_invoices
            - grouped_invoice_lines
          description: >-
            Accepted invoices allocated to this line. Null if any invoice is
            restricted. Effective unit prices include line adjustments; a
            grouped invoice line counts what it bills this line. Null when units
            or quantities cannot be compared.
        invoice_check:
          type:
            - string
            - 'null'
          enum:
            - clean
            - findings
            - incomplete
            - null
          description: >-
            The purchase-order check's verdict on the accepted invoices that
            bill this line: findings when an open quantity or unit price finding
            names the line; clean when every one was checked completely without
            one; incomplete otherwise. Null when no accepted invoice bills the
            line, the line is cancelled, or an invoice is restricted.
        billed_quantity:
          type:
            - string
            - 'null'
        quantity_complete:
          type: boolean
        billed_unit:
          type:
            - string
            - 'null'
          description: >-
            The unit billed_quantity is in: the Peppol code, or the unit as
            written when it has none. A line without a unit takes the unit its
            billed invoice lines share.
        line_reference:
          type: string
          description: >-
            The line identifier as the supplier sees it (Peppol LineItem/ID).
            Never reused once the order is opened; lines are listed in their
            display order. Invoice lines are never matched on it.
        item:
          type: object
          properties:
            name:
              type: string
            description:
              type:
                - string
                - 'null'
            product_code:
              type:
                - string
                - 'null'
              description: The seller's article number.
            buyer_product_code:
              type:
                - string
                - 'null'
              description: The buyer's own article number.
          required:
            - name
            - description
            - product_code
            - buyer_product_code
        quantity:
          type: string
          pattern: ^-?\d+(?:\.\d+)?$
        unit:
          type:
            - string
            - 'null'
          description: As written, such as pcs or hours.
        unit_price:
          type: string
          pattern: ^-?\d+(?:\.\d+)?$
          description: >-
            The agreed net price per unit after the line's own discounts,
            excluding VAT. Zero or below on an allowance, zero or above on a
            charge.
        total_excluding_vat:
          type: string
          pattern: ^-?\d+(?:\.\d+)?$
          description: quantity × unit_price.
        vat_rate:
          type:
            - string
            - 'null'
          pattern: ^-?\d+(?:\.\d+)?$
          description: >-
            The VAT rate the supplier is to charge, as a fraction: 0.25 is 25 %.
            Null when the order states none. A term: an invoice line billing the
            line at a higher rate is a vat_rate finding.
        kind:
          type: string
          enum:
            - item
            - allowance
            - charge
          description: >-
            Peppol: item for goods or services; allowance for a discount and
            charge for a fee, freight or surcharge the document lists on its
            own. Neither names the lines it applies to, and neither is spread
            over them.
        gross_unit_price:
          type:
            - string
            - 'null'
          pattern: ^-?\d+(?:\.\d+)?$
          description: >-
            Peppol Price/AllowanceCharge/BaseAmount: the price per unit printed
            before the line's own discount, for display only; unit_price is the
            binding net price. Only on an item. Not part of the terms, so
            revisions leave it out.
        status:
          type: string
          enum:
            - active
            - cancelled
          description: >-
            A line removed from an opened order is cancelled; it keeps its ID
            and number.
        agreement_item_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            The agreement price the line was ordered from; null when it has none
            or you cannot see its agreement. Not part of the terms, so revisions
            leave it out.
        source_line_id:
          type:
            - string
            - 'null'
          description: >-
            The line's ID in the order's other system (source): the ERP's on an
            imported or pushed order, the caller's on a linked one. Not part of
            the terms, so revisions leave it out.
        coding:
          type:
            - object
            - 'null'
          properties:
            account:
              type:
                - object
                - 'null'
              properties:
                id:
                  type: string
                  format: uuid
                name:
                  type: string
                usable:
                  type: boolean
                  description: >-
                    Active and still in the chart of accounts; a line keeps a
                    code that went.
                number:
                  type:
                    - string
                    - 'null'
              required:
                - id
                - name
                - usable
                - number
            vat_code:
              type:
                - object
                - 'null'
              properties:
                id:
                  type: string
                  format: uuid
                name:
                  type: string
                usable:
                  type: boolean
                  description: >-
                    Active and still in the chart of accounts; a line keeps a
                    code that went.
                code:
                  type:
                    - string
                    - 'null'
                rate:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
              required:
                - id
                - name
                - usable
                - code
                - rate
            dimension_values:
              type: array
              items:
                type: object
                properties:
                  dimension_id:
                    type: string
                    format: uuid
                  dimension_name:
                    type: string
                  dimension_kind:
                    type: string
                    enum:
                      - department
                      - project
                      - custom
                    description: >-
                      The dimension's kind: a project's value fills the order's
                      project reference.
                  id:
                    type: string
                    format: uuid
                  name:
                    type: string
                  usable:
                    type: boolean
                    description: >-
                      Active and still in the chart of accounts; a line keeps a
                      code that went.
                  code:
                    type:
                      - string
                      - 'null'
                required:
                  - dimension_id
                  - dimension_name
                  - dimension_kind
                  - id
                  - name
                  - usable
                  - code
          required:
            - account
            - vat_code
            - dimension_values
          description: >-
            Where the line's cost is booked; null when it is not coded. An
            invoice line matched to the order line takes it as its coding
            suggestion. Not part of the terms, so revisions leave it out.
        received:
          type:
            - object
            - 'null'
          properties:
            quantity:
              type: string
              pattern: ^-?\d+(?:\.\d+)?$
              description: Everything received on the line, in `unit`.
            unit:
              type:
                - string
                - 'null'
              description: >-
                The unit the quantity counts, as written: the line's when it was
                recorded, unless receiving gave another.
            last_received_on:
              type: string
              format: date
              description: When the received quantity last changed.
          required:
            - quantity
            - unit
            - last_received_on
          description: >-
            Goods received on the line (recordPurchaseOrderReceipts); null until
            a total is recorded. Invoices billing more than was received are
            flagged on orders that record goods received, while the received
            unit agrees with the line's.
      required:
        - id
        - line_reference
        - item
        - quantity
        - unit
        - unit_price
        - total_excluding_vat
        - vat_rate
        - kind
        - status
  securitySchemes:
    ApiKeyBearer:
      type: http
      scheme: bearer
      description: >-
        Personal API key sent as a bearer token, together with
        X-Organization-Id. The key must have at least the access level the
        endpoint requires (read, write or admin).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.