Skip to main content

Balance API

The Balance API lets you check your merchant account balances across all supported currencies. Use it to monitor available funds, track frozen amounts from pending payouts, and verify sufficient funds before initiating withdrawals.
Balances are returned per currency within a single balance object. Each currency tracks value (available) and value_freezing (frozen). The value_blocking and enabled fields are currently constant compatibility fields in the runtime response.

Retrieve Balances

Use the balance.get method to retrieve your current balances for all currencies. Endpoint: POST https://api.bafanglaicai88.com/public/api/multihub/v1

Request

Response

Successful responses return HTTP 200. Error responses return HTTP 400. Always check the success field to determine if the request was processed correctly.

Error Response

If the request fails (e.g., invalid authentication), the response will contain an error field with HTTP 400:

Response Fields

Envelope Fields

Balance Object

Amount Entry Fields

All monetary values are returned as integers in minor units (e.g., paise for INR, centavos for MXN). For example, 150000 INR = 1,500.00 INR. Use integer or decimal arithmetic to avoid floating-point precision issues.
Balance values:
  • value — funds you can use right now for new withdrawals or payouts
  • value_freezing — funds reserved by pending withdrawals that have not yet completed. These are temporarily locked and cannot be used for new operations
  • value_blocking — currently a constant compatibility field with value 0
When a withdrawal completes, frozen funds are released and debited. If a withdrawal fails, frozen funds return to value.

Multi-Currency Support

The balance.get method returns balances for all currencies associated with your merchant account in a single balance.amounts array. There is no need to query each currency separately. If your merchant account is configured for multiple currencies (e.g., INR, MXN, TRY, ARS, AUD, LKR, UYU), you will see an entry for each one in the amounts array. Currencies with no activity will not appear in the response.

Usage Example: Check Balance Before Withdrawal

How Balance Changes

Your balance updates automatically in response to payment lifecycle events:
Balance changes are reflected immediately after each event. You can poll balance.get to track updates in real time, or use webhooks to receive notifications when payment events occur.

Authentication

All API requests use the same authentication mechanism: The hash is computed as:
Where requestBody is the JSON string of the request body exactly as sent, and secretKey is your merchant secret key.