Skip to content

Inventory Write-Offs

The InventoryWriteOffs entity represents the process of removing products from stock due to waste, expiration, or damage.

Fields

FieldTypeDescription
idIntegerUnique identifier (Primary Key).
numberStringWrite-off document number.
dateDateTimeDate and time of the operation.
typeEnumType of write-off operation (e.g., expired, defect, tasting, testRemoval).
conveniqRelationThe device where the write-off occurred.
userRelationThe user (staff) who performed the operation.
frontalPhotosFile[]Collection of photos taken during the operation.
createdAtDateTimeMetadata: Creation timestamp.
updatedAtDateTimeMetadata: 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

FieldTypeDescription
idIntegerUnique identifier.
ownerRelationLink to the parent InventoryWriteOffs document.
productRelationLink to the Products entity.
quantityFloatQuantity removed from stock.
priceFloatUnit price at the time of write-off.
createdAtDateTimeMetadata: Creation timestamp.
updatedAtDateTimeMetadata: 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
}