Python SDK
Check Balances
Learn how to check available balances for your AI Agent and customers
Overview
The Balances API allows you to check available funds for both your AI Agent and your customers. A balance is considered “spendable” when:
- Funds have been fully verified and received
- Funds aren’t reserved for pending tasks
Check Agent Balance
Check your AI Agent’s available balance in a specific currency:
Parameters
Parameter | Description |
---|---|
currency | Currency code (e.g., ‘USD’, ‘USDC’) |
Check Customer Balance
Check a specific customer’s available balance:
Parameters
Parameter | Description |
---|---|
customer_id | Your system’s customer ID or Payman’s customer ID |
currency | Currency code (e.g., ‘USD’, ‘USDC’) |
Response Format
Both methods return a float representing the spendable balance in the currency’s units:
For cryptocurrencies, the appropriate decimal places are used:
Type Hints
Error Handling
Using Both Together
You can check both balances to compare available funds:
Balances are always returned in the currency’s natural units. For USD, this means dollars (e.g., 10.50 is $10.50). For USDC, this means whole tokens with 6 decimal places (e.g., 1.000000 is 1 USDC).