Official SDKs
Node.js, PHP and Python libraries with typings, automatic retries and webhook verification built in.
- Node.js
- PHP
- Python
Selling on a platform without a ready-made plugin? The API lets you do everything the dashboard does, in code. It speaks JSON, reports errors in one consistent shape, and its OpenAPI definition is public.
In the dashboard, open Developers → API keys and create a key. Keep it on your server only, and optionally restrict it to specific IP addresses.
Send the price in USD; the customer picks TRX or USDT on the payment page. Reuse the same Idempotency-Key for the same order and retries after a network error are safe.
curl https://hisarpay.com/v1/invoices \
-H "Authorization: Bearer $HISARPAY_API_KEY" \
-H "Idempotency-Key: order_1001" \
-H "Content-Type: application/json" \
-d '{
"price_usd": "49.90",
"order_id": "order_1001",
"success_url": "https://shop.example/thanks"
}'Each notification carries a timestamp and an HMAC-SHA256 signature of the raw body. Verify the signature, drop duplicates by event ID and answer quickly with a 2xx.
POST /webhooks/hisarpay HTTP/1.1
Content-Type: application/json
User-Agent: HisarPay-Webhook/1.0
X-HisarPay-Event-Id: 5f0c6c1e-8a51-4c7e-9d0e-2b1f4f6a9c11
X-HisarPay-Signature: t=1760000000,v1=5257a869e7ecebeda32affa6…
{"id":"5f0c6c1e-…","type":"invoice.paid","livemode":true,"data":{"invoice":{…},"payment":{…}}}On an invoice created with a test key, trigger the paid, underpaid, overpaid and expired cases with the simulate endpoint.
curl https://hisarpay.com/v1/invoices/$INVOICE_ID/simulate \
-H "Authorization: Bearer $HISARPAY_TEST_KEY" \
-H "Content-Type: application/json" \
-d '{ "outcome": "partial", "amount": "20" }'Headers used in requests and responses:
Parameters and example responses for every endpoint are in the API reference in the docs.
| Endpoint | What for |
|---|---|
| /v1/invoices | Create, list, look up by order ID, cancel, and simulate in test mode. |
| /v1/payment-links | Reusable payment links with a fixed or open amount. |
| /v1/withdrawals | Single withdrawals. |
| /v1/balances | Balances and balance transactions. |
| /v1/webhook-endpoints | Endpoints, event filters and secret rotation. |
| /v1/events | Event history and resending. |
| /v1/rates | Current TRX and USDT rates. |
Node.js, PHP and Python libraries with typings, automatic retries and webhook verification built in.
Adds TRX and USDT to your checkout and updates the order by itself once the payment confirms.
Adds a crypto option to your server and domain invoices; the payment is entered on the WHMCS invoice by itself.
Sign-up is free; your test keys are ready the moment you confirm your e-mail.