Pagination
All top-level API resources have support for bulk fetches through "list" API methods. For example, you can list accounts, list transfers, and list payouts. These list API methods share a common structure and accept, at a minimum, the following three parameters: limit, starting_after, and ending_before.
Zoneless's list API methods use cursor-based pagination through the starting_after and ending_before parameters. Both parameters accept an existing object ID value (see below) and return objects in reverse chronological order. The ending_before parameter returns objects listed before the named object. The starting_after parameter returns objects listed after the named object. These parameters are mutually exclusive — you can use either starting_after or ending_before, but not both simultaneously.
Parameters
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For example, if you make a list request and receive 100 objects, ending with acct_z_foo, your subsequent call can include starting_after=acct_z_foo to fetch the next page of the list.
A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For example, if you make a list request and receive 100 objects, starting with acct_z_bar, your subsequent call can include ending_before=acct_z_bar to fetch the previous page of the list.
import { Zoneless } from '@zoneless/node';
const zoneless = new Zoneless('sk_live_z_YOUR_API_KEY', 'https://api.zoneless.com');
const accounts = await zoneless.accounts.list({
limit: 3,
starting_after: 'acct_z_1Nv0FGQ9RKHgCVdK',
});
List Response Format
Whether or not there are more elements available after this set. If false, this set comprises the end of the list.
{
"object": "list",
"url": "/v1/accounts",
"has_more": false,
"data": [
{
"id": "acct_z_1Nv0FGQ9RKHgCVdK",
"object": "account",
"business_type": "individual",
"country": "US",
"created": 1704067200,
"default_currency": "usdc",
"email": "seller@example.com",
"details_submitted": true,
"charges_enabled": true,
"payouts_enabled": true
}
]
}