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

# Export inventory stock (cursor pagination)

> Bulk-export stock for all active products (`status > 0`) using cursor-based
keyset pagination. Designed for full inventory syncs and reporting pipelines
that need every product's warehouse, location, and lot-level stock in one pass.

Each row aggregates warehouse-level quantities and a per-location breakdown,
with per-lot detail for lot-tracked products and FIFO landed unit cost at both
the product and warehouse level.

## Pagination

| Parameter | Description |
|-----------|-------------|
| `cursor`  | Opaque token from `next_cursor` on the previous response. Omit on the **first** page. |
| `limit`   | Max products per page. Default `100`, maximum `1000`. |

Pages are ordered ascending by product `id` (keyset). The run is anchored to a
fixed cutoff captured on the first request, so pages stay stable while records
change mid-run.

## Example flow

```
# 1. Start a run
GET /inventory/stocks/export?limit=1000

# 2. Continue while has_more is true
GET /inventory/stocks/export?cursor=<next_cursor>

# 3. Stop when has_more is false
```

## Notes

- The cursor is cryptographically signed; do not modify it.
- Only `cursor` and `limit` are accepted. Any other query parameter returns
  a **422**. Some deployments rewrite to `index.php?q=$uri&$args`; the server
  ignores the `q` query parameter during validation.




## OpenAPI

````yaml /api-reference/build.yaml get /inventory/stocks/export
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:
  /inventory/stocks/export:
    get:
      tags:
        - Inventory
      summary: Export inventory stock (cursor pagination)
      description: >
        Bulk-export stock for all active products (`status > 0`) using
        cursor-based

        keyset pagination. Designed for full inventory syncs and reporting
        pipelines

        that need every product's warehouse, location, and lot-level stock in
        one pass.


        Each row aggregates warehouse-level quantities and a per-location
        breakdown,

        with per-lot detail for lot-tracked products and FIFO landed unit cost
        at both

        the product and warehouse level.


        ## Pagination


        | Parameter | Description |

        |-----------|-------------|

        | `cursor`  | Opaque token from `next_cursor` on the previous response.
        Omit on the **first** page. |

        | `limit`   | Max products per page. Default `100`, maximum `1000`. |


        Pages are ordered ascending by product `id` (keyset). The run is
        anchored to a

        fixed cutoff captured on the first request, so pages stay stable while
        records

        change mid-run.


        ## Example flow


        ```

        # 1. Start a run

        GET /inventory/stocks/export?limit=1000


        # 2. Continue while has_more is true

        GET /inventory/stocks/export?cursor=<next_cursor>


        # 3. Stop when has_more is false

        ```


        ## Notes


        - The cursor is cryptographically signed; do not modify it.

        - Only `cursor` and `limit` are accepted. Any other query parameter
        returns
          a **422**. Some deployments rewrite to `index.php?q=$uri&$args`; the server
          ignores the `q` query parameter during validation.
      operationId: exportInventoryStocks
      parameters:
        - in: query
          name: cursor
          schema:
            type: string
          description: |
            Signed continuation token from a previous response's `next_cursor`.
            Omit on the first page.
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
          description: Maximum number of products to return per page.
      responses:
        '200':
          description: Successful export page
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - next_cursor
                  - has_more
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      description: >
                        One product row from the bulk stock export. Aggregates
                        warehouse-level and

                        per-location stock for a single active product, with
                        per-lot breakdowns for

                        lot-tracked products. Quantities are rolled up across
                        all locations at the top

                        level and broken out under `location_stocks`.
                      properties:
                        id:
                          type: integer
                          description: Product ID.
                        sku:
                          type: string
                          description: Internal product SKU.
                        name:
                          type: string
                          description: Product name.
                        type:
                          type: string
                          description: Product type.
                        category_id:
                          type: integer
                          nullable: true
                          description: Product category ID.
                        category_name:
                          type: string
                          nullable: true
                          description: Product category name.
                        sub_category_id:
                          type: integer
                          nullable: true
                          description: Product sub-category ID.
                        sub_category_name:
                          type: string
                          nullable: true
                          description: Product sub-category name.
                        qty_onhand:
                          type: number
                          format: float
                          description: Total quantity on hand across all locations.
                        qty_incoming:
                          type: number
                          format: float
                          description: Total quantity incoming across all locations.
                        qty_available:
                          type: number
                          format: float
                          description: >-
                            Total quantity available across all locations
                            (`qty_onhand - qty_pending`).
                        qty_pending:
                          type: number
                          format: float
                          description: Total quantity pending across all locations.
                        qty_backordered:
                          type: number
                          format: float
                          description: Quantity backordered for the product.
                        qty_available_via_assembly:
                          type: number
                          format: float
                          description: Quantity available via assembly for the product.
                        qty_recoverable_via_disassembly:
                          type: number
                          format: float
                          description: >-
                            Quantity recoverable via disassembly for the
                            product.
                        qty_outstanding:
                          type: number
                          format: float
                          description: Outstanding quantity for the product.
                        current_landed_unit_cost:
                          type: number
                          format: float
                          nullable: true
                          description: >
                            Current landed unit cost from the oldest active cost
                            layer with remaining

                            quantity across all warehouses (FIFO). `null` when
                            no active cost layer exists.
                        updated_at:
                          type: string
                          format: date-time
                          nullable: true
                          description: >
                            Most recent stock-row update timestamp across the
                            product's locations.

                            Falls back to the product's `created_at` when no
                            stock rows exist.
                        location_stocks:
                          type: array
                          description: Per-warehouse/location stock breakdown.
                          items:
                            type: object
                            properties:
                              id:
                                type: integer
                                description: Stock row ID.
                              warehouse:
                                type: object
                                description: >-
                                  Warehouse or location node as returned by the
                                  stock export.
                                properties:
                                  id:
                                    type: integer
                                    description: Warehouse/location ID.
                                  status:
                                    type: string
                                    nullable: true
                                    description: Warehouse/location status label.
                                  name:
                                    type: string
                                    nullable: true
                                    description: Warehouse/location name.
                                  parent_id:
                                    type: integer
                                    description: >-
                                      Parent warehouse/location ID (`0` when
                                      none).
                                  parent:
                                    nullable: true
                                    description: >-
                                      Always `null` on the export; use
                                      `parent_id` to resolve hierarchy.
                                  is_pick_location:
                                    type: boolean
                                    description: Whether this node is a pick location.
                                  created_at:
                                    type: string
                                    format: date-time
                                    nullable: true
                                  updated_at:
                                    type: string
                                    format: date-time
                                    nullable: true
                              location:
                                allOf:
                                  - type: object
                                    description: >-
                                      Warehouse or location node as returned by
                                      the stock export.
                                    properties:
                                      id:
                                        type: integer
                                        description: Warehouse/location ID.
                                      status:
                                        type: string
                                        nullable: true
                                        description: Warehouse/location status label.
                                      name:
                                        type: string
                                        nullable: true
                                        description: Warehouse/location name.
                                      parent_id:
                                        type: integer
                                        description: >-
                                          Parent warehouse/location ID (`0` when
                                          none).
                                      parent:
                                        nullable: true
                                        description: >-
                                          Always `null` on the export; use
                                          `parent_id` to resolve hierarchy.
                                      is_pick_location:
                                        type: boolean
                                        description: Whether this node is a pick location.
                                      created_at:
                                        type: string
                                        format: date-time
                                        nullable: true
                                      updated_at:
                                        type: string
                                        format: date-time
                                        nullable: true
                                nullable: true
                                description: >-
                                  Bin/location within the warehouse. `null` when
                                  the stock row is not bin-tracked.
                              qty_onhand:
                                type: number
                                format: float
                                description: Quantity on hand at this warehouse/location.
                              qty_incoming:
                                type: number
                                format: float
                                description: Quantity incoming at this warehouse/location.
                              qty_pending:
                                type: number
                                format: float
                                description: Quantity pending at this warehouse/location.
                              qty_available:
                                type: number
                                format: float
                                description: >-
                                  Quantity available at this warehouse/location
                                  (`qty_onhand - qty_pending`).
                              qty_available_via_assembly:
                                type: number
                                format: float
                                description: >-
                                  Quantity available via assembly at this
                                  warehouse/location.
                              qty_recoverable_via_disassembly:
                                type: number
                                format: float
                                description: >-
                                  Quantity recoverable via disassembly at this
                                  warehouse/location.
                              current_landed_unit_cost:
                                type: number
                                format: float
                                nullable: true
                                description: >
                                  Current landed unit cost from the oldest
                                  active cost layer with

                                  remaining quantity for this warehouse (FIFO).
                                  `null` when none exists.
                              lot_stocks:
                                type: array
                                description: >-
                                  Per-lot stock breakdown at this location.
                                  Populated only for lot-tracked products; an
                                  empty array otherwise.
                                items:
                                  type: object
                                  properties:
                                    lot_id:
                                      type: integer
                                      description: Lot ID.
                                    lot_number:
                                      type: string
                                      nullable: true
                                      description: Lot number.
                                    production_date:
                                      type: string
                                      format: date
                                      nullable: true
                                      description: Lot production date.
                                    expiry_date:
                                      type: string
                                      format: date
                                      nullable: true
                                      description: Lot expiry date.
                                    location_id:
                                      type: integer
                                      description: >-
                                        ID of the location holding this lot's
                                        stock.
                                    qty_onhand:
                                      type: number
                                      format: float
                                      description: >-
                                        Quantity on hand for this lot at the
                                        location.
                  next_cursor:
                    type: string
                    nullable: true
                    description: >-
                      Signed cursor token to fetch the next page. `null` when
                      the export is complete.
                  has_more:
                    type: boolean
                    description: >-
                      `true` when the page is full (`data.length === limit`),
                      indicating more rows may exist.
                  meta:
                    type: object
                    required:
                      - rows
                    properties:
                      rows:
                        type: integer
                        minimum: 0
                        description: Number of items in `data` for this response.
        '401':
          description: Authentication credentials were missing or invalid
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Unauthorized
                  message:
                    type: string
                    example: Authentication credentials are missing or invalid
                  status_code:
                    type: integer
                    example: 401
        '422':
          description: >-
            Validation error (invalid `cursor`/`limit`, or unsupported query
            parameter)
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  errors:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        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.

````