API conventions
Pagination
List endpoints return results newest first, in cursor-based pages. New records added while you page do not shift the pages you have not read yet.
Paging with a cursor
limitis the page size: 1–100, default 20.- Responses look like
{ data, next_before }. For the next page, sendnext_beforeback as thebeforeparameter. - When
next_beforeisnull, you are on the last page. - Treat the cursor as opaque. Depending on the endpoint it may be an id, a timestamp or a number; never build one yourself.
{
"data": [
{ "id": "0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b", "object": "invoice", "status": "paid" },
{ "id": "9e8d7c6b-5a4f-4e3d-8c2b-1a0f9e8d7c6b", "object": "invoice", "status": "paid" }
],
"next_before": "9e8d7c6b-5a4f-4e3d-8c2b-1a0f9e8d7c6b"
}Walking every page
The SDKs’ listAll helpers fetch pages lazily, one after another:
curl "https://hisarpay.com/v1/invoices?status=paid,overpaid&limit=100" \
-H "Authorization: Bearer $HISARPAY_API_KEY"
# next page: with next_before from the previous response
curl "https://hisarpay.com/v1/invoices?status=paid,overpaid&limit=100&before=9e8d7c6b-5a4f-4e3d-8c2b-1a0f9e8d7c6b" \
-H "Authorization: Bearer $HISARPAY_API_KEY"for await (const invoice of hisarpay.invoices.listAll({ status: ['paid', 'overpaid'], limit: 100 })) {
console.log(invoice.id, invoice.paid_amount);
}foreach ($hisarpay->invoices->listAll(['status' => ['paid', 'overpaid'], 'limit' => 100]) as $invoice) {
echo $invoice['id'], PHP_EOL;
}for invoice in client.invoices.list_all({"status": ["paid", "overpaid"], "limit": 100}):
print(invoice["id"], invoice["paid_amount"])Filters
| Endpoint | Parameter | Values |
|---|---|---|
GET /v1/invoices | status | Comma-separated statuses: pending, partial, paid, overpaid, expired, cancelled |
GET /v1/invoices | q | Invoice id, order id, description, e-mail, address or txid |
GET /v1/invoices | token · source | TRX or USDT; api, panel, link, telegram |
GET /v1/invoices | created_from · created_to | When it was made: 2026-12-01, or a time with its zone |
GET /v1/withdrawals | status · source · token · q · created_from · created_to | The same; sources are panel, api, auto, admin |
GET /v1/payment-links | active | true · false |
GET /v1/events | type | A single event type |
GET /v1/balance-transactions | token | Required: TRX or USDT; limit up to 200 |