Path Parameters
Query Parameters
Currency code of your deposit account. If not provided, the default value will be DRE. Allowed values: USD, AUD, EUR, GBP, BRL, CAD, CHF Example: BRL
ID of your recipient Example: 12
Enter the date in the following format: YYYY-MM-DD Example: 2024-01-15
Response
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: null Example: 100
Request 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}'
{
"balance" : 15000 ,
"available_balance" : 10000 ,
"reserve_balance" : 0 ,
"fee" : null
}
Use Cases
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
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 };
}
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 ;
}
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 ;
}
The date 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.