Documentation Index
Fetch the complete documentation index at: https://docs.zuba.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Zuba ledger system implements a robust double-entry bookkeeping system that tracks all financial movements across the platform. Every transaction is recorded as transfers between named accounts, providing complete audit trails and real-time balance tracking.Core Concepts
Accounts
Accounts represent financial entities in the system and are identified by unique names with currency support. When querying your balances, you’ll see:Account Balance Response
| Field | Description |
|---|---|
currency | ISO 4217 currency code |
balance | Available balance (funds you can use) |
pendingIn | Incoming funds being processed |
pendingOut | Outgoing funds being processed |
totalBalance | Total balance including pending |
isActive | Whether the account is active |
lastTransactionAt | Timestamp of most recent transaction |
Account Naming Convention
Accounts use hierarchical naming with colon (:) separators to organize different types of financial entities:
| Pattern | Description | Example |
|---|---|---|
user:{clientId} | Customer/client accounts | user:cc82fa1d-fc7a-478c-a734-d3bce40464e7 |
zuba:{purpose} | Platform system accounts | zuba:deposits, zuba:payouts, zuba:fees:EUR |
{provider}:{identifier} | Provider accounts | revolut:payouts, stripe:card |
ext:{identifier} | External beneficiary accounts | ext:DE89370400440532013000 |
fx:{identifier} | Foreign exchange accounts | fx:partner |
Transactions
All financial movements are recorded as double-entry transactions. When querying transactions, you’ll see them from your account’s perspective as debits (money out) or credits (money in):Transaction Structure
| Field | Description |
|---|---|
id | Unique transaction identifier |
type | debit (money out) or credit (money in) |
amount | Transaction amount |
currency | ISO 4217 currency code |
balanceAfter | Your account balance after this transaction |
counterparty | The other account involved in the transaction |
status | Transaction status (pending, confirmed, failed, cancelled) |
createdAt | When the transaction was created |
confirmedAt | When the transaction was confirmed |
Transaction States
| Status | Description | Actions Available |
|---|---|---|
pending | Transaction created, awaiting confirmation | Confirm, Cancel |
confirmed | Transaction successfully processed | View only |
failed | Transaction failed during processing | Retry, Investigate |
cancelled | Transaction cancelled before processing | View only |
Balance Management
Real-time Balance Calculation
Account balances are calculated in real-time from confirmed transactions:Multi-Currency Support
Each account maintains balances in a single currency. When querying all balances, you’ll receive a list of accounts for each currency:Multi-Currency Response
Payment Flow Integration
Ledger transactions are created automatically by the platform when processing deposits and payouts. You cannot create transactions directly - they are generated as a result of your payment operations.
Payin Transaction Flow
When a customer makes a deposit, multiple ledger transactions are created automatically: Example flow for a €100 deposit:ext:{payer_iban}→stripe:{merchant_iban}(€100.00) - External to providerstripe:{merchant_iban}→zuba:deposits(€100.00) - Provider to platformzuba:deposits→user:{clientId}(€100.00) - Platform to customer
Credit Transaction
Payout Transaction Flow
For payouts, the system creates transaction chains including FX conversion when needed: Example flow for a €100 → $108 payout:user:{clientId}→zuba:payouts(€100.00) - Debit customerzuba:payouts→fx:partner(€100.00) - Send for conversionfx:partner→revolut:payouts($108.00) - Converted amount to providerrevolut:payouts→ext:{beneficiary_iban}($108.00) - Final payout
Debit Transaction
Querying the Ledger
Account Balance
Transaction History
Audit & Compliance
Audit Trail
Every transaction maintains a complete audit trail:- Immutable Records: Transactions cannot be modified once confirmed
- Timestamps: All operations are timestamped with precision
- Metadata: Additional context stored with each transaction
- Reference IDs: Link to external provider transactions
Compliance Features
Financial Reconciliation
Financial Reconciliation
- Daily balance reconciliation across all accounts
- Provider settlement matching and verification
- Automated discrepancy detection and alerts
- Historical balance reconstruction capabilities
Regulatory Reporting
Regulatory Reporting
- Transaction history export for audits
- Real-time balance monitoring and limits
- Suspicious activity pattern detection
- Automated regulatory filing support
Data Integrity
Data Integrity
- Double-entry validation on every transaction
- Balance consistency checks across all accounts
- Automated reconciliation with external providers
- Immutable transaction records with cryptographic hashing
Advanced Features
Currency Conversion Tracking
When FX conversion occurs during a payout, you’ll see multiple transactions in your history representing the conversion:FX Debit Transaction
Account Statements
For detailed reconciliation, you can generate account statements for a specific period:Account Statement
Error Handling
Transaction Failures
When a payout or deposit fails, you may see a failed transaction in your history:Failed Transaction
Common Error Scenarios
| Error | Description | Resolution |
|---|---|---|
| Insufficient funds | Not enough balance to complete payout | Add funds to your account |
| Invalid beneficiary | Beneficiary details are incorrect | Update beneficiary information |
| Provider error | External provider issue | Retry or contact support |
Integration Guidelines
Ledger transactions are created automatically by the platform when you create payouts or receive deposits. You cannot create transactions directly - use the Payouts API to initiate transfers.
Best Practices
Balance Monitoring
Balance Monitoring
- Check balances before initiating payouts to avoid failures
- Set up webhooks for real-time balance notifications
- Use the statement endpoint for reconciliation
- Monitor pending amounts for cash flow planning
Reconciliation
Reconciliation
- Generate statements periodically for your records
- Match ledger transactions with your internal systems
- Keep track of pending transactions for accurate cash positions
- Export transaction history for accounting integration
API Usage
API Usage
- Use pagination (
limitandoffset) for large transaction histories - Filter by currency when querying specific account activity
- Cache balance responses where real-time accuracy isn’t required
- Handle rate limits gracefully with exponential backoff
Next Steps
First Payout Guide
Send your first payout with the Zuba API
Webhooks
Set up real-time notifications for payment events
Batch Payouts
Process multiple payouts efficiently
API Reference
Complete API documentation