Schematex
erd·Crow's-foot ERD·software, finance·complexity 3/3·since v0.4.0

Billing ledger and audit trail

Crow's-foot ERD for an immutable SaaS billing ledger with customers, invoices, payments, refunds, ledger entries, and audit events.

For the SaaS backend engineer

Open in Playground →
erd·§
↘ preview
100%
Billing Ledger Entity-Relationship Diagram with 7 entities and 9 relationships. Billing Ledger belongs to billed to for plan settles reverses posts for source invoice source payment source refund Customer customer_id uuid PK email varchar UK billing_currency char * AuditEvent event_id uuid PK actor_id uuid entity_type varchar * entity_id uuid * action varchar * created_at timestamptz * Subscription subscription_id uuid PK customer_id uuid FK status varchar * current_period_end timestamptz Invoice invoice_id uuid PK customer_id uuid FK subscription_id uuid FK number varchar UK total_cents bigint * status varchar * Payment payment_id uuid PK invoice_id uuid FK provider_ref varchar UK amount_cents bigint * captured_at timestamptz Refund refund_id uuid PK payment_id uuid FK amount_cents bigint * reason varchar LedgerEntry entry_id uuid PK customer_id uuid FK invoice_id uuid FK payment_id uuid FK refund_id uuid FK entry_type varchar * amount_cents bigint * posted_at timestamptz *
UTF-8 · LF · 64 lines · 2038 chars✓ parsed·10.3 ms·23.6 KB SVG

Scenario

Billing schemas become risky when money movement and auditability are mixed into mutable order tables. This ERD separates commercial objects from immutable ledger entries, making it clear which facts can change and which entries are accounting evidence.

Annotation key

ERD syntax