Skip to main content
GET
/
api
/
agent_balance
{
  "balance": {
    "balance": 0,
    "overdraft": 2000
  }
}

Overview

Returns the current balance and overdraft limit for your merchant account. All amounts are returned in cents.

Endpoint

GET /api/agent_balance

Authentication

API-KEY
string
required
Your CashQ API Key for authentication

Request Example

curl -X GET 'https://api.cashqbot.com/api/agent_balance' \
  -H 'API-KEY: your_api_key_here'

Response

balance
object
Balance information for the merchant account

Response Example

{
  "balance": {
    "balance": 0,
    "overdraft": 2000
  }
}

Understanding the Response

Balance Calculation

Your available funds = balance + overdraft Example:
  • Balance: 1000 cents ($10.00)
  • Overdraft: 2000 cents ($20.00)
  • Available funds: 3000 cents ($30.00)

When to Check Balance

Before Transfers

Check balance before initiating large transfers to ensure sufficient funds

Regular Monitoring

Monitor balance regularly to avoid insufficient funds errors

After Deposits

Verify balance after adding funds to your account

Error Recovery

Check balance when receiving insufficient funds errors

Error Responses

Error CodeDescriptionSolution
authentication_errorInvalid or missing API keyVerify your API key is correct and included in the header
internal_server_errorServer error occurredRetry the request after a brief delay

Best Practices

Don’t check balance before every single transaction. Cache the balance for a reasonable time (e.g., 5 minutes) to reduce API calls.
Remember to include overdraft when calculating available funds. Don’t just check the balance field.
Balance is returned in cents. Always divide by 100 when displaying to users.
Set up automated monitoring to alert you when balance falls below a threshold.