> ## 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.

# Bulk create purchase orders

> Create up to 100 purchase orders in one request. Each element of `purchase_orders` is the same object
as `POST /purchase-orders` and is
validated and created on its own, in the order given.

## Partial success
A well-formed request returns `200` even when some or all elements fail. Each element gets one slot
in `data`, identified by its `index` in the request array:
- **Created:** `index`, `id` and `order_numbers`.
- **Failed:** `index` and `error`, that element's validation messages keyed by field.

A missing, non-array or empty `purchase_orders`, or more than 100 elements, returns `422` and creates
nothing.

There is no all-or-nothing transaction: purchase orders created before a failing element are kept,
and a failure after an element's header is saved can leave that purchase order in place while its
slot reports an error.

## Things to send on every element
- **`order_status`**: elements without it are created as **active** and post incoming stock, the same
  as the single create. Send `order_status: "draft"` for purchase orders that should stay drafts.
- **`currency_code`** when the purchase order should not be in the supplier's default currency.
  Omitted, the supplier's default currency is applied (base currency when the supplier has none).

## Retries and idempotency
Accepts an optional `Idempotency-Key` header. A retry with the same key and body replays the first
response (with an `Idempotent-Replay: true` header); the same key with a different body, or while
the first request is still running, returns `409`. Keys are kept for 24 hours and are scoped to your
API token. Order numbers are not unique, so a retry without a key can create duplicate purchase orders.

Limited to 30 requests per minute.




## OpenAPI

````yaml /api-reference/build.yaml post /purchase-orders/bulk
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/bulk:
    post:
      tags:
        - Purchase Orders
      summary: Bulk create purchase orders
      description: >
        Create up to 100 purchase orders in one request. Each element of
        `purchase_orders` is the same object

        as `POST /purchase-orders` and is

        validated and created on its own, in the order given.


        ## Partial success

        A well-formed request returns `200` even when some or all elements fail.
        Each element gets one slot

        in `data`, identified by its `index` in the request array:

        - **Created:** `index`, `id` and `order_numbers`.

        - **Failed:** `index` and `error`, that element's validation messages
        keyed by field.


        A missing, non-array or empty `purchase_orders`, or more than 100
        elements, returns `422` and creates

        nothing.


        There is no all-or-nothing transaction: purchase orders created before a
        failing element are kept,

        and a failure after an element's header is saved can leave that purchase
        order in place while its

        slot reports an error.


        ## Things to send on every element

        - **`order_status`**: elements without it are created as **active** and
        post incoming stock, the same
          as the single create. Send `order_status: "draft"` for purchase orders that should stay drafts.
        - **`currency_code`** when the purchase order should not be in the
        supplier's default currency.
          Omitted, the supplier's default currency is applied (base currency when the supplier has none).

        ## Retries and idempotency

        Accepts an optional `Idempotency-Key` header. A retry with the same key
        and body replays the first

        response (with an `Idempotent-Replay: true` header); the same key with a
        different body, or while

        the first request is still running, returns `409`. Keys are kept for 24
        hours and are scoped to your

        API token. Order numbers are not unique, so a retry without a key can
        create duplicate purchase orders.


        Limited to 30 requests per minute.
      operationId: bulkCreatePurchaseOrders
      parameters:
        - in: header
          name: Idempotency-Key
          required: false
          schema:
            type: string
          description: >
            Optional idempotency token. A retry with the same key and body
            replays the original stored

            response instead of creating the purchase orders again. Reusing the
            key with a different body

            returns `409`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - purchase_orders
              properties:
                purchase_orders:
                  type: array
                  minItems: 1
                  maxItems: 100
                  description: >-
                    Purchase orders to create. Each element is validated with
                    the same rules as `POST /purchase-orders`.
                  items:
                    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
            example:
              purchase_orders:
                - order_date: '2026-11-10'
                  supplier_id: 123
                  order_status: draft
                  order_numbers:
                    - PO-1001
                  items:
                    - sku: WIDGET-001
                      quantity: 10
                      unit_price: 4.5
                - supplier_id: 123
                  order_status: draft
                  items:
                    - sku: WIDGET-002
                      quantity: 5
                      unit_price: 9.99
      responses:
        '200':
          description: One result slot per element, in request order
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                          description: Position of the element in `purchase_orders`.
                        id:
                          type: integer
                          description: >-
                            ID of the created purchase order. Present on
                            success.
                        order_numbers:
                          type: array
                          items:
                            type: string
                          description: >-
                            Order numbers on the created purchase order. Present
                            on success.
                        error:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                          description: >-
                            Validation messages keyed by field. Present on
                            failure.
              example:
                data:
                  - index: 0
                    id: 1001
                    order_numbers:
                      - PO-1001
                  - index: 1
                    error:
                      order_date:
                        - Order date is required.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '409':
          description: >-
            Idempotency conflict (key reused with a different body, or the first
            request is still running)
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '422':
          description: >-
            Invalid envelope (missing, empty or non-array `purchase_orders`, or
            more than 100 elements). Nothing is created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '429':
          description: Too many requests (limit 30 per minute)
      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.