Example: An accounting software automatically imports new and updated client invoices from Qonto every hour, so the bookkeeper always sees the latest billing status without switching tools.Prerequisites:
- At least one client invoice exists in Qonto.
- Scopes:
client_invoices.read,attachment.read
Initialize the sync timestamp
Before your first sync, define the earliest date from which you want to retrieve invoices. Store this timestamp in your database, you will update it after each successful sync.
- Python
- Node.js
Fetch all invoices updated in the time window
List client invoices updated between your last sync and now. Paginate through all pages before processing.Endpoint: List client invoices
OAuth scope required:
client_invoices.readUse
per_page=100 for efficiency. The API returns a maximum of 100 records per page.- Python
- Node.js
Retrieve and download attachments
For each invoice that has an
attachment_id, fetch the attachment to get its download URL, then download the file.Endpoint: Retrieve an attachment- Python
- Node.js
We now have an up-to-date local copy of all client invoices and their PDF attachments for the given time window.