Get from zero to your first transactions. By the end you have funded an account, split a payment, and read the resulting balances, all using Numscript.
Estimated effort: 5 minutes
Prerequisites
Record your first transaction#
Create a ledger
POST/api/ledger/v2/main
This creates a ledger named main. Every account and transaction in this guide lives here.
Fund a user account
Split a payment
Check balances
GET/api/ledger/v2/main/accounts
Ledger returns these balances:
| Account | Balance (USD/2) | Meaning |
|---|---|---|
user:alice | 7000 | $70.00 remaining |
merchant:bob | 2700 | $27.00 (90% of $30) |
platform:fees | 300 | $3.00 (10% of $30) |
Every cent is accounted for. The sum of all non-world balances equals the total funded.
What just happened#
- Double-entry: every
sendcreates balanced movements — what leaves one account enters another @world: a special infinite source/sink for money entering and exiting the ledgerUSD/2: Universal Monetary Notation — the asset type and precision, no floating-point- Splits: Numscript natively handles percentage splits with
remainingcatching rounding - Scarcity: the ledger rejects transactions when the source account has insufficient funds