logoAccess

Pagination

How cursor-based pagination works across all Access API list endpoints.

All list endpoints use cursor-based pagination for consistent, efficient traversal of large datasets.

How It Works

Every list response includes:

{
  "data": [...],
  "has_more": true,
  "next_cursor": "id_01HABC..."
}
FieldDescription
dataArray of results for the current page
has_moretrue if more results exist beyond this page
next_cursorPass this as the cursor parameter to get the next page

Fetching Pages

First page
curl "https://api.tryaccess.xyz/api/v1/transactions?limit=20" \
  -H "x-api-key: sk_..."
Next page
curl "https://api.tryaccess.xyz/api/v1/transactions?cursor=txn_01HABC...&limit=20" \
  -H "x-api-key: sk_..."

Continue until has_more is false.

Parameters

ParameterTypeDefaultDescription
cursorstring—Cursor from a previous response
limitnumber20Results per page (1–100)

Endpoints Using Pagination

  • GET /api/v1/customers
  • GET /api/v1/transactions
  • GET /api/v1/subscriptions
  • GET /api/v1/invoices
  • GET /api/v1/checkout/sessions
  • GET /api/v1/webhooks/events
  • GET /api/v1/crypto/payments
  • GET /api/v1/crypto/payouts

Example: Fetch All Customers

Paginate through all customers
let cursor: string | undefined;
const allCustomers = [];

do {
  const params = new URLSearchParams({ limit: "100" });
  if (cursor) params.set("cursor", cursor);

  const res = await fetch(
    `https://api.tryaccess.xyz/api/v1/customers?${params}`,
    { headers: { "x-api-key": "sk_..." } }
  );
  const { data, has_more, next_cursor } = await res.json();

  allCustomers.push(...data);
  cursor = has_more ? next_cursor : undefined;
} while (cursor);

Ordering

Results are ordered by createdAt descending (newest first) by default. This ordering is consistent across pages.

How is this guide?