Base URL
https://{tenant}.logzi.com/api/receipt_param_schema/
Every request returns a JSON response. On success result.code == 1, on error result.code == 0. The schema defines which custom parameters belong to a receipt type (name, type, unit, order). The actual values of the parameters are managed by the Receipt parameter API.
Possible values of param_type_id
| Value | Name | Description |
|---|---|---|
1 |
Number | Numeric value, optionally with a unit (param_unit_id) |
2 |
Text | Free text value |
3 |
Boolean | Yes / no value |
4 |
Value list | Selectable from a predefined set of possible values (param_enum) |
/api/receipt_param_schema/get
Retrieve a single receipt parameter schema by identifier. Deleted schemas (remove = 1) are not returned.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
int | Unique identifier of the parameter schema |
Example request
GET /api/receipt_param_schema/get?id=3
X-API-KEY: {your_api_key}
Example response
{
"result": { "code": 1, "message": "success" },
"data": {
"id": 3,
"receipt_type_id": 1,
"param_type_id": 1,
"param_name": "Gross weight",
"param_enum": null,
"param_order": 1,
"param_unit_id": 4,
"remove": 0
}
}
/api/receipt_param_schema/list
List of receipt parameter schemas (excluding deleted schemas), sorted by receipt type, display order and identifier. The list is not paginated. Besides the schema fields, the response also contains the names of the parameter type, the receipt type and the unit.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
list_condition[receipt_type_id] |
int | Filter by receipt type identifier |
Example request
GET /api/receipt_param_schema/list?list_condition[receipt_type_id]=1
X-API-KEY: {your_api_key}
Example response
{
"result": { "code": 1, "message": "success" },
"data": [
{
"id": 3,
"receipt_type_id": 1,
"param_type_id": 1,
"param_name": "Gross weight",
"param_enum": null,
"param_order": 1,
"param_unit_id": 4,
"remove": 0,
"param_type_name": "Number",
"receipt_type_name": "Warehouse receipt",
"unit_name_short": "kg"
},
{
"id": 4,
"receipt_type_id": 1,
"param_type_id": 4,
"param_name": "Priority",
"param_enum": "[\"Low\",\"Normal\",\"Urgent\"]",
"param_order": 2,
"param_unit_id": null,
"remove": 0,
"param_type_name": "Value list",
"receipt_type_name": "Warehouse receipt",
"unit_name_short": null
}
]
}
/api/receipt_param_schema/save
Create or modify a receipt parameter schema. For a new schema use data[id] = 0; to modify, provide the existing identifier.
POST fields - data object
| Field | Type | Required | Description |
|---|---|---|---|
id |
int | 0 = new schema, >0 = modify | |
receipt_type_id |
int | Identifier of the receipt type the parameter belongs to | |
param_type_id |
int | Type of the parameter (1 = number, 2 = text, 3 = boolean, 4 = value list) | |
param_name |
string | Name of the parameter (up to 150 characters) | |
param_enum |
array | Array of selectable values. It is only saved when param_type_id = 4 (stored as JSON, up to 1000 characters); for other types the system ignores it. |
|
param_order |
int | Display order (default: 0) | |
param_unit_id |
int | Identifier of the unit. With 0 or an empty value there is no unit. |
Example request
POST /api/receipt_param_schema/save
X-API-KEY: {your_api_key}
Content-Type: application/json
{
"data": {
"id": 0,
"receipt_type_id": 1,
"param_type_id": 4,
"param_name": "Priority",
"param_enum": ["Low", "Normal", "Urgent"],
"param_order": 2
}
}
Example response
{
"result": { "code": 1, "message": "success" },
"data": {
"id": 4
}
}
/api/receipt_param_schema/delete
Delete a receipt parameter schema by identifier. The deletion is logical: the schema is marked with remove = 1 and is no longer returned by queries.
POST fields
| Field | Type | Required | Description |
|---|---|---|---|
id |
int | Identifier of the parameter schema to delete |
Example request
POST /api/receipt_param_schema/delete
X-API-KEY: {your_api_key}
Content-Type: application/json
{
"id": 4
}
Example response
{
"result": { "code": 1, "message": "success" },
"data": {}
}
Create your account now,
pay later!