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

# Preview a sales-order item remap

> Dry-run a remap of a single posted line item to a different product. Reports
whether the remap is allowed, whether a `force` flag is required, and what
will happen to the fulfillment order — **without mutating anything**.

Purgatory mapping only covers pre-posting orders, so this (and the
[remap](/api-reference/sales-orders/remap-a-sales-order-item) endpoint) are
the posted-order counterpart: they let you correct an incorrect product
mapping on an already-posted order and re-post that one line.

Always returns `200` — even when the remap is blocked — so the caller can
read `blocked_reason`. Shipped/cancelled/refunded orders and
already-shipped or invoiced line items are hard-blocked; a line item split
across multiple fulfillment orders is also blocked (the split block is
scoped to the target item, not the whole order); a pushed fulfillment
order sets `requires_force`.




## OpenAPI

````yaml /api-reference/build.yaml get /sales-orders/{salesOrderId}/items/{salesOrderItemId}/remap-preview
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:
  /sales-orders/{salesOrderId}/items/{salesOrderItemId}/remap-preview:
    get:
      tags:
        - Sales Orders
      summary: Preview a sales-order item remap
      description: >
        Dry-run a remap of a single posted line item to a different product.
        Reports

        whether the remap is allowed, whether a `force` flag is required, and
        what

        will happen to the fulfillment order — **without mutating anything**.


        Purgatory mapping only covers pre-posting orders, so this (and the

        [remap](/api-reference/sales-orders/remap-a-sales-order-item) endpoint)
        are

        the posted-order counterpart: they let you correct an incorrect product

        mapping on an already-posted order and re-post that one line.


        Always returns `200` — even when the remap is blocked — so the caller
        can

        read `blocked_reason`. Shipped/cancelled/refunded orders and

        already-shipped or invoiced line items are hard-blocked; a line item
        split

        across multiple fulfillment orders is also blocked (the split block is

        scoped to the target item, not the whole order); a pushed fulfillment

        order sets `requires_force`.
      operationId: previewSalesOrderItemRemap
      parameters:
        - in: path
          name: salesOrderId
          required: true
          schema:
            type: integer
          description: Sales order ID
        - in: path
          name: salesOrderItemId
          required: true
          schema:
            type: integer
          description: Sales order line-item ID (must belong to the sales order)
        - in: query
          name: product_id
          required: true
          schema:
            type: integer
            minimum: 1
          description: ID of the product to remap the line item to
        - in: query
          name: force
          required: false
          schema:
            type: boolean
            default: false
          description: |
            Evaluate the plan as if `force` were passed — i.e. treat a pushed
            fulfillment order as something that will be unpushed, deleted, and
            recreated rather than a block.
      responses:
        '200':
          description: Remap plan (the remap may still be blocked — check `allowed`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    description: >
                      Result of analysing a posted-order line-item remap.
                      Returned by the

                      `remap-preview` endpoint and by the `remap` endpoint when
                      `dry_run` is true.

                      Lets a caller decide whether to proceed before mutating —
                      whether the remap is

                      allowed, whether a `force` flag is required, and what will
                      happen to the

                      fulfillment order.
                    properties:
                      allowed:
                        type: boolean
                        description: Whether the remap can proceed as requested.
                      blocked_reason:
                        type: string
                        nullable: true
                        description: >
                          Human-readable reason the remap is blocked. Populated
                          only when `allowed`

                          is `false`. Hard blocks include invoiced, shipped,
                          split, or cancelled

                          orders.
                      requires_force:
                        type: boolean
                        description: >
                          `true` when the only thing standing in the way is a
                          pushed fulfillment

                          order and the caller did not pass `force`. Re-submit
                          with `force=true` to

                          unpush, delete, and recreate the fulfillment order.
                      fulfillment_order_exists:
                        type: boolean
                        description: >-
                          Whether the sales order currently has a fulfillment
                          order.
                      fulfillment_order_id:
                        type: integer
                        nullable: true
                        description: ID of the existing fulfillment order, when one exists.
                      fo_is_pushed:
                        type: boolean
                        description: >-
                          Whether the existing fulfillment order has been pushed
                          to a source/3PL.
                      fo_action:
                        type: string
                        enum:
                          - none
                          - delete_and_recreate
                        description: >
                          What will happen to the fulfillment order on commit.
                          `none` when no

                          fulfillment order exists; `delete_and_recreate` when
                          an existing one will

                          be deleted and regenerated for the new product.
                      will_delete_fulfillment_order:
                        type: boolean
                        description: >-
                          Convenience flag — `true` when `fo_action` is
                          `delete_and_recreate`.
                      will_recreate_fulfillment_order:
                        type: boolean
                        description: >-
                          Whether a new fulfillment order will be generated
                          after the remap.
                      will_delete_invoice:
                        type: boolean
                        description: >
                          `true` when an invoice is linked to the fulfillment
                          order. This is a hard

                          block — invoices are never auto-voided, so the remap
                          is rejected.
                      old_product_id:
                        type: integer
                        description: >-
                          ID of the product the line item is currently mapped
                          to.
                      new_product_id:
                        type: integer
                        description: ID of the product the line item will be remapped to.
                      warnings:
                        type: array
                        items:
                          type: string
                        description: Non-blocking warnings about the planned remap.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '404':
          description: >-
            Sales order or line item not found, or item does not belong to the
            order
          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.

````