Money and events
Reports
Export your invoices, withdrawals and ledger movements as CSV, Excel or PDF for accounting or analysis. Reports are rendered in the background: check their status and download them once ready.
Requesting a report
POST /v1/reports queues the report and returns the report object with status pending and HTTP 202. The key needs the reports scope. The report covers the data of the key’s mode (live or test).
curl -X POST https://hisarpay.com/v1/reports \
-H "Authorization: Bearer $HISARPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "invoices",
"format": "xlsx",
"lang": "tr",
"from": "2026-10-01T00:00:00Z",
"status": [
"paid",
"overpaid"
]
}'const report = await hisarpay.reports.createAndWait({
kind: 'invoices',
format: 'xlsx',
lang: 'tr',
from: '2026-10-01T00:00:00Z',
status: ['paid', 'overpaid'],
});
const file = await hisarpay.reports.download(report.id);
await writeFile(file.filename ?? 'invoices.xlsx', file.data);$report = $hisarpay->reports->createAndWait([
'kind' => 'invoices',
'format' => 'xlsx',
'lang' => 'tr',
'from' => '2026-10-01T00:00:00Z',
'status' => ['paid', 'overpaid'],
]);
$file = $hisarpay->reports->download($report['id']);
file_put_contents($file['filename'] ?? 'invoices.xlsx', $file['data']);report = client.reports.create_and_wait({
"kind": "invoices",
"format": "xlsx",
"lang": "tr",
"from": "2026-10-01T00:00:00Z",
"status": ["paid", "overpaid"],
})
file = client.reports.download(report["id"])
with open(file["filename"] or "invoices.xlsx", "wb") as fh:
fh.write(file["data"])| Field | Description |
|---|---|
kind | What to export (see the table below). |
format | csv (default, UTF-8 with BOM), xlsx or pdf (A4 landscape). |
lang | Language of the column headers and PDF title: tr or en (default). |
from / to | ISO 8601 date range (UTC); from inclusive, to exclusive. |
status | Only rows in these states (up to 10 values). |
Report kinds
| kind | Contents | status filter |
|---|---|---|
invoices | Invoices | pending, partial, paid, overpaid, expired, cancelled |
withdrawals | Withdrawals | pending_review, queued, processing, completed, failed, rejected |
balance_transactions | Ledger movements | — |
webhook_deliveries | Webhook deliveries | pending, delivered, failed |
CSV and Excel files hold at most 10,000 rows, a PDF at most 2,000 (the newest; a PDF that was cut off says so on every page). Split longer periods into several ranges. At most three reports are prepared at once and 40 a day; once the files of the last seven days reach 100 MB no more can be asked for. The answer is rate_limited then.
Status and download
Follow the status with GET /v1/reports/{id}: pending → processing → ready (or failed). Once ready, download_url is set; download the file with the same API key. The SDKs’ createAndWait runs this loop for you.
{
"id": "7c1e9a40-2b3d-4f5e-8a6b-9c0d1e2f3a4b",
"object": "report",
"livemode": true,
"kind": "invoices",
"format": "xlsx",
"lang": "tr",
"status": "ready",
"filters": { "from": "2026-10-01T00:00:00Z", "to": null, "status": ["paid", "overpaid"] },
"row_count": 1284,
"filename": "hisarpay-invoices-2026-10-23.xlsx",
"download_url": "https://hisarpay.com/v1/reports/7c1e9a40-2b3d-4f5e-8a6b-9c0d1e2f3a4b/download",
"created_at": "2026-10-23T09:00:00.000Z",
"completed_at": "2026-10-23T09:00:04.000Z",
"expires_at": "2026-10-30T09:00:00.000Z"
}curl -o invoices.xlsx https://hisarpay.com/v1/reports/7c1e9a40-2b3d-4f5e-8a6b-9c0d1e2f3a4b/download \
-H "Authorization: Bearer $HISARPAY_API_KEY"Limits
- Up to 3 reports can be in progress at once; a fourth gets
429 rate_limited. - Files are kept for 7 days (
expires_at), then deleted.GET /v1/reportslists the last 7 days. - Exports from the dashboard share the same queue and limits.