Balance
The Balance API allows you to retrieve your current account balance information from Chapa. This is useful for checking available funds before initiating transfers or for reconciliation purposes.
Retrieving Balance
Endpoint https://api.chapa.co/v1/balances
Method GET
Authorization
: Pass your secret key as a bearer token in the request header to authorize this call.
You can also filter balance information for a specific currency by appending the currency code to the endpoint: https://api.chapa.co/v1/balances/{currency_code}
Example:
- For USD balance:
https://api.chapa.co/v1/balances/usd
Response Parameters
Parameter | Type | Description |
---|---|---|
status | string | The status of the request (e.g., “success”) |
message | string | A descriptive message about the result |
data | array | An array of balance objects for different currencies |
Each balance object in the data
array contains:
Parameter | Type | Description |
---|---|---|
currency | string | The currency code (e.g., “ETB”, “USD”) |
available_balance | number | The balance available for transactions (withdrawals, transfers, etc.) |
ledger_balance | number | The total balance including funds that may be on hold or pending settlement |
import requestsurl = "https://api.chapa.co/v1/balances"payload = ''headers = { 'Authorization': 'Bearer CHASECK_TEST-xxxxxxxxxxxxxxxx'} response = requests.get(url, headers=headers, data=payload)data = response.textprint(data)
The balance endpoint returns all currencies associated with your account. Each currency will have its own available and ledger balance.
Understanding Balance Types
-
Available Balance: This is the amount that is available for immediate use. You can use this balance for transfers, withdrawals, and other transactions.
-
Ledger Balance: This represents the balance in your account, which are funds that are not yet available for use (funds that have not yet been settled).
Always check your available balance before initiating transfers to ensure you have sufficient funds.