fastify-xwhatconverts
accounts.list
List WhatConverts accounts with optional date and pagination filters. Requires Agency Key.
accounts.list
List accounts with optional filters. Requires an Agency (Master) API Key.
Signature
fastify.xwhatconverts.accounts.list(params?: {
accountsPerPage?: number;
pageNumber?: number;
startDate?: string;
endDate?: string;
order?: "asc" | "desc";
}): Promise<object>
Params
| Name | Type | Required | Description |
|---|---|---|---|
accountsPerPage | number | No | Results per page. Default 25, max 250. |
pageNumber | number | No | Page number. |
startDate | string | No | Start date in ISO 8601 format. |
endDate | string | No | End date in ISO 8601 format. |
order | string | No | Sort order: asc or desc. |
Returns
A paginated WhatConverts accounts response object.
Throws
[xWhatConverts] Network error: <message>— network-level failure.[xWhatConverts] API error: <status>— non-2xx response;403if not using Agency Key.
Examples
Basic — list all accounts
const result = await fastify.xwhatconverts.accounts.list();
console.log(result.accounts);
Realistic — paginate all accounts
async function fetchAllAccounts() {
const pageSize = 250;
let page = 1;
const all = [];
while (true) {
const result = await fastify.xwhatconverts.accounts.list({
accountsPerPage: pageSize,
pageNumber: page,
});
all.push(...result.accounts);
if (result.accounts.length < pageSize) break;
page++;
}
return all;
}
See Also
- accounts.get — fetch a single account
- accounts.create — create an account
AI Context
package: "@xenterprises/fastify-xwhatconverts"
method: fastify.xwhatconverts.accounts.list(params?)
use-when: List WhatConverts accounts — requires Agency (Master) API key; supports pagination
params: page (number), perPage (number)
returns: { accounts: array, totalAccounts: number }
