Ledger & Balance
This is the most important concept to understand before touching any financial operations. Almost every issue with balances and account connections comes from not understanding what a ledger is.
What is a Ledger?
Think of a ledger like a bank account number that multiple cards and wallets can all draw from. The money lives in the ledger; the accounts are just ways to access it.
How do I create a Ledger?
You don't create one directly. A ledger is created automatically when you create your first virtual account without specifying a ledgerId.
That ledgerId is now the ID of your ledger. Save it β you'll use it to attach other accounts.
What is the "base account"?
Every financial user or entity in your system should have one base account.
How do I attach other accounts to the same Ledger?
Pass the ledgerId from your virtual account when creating any other account type:
Now base, card, and wallet all share the same balance pool.
What does "shared balance" mean in practice?
All accounts on the same ledger draw from the same pool of funds. If you fund the virtual account with 100 DUSD, that 100 DUSD is accessible from the card and the wallet too β not copies of it, the same balance.
Transfers between accounts on the same ledger are internal β they're just bookkeeping moves, no external payment rails involved.
What assets can a Ledger hold?
The format is always SYMBOL/DECIMALS. Amounts are always strings in the SDK to preserve precision.
What is a Balance?
Each asset in a ledger has four balance fields:
What is the difference between a Movement and a Transaction?
Use movements when you want the history of one account. Use transactions when you want the full picture of a transfer between accounts.
What's next
β Accounts β the six account types and how to use them