// apps/dashboard/account.tsx
GET /api/accounts/acc_9f2/balance 200 41ms
{ "available": 4821040, "currency": "EUR" } // cents
SELECT date_trunc('day', booked_at) AS day,
SUM(amount) AS net
FROM ledger_entries WHERE account_id = $1
GROUP BY day ORDER BY day;
-- index: (account_id, booked_at)
const { data } = useQuery(['tx', id],
() => api.transactions.list(id));
// webhook stripe.payout.paid writes to the ledger
ledger.append({ amount: +312000, source: 'stripe' })
const Transfer = z.object({
to: z.string().min(1),
iban: z.string().regex(IBAN),
amount: z.number().positive(),
reference: z.string().max(140),
});
// validated on client and server
POST /api/transfers
201 Created 88ms
idempotency-key: 7c1e
queue transfers.out ack
pod transfers-api Running