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

Settlement and statements

Each restaurant × partner pair has its own ledger of entries in HTG minor units. Sign convention: amount > 0 = you owe the restaurant; amount < 0 = the restaurant owes you. The restaurant is always owed the menu price of what it served. Entries are never edited: a correction is a new entry (a reversal or an adjustment with a description).

Kind Sign When
order_collected_by_partner + your order closed (picked up or not): accepted subtotal − your discount
partner_funded_discount + your discount on a closed order
delivery_fee_collected_by_restaurant − the restaurant collected your delivery fee
partner_markup_collected_by_restaurant − the restaurant collected your markup
restaurant_collected_refund_due − the restaurant collected for food it did not serve
refund_adjustment, adjustment ± agreed corrections, with a description
payout ± a payout the restaurant confirmed
reversal ± undoes exactly one entry

One statement per restaurant × partner × week (Monday to Sunday by the restaurant’s business date, HTG), issued the day after the week ends, from 11:00 UTC (statement.issued). It takes every entry not yet on a statement; late entries for an earlier week are marked carried over. A statement is immutable, and says « Relevé de règlement — ne vaut pas facture »: it is a settlement statement, not a tax invoice.

Worked example. 17 orders in a week: 8 you collected (menu subtotals 47 400 HTG, one with a 1 250 discount) and 9 the restaurant collected (60 700 HTG, delivery fees 2 250, one markup of 400). Gross sales 108 100; you owe 47 400; the restaurant owes you 2 650; net 44 750, payable by you.

Record each payment you make (or receive) with POST /v1/locations/{location_id}/payouts: amount, direction, method, reference, date, optionally the statements it settles. The restaurant’s owner or manager confirms or disputes it in Biskèt (payout.confirmed / payout.disputed). A confirmed payout settles the named statements, else the oldest unpaid ones; an advance stays unapplied until a statement takes it. A statement is paid when confirmed payouts cover its net (statement.paid).

settlement.ts
// Settlement: ledger entries, statements and the sales summary of one location.
import { createBisket, paginate } from '@bisket-ai/partner-sdk';
export async function main(env: { apiKey: string; locationId: string }) {
const bisket = createBisket({ apiKey: env.apiKey });
const path = { location_id: env.locationId };
let entries = 0;
for await (const e of paginate((query) => bisket.GET('/v1/locations/{location_id}/ledger_entries', { params: { path, query } }), { max: 500 })) {
entries++;
if (entries === 1) console.log('latest entry', e.kind, e.amount.amount, e.business_date);
}
const { data: statements } = await bisket.GET('/v1/locations/{location_id}/statements', { params: { path } });
const today = new Date().toISOString().slice(0, 10);
const { data: summary } = await bisket.GET('/v1/locations/{location_id}/sales_summary', { params: { path, query: { from: today, to: today } } });
return { entries, statements: statements!.data.length, summaryObject: (summary as { object: string }).object };
}