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

# Correct a posted receiving-report line quantity

> Preview or apply a quantity correction for a **posted** receiving-report line, identified by its
receiving-report *item* id.

Rather than rewriting the receipt line, this posts an inventory **adjustment** beside the original
receipt (it does not change the receiving-report line, the purchase-order `received_qty`, or peg
`quantity_released`). Use `preview=true` first to measure the impact — including any fulfillment orders
and pegs that may have over-released against the overstated receipt — before applying.

**Decreases** (`correct_qty` < posted) peel the newest on-hand back off via a negative adjustment and
require sufficient available on-hand to reverse. **Increases** (`correct_qty` > posted) only add
on-hand; they do **not** advance PO received quantity, pegs, or receipt cost, so a second receiving
report is preferred. Applying an increase therefore requires `confirm_shelf_only=true`.

The accounting period for the current date must be open, and the receiving report must not be voided.




## OpenAPI

````yaml /api-reference/build.yaml post /receiving-reports/items/{receivingReportItemId}/correct-quantity
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: 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: 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:
  /receiving-reports/items/{receivingReportItemId}/correct-quantity:
    post:
      tags:
        - Receiving Reports
      summary: Correct a posted receiving-report line quantity
      description: >
        Preview or apply a quantity correction for a **posted** receiving-report
        line, identified by its

        receiving-report *item* id.


        Rather than rewriting the receipt line, this posts an inventory
        **adjustment** beside the original

        receipt (it does not change the receiving-report line, the
        purchase-order `received_qty`, or peg

        `quantity_released`). Use `preview=true` first to measure the impact —
        including any fulfillment orders

        and pegs that may have over-released against the overstated receipt —
        before applying.


        **Decreases** (`correct_qty` < posted) peel the newest on-hand back off
        via a negative adjustment and

        require sufficient available on-hand to reverse. **Increases**
        (`correct_qty` > posted) only add

        on-hand; they do **not** advance PO received quantity, pegs, or receipt
        cost, so a second receiving

        report is preferred. Applying an increase therefore requires
        `confirm_shelf_only=true`.


        The accounting period for the current date must be open, and the
        receiving report must not be voided.
      operationId: correctReceivingReportItemQuantity
      parameters:
        - in: path
          name: receivingReportItemId
          required: true
          schema:
            type: integer
          description: Receiving report **item** (line) ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - correct_qty
              properties:
                correct_qty:
                  type: number
                  minimum: 0
                  description: >
                    The corrected quantity for the line, expressed in the same
                    basis (base units) as the

                    line's `received_qty`. Must differ from the currently posted
                    quantity.
                preview:
                  type: boolean
                  default: false
                  description: >-
                    When `true`, measure the correction and its impact only — do
                    not post the adjustment.
                reason:
                  type: string
                  nullable: true
                  maxLength: 1000
                  description: Optional remarks stored on the adjustment.
                confirm_shelf_only:
                  type: boolean
                  default: false
                  description: >
                    Required (`true`) to **apply** an increase via adjustment,
                    acknowledging that only on-hand

                    is corrected — PO received quantity, pegs, and receipt cost
                    are not advanced. Ignored for

                    decreases.
                unit_cost:
                  type: number
                  nullable: true
                  minimum: 0
                  description: >
                    Override unit cost for the adjustment. Defaults to the
                    receipt line's `unit_price` when

                    omitted. Chiefly relevant to positive (increase)
                    adjustments, which may open a new cost layer.
      responses:
        '200':
          description: >
            Correction preview (`preview=true`) or the posted adjustment result.
            The `data` object reports the

            computed delta and the peg / fulfillment-order over-release impact;
            when applied it also includes

            the posted adjustment id and correction linkage.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                    description: >-
                      Result message (e.g. "Quantity correction preview." or
                      "Quantity correction adjustment posted.").
                  data:
                    type: object
                    properties:
                      receiving_report_id:
                        type: integer
                      receiving_report_item_id:
                        type: integer
                      posted_qty:
                        type: number
                        description: Quantity currently posted on the receipt line.
                      correct_qty:
                        type: number
                      delta:
                        type: number
                        description: >-
                          `correct_qty` minus `posted_qty` (negative for a
                          decrease).
                      direction:
                        type: string
                        enum:
                          - increase
                          - decrease
                      prefer_second_receiving_report:
                        type: boolean
                        description: >-
                          True for increases, where a second receiving report is
                          preferred over an adjustment.
                      sku_id:
                        type: integer
                      warehouse_id:
                        type: integer
                      location_id:
                        type: integer
                      lot_id:
                        type: integer
                        nullable: true
                      unit_cost:
                        type: number
                        description: Resolved unit cost used for the adjustment.
                      uom_id:
                        type: integer
                        nullable: true
                        description: >-
                          Base unit-of-measure id (falls back to the received
                          UOM).
                      qty_log_transaction:
                        type: string
                      cost_layer_note:
                        type: string
                        description: Human-readable note on how cost layers are affected.
                      core_note:
                        type: string
                      confidence:
                        type: string
                        enum:
                          - high
                          - medium
                        description: >-
                          `medium` when multiple receiving reports exist against
                          the PO, making over-release attribution approximate.
                      warnings:
                        type: array
                        items:
                          type: string
                      void_and_re_receive_recommended:
                        type: boolean
                        description: >-
                          True when a decrease is large or affects fulfillment
                          orders, suggesting a void-and-re-receive instead.
                      suspect_fulfillment_orders:
                        type: array
                        description: >-
                          Fulfillment orders that may have over-released against
                          the overstated receipt (decreases only).
                        items:
                          type: object
                          properties:
                            fulfillment_order_id:
                              type: integer
                            order_status:
                              type: string
                              nullable: true
                            pushed_at:
                              type: string
                              nullable: true
                            is_pushed:
                              type: boolean
                            sales_order_id:
                              type: integer
                            over_released:
                              type: number
                            peg_ids:
                              type: array
                              items:
                                type: integer
                            can_safely_reverse:
                              type: boolean
                      suspect_pegs:
                        type: array
                        description: >-
                          PO→FO allocation pegs that appear over-released
                          against the corrected quantity (decreases only).
                        items:
                          type: object
                          properties:
                            peg_id:
                              type: integer
                            sales_order_id:
                              type: integer
                            sales_order_item_id:
                              type: integer
                            quantity_allocated:
                              type: number
                            quantity_released:
                              type: number
                            expected_released:
                              type: number
                            over_released:
                              type: number
                            fulfillment_order_id:
                              type: integer
                              nullable: true
                            can_safely_reverse:
                              type: boolean
                      preview:
                        type: boolean
                        description: >-
                          Whether this response is a preview (no adjustment
                          posted).
                      applied:
                        type: boolean
                        description: Whether the adjustment was posted.
                      adjustment_id:
                        type: integer
                        description: >-
                          ID of the posted inventory adjustment. Present only
                          when applied.
                      is_correction:
                        type: boolean
                        description: Present only when applied.
                      corrects_type:
                        type: string
                        description: >-
                          Correction linkage type (receiving report). Present
                          only when applied.
                      corrects_id:
                        type: integer
                        description: >-
                          Receiving report id the correction is linked to.
                          Present only when applied.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '422':
          description: >
            Cannot correct — e.g. item not found, receiving report voided, no
            stock/warehouse/location to adjust,

            correct quantity matches the posted quantity, insufficient on-hand
            to reverse a decrease, an increase

            without `confirm_shelf_only=true`, or the accounting period is
            closed.
          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.

````