When you have fetched all expense data from the voucher endpoint, you need to update the status of each voucher to mark the export as processed. The status of a voucher can be SUCCESS
or FAILED
.
For the successful flow, the export package and its expense reports are moved forward in the process, either to the next recipient or to the status SENT
. You can also provide a voucher number when updating the status for additional control and security. This will make sure that the voucher can only be sent once.
{
"voucherUpdates": [
{
"id": "84bd3279bada45bfa97b0a3fd06fa775",
"status": "SUCCESS",
"bookingDate": "2024-11-21T08:29:00Z",
"voucherNumber": 377,
"informationText": "External System says OK"
}
]
}
If an error occurs in the external system for some reason and you want to abort the import, you can report an error on a voucher, this will make the report(s) remain in status Ready to send. Ideally, you should also send a message highlighting the error and how to solve it.
{
"voucherUpdates":
[
{
"id": "9cfefc3a60f641aea631cf573ea15e6f",
"status": "FAILED",
"errorText": "Processing error please correct"
}
]
}