Overview
TheAccountsAPI
provides methods to list accounts and retrieve balance information. All account operations are accessed through the client.accounts
property.
Methods
list()
List all accounts owned by the current user.account_type
(optional): Filter by account type"uk_retail"
- Personal current accounts"uk_retail_joint"
- Joint current accounts
list[Account]
- List of account objects
Example:
get_balance()
Get balance information for a specific account.account_id
: The unique account identifier
Balance
- Account balance information
Example:
Data Models
Account
Represents a Monzo account.uk_retail
- Personal current accountuk_retail_joint
- Joint current accountuk_prepaid
- Prepaid card (legacy)
Balance
Represents account balance information.Usage Examples
Basic Account Information
Account Type Filtering
Balance Details
Account Summary Dashboard
Error Handling
Working with Account Metadata
Mock Mode
When using mock mode (access_token="test"
), the accounts API returns predefined test data:
- 2 sample accounts (current and savings)
- Realistic balance information
- Proper account structure and IDs
- Simulated spend_today values
Best Practices
- Cache Account Lists: Account information doesn’t change frequently, so cache the results
- Handle Closed Accounts: Check
account.closed
before performing operations - Currency Awareness: Always check
balance.currency
when displaying amounts - Error Handling: Wrap API calls in try/catch blocks for robust error handling
- Rate Limiting: Be mindful of API rate limits when making multiple balance requests