List invoices

Use this to catch up on every invoice that changed since your last sync.

The following endpoint can be used to retrieve the details of invoices within the Hyfin application.


Endpoint

The following endpoint can be used to retrieve invoices. You must replace the {base_url} , {site_id} and {updated_after} variables with the appropriate values.

GET
{base_url}/api/v3.1/site/{site_id}/invoices?updated_after={updated_after}

Request Query Parameters
Field
Type
Description
updated_after
Timestamp
The start of the query's time range (exclusive). On later requests, send the next_updated_after from the previous response. Unlike other timestamps, it needs exactly three digits of milliseconds and a time zone, either Z or an offset such as +05:00. In a query string, send + as %2B. Any other format, or a time in the future, is rejected. Queries look back a maximum of 7 days. A timestamp older than that is moved forward to the limit rather than rejected, so records that last changed before it are not returned. An integration that sends back the next_updated_after of each response never reaches the limit. A moment in time in ISO 8601, with a time zone. Format = YYYY-MM-DDTHH:mm:ss.SSSZ
Response
Field
Type
Description
records_matched
Number
The number of records that matched the query parameters.
records_returned
Number
The number of records that were returned.
next_updated_after
Timestamp
The value to send as updated_after on the next query. When more records matched than this page returned, it is 1 millisecond before the last record's update time, so that record comes back again on the next page: de-duplicate by id. When this page returned every matching record, it is the query time, and the next query returns only records changed since. A moment in time in ISO 8601, with a time zone. Format = YYYY-MM-DDTHH:mm:ss.SSSZ
query_time
Timestamp
The time the query ran. When the page returned every matching record it is also the next_updated_after. A moment in time in ISO 8601, with a time zone. Format = YYYY-MM-DDTHH:mm:ss.SSSZ
limit
Number
The maximum number of records a single response will return. When records_returned equals this, more records are likely waiting and another request should be made with the returned next_updated_after.
records
The records that matched the query parameters, oldest update first.
success
Boolean
Whether the query completed successfully.

Related