Get Balance Specific Day
curl --request GET \
--url https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance/history"
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/history', 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/history",
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/history"
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/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance/history")
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": 15000,
"available_balance": 10000,
"reserve_balance": 0,
"fee": null
}
Account
Get Balance Specific Day
Check what the account balance was on a specific day
GET
/
v2
/
account
/
{merchantId}
/
balance
/
history
Get Balance Specific Day
curl --request GET \
--url https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance/history"
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/history', 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/history",
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/history"
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/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/balance/history")
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": 15000,
"available_balance": 10000,
"reserve_balance": 0,
"fee": null
}
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:
12string
required
Enter the date in the following format: YYYY-MM-DDExample:
2024-01-15Response
number
Example:
15000number
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/history'?date=2025-01-15 \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}'
const merchantId = 'your_merchant_id';
const date = '2024-01-15';
const response = await fetch(
`https://api.wepayments.com/v2/account/${merchantId}/balance/history?date=${date}`,
{
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
}
);
const data = await response.json();
console.log('Balance on', date, ':', data.balance);
import requests
merchant_id = 'your_merchant_id'
date = '2024-01-15'
url = f'https://api.wepayments.com/v2/account/{merchant_id}/balance/history'
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
params = {'date': date}
response = requests.get(url, headers=headers, params=params)
data = response.json()
print(f"Balance on {date}: {data['balance']}")
{
"balance": 15000,
"available_balance": 10000,
"reserve_balance": 0,
"fee": null
}
Use Cases
Historical Balance Tracking
Historical Balance Tracking
Track balance changes over time for reporting and reconciliation:
async function getBalanceHistory(merchantId, startDate, endDate) {
const dates = generateDateRange(startDate, endDate);
const history = [];
for (const date of dates) {
const balance = await getBalanceSpecificDay(merchantId, date);
history.push({ date, ...balance });
}
return history;
}
End-of-Day Reconciliation
End-of-Day Reconciliation
Verify end-of-day balances for accounting purposes:
async function reconcileEndOfDay(merchantId, date) {
const balance = await getBalanceSpecificDay(merchantId, date);
const transactions = await getTransactionsForDay(merchantId, date);
// Compare calculated vs actual balance
const calculatedBalance = calculateBalance(transactions);
const difference = balance.balance - calculatedBalance;
if (difference !== 0) {
console.warn(`Reconciliation mismatch: ${difference}`);
}
return { balance, transactions, difference };
}
Financial Reporting
Financial Reporting
Generate balance reports for specific periods:
async function generateMonthlyReport(merchantId, year, month) {
const daysInMonth = new Date(year, month, 0).getDate();
const report = [];
for (let day = 1; day <= daysInMonth; day++) {
const date = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`;
const balance = await getBalanceSpecificDay(merchantId, date);
report.push({ date, balance: balance.balance });
}
return report;
}
Audit Trail
Audit Trail
Create an audit trail of balance changes:
async function auditBalanceChanges(merchantId, dates) {
const audit = [];
for (let i = 0; i < dates.length - 1; i++) {
const currentBalance = await getBalanceSpecificDay(merchantId, dates[i]);
const nextBalance = await getBalanceSpecificDay(merchantId, dates[i + 1]);
const change = nextBalance.balance - currentBalance.balance;
audit.push({
date: dates[i],
balance: currentBalance.balance,
change: change,
percentChange: (change / currentBalance.balance) * 100
});
}
return audit;
}
Date Format
Thedate parameter must be in the format YYYY-MM-DD:
- ✅ Valid:
2024-01-15 - ✅ Valid:
2023-12-31 - ❌ Invalid:
15/01/2024 - ❌ Invalid:
01-15-2024 - ❌ Invalid:
2024/01/15
Response Fields
balance
The total balance in the account on the specified date.available_balance
The balance available for withdrawal or transactions on the specified date.reserve_balance
The amount held in reserve on the specified date (if applicable).fee
Fee balance on the specified date (only applicable when the account is configured to receive fees in a wallet).Best Practices
Historical Data Availability: Balance history is typically available for the past 90 days. Check with your account manager for specific data retention policies.
Rate Limiting: When querying multiple dates, implement rate limiting to avoid hitting API limits. Consider batching requests or adding delays between calls.
Caching: Historical balance data doesn’t change. Cache responses indefinitely to improve performance and reduce API calls.
Was this page helpful?

