Skip to content
Beta: the Biskèt Partner API may still change before v1 is final. Sandbox access is by request:partners@bisket.ai.

Pagination

Lists take limit (1–100, default 25) and starting_after (the id of the last object of the previous page), and answer { "object": "list", "data": […], "has_more": true }. They are ordered by (created_at, id) descending. With updated_since, they are ordered by (updated_at, id) ascending, for incremental sync: de-duplicate on id and keep the highest version. An id you cannot see as starting_after answers 400 invalid_parameter.

pagination.ts
// Pagination: lists take `limit` and `starting_after`; paginate() walks every page.
import { createBisket, paginate } from '@bisket-ai/partner-sdk';
export async function main(env: { apiKey: string; locationId: string }) {
const bisket = createBisket({ apiKey: env.apiKey });
let count = 0;
for await (const order of paginate(
(query) => bisket.GET('/v1/orders', { params: { query: { ...query, location_id: env.locationId } } }),
{ limit: 25, max: 200 },
)) {
count++;
if (count === 1) console.log('newest order', order.id, order.status);
}
return { count };
}