Fundamentals 12 min read

Design of Account and Accounting System in Payment Platforms

This article explains the foundational design of a payment system's account and accounting architecture, covering transaction models, account types, accounting entries, business processes, and the interaction between account, accounting, and settlement systems to ensure accurate financial tracking.

Architecture Digest
Architecture Digest
Architecture Digest
Design of Account and Accounting System in Payment Platforms

Preface

The account system and accounting design form the underlying foundation of a payment platform, providing services for fund collection, payment, and management for both individual users and enterprise merchants. All operations are defined as transactions, shifting from a transaction‑driven to a user‑centric product‑based model.

1. Transaction Model

All account changes occur through transactions. A transaction model must be built based on business needs and product structures.

Key components include:

Product: e.g., B2C online banking, B2B online banking, quick pay, collection/payments, identity verification, account verification.

Transaction Type: Finer‑grained actions derived from products, such as settlement and collection within B2C online banking.

Account System: Account changes triggered by transactions, e.g., user C1 transfers to user C2.

Accounting Subject: Accounting entries generated per transaction, supporting one‑debit‑one‑credit or one‑debit‑multiple‑credit patterns.

Example: B2C online banking collection.

Assumptions:

User uses China Bank Shenzhen B2C online banking to place an order.

Payment company settles to the merchant's balance account.

2. Account System

Accounts are classified by ownership: personal, enterprise, and internal accounts. Personal accounts record user balances, enterprise accounts include settlement and basic accounts, while internal accounts serve the payment company's own needs (e.g., reserve, long‑term, short‑term accounts).

All accounts record two types of information

(1) Basic Information

Account number

Account type

Balance

Currency

Status

Opening date

Additional permission controls may include recharge allowance, withdrawal allowance, and negative balance allowance.

(2) Transaction Flow Information

All changes since account opening, such as deposits, withdrawals, and freezes.

Accounting Flow

The account management system provides interfaces for opening accounts, bookkeeping, updating account information, and querying.

Account Use Cases (Merchant Side)

(1) Account Opening

Merchant A (an e‑commerce platform) integrates quick pay, negotiates a 1% transaction fee with a prepaid fee of 10,000 CNY, and adopts real‑time D0 settlement.

Settlement account: receives funds after merchant transactions.

Basic account: merchant balance, withdrawable after settlement.

Fee account: stores transaction fees.

Balances after opening are shown in the diagram.

(2) Collection Transaction

A user purchases a 1,000 CNY phone via quick pay; the merchant's settlement account increases by 1,000 CNY. A 1% fee (10 CNY) is recorded in the fee account, leaving 990 CNY.

At 4 PM, settlement moves funds from the settlement account to the basic account.

Account changes are illustrated in the diagram.

(3) Withdrawal

At 4:30 PM, the merchant withdraws 600 CNY, incurring a 2 CNY fee. The basic account balance becomes 400 CNY, and the fee account reduces to 9,988 CNY.

Withdrawal flow is shown in the diagram.

3. Accounting System

Accounting subjects are categorized as assets, liabilities, mixed, equity, and profit‑and‑loss accounts. Asset accounts have debit balances, liability accounts have credit balances, and mixed accounts can be either.

Subjects are divided into general ledger (primary) and detailed ledger (secondary) accounts. Only leaf accounts can hold balances.

Common accounting subjects include:

Asset: bank deposits, accounts receivable, in‑transit allocations.

Liability: personal balance accounts, corporate balance accounts, payable accounts.

Mixed (mainly settlement): pending settlement recharge, pending settlement withdrawal, pending settlement payment.

The mapping between accounting subjects and accounts is illustrated in the diagram.

4. Business Process

1. Overall Transaction Flow

Key systems involved:

Transaction gateway: handles user deposit/withdrawal/payments.

Fund allocation system: invokes accounting for fund transfers and handles long/short‑term funds.

Other systems: request accounting services.

Account system records each transaction's receipt and payment details.

Accounting system records double‑entry bookkeeping based on business needs.

Settlement system performs clearing, calculates amounts for each account, triggers payouts, and performs reconciliation.

2. Account and Accounting Processing Flow

Each transaction generates an account ledger entry and one or more accounting entries. The account system is a prerequisite for the accounting system.

After the front‑end payment order is created, the payment core packages the transaction, sends it to the bank, receives confirmation, and completes the transaction.

To improve performance, transaction processing is separated from accounting. Successful transactions are forwarded to the account system as ledger entries.

The account system assigns a ledger number, calculates fees, and updates balances either in real‑time or batch mode.

Accounting entries are later batch‑processed, supporting one‑debit‑one‑credit, one‑debit‑multiple‑credit, and multiple‑debit‑one‑credit patterns.

Daily end‑of‑day batch processes reconcile account balances with accounting balances, marking the completion of the bookkeeping cycle.

backendpaymentaccountingfinancial systemsTransaction Model
Architecture Digest
Written by

Architecture Digest

Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.