Skip to main content

Withdrawal Statistics

Get aggregated metrics on your disbursements to track your performance.

Endpoint

GET /api/withdraws/statistics

Query parameters

ParameterTypeRequiredDescription
startDateStringStart date (format: yyyy-MM-dd)
endDateStringEnd date (format: yyyy-MM-dd)
Default period

If no dates are specified, statistics cover all withdrawals in your account.

Request examples

Global statistics

curl -X GET "https://app.awdpay.com/api/withdraws/statistics" \
-H "Authorization: Bearer $AWDPAY_TOKEN"

Current month statistics

curl -X GET "https://app.awdpay.com/api/withdraws/statistics?startDate=2025-01-01&endDate=2025-01-31" \
-H "Authorization: Bearer $AWDPAY_TOKEN"

Last 7 days

curl -X GET "https://app.awdpay.com/api/withdraws/statistics?startDate=2025-01-08&endDate=2025-01-15" \
-H "Authorization: Bearer $AWDPAY_TOKEN"

Response

{
"totalWithdrawals": 248,
"successfulWithdrawals": 231,
"failedWithdrawals": 12,
"pendingWithdrawals": 5,
"totalAmount": 12450000.00,
"successAmount": 11800000.00,
"failedAmount": 450000.00,
"pendingAmount": 200000.00,
"totalFees": 187500.00,
"currency": "XOF",
"successRate": 93.15,
"averageAmount": 50201.61,
"largestWithdrawal": 500000.00,
"smallestWithdrawal": 1000.00,
"byGateway": [
{
"gatewayName": "wave-senegal",
"count": 145,
"totalAmount": 7250000.00,
"successCount": 142,
"failedCount": 3
},
{
"gatewayName": "orange-money-sn",
"count": 103,
"totalAmount": 5200000.00,
"successCount": 89,
"failedCount": 9
}
],
"byCountry": [
{
"country": "SN",
"count": 210,
"totalAmount": 10500000.00
},
{
"country": "CI",
"count": 38,
"totalAmount": 1950000.00
}
]
}

Response fields

Global metrics

FieldTypeDescription
totalWithdrawalsIntegerTotal number of withdrawals
successfulWithdrawalsIntegerNumber of successful withdrawals
failedWithdrawalsIntegerNumber of failed withdrawals
pendingWithdrawalsIntegerNumber of pending withdrawals
totalAmountDoubleTotal amount of all withdrawals
successAmountDoubleTotal amount of successful withdrawals
failedAmountDoubleTotal amount of failed withdrawals
pendingAmountDoubleTotal amount of pending withdrawals
totalFeesDoubleTotal fees charged
currencyStringMain currency
successRateDoubleSuccess rate (%)
averageAmountDoubleAverage withdrawal amount
largestWithdrawalDoubleLargest withdrawal
smallestWithdrawalDoubleSmallest withdrawal

Breakdown by gateway

FieldTypeDescription
gatewayNameStringGateway name
countIntegerNumber of withdrawals
totalAmountDoubleTotal amount
successCountIntegerNumber of successful withdrawals
failedCountIntegerNumber of failed withdrawals

Breakdown by country

FieldTypeDescription
countryStringCountry code
countIntegerNumber of withdrawals
totalAmountDoubleTotal amount

Usage example

async function getMonthlyReport(year, month) {
const startDate = `${year}-${month.toString().padStart(2, '0')}-01`;
const lastDay = new Date(year, month, 0).getDate();
const endDate = `${year}-${month.toString().padStart(2, '0')}-${lastDay}`;

const response = await fetch(
`https://app.awdpay.com/api/withdraws/statistics?startDate=${startDate}&endDate=${endDate}`,
{ headers: { 'Authorization': `Bearer ${token}` } }
);

const stats = await response.json();

console.log(`Month report ${month}/${year}`);
console.log(`Total: ${stats.totalWithdrawals} withdrawals`);
console.log(`Success rate: ${stats.successRate.toFixed(2)}%`);
console.log(`Total amount: ${stats.totalAmount.toLocaleString()} ${stats.currency}`);
console.log(`Total fees: ${stats.totalFees.toLocaleString()} ${stats.currency}`);

return stats;
}

Next step

➡️ Webhooks — Receive real-time notifications