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

# Product stock status

> The product's total quantity on hand, with a lot/serial number breakdown.

Read-only report: nothing on this page can be created, updated or deleted through the API.

* `Quantity` is the sum of **every warehouse movement** for the product (despatches, plus transfers, stock counts and any other warehouse-slip type outside this API's scope) — not just despatches created via `POST /api/v1/despatches`, but every movement recorded in the Noyax application. This is what makes it reflect the product's real quantity on hand.
* `WarehouseName` (optional, query) restricts the count to movements in that warehouse; when omitted, every warehouse is summed.
* Depending on the product's `StockType`, an additional breakdown is included:
  * `StockType` 3 (Lot), 4 (FIFO), 6 (LIFO) or 7 (FEFO): `Lots`, one entry per lot whose remaining quantity is greater than zero (`LotNo`, `Quantity`). Lots at zero or below are left out.
  * `StockType` 5 (Serial): `SerialNumbers`, the serial numbers that have been entered but not yet exited.
  * Any other `StockType` (1, 2): `Lots` and `SerialNumbers` are `null`; only `Quantity` is meaningful.
* `UnitCode` is the product's main unit's universal code if set, otherwise its name (`Quantity` and each lot's `Quantity` are in this unit).

## Error codes

Codes this endpoint can return. The [general errors](/en/v1/guides/result-codes) that apply to every endpoint (authentication, permissions, request headers, daily limit) are not repeated here.

| Code   | HTTP | Meaning                                              |
| ------ | ---- | ---------------------------------------------------- |
| `2000` | 404  | Product not found                                    |
| `4200` | 400  | The warehouse given in `warehouseName` was not found |


## OpenAPI

````yaml api-reference/openapi.json GET /api/v1/stock/products/{productId}/status
openapi: 3.1.1
info:
  title: Noyax API
  description: Server-to-server API for integrations to access Noyax data.
  version: '1.0'
servers:
  - url: https://dev.noyax.com/services/noyax_api
security:
  - Bearer: []
tags:
  - name: Product Stock Status
  - name: Sections
  - name: Warehouses
  - name: Quotes
  - name: Product Critical Stock
  - name: Product groups
  - name: Product Parameter Definitions
  - name: Product Parameters
  - name: Product Prices
  - name: Products
  - name: Orders
  - name: Bank Accounts
  - name: Bank Internal Transfers
  - name: Bank Openings
  - name: Banks
  - name: Bank Transfers
  - name: Credit Card Collections
  - name: Customer Balances
  - name: Customer Transactions
  - name: Repayment Plans
  - name: Despatches
  - name: Cities
  - name: Countries
  - name: Currencies
  - name: Districts
  - name: Line Groups
  - name: Shipment Definitions
  - name: Units
  - name: VAT rates
  - name: Customer Addresses
  - name: Customer Bank Accounts
  - name: Customer Definitions
  - name: Customer Group Members
  - name: Customer Links
  - name: Customer Parameters
  - name: Customer Representatives
  - name: Customers
  - name: Customer Telephones
paths:
  /api/v1/stock/products/{productId}/status:
    get:
      tags:
        - Product Stock Status
      summary: Get product stock status
      description: >-
        Returns the product's total quantity on hand and, depending on its
        StockType, a breakdown by remaining lot quantity or by serial numbers
        still in stock. Read-only report; nothing here can be created, updated
        or deleted through the API.
      parameters:
        - name: productId
          in: path
          description: Product ID.
          required: true
          schema:
            type: string
            format: uuid
        - name: warehouseName
          in: query
          description: >-
            Only count movements in this warehouse (name from GET
            /api/v1/stock/warehouses). When empty, all warehouses are included.
          schema:
            type: string
        - name: X-UserID
          in: header
          description: >-
            ID of the Noyax user the request is made on behalf of. Written to
            the audit fields of created, updated and deleted records.
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: X-CompanyID
          in: header
          description: >-
            ID of the company. The user must be assigned to this company. All
            reads and writes are limited to this company.
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: X-PeriodID
          in: header
          description: >-
            ID of the accounting period. Optional for customer endpoints; if
            sent, it is written to created records.
          schema:
            minimum: 1
            type: integer
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataResultOfProductStockStatusDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0201'
                Message: X-UserID header is required.
                Errors:
                  - Code: '0201'
                    Message: X-UserID header is required.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0102'
                Message: Token has expired. Obtain a new token using the refresh token.
                Errors:
                  - Code: '0102'
                    Message: >-
                      Token has expired. Obtain a new token using the refresh
                      token.
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0110'
                Message: You do not have permission for this operation.
                Errors:
                  - Code: '0110'
                    Message: You do not have permission for this operation.
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0120'
                Message: Daily request limit (10000) exceeded.
                Errors:
                  - Code: '0120'
                    Message: Daily request limit (10000) exceeded.
components:
  schemas:
    DataResultOfProductStockStatusDto:
      required:
        - Success
        - ResultCode
        - Data
      type: object
      properties:
        Success:
          type: boolean
          description: Whether the operation succeeded.
          example: true
        ResultCode:
          type: string
          description: >-
            "0000" on success. On failure, the code of the first error; all
            errors are listed in Errors.
          example: '0000'
        Message:
          type:
            - 'null'
            - string
          description: >-
            Error message when Success is false. Messages of all errors are
            joined into a single text.
        Data:
          $ref: '#/components/schemas/ProductStockStatusDto'
    ErrorResult:
      type: object
      properties:
        Success:
          type: boolean
          description: Whether the operation succeeded.
          example: false
        ResultCode:
          type:
            - 'null'
            - string
          description: >-
            "0000" on success. On failure, the code of the first error; all
            errors are listed in Errors.
        Message:
          type:
            - 'null'
            - string
          description: >-
            Error message when Success is false. Messages of all errors are
            joined into a single text.
        Errors:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ResultError'
          description: All errors with their codes. Only present when Success is false.
    ProductStockStatusDto:
      type: object
      properties:
        UnitCode:
          type:
            - 'null'
            - string
          description: >-
            Product's main unit code (universal code if set, otherwise the
            unit's name).
          example: C62
        Quantity:
          type: number
          description: >-
            Total quantity on hand, in UnitCode. Includes every warehouse
            movement (despatches and any other movement type such as transfers
            or stock counts), not just despatches created through this API.
          format: double
        Lots:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ProductStockLotDto'
          description: >-
            Remaining quantity per lot, only when the product's StockType is 3
            (Lot), 4 (FIFO), 6 (LIFO) or 7 (FEFO). Lots with no remaining
            quantity are left out. Null when the product's StockType is not one
            of these.
        SerialNumbers:
          type:
            - 'null'
            - array
          items:
            type: string
          description: >-
            Serial numbers currently in stock (entered but not yet exited), only
            when the product's StockType is 5 (Serial). Null when the product's
            StockType is not 5.
      description: Response data. Null when Success is false.
    ResultError:
      required:
        - Code
        - Message
      type: object
      properties:
        Code:
          type: string
          description: Error code. See the result codes page for the full list.
        Message:
          type: string
          description: Error description.
    ProductStockLotDto:
      type: object
      properties:
        LotNo:
          type:
            - 'null'
            - string
          description: Lot number.
          example: LOT-2026-001
        Quantity:
          type: number
          description: Remaining quantity of this lot, in UnitCode.
          format: double
  securitySchemes:
    Bearer:
      type: http
      description: Access token obtained from the Noyax auth service with your API key.
      scheme: bearer
      bearerFormat: JWT

````