Refund Statistics
Get refund statistics and metrics.
GET
https://api.zenpayz.com/merchant/api/v1/refund-intents/statsBearer · API key
Request
Headers
| Header | Description |
|---|---|
Authorization REQUIRED | Bearer {api_key} |
X-Signature REQUIRED | HMAC-SHA256 signature |
X-Timestamp REQUIRED | ISO 8601 timestamp |
X-Secret-Salt REQUIRED | Secret salt for HMAC validation |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
startDate OPTIONAL | string30 days ago | Start date (ISO format) |
endDate OPTIONAL | stringnow | End date (ISO format) |
currency OPTIONAL | string- | Filter by currency code |
Response
Success (200 OK)
{
"success": true,
"data": {
"total": 150,
"pending": 5,
"approved": 3,
"rejected": 1,
"processing": 2,
"completed": 135,
"failed": 3,
"cancelled": 1,
"totalAmount": 250000,
"averageAmount": 1666.67,
"averageProcessingTime": 285633,
"refundRate": 90
}
}
Response Fields
| Parameter | Type | Description |
|---|---|---|
total OPTIONAL | number | Total number of refunds |
pending OPTIONAL | number | Refunds pending approval |
approved OPTIONAL | number | Approved, awaiting processing |
rejected OPTIONAL | number | Rejected by admin |
processing OPTIONAL | number | Currently being processed by TSP |
completed OPTIONAL | number | Successfully completed refunds |
failed OPTIONAL | number | Failed refunds |
cancelled OPTIONAL | number | Cancelled refunds |
totalAmount OPTIONAL | number | Sum of all refund amounts |
averageAmount OPTIONAL | number | Average refund amount |
averageProcessingTime OPTIONAL | number | Average processing time in milliseconds |
refundRate OPTIONAL | number | Percentage of completed refunds (completed / total * 100) |
Examples
- cURL
- SDK
curl -X GET "https://api.zenpayz.com/merchant/api/v1/refund-intents/stats?startDate=2026-01-01&endDate=2026-03-28" \
-H "Authorization: Bearer zp_test_xxxxx" \
-H "X-Timestamp: 2026-03-28T10:30:00.000Z" \
-H "X-Signature: a1b2c3d4e5f6..." \
-H "X-Secret-Salt: your_secret_salt"
const stats = await zenpays.refunds.getStats('2026-01-01', '2026-03-28');
console.log(`Total: ${stats.total}, Completed: ${stats.completed}`);
console.log(`Refund rate: ${stats.refundRate}%`);
console.log(`Total amount: ${stats.totalAmount}`);
Related Endpoints
- List Refunds — Get individual refund records
- Get Refund — Get details of a specific refund