Advancements Balances
This section describes the API of the Advancements balances resource. A balance present a balance of the expenses and the advancements of an user in an organization in a currency.
Parameters
amount: | float |
currency: | string |
payer: | JSON object |
receiver: | JSON object |
Example of Balance
List balances
List all balances of the current user logged in the request.
Available payers and available receivers
In the same response body. This API will respond all available payers and receivers for filtering.
Definition
GET https://app.rexpense.com/api/v1/advancements/balances
Example request
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/advancements/balances \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Response Example Success
HTTP 200 OK
List organizations balances
List all balances from the organizations where the current logged in user is Administrator or Manager. The balances collection does not include any information about the current logged in user (this can be achievied in the endpoint above).
Parameters
page: | integer |
per_page: | integer limit to 100 |
Definition
GET https://app.rexpense.com/api/v1/advancements/balances/organizations
Example request
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/advancements/balances/organizations \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Response Example Success
HTTP 200 OK
Show balance
Show a balance according to the given user (receiver_id
), organization (payer_id
) and currency.
Parameters
payer_id: | integer required |
receiver_id: | integer required |
currency: | string required |
Definition
GET https://app.rexpense.com/api/v1/advancements/balances/:payer_id
Example request
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/advancements/balances/1 \ -H 'Accept: application/json' \ -H 'Content-type: application/json' \ -d '{"currency":"USD","receiver_id":1}'
Response Example Success
HTTP 200 OK
Filtering advancement balances
You can filter the list of advancement balances.
Parameters
All parameters must be nested a 'q' parameter.
Payers and Receivers
You have to use the information provided in the nodes available_payers
and available_receivers
to filter those fields.
balance_gteq: | float |
balance_lteq: | float |
receiver_id: | integer |
payer_id: | integer |
currency: | string |