Purpose
Fetch the stock write-offs caused by a single receipt — the inventory deducted from your storages when the receipt’s products were sold. Use it to reconcile a sale against the warehouse movements it produced (“Çıxarılan ehtiyat” / stock deduction by receipt id). Only the deductions of the receipt itself are returned: each item hasoperation_id = null and a non-null receipt_product_id. Manual stock corrections or operations from other documents are excluded.
This endpoint requires the receipts:read scope.
HTTP Request
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | number | Unique identifier of the receipt whose stock deductions you want to inspect. |
Request Example
Response
200 OK — Stock operations
404 Not Found — Invalid ID
Field Reference
Stock operation object
| Field | Type | Description |
|---|---|---|
id | number | Stock operation identifier. |
receipt_id | number | Receipt the operation belongs to. |
receipt_product_id | number | Receipt product line that produced the write-off (always set for receipt deductions). |
product_id | number | Product whose stock was deducted. |
stock_id | number | Stock record affected by the operation. |
storage_id | number | Storage the stock belongs to. |
quantity | number | Quantity deducted from stock. |
before_quantity | number | Stock quantity before the operation. |
after_quantity | number | Stock quantity after the operation. |
cost | number | Unit cost applied to the deduction. |
before_cost | number | Stock cost before the operation. |
total_cost | number | Total cost of the deducted quantity. |
operated_at | string | When the operation was applied (YYYY-MM-DD HH:mm:ss). |
product | object | Related product. Present even when the product was soft-deleted. |
stock | object | Affected stock together with its storage. |
stock
| Field | Type | Description |
|---|---|---|
id | number | Stock identifier. |
storage | object | Storage the stock belongs to (id, name). |
Notes
- The endpoint returns only the receipt’s own deductions (
operation_id = null,receipt_product_id != null); inventory adjustments from other documents are not included. - A
productmay be soft-deleted but is still returned so historical receipts remain fully reconcilable. - Combine with Get Receipt by ID to map each
receipt_product_idback to its sold line item.