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

# Update a purchase order (PATCH alias)

> Same as `PUT /purchase-orders/{id}`: only the fields you send change, and `items`, when sent,
replaces every line. See that operation for the full behavior, including supplier currency
(`currency_code`, `exchange_rate`, `items[].presentment_unit_price`).




## OpenAPI

````yaml /api-reference/build.yaml patch /purchase-orders/{id}
openapi: 3.0.0
info:
  title: Luminous API
  version: 1.0.0
  description: API documentation for Luminous
servers:
  - url: https://{companyName}.api.joinluminous.com/external/api/v1
    variables:
      companyName:
        default: companyName
        description: Your company-specific subdomain
security: []
tags:
  - name: Products
    description: Get and manage products
  - name: Pricing
    description: Manage price schedules, levels, and customizations
  - name: BOMs
    description: Manage Bills of Materials (BOMs)
  - name: Labels
    description: Label rendering via Labelary ZPL service
  - name: Companies
    description: Manage business accounts and their associated data
  - name: Contacts
    description: Manage contact information for individuals
  - name: Suppliers
    description: Manage suppliers (factories) — vendors used on purchase orders
  - name: Supplier SKUs
    description: Manage per-supplier SKU and unit-cost overrides for products
  - name: Locations
    description: Manage warehouses and locations
  - name: Inventory
    description: Get and adjust product stock levels
  - name: Lots
    description: Create, update, and delete product lots (batches)
  - name: Transfer Orders
    description: Manage transfer orders
  - name: Fulfillment Orders
    description: Manage fulfillment orders and picklists
  - name: Freight
    description: >-
      Freightview LTL freight — quotes, booking and documents for fulfillment
      orders
  - name: Fulfillment Priority Lists
    description: Configure fulfillment routing priority lists
  - name: Purchase Orders
    description: Get and modify purchase orders
  - name: Supplier Portal
    description: >-
      Read a supplier's response to a purchase order and control the one-click
      portal link
  - name: Receiving Reports
    description: Manage receiving reports
  - name: Defective Reports
    description: >-
      Record and list defective units received on purchase orders (Inventory >
      Defectives)
  - name: Payment Obligations
    description: Manage payment obligations for purchase orders
  - name: Sales Orders
    description: Manage sales orders and sales order shipments
  - name: Purgatory
    description: >-
      Inspect and resolve non-posted sales orders in the purgatory staging
      workflow
  - name: PickFlow Warehouse
    description: >-
      Warehouse-floor lookups for PickFlow — barcode resolution, bin and product
      stock, bin search, and receivables
  - name: PickFlow Shipping
    description: >-
      Provider-agnostic shipping rates, services, packages, and label purchase
      for PickFlow
  - name: Cycle Counts
    description: >-
      Create, drive, and post PickFlow cycle counts — batches, per-warehouse
      sessions, and CSV import/export
  - name: Print Stations
    description: List paired print stations and enqueue print jobs to them
  - name: Invoices
    description: Get and manage invoices
  - name: Work Orders
    description: >-
      Manage work orders — production lifecycle, steps, materials, links,
      shipments, and comments
  - name: Production Batches
    description: Group and manage work orders as production batches
  - name: Bills
    description: >-
      Accounts payable bill management, payments, attachments, allocations, and
      variance
  - name: Prepayments
    description: Manage vendor prepayments and applications
  - name: Vendor Credits
    description: Manage vendor credits and applications
  - name: Vendor Returns
    description: Manage vendor returns and credit generation
  - name: Customer Returns
    description: Manage customer returns (sales returns), receiving, and restock behavior
  - name: Stock Snapshot
    description: Point-in-time stock snapshots with export support
  - name: Consumption
    description: Consumption reports and exports
  - name: Inventory Aging
    description: Cost-layer-based inventory aging reports
  - name: Bills Reports
    description: Accounts payable bills aging reports
  - name: Forecast
    description: Materialized forecast data
  - name: Reports
    description: Close the books, inventory discrepancy, transaction COGS, and EDI reports
  - name: Tags
    description: Add/remove tags across various resources
  - name: Custom Fields
    description: Get and set custom fields across various resources
  - name: Approvals
    description: >-
      Approval rules that hold sales orders and supplier POs for sign-off, and
      their approver templates
  - name: Currency
    description: Currency configuration, exchange rates, and conversion
  - name: Drive
    description: >
      Browse, upload, tag and manage files in your Luminous Drive. An API token
      sees the shared

      drive only, never My Files or restricted folders and files. Every write
      and download made

      through the API is recorded in the file's activity log (`GET
      /file-cabinet/files/{id}/activity`)

      with `actor_kind: api_token`.
  - name: Integration Mappings
    description: Manage integration mappings for external systems
  - name: Integration Field Mappings
    description: Manage field-level mappings between Luminous and external systems
  - name: Automations
    description: Create, test, and inspect automation rules and their runs
paths:
  /purchase-orders/{id}:
    patch:
      tags:
        - Purchase Orders
      summary: Update a purchase order (PATCH alias)
      description: >
        Same as `PUT /purchase-orders/{id}`: only the fields you send change,
        and `items`, when sent,

        replaces every line. See that operation for the full behavior, including
        supplier currency

        (`currency_code`, `exchange_rate`, `items[].presentment_unit_price`).
      operationId: patchPurchaseOrder
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: ID of the purchase order to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - order_date
                - supplier_id
                - items
              properties:
                order_date:
                  type: string
                  format: date
                  description: Date when the purchase order was created (YYYY-MM-DD)
                  example: '2024-01-15'
                supplier_id:
                  type: integer
                  description: ID of the supplier
                  example: 123
                warehouse_id:
                  type: integer
                  nullable: true
                  description: ID of the warehouse
                  example: 1
                location_id:
                  type: integer
                  nullable: true
                  description: ID of the location
                  example: 1
                order_status:
                  oneOf:
                    - type: string
                      enum:
                        - active
                        - production_started
                        - production_completed
                        - in_transit
                        - completed
                        - draft
                        - cancelled
                        - deleted
                    - type: integer
                      enum:
                        - 1
                        - 20
                        - 40
                        - 50
                        - 99
                        - 101
                        - 100
                        - -1
                  nullable: true
                  default: active
                  description: >
                    Milestone status (token or numeric id). Also accepts 30
                    (production_active) and 88 (delivered) by id.

                    Writes a milestone row and updates the PO header.


                    `draft` (101) and `cancelled` (100) are order states, not
                    timeline milestones. They do not

                    count as incoming stock and the purchase order cannot take a
                    new receipt while in either state.

                    Creating a purchase order with `order_status: draft` saves
                    it as a draft from the start, so its

                    lines never post incoming. Moving it to an open milestone
                    later posts incoming at that point.
                  example: active
                order_numbers:
                  type: array
                  nullable: true
                  description: >-
                    Array of purchase order numbers used to identify the
                    purchase order across various systems
                  items:
                    type: string
                    maxLength: 255
                  example:
                    - PO-2024-001
                    - SUPPLIER-PO-123
                invoice_date:
                  type: string
                  format: date
                  nullable: true
                  description: Date when the purchase order was invoiced (YYYY-MM-DD)
                  example: '2024-01-16'
                incoterm:
                  type: string
                  nullable: true
                  description: >-
                    Incoterm (delivery term) for the purchase order, given as a
                    logistic code configured for the account (e.g. `exw`, `fob`,
                    `ddp`). Matching is case-insensitive — both the lower-case
                    code (`exw`) and its upper-case label (`EXW`) are accepted.
                    Returned on the purchase order resource as `incoterm`. If
                    omitted, the account default is applied.
                  example: exw
                payment_terms:
                  type: string
                  nullable: true
                  description: >-
                    Payment terms for the purchase order. Must exactly match one
                    of the payment terms configured for the account (Manage >
                    Suppliers); matching is case-sensitive (`Net 30` passes
                    where `net 30` fails). Returned on the purchase order
                    resource as `payment_terms`. If omitted, the account default
                    is applied.
                  example: Net 30
                currency_code:
                  type: string
                  nullable: true
                  minLength: 3
                  maxLength: 3
                  description: >
                    The purchase order's supplier currency: a three-letter code,
                    in any case, listed by

                    `GET /currency/available`. `null` puts the purchase order in
                    base currency. Sending your base

                    currency code explicitly also puts it in base currency, but
                    stores the code (rate `1`) so responses

                    return it instead of `null`.

                    On create, omitting it applies the supplier's default
                    currency (base currency when the supplier has

                    none). On update, omit to leave the currency and rate
                    unchanged. Costs and totals stay in base currency.


                    Changing the currency restates `presentment_unit_price` at
                    the new rate on every line the request

                    does not price (`unit_price` and costs do not change).
                    Responds `422` on `currency_code` when the code

                    is unknown or no rate exists on or before `order_date` (send
                    `exchange_rate` to supply one).
                  example: EUR
                exchange_rate:
                  type: number
                  nullable: true
                  minimum: 1.e-8
                  maximum: 9999999999
                  description: >
                    Base-currency units per 1 unit of `currency_code`. Requires
                    `currency_code`. If omitted, the rate on or

                    before `order_date` is used. While the currency stays the
                    same on update, the stored rate is kept and

                    a different value here is ignored.
                  example: 1.085
                total_shipping_cost:
                  type: number
                  format: float
                  minimum: 0
                  nullable: true
                  default: 0
                  description: Total shipping cost
                  example: 50
                total_tax:
                  type: number
                  format: float
                  minimum: 0
                  nullable: true
                  default: 0
                  description: Total tax amount
                  example: 80
                volume_target_cbm:
                  type: number
                  format: float
                  minimum: 0
                  nullable: true
                  description: >
                    Target container volume in cubic metres (the container-fill
                    gauge's denominator). When set, the

                    purchase-order response reports `volume_remaining_cbm` and
                    `volume_fill_percent` against it.
                  example: 67
                public_note:
                  type: string
                  nullable: true
                  description: Public notes visible to suppliers
                  example: Please ship via express delivery
                private_note:
                  type: string
                  nullable: true
                  description: Internal private notes
                  example: Rush order - expedite processing
                requested_ship_date:
                  type: string
                  format: date
                  nullable: true
                  description: Requested shipping date (YYYY-MM-DD)
                  example: '2024-01-20'
                arrival_due_date:
                  type: string
                  format: date
                  nullable: true
                  description: Expected arrival date (YYYY-MM-DD)
                  example: '2024-01-25'
                shipment_type:
                  type: string
                  nullable: true
                  enum:
                    - Air
                    - Sea
                    - Road
                    - Rail
                    - Express
                    - null
                  description: >
                    Freight mode used by the Transit Time Matrix. Matching is
                    case-insensitive — `sea` and `SEA` are

                    stored as `Sea` — but any other value returns `422`. On
                    update, omit to keep the stored value or send

                    `null` to clear it.


                    When a request sends `shipment_type` or
                    `override_transit_days` and the PO has a warehouse, the

                    Original ETA (`original_arrival_due_date`) and current ETA
                    (`arrival_due_date`) are filled from the

                    transit matrix if empty. Arrival dates sent in the same
                    request are always kept as sent.


                    When the PO has no `requested_ship_date`, the count starts
                    from today, unless the account's

                    `transit_eta_requires_ship_date` setting is on (off by
                    default). Then both dates stay empty until the

                    PO has a requested ship date, and a `PUT
                    /purchase-orders/{id}` that sends `requested_ship_date` to a

                    PO that already has a freight mode or override fills them
                    while they are empty, even without

                    `shipment_type` or `override_transit_days` in the request.
                    Transfer POs are not affected.
                  example: Sea
                original_arrival_due_date:
                  type: string
                  format: date
                  nullable: true
                  description: >
                    Frozen Original ETA (YYYY-MM-DD) — the arrival date as first
                    planned, kept separate from the current

                    `arrival_due_date`. On update, omit to keep the stored value
                    or send `null` to clear it.
                  example: '2024-01-25'
                override_transit_days:
                  type: integer
                  minimum: 0
                  maximum: 3650
                  nullable: true
                  description: >
                    Manual override of the transit-matrix calendar days used to
                    derive the arrival date. `0` is allowed.

                    On update, omit to keep the stored value or send `null` to
                    clear it.
                  example: 35
                ship_to:
                  type: object
                  nullable: true
                  description: Shipping address information
                  properties:
                    address_1:
                      type: string
                      maxLength: 255
                      nullable: true
                      description: Primary street address
                      example: 123 Main Street
                    address_2:
                      type: string
                      maxLength: 255
                      nullable: true
                      description: Secondary address line (apt, suite, etc.)
                      example: Suite 100
                    city:
                      type: string
                      maxLength: 255
                      nullable: true
                      description: City name
                      example: Anytown
                    state:
                      type: string
                      maxLength: 255
                      nullable: true
                      description: State or province
                      example: CA
                    zip:
                      type: string
                      maxLength: 255
                      nullable: true
                      description: ZIP or postal code
                      example: '90210'
                    country:
                      type: string
                      maxLength: 255
                      nullable: true
                      description: Country name
                      example: United States
                    default_ship_to_address:
                      type: string
                      enum:
                        - ship_to_address
                        - warehouse
                      nullable: true
                      description: Default shipping address preference
                      example: warehouse
                items:
                  type: array
                  minItems: 1
                  description: Array of line items for the purchase order
                  items:
                    type: object
                    required:
                      - quantity
                    properties:
                      id:
                        type: integer
                        nullable: true
                        description: Line item ID (only used for updates)
                        example: 456
                      product_id:
                        type: integer
                        nullable: true
                        description: ID of the product (required if sku not provided)
                        example: 123
                      sku:
                        type: string
                        maxLength: 255
                        nullable: true
                        description: >-
                          SKU of the product (required if product_id not
                          provided)
                        example: WIDGET-001
                      quantity:
                        type: number
                        format: float
                        minimum: 0.001
                        description: Quantity of the item ordered
                        example: 10.5
                      unit_price:
                        type: number
                        format: float
                        description: >
                          Price per unit, always in **base currency**. Required
                          unless `presentment_unit_price` is sent.

                          On a foreign-currency purchase order,
                          `presentment_unit_price` becomes this price divided by
                          the

                          exchange rate. Do not send a supplier-currency amount
                          here.
                        example: 49.99
                      presentment_unit_price:
                        type: number
                        format: float
                        nullable: true
                        minimum: 0
                        maximum: 99999999999
                        description: >
                          The line price in the purchase order's supplier
                          currency, per ordered unit. `unit_price` becomes

                          this price times the exchange rate, and wins if both
                          are sent. Without `unit_price`, a

                          base-currency purchase order responds `422` on this
                          field.
                        example: 46
                      ordered_qty:
                        type: number
                        format: float
                        minimum: 0.001
                        nullable: true
                        description: >-
                          Ordered quantity in base unit of measure (calculated
                          automatically if not provided)
                        example: 10.5
                      received_qty:
                        type: number
                        format: float
                        minimum: 0
                        nullable: true
                        default: 0
                        description: Quantity already received
                        example: 5
                      expected_ship_date:
                        type: string
                        format: date
                        nullable: true
                        description: >-
                          Per-line expected ship date override. When omitted or
                          null, the line inherits the purchase order's header
                          `requested_ship_date`.
                        example: '2026-08-15'
                      expected_arrival_date:
                        type: string
                        format: date
                        nullable: true
                        description: >-
                          Per-line expected arrival date override. When omitted
                          or null, the line inherits the purchase order's header
                          `arrival_due_date`.
                        example: '2026-08-20'
                      lot_id:
                        type: integer
                        nullable: true
                        description: ID of the product lot
                        example: 789
                      lot_number:
                        type: string
                        nullable: true
                        description: >-
                          Lot number for the received item (used when the
                          product has lot tracking enabled).
                        example: LOT-12345
                      lot_name:
                        type: string
                        nullable: true
                        description: Alias for `lot_number`.
                      uom_id:
                        type: integer
                        nullable: true
                        description: >-
                          ID of the unit of measure for the item. If omitted, a
                          default is resolved automatically in priority order:
                          the product's default purchase unit, then its default
                          selling unit, then the base unit of its unit class,
                          then the account's base unit. If no unit of measure is
                          supplied and no default can be resolved, the request
                          fails with a 422 error.
                        example: 1
                      source_sku:
                        type: string
                        maxLength: 255
                        nullable: true
                        description: Source SKU from the supplier
                        example: SUPPLIER-SKU-123
                      tags:
                        type: array
                        nullable: true
                        description: Tags to associate with this line item
                        items:
                          type: string
                          maxLength: 255
                        example:
                          - priority
                          - fragile
                      custom_fields:
                        type: object
                        nullable: true
                        description: Custom field values for this line item
                        additionalProperties:
                          oneOf:
                            - type: string
                            - type: number
                            - type: boolean
                        example:
                          Lot Number: LOT-12345
                          Expiry Date: '2024-12-31'
                payments:
                  type: array
                  nullable: true
                  description: >
                    Array of payments for this purchase order. If provided,
                    replaces all existing payments.

                    Totals are automatically recalculated after payments are
                    updated.
                  items:
                    type: object
                    required:
                      - payment_date
                      - payment_type
                      - paid_amount
                    properties:
                      payment_date:
                        type: string
                        format: date
                        description: Date of the payment (YYYY-MM-DD)
                        example: '2024-01-15'
                      payment_type:
                        type: string
                        enum:
                          - cash
                          - credit_card
                          - debit_card
                          - check
                          - bank_transfer
                        description: Type of payment
                        example: check
                      paid_amount:
                        type: number
                        format: float
                        minimum: 0.01
                        description: Amount paid
                        example: 500
                      remarks:
                        type: string
                        maxLength: 1000
                        nullable: true
                        description: Payment remarks or notes
                        example: 'Check #1234'
                      external_id:
                        type: string
                        maxLength: 255
                        nullable: true
                        description: External payment reference ID
                        example: PAY-EXT-12345
                custom_fields:
                  type: object
                  nullable: true
                  description: Custom field values for the purchase order
                  additionalProperties:
                    oneOf:
                      - type: string
                      - type: number
                      - type: boolean
                  example:
                    Customer PO: PO-98765
                    Priority Level: High
                tags:
                  type: array
                  nullable: true
                  description: Tags to associate with the purchase order
                  items:
                    type: string
                    maxLength: 255
                  example:
                    - urgent
                    - priority
                    - rush-order
      responses:
        '200':
          description: Purchase order updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: Unique identifier for the purchase order
                      order_numbers:
                        type: array
                        description: List of purchase order numbers
                        items:
                          type: string
                      created_by:
                        type: integer
                        nullable: true
                        description: >-
                          ID of the Luminous user who created the purchase order
                          (the app's **Created By**), or `null` when none was
                          recorded. `POST /purchase-orders` records the user the
                          API token belongs to (for an OAuth token, the user it
                          was issued for); it is not accepted in the request
                          body and `PUT` never changes it. Purchase orders
                          created through the API before this field existed
                          return `null`.
                        example: 12
                      created_by_name:
                        type: string
                        nullable: true
                        description: >-
                          First and last name of the `created_by` user, or
                          `null` when there is no such user or no name. A
                          PII-restricted token always gets `null` (the
                          `created_by` ID is still returned). Returned by `GET
                          /purchase-orders`, `GET /purchase-orders/{id}` and the
                          purchase order payment endpoints; the create, update
                          and append-items responses, and purchase orders
                          embedded in other responses (receiving reports,
                          inbound shipments), have no `created_by_name` key.
                        example: Pat Buyer
                      created_at:
                        type: string
                        format: date-time
                        description: Timestamp when the purchase order was created
                      updated_at:
                        type: string
                        format: date-time
                        description: Timestamp when the purchase order was last updated
                      order_status:
                        type: string
                        enum:
                          - active
                          - inactive
                          - deleted
                        description: Status of the purchase order
                      order_date:
                        type: string
                        format: date
                        description: Date when the purchase order was created
                      invoice_date:
                        type: string
                        format: date
                        description: Date when the purchase order was invoiced
                      arrival_due_date:
                        type: string
                        format: date
                        nullable: true
                        description: Expected arrival date for the order
                      requested_ship_date:
                        type: string
                        format: date
                        nullable: true
                        description: Requested shipping date
                      original_arrival_due_date:
                        type: string
                        format: date
                        nullable: true
                        description: >-
                          Frozen Original ETA — the arrival date as first
                          planned, distinct from the current `arrival_due_date`.
                          Null when unset.
                      shipment_type:
                        type: string
                        nullable: true
                        enum:
                          - Air
                          - Sea
                          - Road
                          - Rail
                          - Express
                          - null
                        description: >-
                          Freight mode used by the Transit Time Matrix. Null
                          when unset.
                      override_transit_days:
                        type: integer
                        nullable: true
                        description: >-
                          Manual override of the transit-matrix calendar days
                          used to derive the arrival date. Null when unset.
                      order_type:
                        type: integer
                        description: Type of the order
                      incoterm:
                        type: string
                        description: International Commercial Terms for the order
                      tracking_info:
                        type: string
                        nullable: true
                        description: Tracking information for the order
                      payment_terms:
                        type: string
                        description: Payment terms for the order
                      supplier_id:
                        type: integer
                        description: ID of the supplier
                      item_count:
                        type: integer
                        description: Number of unique items in the order
                      total_qty_ordered:
                        type: number
                        format: float
                        description: Total quantity of line items ordered
                      total_qty_received:
                        type: number
                        format: float
                        description: Total quantity of line items received
                      total_qty_remaining:
                        type: number
                        format: float
                        description: >-
                          Total quantity of line items remaining to be received
                          (ordered - received)
                      receipt_status:
                        type: string
                        nullable: true
                        enum:
                          - awaiting_shipment
                          - partially_received
                          - fully_received
                        description: >-
                          PO-level receipt status rolled up from its lines (same
                          value as the app's Receipt Status column).
                          `awaiting_shipment` — nothing received yet ("Pending
                          Receipt" in the app); `fully_received` — every line
                          not closed short has received at least its ordered
                          quantity (over-receipt counts); `partially_received` —
                          anything else. Voided receipts don't count.
                      currency_code:
                        type: string
                        nullable: true
                        description: >-
                          The purchase order's supplier currency. `null` for a
                          purchase order in the account's base currency, unless
                          the base currency code was sent explicitly through the
                          API, in which case it is returned. Costs and totals
                          are always in base currency.
                        example: EUR
                      exchange_rate:
                        type: number
                        format: float
                        nullable: true
                        description: >-
                          Base-currency units per 1 unit of `currency_code`.
                          `null` for a base-currency purchase order.
                        example: 1.085
                      order_cost:
                        type: number
                        format: float
                        description: >-
                          Cost of the order before tax and shipping — line items
                          plus additional fees (including automatic cost-rule
                          fees)
                      total_tax:
                        type: number
                        format: float
                        description: Total tax amount
                      total_shipping_cost:
                        type: number
                        format: float
                        description: Total shipping cost
                      total_cost:
                        type: number
                        format: float
                        description: Total cost including tax and shipping
                      total_paid:
                        type: number
                        format: float
                        description: Total amount paid
                      total_due:
                        type: number
                        format: float
                        description: Total amount due
                      total_volume_cbm:
                        type: number
                        format: float
                        description: >
                          Container-fill summary: total shipping volume in cubic
                          metres, rolled up from each line item's

                          box/carton dimensions × ordered quantity. `0` when no
                          line item's SKU has usable dimensions.
                      total_weight_kg:
                        type: number
                        format: float
                        description: >
                          Container-fill summary: total shipping weight in
                          kilograms, rolled up from each line item's

                          per-unit weight × ordered quantity. `0` when no line
                          item's SKU has a weight set.
                      lines_missing_dimensions:
                        type: integer
                        description: >
                          Number of line items whose SKU lacks usable box/carton
                          dimensions and therefore contribute

                          nothing to `total_volume_cbm`. Useful for flagging an
                          incomplete container-fill estimate.
                      volume_target_cbm:
                        type: number
                        format: float
                        nullable: true
                        description: >
                          Target container volume in cubic metres (the fill
                          gauge's denominator), or `null` when no

                          target has been set for this purchase order.
                      volume_remaining_cbm:
                        type: number
                        format: float
                        nullable: true
                        description: >
                          Remaining container volume in cubic metres, computed
                          as `max(0, volume_target_cbm - total_volume_cbm)`.

                          `null` when `volume_target_cbm` is not set.
                      volume_fill_percent:
                        type: number
                        format: float
                        nullable: true
                        description: >
                          How full the container is, as a percentage
                          (`total_volume_cbm / volume_target_cbm × 100`).

                          `null` when `volume_target_cbm` is not set or zero.
                      down_payment:
                        type: number
                        format: float
                        description: Down payment amount
                      public_note:
                        type: string
                        nullable: true
                        description: Public notes
                      private_note:
                        type: string
                        nullable: true
                        description: Private notes
                      starred:
                        type: boolean
                        description: Whether the order is starred
                      items:
                        type: array
                        description: >-
                          Line items in the purchase order. Each is the same
                          `PurchaseOrderItem` object served by `GET
                          /purchase-orders/items`; on this detail endpoint the
                          per-line `allocations` array is populated.
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              description: Line item ID
                            purchase_order_id:
                              type: integer
                              description: ID of the parent purchase order
                            created_at:
                              type: string
                              format: date-time
                              description: Creation timestamp
                            updated_at:
                              type: string
                              format: date-time
                              description: Last update timestamp
                            quantity:
                              type: number
                              format: float
                              description: >-
                                How much was ordered, counted in the line's
                                **ordered** unit of measure (the unit
                                `ordered_unit_of_measure` names). A line ordered
                                as 10 cases of 12 reads `10` here and `120` in
                                `quantity_ordered`.
                            presentment_unit_price:
                              type: number
                              format: float
                              nullable: true
                              description: >-
                                The line price in the purchase order's supplier
                                currency, per ordered unit. `null` on a
                                base-currency purchase order.
                            unit_price:
                              type: number
                              format: float
                              description: >-
                                Price per unit, always in base currency. For a
                                line written through this API whose ordered unit
                                converts, this is per base unit; a line saved on
                                the PO screen keeps it per ordered unit.
                            unit:
                              type: string
                              nullable: true
                              description: Unit of measure
                            tax:
                              type: number
                              format: float
                              description: Tax amount
                            discount_amount:
                              type: number
                              format: float
                              description: Discount amount
                            line_total:
                              type: number
                              format: float
                              description: Total for this line item
                            expected_ship_date:
                              type: string
                              format: date
                              nullable: true
                              description: >-
                                Per-line expected ship date override. When null,
                                this line inherits the purchase order's header
                                `requested_ship_date`.
                            expected_arrival_date:
                              type: string
                              format: date
                              nullable: true
                              description: >-
                                Per-line expected arrival date override. When
                                null, this line inherits the purchase order's
                                header `arrival_due_date`.
                            requested_ship_date:
                              type: string
                              format: date
                              nullable: true
                              description: >-
                                Purchase order header requested ship date,
                                copied onto every line. It is the same for every
                                line of a PO and differs from the per-line
                                `expected_ship_date` override.
                            arrival_due_date:
                              type: string
                              format: date
                              nullable: true
                              description: >-
                                Purchase order header current ETA, copied onto
                                every line. It is the same for every line of a
                                PO and differs from the per-line
                                `expected_arrival_date` override.
                            shipment_type:
                              type: string
                              nullable: true
                              enum:
                                - Air
                                - Sea
                                - Road
                                - Rail
                                - Express
                                - null
                              description: >-
                                Purchase order header freight mode, copied onto
                                every line. It is the same for every line of a
                                PO and is not a per-line value.
                            original_arrival_due_date:
                              type: string
                              format: date
                              nullable: true
                              description: >-
                                Purchase order header frozen Original ETA (the
                                arrival date as first planned), copied onto
                                every line.
                            override_transit_days:
                              type: integer
                              nullable: true
                              description: >-
                                Purchase order header manual override of the
                                transit-matrix calendar days, copied onto every
                                line.
                            quantity_received:
                              type: number
                              format: float
                              description: >-
                                How much has been received against this line,
                                summed across receipts, in the **base** unit of
                                measure. Each receipt line records the unit it
                                was received in and stores its quantity already
                                converted to base, so this total is reliably in
                                one unit (DV-4147). It previously read a roll-up
                                column that some receiving paths populated
                                without converting, so this figure is no longer
                                approximate on a line whose ordered and base
                                units differ.
                            received_quantity:
                              type: number
                              format: float
                              deprecated: true
                              description: >-
                                **Deprecated (2026-08-13).** Identical value to
                                `quantity_received`; use that field instead.
                                Both keys are emitted from one computed value
                                and can never diverge. No sunset date — the
                                alias is retained indefinitely for backward
                                compatibility.
                            quantity_ordered:
                              type: number
                              format: float
                              description: >-
                                The same order as `quantity`, converted to the
                                line's **base** unit of measure — not a second
                                order. A line ordered as 10 cases of 12 reads
                                `120` here and `10` in `quantity`.
                            quantity_shipped:
                              type: number
                              format: float
                              description: >-
                                How much has shipped against this line, in the
                                **ordered** unit of measure. Summed across every
                                shipment line, each converted from the unit it
                                was recorded in. Gross: no shipment-status
                                filter.
                            quantity_billed:
                              type: number
                              format: float
                              description: >-
                                How much has been billed against this line, in
                                the **ordered** unit of measure. Summed across
                                every linked bill line, each converted from its
                                own unit. Gross and status-agnostic — drafts
                                count, credits and returns are not netted off —
                                and excluding lines whose bill was deleted.
                            quantity_allocated:
                              type: number
                              format: float
                              description: >-
                                How much of this incoming line is already
                                committed to a sales order, in the **base** unit
                                of measure. The open purchase-to-order
                                reservation; `0` on an unpegged line.
                            quantity_released:
                              type: number
                              format: float
                              description: >-
                                Gross quantity released from pegs on this line —
                                the received/fulfilled portion of the
                                purchase-to-order reservation, in the **base**
                                unit of measure. Additive to
                                `quantity_allocated` (which stays open-only, so
                                releasing a peg does not shrink it); `0` on an
                                unpegged line.
                            under_covered_quantity:
                              type: number
                              format: float
                              description: >-
                                How much of the open reservation on this line
                                can no longer be covered by the effective
                                remaining quantity — for example when the parent
                                PO is **Completed** short, leaving effective
                                remaining at `0`. Additive; `0` on an unpegged
                                line or one whose open reservation is still
                                fully coverable.
                            remaining_to_ship:
                              type: number
                              format: float
                              description: >-
                                `quantity − quantity_shipped`, in the
                                **ordered** unit of measure. **Signed** —
                                over-shipping off a PO is a supported flow
                                reconciled on the bill, so an over-shipped line
                                reports the overage as a negative rather than
                                `0`.
                            remaining_to_receive:
                              type: number
                              format: float
                              description: >-
                                `quantity − quantity_received`. **Signed**, for
                                the same reason as `remaining_to_ship`. The one
                                figure here that spans two bases — `quantity` is
                                the ordered unit and the received quantity is
                                nominally the base unit (DV-4119) — so treat it
                                as approximate on a line whose two units differ.
                                Closing a line short does **not** change this
                                figure — read `open_quantity` for what is still
                                expected.
                            open_quantity:
                              type: number
                              format: float
                              description: >-
                                Still-expected quantity in the **ordered** unit
                                of measure. `0` when the line is closed short;
                                otherwise `remaining_to_receive` floored at 0.
                                Integrators that treat "remaining" as "still
                                coming" should read this field. See `PATCH
                                /purchase-orders/{purchaseOrderId}/items/{lineItemId}/closed`.
                              example: 40
                            closed_at:
                              type: string
                              format: date-time
                              nullable: true
                              description: >-
                                When the line was closed short (ISO-8601), or
                                `null` if the line is open.
                              example: null
                            close_reason:
                              type: string
                              nullable: true
                              description: >-
                                Reason recorded when the line was closed short,
                                or `null` if the line is open.
                              example: null
                            available_to_allocate:
                              type: number
                              format: float
                              description: >-
                                How much of this incoming line is still free to
                                commit to a sales order, in the **base** unit of
                                measure: `max(0, open quantity −
                                quantity_allocated)`, where the open quantity is
                                ordered minus received. **Floored at 0** (unlike
                                the two signed figures above) because you cannot
                                commit a negative quantity. A closed line
                                reports `0`. Answers what is left to promise,
                                not how far off the PO the delivery landed.
                                Renamed from `quantity_remaining` (DV-4144).
                            volume_cbm:
                              type: number
                              format: float
                              description: >
                                Per-unit shipping volume in cubic metres,
                                derived from the SKU's box dimensions

                                (falling back to carton dimensions). `0` when
                                the SKU has no usable dimensions. Part of the

                                container-fill summary.
                            line_volume_cbm:
                              type: number
                              format: float
                              description: >
                                This line's total shipping volume in cubic
                                metres (`volume_cbm` × `quantity_ordered`).
                            weight_kg:
                              type: number
                              format: float
                              description: >
                                Per-unit shipping weight in kilograms. `0` when
                                the SKU has no weight set. Part of the

                                container-fill summary.
                            line_weight_kg:
                              type: number
                              format: float
                              description: >
                                This line's total shipping weight in kilograms
                                (`weight_kg` × `quantity_ordered`).
                            allocations:
                              type: array
                              description: >
                                Which sales orders currently hold the allocation
                                on this line. Only populated on the

                                single purchase-order detail endpoint (`GET
                                /purchase-orders/{id}`); always an empty

                                array on the list endpoint and for non-allocated
                                lines.
                              items:
                                type: object
                                properties:
                                  sales_order_id:
                                    type: integer
                                    description: >-
                                      ID of the sales order holding the
                                      allocation
                                  sales_order_number:
                                    type: string
                                    nullable: true
                                    description: Human-readable sales order number
                                  quantity_allocated:
                                    type: number
                                    format: float
                                    description: >-
                                      Open quantity this sales order has pegged
                                      to the line
                                  quantity_released:
                                    type: number
                                    format: float
                                    description: >-
                                      Quantity already released from this sales
                                      order's pegs on the line (the
                                      received/fulfilled portion). Rows are
                                      retained while either `quantity_allocated`
                                      or `quantity_released` is greater than
                                      `0`, so a fully-received allocation still
                                      appears with its release history.
                                  peg_ids:
                                    type: array
                                    items:
                                      type: integer
                                    description: >
                                      IDs of the pegs backing this allocation.
                                      Pass these to

                                      `POST /purchase-orders/reverse-allocation`
                                      (which is peg-scoped) to reverse an

                                      allocation made through the API. Allocate,
                                      read the peg ids back from

                                      `GET /purchase-orders/{id}`, then reverse
                                      them.
                            source_sku:
                              type: string
                              nullable: true
                              description: Source SKU from the supplier
                            product:
                              type: object
                              nullable: true
                              description: Associated product information
                              properties:
                                id:
                                  type: integer
                                  description: Product ID
                                name:
                                  type: string
                                  description: Product name
                                description:
                                  type: string
                                  nullable: true
                                  description: Product description
                                retail_price:
                                  type: number
                                  format: float
                                  description: Product retail price
                                wholesale_price:
                                  type: number
                                  format: float
                                  description: Product wholesale price
                                unit_cost:
                                  type: number
                                  format: float
                                  description: Product unit cost
                                product_weight:
                                  type: number
                                  format: float
                                  description: Product weight
                                product_length:
                                  type: number
                                  format: float
                                  description: Product length (in inches)
                                product_width:
                                  type: number
                                  format: float
                                  description: Product width (in inches)
                                product_height:
                                  type: number
                                  format: float
                                  description: Product height (in inches)
                                sellable:
                                  type: boolean
                                  description: Whether the product is sellable
                                discontinued:
                                  type: boolean
                                  description: Whether the product is discontinued
                                image_url:
                                  type: string
                                  nullable: true
                                  description: Product image URL
                                variant_attributes:
                                  type: object
                                  nullable: true
                                  description: Product variant attributes
                                sku:
                                  type: string
                                  description: Product internal SKU
                                upc:
                                  type: string
                                  description: Product UPC/Barcode
                                created_at:
                                  type: string
                                  format: date-time
                                  description: Product creation timestamp
                                updated_at:
                                  type: string
                                  format: date-time
                                  description: Product last update timestamp
                            base_unit_of_measure:
                              type: object
                              nullable: true
                              description: Base unit of measure
                              properties:
                                id:
                                  type: integer
                                name:
                                  type: string
                                abbreviation:
                                  type: string
                            ordered_unit_of_measure:
                              type: object
                              nullable: true
                              description: Ordered unit of measure
                              properties:
                                id:
                                  type: integer
                                name:
                                  type: string
                                abbreviation:
                                  type: string
                            lot:
                              type: object
                              nullable: true
                              description: Product lot information
                              properties:
                                id:
                                  type: integer
                                lot_number:
                                  type: string
                                expiration_date:
                                  type: string
                                  format: date
                                  nullable: true
                      supplier:
                        type: object
                        properties:
                          id:
                            type: integer
                          status:
                            type: integer
                          name:
                            type: string
                          description:
                            type: string
                          street_address:
                            type: string
                          city:
                            type: string
                          state:
                            type: string
                          zip:
                            type: string
                          country:
                            type: string
                          contact_name:
                            type: string
                          contact_email:
                            type: string
                          contact_phone:
                            type: string
                          created_at:
                            type: string
                            format: date-time
                          updated_at:
                            type: string
                            format: date-time
                          custom_fields:
                            type: object
                            description: >-
                              Read-only map of the supplier's custom field
                              values as label => value pairs. Always a JSON
                              object; empty when no custom fields are set.
                            example:
                              Region: Southwest
                              Preferred Carrier: UPS
                      payments:
                        type: array
                        description: Array of payments for this purchase order
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              description: Unique identifier for the payment
                            payment_date:
                              type: string
                              format: date
                              description: Date of the payment
                            payment_type:
                              type: string
                              enum:
                                - cash
                                - credit_card
                                - debit_card
                                - check
                                - bank_transfer
                              description: Type of payment
                            paid_amount:
                              type: number
                              format: float
                              description: Amount paid
                            remarks:
                              type: string
                              nullable: true
                              description: Payment remarks or notes
                            external_id:
                              type: string
                              nullable: true
                              description: External payment reference ID
                            created_by:
                              type: object
                              description: User who created the payment
                              properties:
                                id:
                                  type: integer
                                  description: User ID
                                name:
                                  type: string
                                  nullable: true
                                  description: User full name
                            created_at:
                              type: string
                              format: date-time
                              description: Timestamp when the payment was created
                            updated_at:
                              type: string
                              format: date-time
                              description: Timestamp when the payment was last updated
                      ship_to:
                        type: object
                        nullable: true
                        description: Shipping address information
                        properties:
                          address_1:
                            type: string
                            nullable: true
                            description: Primary street address
                          address_2:
                            type: string
                            nullable: true
                            description: Secondary address line
                          city:
                            type: string
                            nullable: true
                            description: City name
                          state:
                            type: string
                            nullable: true
                            description: State or province
                          zip:
                            type: string
                            nullable: true
                            description: ZIP or postal code
                          country:
                            type: string
                            nullable: true
                            description: Country name
                          default_ship_to_address:
                            type: string
                            enum:
                              - ship_to_address
                              - warehouse
                            nullable: true
                            description: Default shipping address preference
                      warehouse_id:
                        type: integer
                        nullable: true
                        description: >-
                          ID of the destination warehouse. Always present (null
                          when the PO has no warehouse set).
                      location_id:
                        type: integer
                        nullable: true
                        description: >-
                          ID of the destination location within the warehouse.
                          Always present (null when the PO has no location set).
                      warehouse:
                        type: object
                        nullable: true
                        description: >-
                          Expanded warehouse object. Present when the warehouse
                          relation is loaded (list and detail responses);
                          omitted when the PO has no warehouse.
                        properties:
                          id:
                            type: integer
                          name:
                            type: string
                      location:
                        type: object
                        nullable: true
                        description: >-
                          Expanded location object. Present when the location
                          relation is loaded (list and detail responses);
                          omitted when the PO has no location.
                        properties:
                          id:
                            type: integer
                          name:
                            type: string
                      tags:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                            name:
                              type: string
                            description:
                              type: string
                              nullable: true
                            icon:
                              type: string
                              nullable: true
                            color:
                              type: string
                              nullable: true
                      fulfillment_orders:
                        type: array
                        description: >-
                          Linked fulfillment orders. Present when the relation
                          is loaded; deduplicated by ID.
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                            order_number:
                              type: string
                              nullable: true
                            order_status:
                              type: string
                              nullable: true
                      custom_fields:
                        type: object
                        description: >-
                          Custom field values on the purchase order as label =>
                          value pairs. Field definitions are available via `GET
                          /custom-fields?object_type=purchase-orders`; values
                          can also be read and written via
                          `/purchase-orders/{id}/custom-fields`. Number-type
                          custom fields come back as numbers (the stored numeric
                          value, or stored numeric text converted to a number);
                          a number field holding non-numeric text returns
                          `null`.
                        additionalProperties: true
        '400':
          description: Bad request - validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '404':
          description: Purchase order not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '422':
          description: >-
            Unprocessable entity - validation error (same rules as `PUT
            /purchase-orders/{id}`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authenticate using a bearer token. To create a token, navigate to
        /settings/api-tokens and click Create API Token.

````

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