Base URL
https://{tenant}.logzi.com/api/receipt_param/
Every request returns a JSON response. On success result.code == 1, on error result.code == 0. A record stores the value of a single parameter belonging to a receipt; the structure of the parameter is described by the Receipt parameter schema API.
/api/receipt_param/get
Retrieve a single receipt parameter value. The lookup is based on the parameter schema identifier and/or the receipt identifier, and the first matching row is returned. At least one of the parameters must be provided, otherwise the response is Not found.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
param_schema_id |
int | Identifier of the parameter schema (at least this or receipt_id is required) |
|
receipt_id |
int | Identifier of the receipt (at least this or param_schema_id is required) |
Example request
GET /api/receipt_param/get?param_schema_id=3&receipt_id=42
X-API-KEY: {your_api_key}
Example response
{
"result": { "code": 1, "message": "success" },
"data": {
"id": 17,
"param_schema_id": 3,
"param_value": "125.5",
"receipt_type_id": 1,
"receipt_id": 42
}
}
/api/receipt_param/list
List of receipt parameter values. The list is not paginated; the results are returned in a single array. Without filters it returns all records.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
list_condition[receipt_id] |
int | Filter by receipt identifier | |
list_condition[receipt_type_id] |
int | Filter by receipt type identifier |
Example request
GET /api/receipt_param/list?list_condition[receipt_id]=42
X-API-KEY: {your_api_key}
Example response
{
"result": { "code": 1, "message": "success" },
"data": [
{
"id": 17,
"param_schema_id": 3,
"param_value": "125.5",
"receipt_type_id": 1,
"receipt_id": 42
},
{
"id": 18,
"param_schema_id": 4,
"param_value": "Urgent",
"receipt_type_id": 1,
"receipt_id": 42
}
]
}
/api/receipt_param/save
Save a receipt parameter value. If a record already exists for the given receipt and parameter schema (param_schema_id + receipt_id), the save modifies it, otherwise it creates a new record. The response contains the identifier of the record.
POST fields - data object
| Field | Type | Required | Description |
|---|---|---|---|
param_schema_id |
int | Identifier of the parameter schema (greater than 0) | |
receipt_id |
int | Identifier of the receipt (greater than 0) | |
receipt_type_id |
int | Identifier of the receipt type | |
param_value |
string | The parameter value as text (up to 1500 characters). Depending on the param_type_id of the schema it is a number, text, boolean value or an item of the value list. |
Example request
POST /api/receipt_param/save
X-API-KEY: {your_api_key}
Content-Type: application/json
{
"data": {
"param_schema_id": 3,
"receipt_id": 42,
"receipt_type_id": 1,
"param_value": "125.5"
}
}
Example response
{
"result": { "code": 1, "message": "success" },
"data": {
"id": 17
}
}
Create your account now,
pay later!