HoltPay REST API, v1

Create invoices from your server, send customers to the hosted checkout page, and receive a signed webhook when an invoice is paid.

Authentication

Every request needs an API key in the Authorization header. Create keys in the dashboard under API keys. A key is shown once when it is created.

Header
Authorization: Bearer hp_...
  • Keep keys on your server. Never put one in a web page or app.
  • Revoke a key in the dashboard if it is exposed.
  • The same key creates live and test invoices. The network field decides which. See Testing.

Errors always have this shape, with a matching HTTP status:

Error
{ "error": { "code": "invalid_amount", "message": "amount must be between ..." } }

Create an invoice

POST/v1/invoices

Creates an invoice payable to the wallet address saved in your settings and returns a link to the hosted checkout page. Live invoices need a wallet address and a Telegram username in your dashboard settings; customers see the username at checkout so they can contact you about a payment.

FieldTypeDescription
amountstringAmount to charge, for example "149.00". From 0.01 to 1000000, at most 2 decimals. Required.
currencystringUSDT or USDC. Required.
networkstringethereum, bsc, polygon, arbitrum, base, tron, ton, solana or test. Tron and TON support USDT only; Base supports USDC only. Required.
order_idstringYour own reference for the order, up to 128 characters.
descriptionstringText describing the purchase. Shown to the customer.
redirect_urlstringWhere the "Return to merchant" button leads after payment.
expires_in_minutesnumberHow long the invoice stays payable, 5 to 1440. Default 30.
metadataobjectAny JSON object. Returned to you unchanged.
Request
curl https://your-holtpay-host/v1/invoices \
  -H "Authorization: Bearer hp_..." \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "149.00",
    "currency": "USDT",
    "network": "tron",
    "order_id": "ORD-1042",
    "description": "Order 1042"
  }'
Response
{
  "id": "inv_3f9a1c0b7d2e4a6f8b1c2d3e",
  "status": "pending",
  "test": false,
  "amount": "149.00",
  "pay_amount": "149.0001",
  "currency": "USDT",
  "network": "tron",
  "order_id": "ORD-1042",
  "address": "TQ5vNc8kYx3LrW2dHs9BfJ7mPuA4eZg6Rt",
  "checkout_url": "https://your-holtpay-host/pay/inv_3f9a...",
  "expires_at": "2026-11-27T15:55:00.000Z"
}

Redirect the customer to checkout_url. The page shows the amount, address, QR code and time left.

pay_amount is slightly higher than amount. All your payments arrive at one wallet address, so each invoice asks for a unique amount (a few ten-thousandths more, never above 0.05) to tell payments apart. The customer must send exactly pay_amount, in the invoice's currency and on its network. A different amount, currency or network is not matched to any invoice.

  • Limits: 120 new invoices a minute and 2,000 unpaid invoices at once per merchant. Beyond that the API answers 429.
  • A payment that arrives after the invoice has expired is not matched automatically. It still reaches your wallet, and is listed in the dashboard so you can settle the invoice by hand. See Wrong amounts.
  • After the free trial, live invoices need an active plan. Without one the API answers 402 with the code subscription_required. Test invoices always work.

Other endpoints

Retrieve an invoice

GET/v1/invoices/{id}

Returns one invoice with its current status.

List invoices

GET/v1/invoices?status=paid

Returns your invoices, newest first. Optional filters: status, order_id, limit (up to 100) and before (an ISO time).

List networks

GET/v1/networks

Returns the networks and currencies available. No API key needed.

Invoice statuses

StatusMeaning
pendingWaiting for the customer to pay.
confirmingA matching transfer was detected and is being confirmed by the network.
paidThe payment is confirmed in your wallet.
expiredNo payment arrived before the invoice expired.

How a paid invoice was settled

FieldMeaning
settled_bychain: the exact amount arrived. tolerance: a slightly different amount arrived, within the tolerance you set. merchant or admin: settled by hand in the dashboard. null while unpaid.
paid_amountWhat actually arrived, for example "148.20". null when you marked the invoice paid without a detected transfer.
payment_link_idThe payment link the invoice came from, if any.

Webhooks

Set your endpoint URL in the dashboard under Webhooks. HoltPay sends a POST request with a JSON body for invoice.confirming, invoice.paid and invoice.expired.

Payload
{
  "id": "evt_5b1e...",
  "event": "invoice.paid",
  "created_at": "2026-11-27T15:41:13.000Z",
  "data": {
    "id": "inv_3f9a1c0b7d2e4a6f8b1c2d3e",
    "status": "paid",
    "test": false,
    "order_id": "ORD-1042",
    "amount": "149.00",
    "pay_amount": "149.0001",
    "currency": "USDT",
    "network": "tron",
    "tx_hash": "9f3c...a81e"
  }
}

data is the full invoice, in the same shape the API returns.

Verify the signature

Each request carries an X-HoltPay-Signature: t=<unix time>,v1=<hex> header. v1 is an HMAC-SHA256 of <t>.<raw request body>, keyed with your signing secret. Compute the same value on your server and compare before trusting the payload.

Node.js
const crypto = require('crypto');

function isValid(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
  const expected = crypto
    .createHmac('sha256', secret)
    .update(parts.t + '.' + rawBody)
    .digest('hex');
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
  return fresh && parts.v1.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected));
}
  • Respond with a 2xx status within 10 seconds. Otherwise the call is retried after 30 seconds, 2 minutes, 10 minutes, 1 hour and 6 hours.
  • The same event can arrive more than once. Make your handler safe to repeat by checking the invoice ID.
  • Deliver goods only on invoice.paid.
  • Recent deliveries and their responses are listed in the dashboard.
  • If you rotate the signing secret, the old secret stops working immediately.

Wrong amounts, late and wrong-network payments

Customers sometimes send a little less (an exchange took its fee out of the amount), pay after the invoice expired, or use another network. These payments still reach your wallet. HoltPay keeps watching your wallet for a day after your last invoice closed, and lists such payments in the dashboard under Payments to check. You also get an email.

  • Choose the invoice a payment was for, and the invoice becomes paid with settled_by: "merchant". Your endpoint gets the usual invoice.paid webhook. A transfer can settle only one invoice.
  • For an invoice you can see was paid but that HoltPay did not list (for example, days later), use Mark as paid on the invoice.
  • In Settings you can accept amounts up to 0.5%, 1%, 2%, 3% or 5% away from the invoice. Such a payment settles the invoice automatically with settled_by: "tolerance", unless the amount is close to another open or recently closed invoice too. Then it is listed for you to decide.

Code libraries

Single-file clients with no dependencies. They create and fetch invoices and verify webhook signatures.

Node.js
import { HoltPay } from './holtpay.mjs';

const holtpay = new HoltPay({ apiKey: process.env.HOLTPAY_API_KEY, baseUrl: 'https://your-holtpay-host' });
const invoice = await holtpay.createInvoice({ amount: '25.00', currency: 'USDT', network: 'tron', order_id: '1042' });
// redirect the customer to invoice.checkout_url

// In your webhook handler, with the raw request body:
const event = HoltPay.verifyWebhook(rawBody, req.headers['x-holtpay-signature'], process.env.HOLTPAY_WEBHOOK_SECRET);
if (event.event === 'invoice.paid') { /* mark the order paid */ }

Testing

The test network has no blockchain behind it, so you can try the whole integration without real money or a wallet.

  • Create an invoice with "network": "test", or switch the dashboard to Test and use Create invoice.
  • Its checkout page is marked "Test invoice. Do not send real funds."
  • Mark it paid with the request below, or with Simulate payment in the dashboard. Your endpoint receives the same webhooks, with "test": true.
POST/v1/invoices/{id}/simulate-payment

Test and live data are separate. Test invoices never appear in live totals. In production, ignore webhooks where data.test is true.