General - Get balance for an account
API Url
Used to get all account balances with an ID for all employees user has access.
http://localhost:16010/ProMarkREST/rest/General/account-balances/{account_id}
Permissions: user
Path parameters
| Field | Type | Description |
|---|---|---|
| account_id | String | Account ID. |
Query parameters
| Field | Type | Description |
|---|---|---|
periodTypeoptional | Number[1-4] | Type of period (1: Latest closed period, 2: Oldest open period, 3: Current period 4: Current and future periods). |
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
accountsoptional | Object[] | Collection of accounts that belong to a given employee. |
balanceoptional | Number | Balance value. |
departmentoptional | String | Department suffix. |
descriptionoptional | String | Account description. |
formatoptional | Number | Account format (1: HH:MM, 4: HH.CC, 7: HH). |
groupoptional | String | Employee group. |
unitoptional | Number | Account unit (1: Hours, 2: Days, 3: Pieces). |
| employees | Object[] | Collection of employees with nested accounts |
| empNo | String | Employee number. |
| firstName | String | Employee first name. |
| sortEmpNo | String | Sort employee number. |
| surname | String | Employee surname. |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
Success example with a single shift:
HTTP/1.1 200 OK{"response": {"data": {"employees": [{"empNo": "1","sortEmpNo": "!!!!!1","firstName": "John test","surname": "Doex Test"},{"empNo": "2","sortEmpNo": "!!!!!2","firstName": "2","surname": "2","accounts": [{"id": "A001","department": "","group": "","balance": 86400,"description": "Holidays","shortDescription" : "holiday","unit": 2,"format": 1},{"id": "T001","department": "","group": "","balance": 43200,"description": "Normal hours","unit": 1,"format": 1},{"id": "T002A","department": "","group": "","balance": 81000,"description": "Flex","unit": 1,"format": 1}]}]},"errorCode": 0,"errorMessage": ""}}
Error 4xx
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data (empty). |
| errorCode | Number | Error code. |
| errorMessage | String | Error description. |
Error example:
HTTP/1.1 404 Not found{"response": {"errorCode": 5,"errorMessage": "No employees"}}