Developer docs
On this page
Ask for a page#
| Parameter | Default | What it does |
|---|---|---|
page | 1 | Which page, starting at 1. |
size | 50 | How many items on a page, 1 to 200. |
curl "https://coresyncapi.avitechcloud.com/api/v1/payments?page=2&size=100" \
-H "X-API-Key: $CORESYNC_API_KEY"Read the page#
| Field | What it is |
|---|---|
items | The records on this page. |
total | How many records match, across all pages. |
page | This page's number. |
size | The page size that was used. |
{
"items": [
{
"id": "3f2a6c1e-8b7d-4c1a-9e2f-1a2b3c4d5e6f",
"account_number": "AL-01042",
"subscriber_code": "AL1042",
"username": "wanjiku.k",
"name": "Wanjiku Kamau",
"phone": "+254712345678",
"email": "wanjiku@example.com",
"status": "ACTIVE",
"service_type": "PPPOE",
"online": true,
"plan_name": "Home 10 Mbps",
"expires_at": "2026-11-25T09:00:00Z",
"credit_balance": {
"amount": "300.00",
"currency": "KES"
}
}
],
"total": 137,
"page": 1,
"size": 50
}Get every page#
Ask for page + 1 until page × size reaches total. These use the helper from the quickstart.
// Every item of a list, one page at a time.
async function* everything(path, query = {}) {
for (let page = 1; ; page++) {
const res = await api(path, { query: { ...query, page, size: 200 } });
yield* res.items;
if (res.items.length === 0 || page * res.size >= res.total) return;
}
}
for await (const p of everything("/payments", { from: "2026-10-01T00:00:00Z" })) {
console.log(p.received_at, p.reference, p.amount.amount);
}Good to know#
- Lists are newest first. Plans are sorted by name.
- Pages are counted when you ask. If new records arrive while you page through a newest-first list, older ones move down a page, and you can see one twice. Skip ids you have already seen, or narrow the list with from and to where the operation has them.
- A page past the end comes back with empty items and the real total.
- A
sizeover 200 or apageunder 1 answers400 validation_failed. GET /webhooksreturns a plain list, not a page: an ISP has at most 10 endpoints.
These operations return pages:
GET /subscribers: list subscribersGET /subscribers/lookup: find subscribers by phone, email or account numberGET /subscribers/{id}/invoices: list a subscriber's invoicesGET /subscribers/{id}/payments: list a subscriber's paymentsGET /sessions: list who is online nowGET /plans: list plansGET /invoices: list invoicesGET /payments: list paymentsGET /webhooks/{id}/deliveries: list an endpoint's deliveries
Stuck, or missing something? Tell us what you're building.
hello@coresyncisp.com