clientCode.
What you get
Each event names the resource, the kind of change and the accepted revision. It carries no Customer or financial detail. To see the detail, read the resource with its ownGET. The feed needs at least one of customers:read, receivables:read, payment_requests:read or payment_observations:read, and shows only the resource types those scopes cover.
Step 1: Read a page
Request the feed without a cursor to start at the oldest retained change.200 OK with data (the events), nextCursor and hasMore. An event looks like this:
Step 2: Process, store the cursor, repeat
- Process every event in
data. Delivery is at least once, so skip aneventIdyou have already handled. - Store
nextCursorafter you finish the page. Treat it as opaque. - Send it as
cursoron the next request. Keep going whilehasMoreistrue. When it isfalse, wait and poll again at your own pace.
nextCursor is present even on an empty page.
Step 3: Read what changed
For each event,GET the resource named in resource. For example, read the Receivable by its ID. That read is authorized when you make it.
Step 4: Recover from an expired cursor
Changes are kept for 30 days. A cursor older than that returns410 change_cursor_expired. To recover:
- Request
GET /v1/clients/{clientCode}/changes?from=latest. It returns no events and anextCursorafter every change committed so far. - Read the Customers and Receivables you need.
- Resume from the cursor in step 1.
Add webhooks to poll sooner
Webhooks tell you promptly that something changed. They carry the sameeventId. Keep the feed as the source of truth and use notifications only to poll sooner.