Get Balance
curl --request GET \
--url https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"balance": 10000,
"available_balance": 10000,
"reserve_balance": 0
}
{
"error": "Internal server error"
}
Account
Get Balance
Check the balance of all the accounts you have access to
GET
/
v2
/
account
/
{merchantId}
/
balance
Get Balance
curl --request GET \
--url https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"balance": 10000,
"available_balance": 10000,
"reserve_balance": 0
}
{
"error": "Internal server error"
}
Path Parameters
string
required
Merchant ID
Query Parameters
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: BRLstring
ID of your recipientExample:
12Response
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
number
Example:
12000number
Example:
10000number
Example:
0number 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: 100Request 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
}
{
"error": "Internal server error"
}
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
Check Available Funds
Check Available Funds
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
}
Multi-Currency Balance
Multi-Currency Balance
Check balances across different currencies:
const currencies = ['USD', 'BRL', 'EUR'];
const balances = await Promise.all(
currencies.map(currency =>
getBalance(merchantId, { currency })
)
);
Monitor Reserve Balance
Monitor Reserve Balance
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.Was this page helpful?

