Skip to main content
GET
https://api.sandbox.wepayout.com.br
/
v2
/
account
/
{merchantId}
/
balance
Get Balance
curl --request GET \
  --url https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance \
  --header 'Authorization: Bearer <token>'
{
  "balance": 10000,
  "available_balance": 10000,
  "reserve_balance": 0
}

Path Parameters

merchantId
string
required
Merchant ID

Query Parameters

currency
string
Currency code of your deposit account. If not provided, the default value will be DRE.Allowed values: USD, AUD, EUR, GBP, BRL, CAD, CHFExample: BRL
recipient_id
string
ID of your recipientExample: 12

Response

This status is returned in the following scenarios:
  • The search was successful
  • When the currency is incorrectly provided, the return will have this status with zeroed values
  • When the merchant has no accounts, the return will have this status with zeroed values
balance
number
Example: 12000
available_balance
number
Example: 10000
reserve_balance
number
Example: 0
fee
number or null
This field will only be different from null when the account is configured to receive fees in a wallet. Other than in this case, the balance of the other fee account(wallet) that will receive the fees is returned.Default: nullExample: 100

Request Example

curl --request GET \
  --url 'https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {token}'
{
  "balance": 10000,
  "available_balance": 10000,
  "reserve_balance": 0
}

Response Fields

balance

The total balance in the account.

available_balance

The balance available for withdrawal or transactions.

reserve_balance

The amount held in reserve (if applicable).

fee

Fee balance (only applicable when the account is configured to receive fees in a wallet).

Use Cases

Before processing a transaction, check if the merchant has sufficient available balance:
const balance = await getBalance(merchantId);
if (balance.available_balance >= transactionAmount) {
  // Proceed with transaction
} else {
  // Insufficient funds
}
Check balances across different currencies:
const currencies = ['USD', 'BRL', 'EUR'];
const balances = await Promise.all(
  currencies.map(currency => 
    getBalance(merchantId, { currency })
  )
);
Track the reserve balance to ensure compliance with reserve requirements:
const balance = await getBalance(merchantId);
if (balance.reserve_balance < requiredReserve) {
  // Alert: Reserve below threshold
}

Error Handling

Invalid Currency

When an invalid currency is provided, the API returns a 200 status with zeroed values:
{
  "balance": 0,
  "available_balance": 0,
  "reserve_balance": 0
}

No Accounts

When the merchant has no accounts, the API returns a 200 status with zeroed values:
{
  "balance": 0,
  "available_balance": 0,
  "reserve_balance": 0
}

Best Practices

Cache Balance Data: Balance information doesn’t change frequently. Consider caching the response for a short period (e.g., 1-5 minutes) to reduce API calls.
Check Available Balance: Always use available_balance rather than balance when determining if funds are available for transactions, as balance includes reserved amounts.