HotVoucher Pay· integration sample

Accept HotVoucher on your website

Your buyers pay with their HotVoucher wallet, a HotVoucher voucher code, or any crypto on the networks HotVoucher supports. Every payment lands in your HotVoucher account in the coin the buyer paid (or in the settle coin set for your account), minus the gateway fee. Copy the files below, set two environment variables and you are live.

1Get an API token

In the HotVoucher app: Voucher → API token for your site. Allow your server IP, set the callback URL, save the callback secret.

2Create an invoice

Your server calls POST /api/v1/invoices with the customer id and the amount (USD or IRR, or none for a top-up).

3Send the buyer to the payment page

Redirect to the invoice's payUrl; when the payment is done the page brings the buyer back to your returnUrl.

4Confirm by webhook

invoice.paid / payment.received arrive signed with your callback secret. Mark the order paid there.

Sample files — copy or download; replace nothing but the environment variables

Node.js (Express)PHP
⚠ Never put the API token (hvk_…) in the browser. Only your server talks to /api/v1/*; the page only receives the invoice id.

What the buyer sees

A HotVoucher payment page with the amount, a countdown and three ways to pay:

  • HotVoucher wallet — instant, confirmed with an email code.
  • HotVoucher voucher — the whole voucher value is paid to you (no change is returned).
  • Crypto — every active coin/network. Each of your customers gets one permanent address per network; if less than the invoice arrives, the buyer sends the rest to the same address.

Anything that arrives — full, partial, more, or after the invoice expired — is yours and is reported by payment.received. Credit your customer on your side (for example top up their balance).

Fees & addresses

  • Gateway fee — a percentage of every payment (see GET /api/v1/fees).
  • Network fee — crypto payments only: the network cost of moving the coins to the HotVoucher hot wallet, per coin/network (networkFeeUsd in /api/v1/fees and in every payment.received webhook). Wallet and voucher payments have no network fee.
  • Addresses are free. Gateway addresses are separate from the wallet addresses of logged-in HotVoucher users.

List the addresses created for your customers with GET /api/v1/addresses?customer=&network=, and check any address with GET /api/v1/addresses/validate?address=…&network=TRC20 → {valid, mine, customer} (valid format / one of your customers' addresses).

Invoice options

FieldRequiredMeaning
customeryesYour user id / username (max 64). Decides the customer's permanent deposit addresses.
amount + currencyno"USD" or "IRR". Without an amount the invoice is an open top-up: any amount is accepted.
orderId, descriptionnoShown to the buyer and returned in webhooks.
returnUrlnohttps URL for the "Back to shop" button.
expiresInMin, langnoMinutes until the invoice expires (5…10080); page language "en" / "fa".

Full reference: /api/v1/docs

No website?

Use Payment links in the HotVoucher app (More → Payment link): create a link with a fixed or open amount, send it anywhere or show its QR code — every payment to it goes straight to your account. No coding, no domain.