Process invoice updates
Once an invoice has been registered either for invoicing purpose or for collection, it will undergo a collection process and various activities will be performed until it is recovered.
Kravia offers an API in order to detect and process invoices updates efficiently.
Retrieve updated invoices since
Using the Invoice search endpoint, it is possible to retrieve all invoices updated after a specific timestamp:
curl https://api.kravia.ai/api/v2/invoice/search \
?byAscending=True \
&lastUpdatedTime=2021-06-01T15:13:14.4044853 \
&orderBy=11 \
&skip=0 \
&top=20 \
--header 'Authorization: YOUR_SECRET_TOKEN'
The following query parameters can be used for pagination:
-
top → control the number of invoice in the response
-
skip → handles pagination
-
lastUpdatedTime → filters invoices to only include invoices updated after a specific date
-
orderBy → Value 11 sort invoices by last updated time
-
byAscending → true indicates that we will sort invoices chronologically from the change date
By storing the last updated time in the invoice search response, we can use it in the next query in order to paginate through all invoices and to retrieve a delta of all modified invoices.
Retrieve invoice details
Once we have identified invoices being modified in the previous time window, we can use the invoice details API in order to retrieve detailled information about the invoice
curl 'https://api.kravia.ai/api/v2/invoice/{id}/details' \
--header 'Authorization: YOUR_SECRET_TOKEN'
The API response includes information such as:
-
Invoice details and timeline
-
Documents & activities
-
Outstanding amount and payment details
-
Available actions