API CheckBalance
Request parameters:
- tenant — (mandatory) to which tenant/system to connect, e.g. "demo"
- account_id - (conditional) - Account ID
- account_name - (conditional) - Account Name
- account_code - (conditional) - Account Code
- ref_date — reference date — (default: "") — select all "actual" pockets of the balance, means those that have ("start" <= ref_date OR "start" is empty) AND ("end" > ref_date OR "end" is empty); if no ref_date provided, skip "actual" check and return all pockets
- balance_name — balance name — (default: "all") — check only mentioned balance
- return_pockets — return pockets — (default: "false") — add pockets' details in response
- return_reservations — return reservations — (default: "false") — add details about reserved values in response: total (and if "return_pockets=true" then also per pocket)
- return_limits - (optional; default false) - return balances that are used as "limits" or not
Response details:
- processing_date — timestamp with time zone when request was processed
- header
- CheckBalance
- request
- "input" (request parameters) as is
- response
- ref_date — reference date for which balances are checked; or empty if ref_date check is skipped
- balances — array of balances
- [0..n]
- balance_id — id of found balance
- balance_name — name of found balance
- balance_total — total numbers for the balance
- value — total value (sum of all "actual" pockets) of the balance
- (if requested) reserved — total reserved value (sum of all reservations of all "actual" pockets) of the balance
- (if requested) pockets — array of pockets
- [1..m]
- start
- end
- label
- value
- (if requested) reserved
- [1..m]
- [0..n]
- request
Request example
{
"tenant": "taskvizor",
"account_id": "504",
"balance_name": "TASKS",
"return_pockets": "true",
"return_return_reservations": "true"
}
CODE
Response example
{
"processing_result": {
"text": "success",
"status": "ok",
"code": 0
},
"processing_date": "2019-04-24 16:38:05",
"CheckBalance": {
"response": {
"tenant": "zegoal",
"skip_lookup_account": false,
"return_reservations": false,
"return_pockets": false,
"ref_date": "",
"balances": [
{
"balance_total": {"value": 0},
"balance_name": "Money_BYN",
"balance_id": 1
},
{
"balance_total": {"value": 0},
"balance_name": "TASKS",
"balance_id": 2
},
{
"balance_total": {"value": 0},
"balance_name": "USERS",
"balance_id": 3
}
],
"balance_name": "",
"account_name": "Название аккаунта 128",
"account_id": 1,
"account_code": "128",
"TZ": "Europe/Minsk"
},
"request": {
"tenant": "zegoal",
"account_id": "1"
}
}
}
CODE