COUNTCOUNT
Sign Up

Guides

Handle Pagination

List endpoints return paginated results. Walk every page using page and limit query parameters and the totalPages field in the response.

Query parameters

Every list endpoint accepts page (1-based) and limit (records per page). Defaults vary by resource — check the endpoint reference for supported sort and filter parameters.

Response shape

Paginated responses include page, limit, totalRecords, and totalPages alongside the records array. The array key differs by resource — see Response shapes.

List row keys
// The records array lives under a different key per resource:
const LIST_ROW_KEYS = {
  customers: 'records',
  transactions: 'transactions',
  invoices: 'invoices',
  documents: 'records', // verify against the response for each resource
};

Fetch all pages

Loop until page exceeds totalPages. Start at page 1 and increment after each successful response.

The example uses a pseudocode signedGet helper. See Authentication & signing for the HMAC base string and headers your client must send.

Fetch all customers
async function fetchAllCustomers(baseUrl) {
  const allRecords = [];
  let page = 1;
  let totalPages = 1;

  while (page <= totalPages) {
    // signedGet is illustrative — see Authentication & signing for HMAC headers.
    const response = await signedGet(
      `${baseUrl}/partners/customers?page=${page}&limit=50`
    );
    const data = response.data;
    allRecords.push(...data.records);
    totalPages = data.totalPages;
    page += 1;
  }

  return allRecords;
}

Rate limits

Large sync jobs that walk many pages count against the 100 requests per minute per clientId limit. Add backoff on 429 responses and use the Retry-After header. See Errors & troubleshooting.