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

# Get receipt stock operations

> Retrieve the stock deduction operations generated by a receipt ("Çıxarılan ehtiyat"). Returns only the stock write-offs caused by the receipt itself, where `operation_id` is `null` and `receipt_product_id` is set. Each item reports the quantity and cost movement per stock and storage, together with the related product and storage details. Requires the `receipts:read` scope.



## OpenAPI

````yaml /api-reference/v2/openapi.json get /receipts/{id}/stock-operations
openapi: 3.1.0
info:
  title: Clopos Open API v2
  description: >-
    The **Clopos Open API v2** provides secure and unified access to the Clopos
    ecosystem, enabling seamless integration of POS, ordering, payments, and
    restaurant management services.
  contact:
    email: dev@clopos.com
  version: 2.0.0
  license:
    name: ''
servers:
  - url: https://integrations.clopos.com/open-api/v2
    description: '**Base Url**'
security:
  - xToken: []
tags:
  - name: Authentication
  - name: Venues
  - name: Users
  - name: Customers
  - name: Menu
  - name: Stations
  - name: Products
  - name: Price Lists
  - name: Sales
  - name: Orders
  - name: Receipts
paths:
  /receipts/{id}/stock-operations:
    get:
      tags:
        - Receipts
      summary: Get receipt stock operations
      description: >-
        Retrieve the stock deduction operations generated by a receipt
        ("Çıxarılan ehtiyat"). Returns only the stock write-offs caused by the
        receipt itself, where `operation_id` is `null` and `receipt_product_id`
        is set. Each item reports the quantity and cost movement per stock and
        storage, together with the related product and storage details. Requires
        the `receipts:read` scope.
      parameters:
        - name: id
          in: path
          required: true
          description: Receipt ID
          schema:
            type: integer
      responses:
        '200':
          description: Stock operations retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReceiptStockOperationsResponse'
        '404':
          description: Receipt not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ReceiptStockOperationsResponse:
      type: object
      properties:
        data:
          type: array
          description: >-
            Stock deduction operations caused by the receipt itself
            (operation_id is null and receipt_product_id is set).
          items:
            $ref: '#/components/schemas/ReceiptStockOperation'
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
        details:
          type: object
    ReceiptStockOperation:
      type: object
      description: A single stock write-off generated by the receipt.
      properties:
        id:
          type: integer
          description: Stock operation identifier.
        receipt_id:
          type: integer
          description: Receipt identifier the operation belongs to.
        receipt_product_id:
          type:
            - integer
            - 'null'
          description: Receipt product line that produced the write-off.
        product_id:
          type: integer
          description: Product identifier.
        stock_id:
          type: integer
          description: Stock identifier affected by the operation.
        storage_id:
          type: integer
          description: Storage identifier the stock belongs to.
        quantity:
          type: number
          description: Quantity deducted from stock.
        before_quantity:
          type: number
          description: Stock quantity before the operation.
        after_quantity:
          type: number
          description: Stock quantity after the operation.
        cost:
          type: number
          description: Unit cost applied to the deduction.
        before_cost:
          type: number
          description: Stock cost before the operation.
        total_cost:
          type: number
          description: Total cost of the deducted quantity.
        operated_at:
          type: string
          description: Timestamp when the operation was applied (YYYY-MM-DD HH:mm:ss).
        product:
          $ref: '#/components/schemas/ReceiptStockOperationProduct'
        stock:
          $ref: '#/components/schemas/ReceiptStockOperationStock'
    ReceiptStockOperationProduct:
      type: object
      description: Related product. Present even if the product was soft-deleted.
      properties:
        id:
          type: integer
          description: Product identifier.
        name:
          type: string
          description: Product name.
      additionalProperties: true
    ReceiptStockOperationStock:
      type: object
      properties:
        id:
          type: integer
          description: Stock identifier.
        storage:
          $ref: '#/components/schemas/ReceiptStockStorage'
    ReceiptStockStorage:
      type: object
      properties:
        id:
          type: integer
          description: Storage identifier.
        name:
          type: string
          description: Storage name.
  securitySchemes:
    xToken:
      type: apiKey
      in: header
      name: x-token
      description: JWT access token obtained from /v2/auth endpoint

````