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

# Commit a multi-warehouse allocation plan (per-location reservations)

> Applies a sourcing plan by creating per-location reservations through the canonical
reservation doorway (each warehouse leg reserves independently; the over-allocation
gate fires per leg). Idempotent: re-running releases any existing reservations for the
order, then re-reserves per the plan. The body may carry an operator-edited plan; if
omitted, the system auto-plan (preferred location first, then most-available) is used
for every physical line. Posts NO journal entry (reservation is not a GL event,
AICPA ASC 606). Requires `orders:write` scope. Idempotent via the `Idempotency-Key`
header.




## OpenAPI

````yaml /openapi.yaml post /orders/{id}/allocate
openapi: 3.1.0
info:
  title: Arcus ERP Public API
  version: 1.0.0
  description: >
    Arcus ERP public REST API. Designed for external integrations and data
    migration.


    **Authentication.** Bearer token (API key) via the `Authorization` header.

    Format: `Authorization: Bearer ark_live_ent_<code>_<random>` (or
    `ark_test_*` for sandbox).

    API keys are issued per-entity in **Settings > Developers > API Keys**.


    **Entity scoping.** The entity is encoded in the API key prefix; routes are
    flat

    (e.g. `/v1/accounts`, `/v1/orders`, `/v1/products`). A small set of platform
    endpoints

    (migration, reconciliation, events, webhook endpoints, API keys) use the

    `/v1/entities/{entity_id}/...` form -- those are noted in their tags.


    **Key capabilities.**
      - Related-resource hydration via `?expand[]=` (see `x-arcus-expand` on each resource).
      - Cursor-based pagination (`starting_after` / `ending_before` / `limit`).
      - Idempotency via the `Idempotency-Key` header.
      - Webhook events for asynchronous notification.
      - Conditional requests / ETag for cache validation.
servers:
  - url: https://api.arcuserp.com/v1
    description: Arcus ERP API (accepts both live `ark_live_*` and test `ark_test_*` keys)
  - url: https://dev-api.arcuserp.com/v1
    description: >-
      Dev sandbox API (test-only data, accepts `ark_test_*` keys against dev
      RDS)
security: []
paths:
  /orders/{id}/allocate:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
    post:
      tags:
        - Orders
      summary: Commit a multi-warehouse allocation plan (per-location reservations)
      description: >
        Applies a sourcing plan by creating per-location reservations through
        the canonical

        reservation doorway (each warehouse leg reserves independently; the
        over-allocation

        gate fires per leg). Idempotent: re-running releases any existing
        reservations for the

        order, then re-reserves per the plan. The body may carry an
        operator-edited plan; if

        omitted, the system auto-plan (preferred location first, then
        most-available) is used

        for every physical line. Posts NO journal entry (reservation is not a GL
        event,

        AICPA ASC 606). Requires `orders:write` scope. Idempotent via the
        `Idempotency-Key`

        header.
      operationId: allocateOrder
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                lines:
                  type: array
                  description: >-
                    Optional operator-edited plan. When omitted, the system
                    auto-plan is used.
                  items:
                    type: object
                    properties:
                      order_item_id:
                        type: string
                        format: uuid
                      legs:
                        type: array
                        items:
                          type: object
                          properties:
                            location_id:
                              type: string
                              format: uuid
                            qty:
                              type: integer
                              minimum: 1
                            reservation_mode:
                              type: string
                              enum:
                                - firm
                                - soft
                              default: firm
      responses:
        '200':
          description: The committed allocation plan.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      order_id:
                        type: string
                        format: uuid
                      lines:
                        type: array
                        items:
                          type: object
                          properties:
                            order_item_id:
                              type: string
                              format: uuid
                            legs:
                              type: array
                              items:
                                type: object
                                properties:
                                  location_id:
                                    type: string
                                    format: uuid
                                  qty:
                                    type: integer
                                  reservation_mode:
                                    type: string
                                    enum:
                                      - firm
                                      - soft
        '404':
          description: Order not found.
        '422':
          description: No resolvable location.
      security:
        - ApiKeyAuth: []
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: |
        Client-generated unique key for idempotent POST/PATCH/DELETE operations.
        Alias for the Idempotency parameter. Max 255 chars. On retry with the
        same key, the original response is returned without re-executing the
        operation. Keys expire after 24 hours.
      schema:
        type: string
        maxLength: 255
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: |
        API key issued per entity via Settings > Developers > API Keys.
        Each key carries scopes (e.g. orders:read, products:write).
        Bearer token format: Authorization: Bearer ark_live_ent_<code>_<random>
        Test keys use ark_test_ent_<code>_<random>. Both are issued per entity
        via Settings > Developers > API Keys.

````