API reference
Invoices
Create, look up and cancel invoices, and simulate payments in test mode. Details in the guide →
- POST/v1/invoicesCreate an invoice
- GET/v1/invoicesList invoices (newest first)
- GET/v1/invoices/by-order/{order_id}Get an invoice by your order id
- GET/v1/invoices/{id}Get an invoice with its payments
- POST/v1/invoices/{id}/cancelCancel a pending invoice with nothing received
- POST/v1/invoices/{id}/simulateSimulate a payment (test keys only)
/v1/invoicesCreate an invoice
invoicesKey: live or testSend price_usd, or token together with amount; price_usd cannot be combined with amount. A repeated order_id returns the existing invoice with 200.
Request body
price_usdstringoptionalPrice in USD, from the minimum (
GET /v1/tokens) to 10,000,000. Withouttokenthe customer picks the coin.pattern ^(0|[1-9]\d{0,11})(\.\d{1,2})?$
tokenstringoptionalFix the coin: "TRX" or "USDT".
Values:
TRXUSDTamountstringoptionalAmount in the coin (with
token). Cannot be combined withprice_usd.pattern ^(0|[1-9]\d{0,11})(\.\d{1,6})?$
tokensarray<string>optionalCoins the customer may choose from. Default: all.
Values:
TRXUSDT≥ 1 items
order_idstringoptionalYour order id. Repeating it returns the existing invoice.
1–128 chars
descriptionstringoptional≤ 500 chars
success_urlstring (url)optional≤ 2048 chars
return_urlstring (url)optional≤ 2048 chars
callback_urlstring (url)optionalExtra webhook destination for this invoice (https; signed with your default endpoint secret).
≤ 2048 chars
expires_in_minutesintegeroptional5–1440
metadataobjectoptionalcustomer_emailstring (email)optionalWhere the payer gets their receipt, if your account sends receipts
≤ 200 chars · pattern ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
fee_paid_by_customerbooleanoptional
Responses
- 200 OKReturns the Invoice object
- 201 CreatedReturns the Invoice object
- 400 Bad RequestError object
curl -X POST https://hisarpay.com/v1/invoices \
-H "Authorization: Bearer $HISARPAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"price_usd": "49.90",
"order_id": "order_1001",
"description": "Pro plan, 1 month",
"success_url": "https://shop.example/thanks"
}'/v1/invoicesList invoices (newest first)
Filters can be combined. q finds an invoice by its id or the beginning of it, its order id, payment address or transaction id, or by part of its description or customer e-mail.
invoicesKey: live or testQuery parameters
statusstringoptionalComma-separated: pending, partial, paid, overpaid, expired, cancelled
sourcestringoptionalComma-separated: api, panel, link, telegram
tokenstringoptionalCoin: TRX or USDT.
Values:
TRXUSDTcreated_fromstringoptionalCreated at or after. A day like 2026-12-01 (UTC) or a time like 2026-12-01T09:30:00Z
created_tostringoptionalCreated before. A day is taken in whole
qstringoptionalSearch text
≤ 100 chars
limitintegeroptionalPage size.
1–100
beforestring (uuid)optionalnext_before from the previous response, for the next page.
Responses
- 200 OKJSON response
2 fields
dataarray<Invoice>next_beforestring | number· nullable
curl "https://hisarpay.com/v1/invoices?limit=20" \
-H "Authorization: Bearer $HISARPAY_API_KEY"/v1/invoices/by-order/{order_id}Get an invoice by your order id
invoicesKey: live or testPath parameters
order_idstringrequiredThe order_id you set when creating the invoice.
1–128 chars
Responses
- 200 OKReturns the Invoice object
curl https://hisarpay.com/v1/invoices/by-order/order_1001 \
-H "Authorization: Bearer $HISARPAY_API_KEY"/v1/invoices/{id}Get an invoice with its payments
invoicesKey: live or testPath parameters
idstring (uuid)requiredThe record id.
Responses
- 200 OKReturns the Invoice object
curl https://hisarpay.com/v1/invoices/0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b \
-H "Authorization: Bearer $HISARPAY_API_KEY"/v1/invoices/{id}/cancelCancel a pending invoice with nothing received
invoicesKey: live or testPath parameters
idstring (uuid)requiredThe record id.
Responses
- 200 OKReturns the Invoice object
curl -X POST https://hisarpay.com/v1/invoices/0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b/cancel \
-H "Authorization: Bearer $HISARPAY_API_KEY"/v1/invoices/{id}/simulateSimulate a payment (test keys only)
invoicesKey: test onlyPath parameters
idstring (uuid)requiredThe record id.
Request body
outcomestringrequiredValues:
paidpartialoverpaidexpiredamountstringoptionalpattern ^(0|[1-9]\d{0,11})(\.\d{1,6})?$
Responses
- 200 OKReturns the Invoice object
curl -X POST https://hisarpay.com/v1/invoices/0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b/simulate \
-H "Authorization: Bearer $HISARPAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"outcome": "partial",
"amount": "13"
}'