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

# Reconcile source reference

> Bind an existing remote OMS order ID to a fulfillment order's `source_reference_identifier`,
resolving push failures caused by duplicate-push errors (HTTP 409) or other desync states
where Luminous lost track of the remote order it already created.

**Modes**

- **Auto** (default) — omit or set `source_reference_identifier` to `null`. Luminous queries the
  remote OMS for orders matching this fulfillment order's order number, validates line items,
  and binds the first match.
- **Manual** — provide `source_reference_identifier`. Luminous fetches that specific remote order,
  validates line items, and binds it. Add `"force": true` to skip line-item validation when
  SKU mappings can't be resolved.

After a successful bind the fulfillment order status is set to `awaiting_fulfillment`, its error
message is cleared, and a sales order refresh job is dispatched (unless `trigger_order_refresh`
is `false` or `dry_run` is `true`).

The push endpoint's 422 response body includes a `links.reconcile` URL pointing directly here
when a push fails.

**Supported integrations** — currently TrackStar. Other OMS integrations return a 422 with
an `app` field naming the unsupported integration.




## OpenAPI

````yaml /api-reference/build.yaml post /fulfillment-orders/{id}/reconcile-source-reference
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: Purchase Orders
    description: Get and modify purchase orders
  - name: Receiving Reports
    description: Manage receiving reports
  - 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 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: Currency
    description: Currency configuration, exchange rates, and conversion
  - name: Integration Mappings
    description: Manage integration mappings for external systems
  - name: Integration Field Mappings
    description: Manage field-level mappings between Luminous and external systems
paths:
  /fulfillment-orders/{id}/reconcile-source-reference:
    post:
      tags:
        - Fulfillment Orders
      summary: Reconcile source reference
      description: >
        Bind an existing remote OMS order ID to a fulfillment order's
        `source_reference_identifier`,

        resolving push failures caused by duplicate-push errors (HTTP 409) or
        other desync states

        where Luminous lost track of the remote order it already created.


        **Modes**


        - **Auto** (default) — omit or set `source_reference_identifier` to
        `null`. Luminous queries the
          remote OMS for orders matching this fulfillment order's order number, validates line items,
          and binds the first match.
        - **Manual** — provide `source_reference_identifier`. Luminous fetches
        that specific remote order,
          validates line items, and binds it. Add `"force": true` to skip line-item validation when
          SKU mappings can't be resolved.

        After a successful bind the fulfillment order status is set to
        `awaiting_fulfillment`, its error

        message is cleared, and a sales order refresh job is dispatched (unless
        `trigger_order_refresh`

        is `false` or `dry_run` is `true`).


        The push endpoint's 422 response body includes a `links.reconcile` URL
        pointing directly here

        when a push fails.


        **Supported integrations** — currently TrackStar. Other OMS integrations
        return a 422 with

        an `app` field naming the unsupported integration.
      operationId: reconcileFulfillmentOrderSourceReference
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: ID of the fulfillment order
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                source_reference_identifier:
                  type: string
                  nullable: true
                  maxLength: 255
                  description: >
                    The remote OMS order ID to bind. Omit or pass `null` for
                    **auto** mode.

                    Provide a value for **manual** mode.
                force:
                  type: boolean
                  default: false
                  description: >
                    Manual mode only. When `true`, skip line-item quantity/SKU
                    validation and bind

                    the remote order regardless. Has no effect in auto mode and
                    returns a 422 if

                    used without `source_reference_identifier`.
                dry_run:
                  type: boolean
                  default: false
                  description: >
                    When `true`, validate and return what would happen without
                    writing to the database

                    or dispatching a refresh job.
                trigger_order_refresh:
                  type: boolean
                  default: true
                  description: >
                    When `true` (default), dispatch a sales order refresh job
                    after a successful bind.

                    Ignored when `dry_run` is `true`.
                debug:
                  type: boolean
                  default: false
                  description: >-
                    When `true`, capture and return outbound OMS HTTP traffic in
                    `data.debug`.
      responses:
        '200':
          description: >
            Reconciliation succeeded (or was already reconciled / dry run).
            Check `data.data.mode` to

            distinguish: `"auto"`, `"manual"`, `"noop"` (already reconciled), or
            the `dry_run` flag.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      success:
                        type: boolean
                        example: true
                      message:
                        type: string
                        example: Fulfillment order reconciled with remote order.
                      data:
                        type: object
                        properties:
                          fulfillment_order_id:
                            type: integer
                          source_reference_identifier:
                            type: string
                            description: The remote OMS order ID that was bound.
                          mode:
                            type: string
                            enum:
                              - auto
                              - manual
                              - noop
                            description: >
                              `auto` — lookup found a match automatically.

                              `manual` — caller provided the remote ID.

                              `noop` — FO already had a source reference
                              identifier; no change made.
                          line_items_matched:
                            type: boolean
                            description: >-
                              Whether Luminous line items matched the remote
                              order's line items.
                          forced:
                            type: boolean
                            description: >-
                              True when `force=true` was passed and line items
                              did not match.
                          candidates_considered:
                            type: integer
                            nullable: true
                            description: >-
                              Number of remote candidates evaluated (auto mode
                              only; null in manual mode).
                          dry_run:
                            type: boolean
                            description: >-
                              Present and true when `dry_run=true` was
                              requested.
                          already_reconciled:
                            type: boolean
                            description: >-
                              Present and true when the FO already had a source
                              reference (noop mode).
                      debug:
                        type: object
                        description: >-
                          Present only when `debug=true` was sent in the request
                          body.
                        additionalProperties: true
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '404':
          description: Fulfillment order not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '422':
          description: >
            Reconciliation failed. Common reasons: no matching remote order
            found, line items do not

            match (use `force=true` to override in manual mode), remote ID
            already claimed by another

            FO, integration app does not support remote lookup, or `force=true`
            sent without

            `source_reference_identifier`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                      data:
                        type: object
                        description: Error context (fields vary by error type).
                        additionalProperties: true
                      debug:
                        type: object
                        additionalProperties: true
      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.

````