Commerce
Store the accounts buyers should pay.
Payout accounts are workspace-scoped provider destinations used by products and hosted payment links.
Routes
GET
/payoutsPro or BusinessPOST
/payoutsPro or BusinessPATCH
/payouts/:idDELETE
/payouts/:idSoft-deletes the payout account.
Create
json
{
"label": "Primary Telebirr",
"accountHolderName": "Example Merchant",
"type": "PHONE",
"account": "0911223344",
"providersAllowed": ["telebirr", "cbebirr", "mpesa"]
}Phone destinations support Telebirr, CBE Birr, and M-Pesa. Bank destinations accept exactly one of CBE, Dashen, or Bank of Abyssinia. The first active payout account becomes the workspace default.
typescript
import { veritas } from "@/lib/veritas";
const created = await veritas<{ account: { id: string } }>("/payouts", {
method: "POST",
body: JSON.stringify({
label: "Primary Telebirr",
accountHolderName: "Example Merchant",
type: "PHONE",
account: "0911223344",
providersAllowed: ["telebirr", "cbebirr", "mpesa"],
}),
});
const payoutId = created.account.id;
const payouts = await veritas("/payouts");
await veritas(`/payouts/${payoutId}`, {
method: "PATCH",
body: JSON.stringify({
label: "Main mobile account",
isDefault: true,
}),
});
await veritas(`/payouts/${payoutId}`, { method: "DELETE" });