Skip to main content
You do not need to re-read every record to stay current. The change feed lists the changes PayPathIQ has committed for your Integration and Client, in order. This guide shows a polling loop. Finish the quickstart first so you have a key and a 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 own GET. 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.
Expect 200 OK with data (the events), nextCursor and hasMore. An event looks like this:

Step 2: Process, store the cursor, repeat

  1. Process every event in data. Delivery is at least once, so skip an eventId you have already handled.
  2. Store nextCursor after you finish the page. Treat it as opaque.
  3. Send it as cursor on the next request. Keep going while hasMore is true. When it is false, 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 returns 410 change_cursor_expired. To recover:
  1. Request GET /v1/clients/{clientCode}/changes?from=latest. It returns no events and a nextCursor after every change committed so far.
  2. Read the Customers and Receivables you need.
  3. Resume from the cursor in step 1.
Taking the cursor first means a change that commits while you read is delivered by the feed instead of being missed.

Add webhooks to poll sooner

Webhooks tell you promptly that something changed. They carry the same eventId. Keep the feed as the source of truth and use notifications only to poll sooner.