Change the expense status
You are able to set certain statuses for an expense via API:
- Set to rejected: POST request to reject a set of expenses. The body includes the guid of the reject reason (optional, can be configured in the Rydoo Admin settings), an additional message (free text), and the expense guids that are to be rejected (mandatory).
- Set to reported: PUT request to set the status of an expense to Reported, the request should include the expense guid in the path.
- Set to unreported: PUT request to unreport an expense, the request should include the expense guid in the path.
Best practices
- Rejecting expenses: Expenses can not be rejected once they are in status Reported. To reject an expense that has been reported, you'll first have to use the 'Unreport an expense' request, followed by the 'Reject an expense' request.
Updating expenses with multiple VAT feature
For updating the status of an expense with multiple VAT in Rydoo (=parent Expense), either the parent expenseGuid or child expenseGuid can be used:
- Example:
PUT /v3/expenses/parentExpenseGuid/report - Result: the parent expense is reported and its related VAT children are reported with it.
Or
- Example:
PUT /v3/expenses/childExpenseGuid/report - Result: the child expense is reported, and the parent and all sibling VAT children are also reported with it.
The same logic will apply for setting expenses to Reimbursed. Once the parent expense is marked as reimbursed, it will remain reimbursed even if a rejected status is later sent for another child expense.
Error messages
Expense has wrong status to reject: expenses that are in status Reported, cannot be rejected. They will first have to be Unreported, before they can be rejected.
ExpenseStatus_InvalidCurrentStatus: expense cannot be set to status Reported, because the current status of the expense does not allow it. Make sure the expense is not in status 'Rejected'.
Report_WrongCompanySettingsToReport: expense cannot be set to status Reported, because the current status of the expense does not allow it and does not match the approval flow of the account settings. In case your account works with one level of approval (approver role only), the expense needs to be in status 'Approved' before it can be reported. In case you work with a second level of approval (controller role), the expense needs to be in status 'Controlled'.
Unreport_WrongStatusToUnreport: expense cannot be unreported, because the current status of the expense does not allow it. Make sure the expense is in status 'Reported' before trying to unreport it.