Ledger Infrastructure for Fintech: From Card Payments to Balanced Journals

A $100 card payment, a $2.90 fee and a T+2 payout, written as balanced journals: the event mapping, retry rules and controls a fintech ledger needs.

Paprel Product Team
7 min read
A payment card feeds a transaction channel that splits into paired accounting entries

A customer pays a merchant $100 by card. The processor keeps a $2.90 fee and pays out $97.10 two days later. Your product shows "$100 received, $97.10 paid out." The merchant's books need three balanced journals:

DayEventDebitCredit
TCard payment capturedPayments Clearing 100.00Sales Revenue 100.00
T+2Processor fee withheldProcessing Fees 2.90Payments Clearing 2.90
T+2Payout lands in the bankCash · Operating 97.10Payments Clearing 97.10

After the payout, Payments Clearing is back to zero. Revenue shows the full $100 the merchant earned, the fee shows up as an expense, and cash matches the bank. If clearing doesn't net to zero, the leftover is a payout that hasn't arrived or a fee nobody recorded. That leftover is your reconciliation worklist.

That's what ledger infrastructure means for a fintech product: every money movement becomes a balanced entry against a chart of accounts, so balances can be explained rather than just displayed.

The Journals as API Calls

In Paprel each merchant gets its own company with its own books (provisioning). The capture journal is one call to POST /v1/accounting/journals. Account IDs are placeholders for UUIDs from the company's chart of accounts:

Shell
curl -X POST "$BASE/v1/accounting/journals" \
  -H "$AUTH" -H "$PARTNER" -H "$CT" \
  -d '{
    "date": "2026-10-27",
    "currency": "USD",
    "reference": "ch_8f2k19",
    "description": "Card payment ch_8f2k19",
    "posted": true,
    "lines": [
      { "account_id": "<payments clearing account id>", "description": "Card payment, gross", "debit": "100.00" },
      { "account_id": "<sales revenue account id>", "description": "Sale",                "credit": "100.00" }
    ],
    "meta_data": {
      "root_entity_type": "card_payment",
      "root_entity_id": "ch_8f2k19"
    }
  }'

meta_data.root_entity_type and root_entity_id tie the journal to your own payment ID, so GET /v1/accounting/journals/for-entity?entity_type=card_payment&entity_id=ch_8f2k19 returns every journal for that payment. The fee and payout journals have the same shape with different lines.

Payments Clearing should be an ordinary asset account you create, not the system receivable or payable control account. Those are posted through document and payment workflows. The marketplace accounting guide uses the same clearing-account pattern for orders, commissions and payouts.

The Event Mapping Table

Write your mapping down once, as a table, before writing any code. This is the mapping for the merchant's books in the example above:

Product eventDebitCreditNotes
Card payment capturedPayments Clearing (asset)Sales Revenue (income)Gross amount
Processor feeProcessing Fees (expense)Payments ClearingBooked when the fee is known
RefundSales Revenue (or a refunds contra-revenue account)Payments ClearingThe capture journal with the legs reversed
Payout to bankCash · Operating (asset)Payments ClearingNet amount that actually arrived

Two rules keep the table honest:

  • Each event posts exactly once. One product event, one journal, joined back to the event by root_entity_id.
  • Clearing accounts must net to zero. Every debit to clearing is eventually matched by a credit, and anything left over needs investigating.

If you're the platform holding funds for sellers, your own books add a Seller Payables liability between capture and payout; the marketplace guide shows that split.

When the $97.10 shows up on the bank statement, Paprel's reconciliation matches the bank line to the payout. Matching is driven by configurable match-policies, and POST /v1/accounting/transactions/settlement-preview shows allocations, fees and projected realised FX before you confirm with confirm-match. See banking and reconciliation.

Financial History You Can Rebuild

A fintech ledger has to give the same answer every time you ask what happened. Three properties do the work:

Balanced or rejected. Every journal is validated before it is written, whether you post it directly or a document generates it. An unbalanced journal is rejected and leaves no partial state.

Retries that don't double-post. Paprel's write path handles retries differently depending on what you're writing (webhooks and idempotency):

WriteRetry behavior
Invoice or bill paymentSend an Idempotency-Key. Same key and same details returns the payment already recorded; same key with different details returns 409
Document with your own document_numberA repeat is rejected with DUPLICATE_DOCUMENT_NUMBER
JournalNot deduplicated. Check the ledger before retrying

For journal-heavy flows like the one above, keep one request in flight per product event. If a journal post times out, look for it with GET /v1/accounting/journals?reference=ch_8f2k19 or the for-entity call before you resubmit.

Recovery from the ledger. Webhooks notify you; the ledger is the source of truth. After an outage, read GET /v1/accounting/journals for the window you missed (it filters by date_range, account, reference and more) and reconcile your local state against it.

Reporting From the Same Rows

Paprel's reports are derived live from journal rows, so there's no second store to keep in sync:

  • GET /v1/reports/general-ledger?account=… for every movement through Payments Clearing
  • GET /v1/reports/trial-balance to confirm the books tie
  • GET /v1/reports/income-statement and GET /v1/reports/balance-sheet for the merchant's statements

Controls and Corrections

Once operators and merchants can touch financial records, you need to know who can do what:

  • Scoped permissions. Posting a journal requires accounting:journal-add, accounting:journal-edit or role:admin, and each credential gets only the permissions you grant it.
  • Corrections are reversals. Posted journals are voided with PUT /v1/accounting/journals/void, which reverses the effect and keeps the history.
  • Period locks. Transaction locks protect closed periods, and writes against them are refused with lock errors such as JOURNAL_LOCKED (API errors). The paprel-transaction-locks component puts lock management in your UI.
  • Activity history. GET /v1/activity answers who changed what and when.

Build Versus Partner

Building is reasonable when the ledger itself is your product and you can staff it for years. Most fintech teams find the scope keeps expanding: reconciliation, reporting, period close, corrections, multi-currency and audit history. Before deciding:

AI agents can work against the same books through Paprel's hosted MCP server, with journal entries arriving as drafts a human posts. See Paprel for AI.

Get a free sandbox (self-serve, no sales call). For the product view, see embedded accounting for fintech and the general ledger API.

Post your first journal in 5 minutes →
Posted by: Paprel Product Team · Product & Platform Integration Review
Posted on: (Updated: October 29, 2026)
Evaluate Paprel

Build in sandbox, launch with a production trial

Use sandbox for developer testing with no billing. When you are ready for real workflows, start production on a monthly plan with a 14-day free trial.

API-First Delivery
Audit-Ready Controls
Sandbox And Guided Rollout