Download Report
Download a completed report file.
GET
https://api.zenpayz.com/merchant/api/v1/reports/:id/downloadBearer · 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 |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id OPTIONAL | string | Report ID |
Response
Success (200 OK)
Returns the report file with appropriate content-type header:
text/csvfor CSV reportsapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetfor XLSXapplication/pdffor PDF reports
Error Responses
| Code | HTTP | Message |
|---|---|---|
| REPORT_NOT_FOUND | 404 | Report does not exist |
| REPORT_NOT_READY | 400 | Report is still processing |
Examples
- cURL
- SDK
curl -X GET "https://api.zenpayz.com/merchant/api/v1/reports/rep_550e8400/download" \
-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" \
-o report.csv
const fileBuffer = await zenpays.reports.download('rep_550e8400');
// Save to file
fs.writeFileSync('report.csv', fileBuffer);