Generate Report
Generate a new report for transactions, payouts, settlements, or other data.
POST
https://api.zenpayz.com/merchant/api/v1/reports/generateBearer · 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 |
Content-Type REQUIRED | application/json |
Body Parameters
| Parameter | Type | Description |
|---|---|---|
type REQUIRED | string | Report type: transactions, payouts, settlements, refunds, customers |
format OPTIONAL | string | Output format: csv, xlsx, pdf (default: csv) |
startDate REQUIRED | string | Start date (ISO 8601) |
endDate REQUIRED | string | End date (ISO 8601) |
filters OPTIONAL | object | Additional filters based on report type |
columns OPTIONAL | array | Specific columns to include |
Response
Success (201 Created)
{
"success": true,
"data": {
"id": "rep_550e8400-e29b-41d4-a716-446655440000",
"merchantId": "mer_xxxxx",
"type": "transactions",
"format": "csv",
"status": "processing",
"startDate": "2024-01-01T00:00:00.000Z",
"endDate": "2024-01-31T23:59:59.999Z",
"createdAt": "2024-01-15T10:30:00.000Z"
}
}
Report Status
| Status | Description |
|---|---|
pending | Report queued for processing |
processing | Report is being generated |
completed | Report ready for download |
failed | Report generation failed |
Examples
- cURL
- SDK
curl -X POST https://api.zenpayz.com/merchant/api/v1/reports/generate \
-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" \
-d '{
"type": "transactions",
"format": "csv",
"startDate": "2024-01-01T00:00:00.000Z",
"endDate": "2024-01-31T23:59:59.999Z"
}'
const report = await zenpays.reports.generate({
type: 'transactions',
format: 'csv',
startDate: '2024-01-01T00:00:00.000Z',
endDate: '2024-01-31T23:59:59.999Z',
});
console.log(report.id); // rep_550e8400...