Expense statuses
This section describes how to handle and update the expense status. There are six possible statuses for an expense:
awaiting_analysis |
#939393
|
no manager or admin has analyzed the expense yet |
analyzing |
#3D3D3D
|
an analyst, manager or an admin is analyzing the expense |
analyzed |
#0DCCB3
|
an analyst, manager or an admin has analyzed the expense |
pending |
#F39C0F
|
there is some information missing in the expense, so the receiver has to complete it |
approved |
#27AE60
|
a manager or an admin has approved the expense |
liquidated |
#529ECC
|
the expense has been liquidated, the receiver received the approved amount |
rejected |
#C0392A
|
a manager or an admin has rejected the expense |
noncompliant |
#690000
|
the expense is not in compliance with organization's policies |
Show statuses
List all possible statuses that an expense can change to.
Definition
GET https://app.rexpense.com/api/v1/expenses/:id/status
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/expenses/1/status \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Response Example
Update status
To update an expense status you have to provide the status
parameter containing one of the possible
status to change. Besides, if the status is approved
or liquidated
(only if the status the expense changed from is awaiting_analysis
) you have to supply the approved_amount
.
Parameters
status | string required 'awaiting_analysis', 'analyzing', 'analyzed', 'pending', 'approved', 'liquidated' or 'rejected |
approved_amount | float this field is required only if the status is equals to approved or liquidated |
approved_amount_currency | string this field is required only if the status is equals to approved or liquidated based on currencies code default: 'BRL' |
ignore_noncompliant | boolean this field is required only if the status is noncompliant. If not provided, it will respond with a 422 HTTP Unprocessable Entity. |
Definition
PUT https://app.rexpense.com/api/v1/expenses/:id/status
$ curl -u $YOUR_API_TOKEN:X -X PUT https://app.rexpense.com/api/v1/expenses/1/status \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Response Example Success
HTTP 200 OK
Response Example Failure
HTTP 422 Unprocessable Entity