Skip to main content

Chargeback Analytics

Retrieve time-series chargeback analytics data with configurable granularity.

GEThttps://api.zenpayz.com/merchant/api/v1/chargebacks/analytics
Bearer · API key

Request

Headers

HeaderDescription
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
Content-Type
REQUIRED
application/json
X-Merchant-Id
REQUIRED
Merchant identifier
X-Request-Id
REQUIRED
Unique request identifier

Query Parameters

ParameterTypeDescription
startDate
OPTIONAL
stringStart date filter (ISO 8601)
endDate
OPTIONAL
stringEnd date filter (ISO 8601)
granularity
OPTIONAL
stringTime bucket size: day, week, month (default: day)
currency
OPTIONAL
stringFilter by ISO 4217 currency code

Response

Success (200 OK)

{
"success": true,
"data": {
"granularity": "day",
"currency": "USD",
"timeSeries": [
{
"date": "2024-01-13",
"totalChargebacks": 3,
"totalAmount": 450.00,
"wonCount": 1,
"lostCount": 1,
"pendingCount": 1
},
{
"date": "2024-01-14",
"totalChargebacks": 5,
"totalAmount": 820.50,
"wonCount": 3,
"lostCount": 0,
"pendingCount": 2
},
{
"date": "2024-01-15",
"totalChargebacks": 2,
"totalAmount": 175.25,
"wonCount": 0,
"lostCount": 1,
"pendingCount": 1
}
]
},
"message": "Chargeback analytics retrieved successfully",
"error": null,
"meta": {
"request_id": "req_xxxxx",
"timestamp": "2024-01-15T10:30:00.000Z",
"processing_time_ms": 68,
"api_version": "v1",
"endpoint": "GET /chargebacks/analytics",
"user_type": "merchant"
}
}

Error Responses

CodeHTTPMessage
VALIDATION_ERROR400Invalid query parameters
UNAUTHORIZED401Invalid API key

Examples

curl -X GET "https://api.zenpayz.com/merchant/api/v1/chargebacks/analytics?startDate=2024-01-01T00:00:00.000Z&endDate=2024-01-31T23:59:59.000Z&granularity=day&currency=USD" \
-H "Authorization: Bearer zp_test_xxxxx" \
-H "X-Timestamp: 2024-01-15T10:30:00.000Z" \
-H "X-Signature: a1b2c3d4e5f6..." \
-H "X-Secret-Salt: your_secret_salt" \
-H "Content-Type: application/json" \
-H "X-Merchant-Id: merch_xxxxx" \
-H "X-Request-Id: req_xxxxx"