A neobank already has the transaction feed. What its SMB customers lack is books: a receivable that clears when the money lands, a fee that shows up as an expense, and a trial balance their accountant will sign off. Embedded accounting is the layer that turns the feed into those books, one isolated company per business customer.
This post walks the mechanics with Paprel: provisioning a company per customer, recording a payout that arrives net of a fee, and reconciling it. Every endpoint and field is in the API reference; IDs in angle brackets are placeholders.
A Balance Is Not a Book
Your ledger knows that 970.00 arrived in Kopi Kampung's account on Tuesday. Kopi Kampung's books need to know more:
- it settles invoice
INV-0042for 1,000.00, so the receivable must close in full; - the 30.00 gap is a processor fee, an expense, not an unpaid balance;
- the invoice, the payment and the bank line must be linked so an accountant can trace any one to the others.
A transaction feed holds none of that. A double-entry ledger per customer does.
One SMB Customer = One Company
In Paprel a company is the tenant boundary: its own ledger, document numbering and seeded chart of accounts. A neobank provisions one per business customer from its backend through the Partner API.
Get a partner token (POST /v1/partner/token), then create companies, up to 100 per call:
curl -X POST https://api.paprel.com/v1/partner/companies \
-H 'Authorization: Bearer <partner token>' \
-H 'Content-Type: application/json' \
-d '{
"companies": [{
"external_company_id": "merchant-0001",
"company_name": "Kopi Kampung Sdn Bhd",
"country": "MY",
"currency": "MYR",
"locale": "en-MY",
"timezone": "Asia/Kuala_Lumpur",
"owner": { "external_user_id": "user-0001", "email": "owner@example.com", "name": "Aisyah Rahman" }
}]
}'
Your external_company_id and external_user_id are the idempotency keys. If onboarding retries after a timeout, the same item returns outcome: "existing" with the same ids. Different data for an id that already exists returns 409 for that item and never overwrites the company. Provisioning covers users and roles.
To act inside the company, mint a session with POST /v1/partner/companies/{company_id}/sessions. A session is an App Connect token, so everything below is the ordinary Public API, called with authorization: Bearer <session token> and x-partner-domain (shown as $AUTH and $PARTNER, as in the 20-minute guide).
Worked Example: A Payout with a Fee
Kopi Kampung invoiced a buyer 1,000.00. The buyer paid through a card processor, which paid out 970.00 and kept 30.00. Record the payment against the invoice with the fee in bank_charge:
curl -X POST $BASE/v1/invoices/<invoice anchor_id>/payment \
-H "$AUTH" -H "$PARTNER" -H "$CT" \
-H "Idempotency-Key: payout-po_8831-inv-0042" \
-d '{
"payment_amount": "970.00",
"bank_charge": "30.00",
"payment_date": "2026-10-28",
"payment_mode": "<payment mode id>",
"deposit_account": "<operating bank account id>",
"reference_number": "po_8831"
}'
The payment amount plus the charge, 1,000.00, is applied to the invoice, so it closes in full. The resulting journal balances:
| Account | Debit | Credit |
|---|---|---|
| Operating Bank | 970.00 | |
| Bank charges (expense) | 30.00 | |
| Accounts Receivable | 1,000.00 |
Account names here are illustrative. Read the actual lines back with GET /v1/accounting/journals/for-entity?entity_type=invoice&entity_id=<invoice id>.
The Idempotency-Key matters because payout processing retries. Repeat the call with the same key and the same body, and Paprel returns the payment it already recorded. The same key with a different body returns 409. This guarantee covers payments, not journals: a directly posted journal is not deduplicated, so check the ledger before retrying one. Webhooks and idempotency has the full list.
The same pattern appears in SaaS billing to accounting, where a gateway fee is recorded on the payment call.
Reconciling the Bank Line
When the books hold bank transactions as well as documents, the match is a three-step flow on /v1/accounting/transactions:
- Find candidates.
POST /v1/accounting/transactions/find-group-matchtakes the selected banktransactionsand returns bounded suggestions from their remaining balances. Pass amatch_policy_idto use one of your configured match policies (GET /v1/accounting/match-policies). This is discovery only; it creates nothing. - Preview the settlement.
POST /v1/accounting/transactions/settlement-previewtakes the targetentity,entity_idandselections(each withtransaction_id, and optionallybank_amount,document_amount,bank_charge,settlement_rate). It returns estimated FX conversion, explicit bank and document allocations, fees, remaining balances and projected realised FX. It is an estimate, not a settlement. - Confirm.
POST /v1/accounting/transactions/confirm-matchtakescurrency,entityand amappingof explicit amounts. It allocates atomically, revalidates current balances, and never silently recalculates amounts. Exact retries are idempotent; a changed allocation payload returns a conflict.
A wrong match can be undone with POST /v1/accounting/transactions/revert. Statement reconciliation is a separate step (/v1/accounting/reconciliations), with an embeddable reconciliation component if you don't want to build that screen.
One thing to settle early: how your transaction data reaches each company's books. Paprel documents no bank-feed or aggregator connector, and the public API lists bank transactions (GET /v1/accounting/transactions) rather than importing them. Put that question on the agenda for your integration review.
What to Evaluate in an Embedded Accounting Layer
| Question | How to check it on Paprel |
|---|---|
| Do payments, fees and reversals have a balanced accounting path? | Record a payment with bank_charge in the sandbox; read the journal back |
| Is matching explainable and reversible? | settlement-preview before confirm-match; revert after |
| Is each customer's data isolated? | One company per customer; tokens are minted for one company |
| Do reports come from the same records? | Trial balance, P&L and balance sheet are derived live from journal lines |
| Can operators, finance staff and outside accountants have different access? | Custom roles per company via POST /v1/acl/role |
Where Paprel Fits
Paprel gives a neobank the ledger and accounting workflows underneath its SMB product: a company per customer through the Partner API, documents and payments that post balanced journals, configurable matching, and reports derived from the same records. Delivery is headless API under your brand, a hosted workspace, or @paprel/embed-* Web Components for banking, transactions, reconciliation and reports. Invoices and bills are API-first.
To try the invoice and payment loop end to end, run the 20-minute build in the sandbox.
Read Next In This Series
- Ledger Infrastructure for Fintech — the journal model behind payments and payouts.
- Bank Reconciliation for Embedded Accounting Platforms — the hard matching cases in depth.
- Multi-Tenant Accounting Systems — isolation across thousands of customer books.
Weighing whether to build this yourself? Run the numbers in build vs buy.
