Polling for changes
There is no "everything that changed since" query yet. These patterns cover the common integrations and keep reads low.
Patterns
- New records: list newest first, for example
GET /v1/invoices?sort=-lastModified&limit=25, and skip the ids you have already seen. This also returns records edited in ARI's apps. - Invoices that were paid, including online payments:
GET /v1/invoices?paidDateFrom=<your last poll, minus a few minutes>&sort=-paidDate. ARI stamps the paid date on its servers when an invoice's status changes to Paid. An invoice saved as paid when it is first created, a counter sale for example, has no server stamp. It shows up as a new invoice withpaid: trueinstead. - A full copy: page through each list once a night. 20,000 invoices cost about 20,000 reads and 200 requests.
- Deleted records:
includeDeleted=truelists records still in ARI's Recycle Bin, for about 7 days, withdeleted: true.
What not to rely on
Do not use updatedAt or the lastModified sort to detect every change. They record when ARI's apps last saved the record, using the device's clock. Changes made by ARI's servers do not move them. Those include online payments, approvals and signatures in the Client Portal, and appointment reminders and cancellations.
Why reads are the limit that matters
A shop can read 300,000 records a day. A list whose filters and sort cannot use an index reads up to 1,000 matching records, or 2,000 for a summary, to sort them. So a poll for "unpaid invoices, newest first" every few minutes can use the day's reads by mid-morning, while "the newest 25 invoices" reads 25.
Watch the X-Reads-Used header while you build an integration, and poll with the narrowest query that works. The limits are on the overview.