Inventory Write-Offs
The InventoryWriteOffs entity represents the process of removing products from stock due to waste, expiration, or damage.
Fields
| Field | Type | Description |
|---|---|---|
id | Integer | Unique identifier (Primary Key). |
number | String | Write-off document number. |
date | DateTime | Date and time of the operation. |
type | Enum | Type of write-off operation (e.g., expired, defect, tasting, testRemoval). |
conveniq | Relation | The device where the write-off occurred. |
user | Relation | The user (staff) who performed the operation. |
frontalPhotos | File[] | Collection of photos taken during the operation. |
createdAt | DateTime | Metadata: Creation timestamp. |
updatedAt | DateTime | Metadata: Last update timestamp. |
Get List of Inventory Write-Offs
Fetch a list of inventory write-off documents.
Endpoint: POST /core/data/InventoryWriteOffs/select
Example Request:
json
{
"fields": {
"id": true,
"number": true,
"date": true,
"type": { "id": true, "value": true },
"conveniq": { "id": true, "name": true }
},
"conditions": {
"operator": "and",
"filters": [
{
"field": "date",
"comparator": ">",
"value": "2025-01-01T00:00:00Z"
}
]
},
"orderBy": [
{
"field": "date",
"order": "desc"
}
],
"limit": 50,
"offset": 0
}Get Single Inventory Write-Off
Retrieve details for a specific write-off by ID.
Endpoint: POST /core/data/InventoryWriteOffs/select
Example Request:
json
{
"fields": {
"id": true,
"number": true,
"date": true,
"user": { "id": true, "name": true },
"frontalPhotos": { "id": true, "fileName": true }
},
"conditions": {
"filters": [
{
"field": "id",
"comparator": "=",
"value": 4001
}
]
},
"limit": 1
}Write-Off Products (Table Part)
The InventoryWriteOffsProducts entity stores individual items removed during a write-off.
Table Part Fields
| Field | Type | Description |
|---|---|---|
id | Integer | Unique identifier. |
owner | Relation | Link to the parent InventoryWriteOffs document. |
product | Relation | Link to the Products entity. |
quantity | Float | Quantity removed from stock. |
price | Float | Unit price at the time of write-off. |
createdAt | DateTime | Metadata: Creation timestamp. |
updatedAt | DateTime | Metadata: Last update timestamp. |
Get Products for a Inventory Write-Off
To fetch all products for a specific write-off, filter by the owner.id field.
Endpoint: POST /core/data/InventoryWriteOffsProducts/select
Example Request:
json
{
"fields": {
"id": true,
"product": { "id": true, "name": true },
"quantity": true,
"price": true
},
"conditions": {
"operator": "and",
"filters": [
{
"field": "owner.id",
"comparator": "=",
"value": 4001
}
]
},
"limit": 500
}