Architecture

Embedded Accounting Architecture

Paprel turns product events into balanced, append-only double-entry records. Company-scoped access, financial reports, and signed webhooks share one ledger core, reached through REST APIs, SDKs, and Model Context Protocol (MCP) tools.

Read the architecture docs
System OverviewPAPREL / 008
REST API
SDK Clients
MCP Agents
Paprel Accounting CoreCompany-scoped

Double-Entry Ledger

AuthenticateValidatePost
Append-only ledger=
Financial Reports
Signed Webhooks

PAPREL · Shared Core · FIG. 008

The write path

From API Call to Double-Entry Ledger

Every write — direct journal, invoice, payment, agent tool call — passes the same gates, in the same order. Nothing reaches the ledger unverified.

  1. Your platform

    REST · SDK · MCP

    One surface, three ways in. The same primitives whether the caller is your backend, a typed SDK, or an AI agent over Model Context Protocol.

  2. Auth & scope

    OAuth 2.0 · tenant-scoped

    Every token is scoped to a company with per-route grants. The same model powers dashboards, machine clients, and MCP agents.

  3. Idempotency check

    seen before? → recorded result (payments)

    Supported requests use idempotency keys under the endpoint contract. Follow the endpoint requirements; idempotency is not an unconditional guarantee against duplicate actions.

  4. Balance validation

    debits = credits, or rejected

    Checked at write time, before anything reaches the ledger. Validate the supported posting behavior and account mappings for your integration.

  5. Append-only ledger

    corrections are new entries

    Posted lines are never edited in place. Versioned documents keep a stable anchor while the full history stays walkable.

Live reports

derived, never reconciled

P&L, balance sheet, and trial balance are views over the same rows the engine wrote — no sync step, no end-of-day batch.

Signed webhooks

at-least-once · verifiable

Events carry timestamped HMAC signatures over the exact raw request body so consumers can verify integrity and dedupe redeliveries.

The layered core

The Four Layers of Embedded Accounting

Workflows never bypass the ledger; reports never drift from it. Each layer either compiles into the layer below or derives from it — which is why there is no reconciliation step anywhere in the stack.

Read the full layer-by-layer article
Inside the CorePAPREL / 009
  1. Reporting layer

    01

    Derived live from journal rows

    Reports are views over the ledger, not a second datastore that gets synced and reconciled. The trial balance ties to zero by arithmetic, not by health check.

  2. Workflow layer

    02

    Documents compile into journals

    Invoices, bills, credit notes, and expenses generate balanced journals through account mappings set once. A compiler into the ledger's guarantees — never a bypass.

  3. Ledger engine

    03

    Append-only · balanced or rejected

    Journals are the only primitive. If a number appears in a report, there is a journal line behind it — balance-validated at the API boundary.

  4. Tenancy

    04

    Isolation enforced at the data layer

    A company identifies a set of books and reporting scope. Confirm tenant access enforcement and privileged paths for your deployment.

Tenancy & isolation

Multi-Tenant Accounting: A Company Is the Boundary

One API call provisions a customer with isolated books of their own — ledger, document numbering, and a default chart of accounts included.

Your platform

one tenant per customer · OAuth-scoped tokens

Customer A

region: US

  • Own ledger & chart of accounts
  • Isolated at the data layer
  • Own audit history

Customer B

region: EU

  • Own ledger & chart of accounts
  • Isolated at the data layer
  • Own audit history

Customer C

region: APAC

  • Own ledger & chart of accounts
  • Isolated at the data layer
  • Own audit history

Confirm the company boundary, enforcement design and privileged access paths for your deployment. Example regions in this diagram are illustrative, not a residency commitment.

Reliability model

Reliable Writes: Idempotency and Signed Webhooks

Every financial API eventually receives the same request twice. In a ledger, a duplicate write isn't a duplicate row — it's an audit problem. So the write path assumes retries.

Retries are the normal case

Timeouts, webhook redeliveries, queue replays — the write path is designed to be retried, because it will be. Payments take an idempotency key and return the recorded result on retry, documents reject a repeated document number, and every journal is balance-validated before it posts.

Signed, verifiable delivery

Webhooks are delivered at-least-once with timestamped HMAC signatures over the exact raw request body, so a consumer can verify integrity and safely ignore duplicates.

Recovery beyond redelivery

Automatic retries and operator resend recover individual deliveries. For wider gaps, consumers reconcile against company-scoped APIs and ledger exports—the accounting data remains the source of truth.

Audit history, exportable

Confirm the activity history, evidence format, export coverage and retention agreed for your service.

Deployment

Deployment Models: Managed, White-Label, and Private

The ledger core and its guarantees are identical across all three — the models exist for distribution and compliance shapes, not as upgrades.

Managed

Paprel hosts, you integrate

  • Hosting region, support access and onward processing locations are agreed for each deployment
  • Sandbox is self-serve; production starts at published pricing
  • Sandbox and production are separate, isolated environments

The right starting point for almost everyone.

White-label

Paprel powers, your brand fronts

  • Every tenant carries your partner attribution — your customer relationship, end to end
  • Headless API under your brand — your UI and domain, Paprel underneath
  • Managed responsibilities are defined by the agreed service scope

For platforms that own the accounting experience.

Private / BYOC

Your cloud, scoped together

  • Deployment in your infrastructure or on dedicated infrastructure
  • Scoped per engagement — conversation first
  • Operational and security responsibilities are agreed per deployment

For compliance shapes managed can't express.

Architecture review

Bring your hardest questions

Talk directly to the engineers who built and operate the ledger — deployment fit, OAuth and MCP scope, data residency, and rollout, in a working session.