On this page
Why edge cases happen
In a crypto payment the customer enters the amount, and once a transfer is sent it cannot be pulled back. The most common causes are:
- Exchange withdrawal fees: some exchanges deduct the fee from the amount sent, so the customer types 50 USDT and less arrives.
- Hand-typed amounts: customers who type the amount instead of scanning the QR code can slip a digit.
- Delayed sends: the customer starts the payment in the invoice’s final minute, or the exchange holds the withdrawal.
- Split transfers: the customer tries to complete the amount from two different wallets.
Invoice statuses at a glance
A HisarPay invoice starts as pending and moves with the payments it receives. All transfers to the same address are added together:
| Status | Meaning | Event sent |
|---|---|---|
| pending | Open, nothing paid yet | — |
| partial | Part of the amount paid, outside the tolerance | invoice.partial |
| paid | Paid in full, or short within the tolerance | invoice.paid |
| overpaid | More than the amount was paid | invoice.overpaid |
| expired | Time ran out without enough payment | invoice.expired |
| cancelled | The invoice was cancelled | invoice.cancelled |
Underpayments
Within tolerance: treat it as paid
Under Settings → Store in the dashboard you can set an underpayment tolerance from 0% to 20%. If the amount received falls short by no more than that percentage, the invoice becomes paid and the shortfall is recorded in underpaid_amount. For example, with a 2% tolerance, 98.50 USDT on a 100 USDT invoice counts as paid, with 1.50 USDT recorded as underpaid.
A tolerance is the most practical way to avoid making a customer send a second transfer over a small exchange fee. Choose the percentage to fit your margins; for high-value sales, a lower setting makes more sense.
Outside tolerance: a partial payment
If the amount received is short by more than the tolerance, the invoice moves to partial. The customer can send the rest to the same address, and the checkout shows the remaining amount with an updated QR code. To give them time, the invoice is extended by at least 30 minutes. Once the rest arrives, the invoice becomes paid.
Overpayments
If the customer sends more than required, the full amount is credited to your balance, the invoice becomes overpaid and the extra shows up in overpaid_amount. You can fulfil the order as usual. To refund the difference, ask the customer for an address and send it as a separate withdrawal; do not send it back to the address the payment came from, because that address may belong to an exchange.
Late payments
Payments that arrive after expiry are never lost. HisarPay always credits them to your balance and flags them with late: true. Lateness is judged by the transaction’s block time, so network congestion or a delay on our side never turns an on-time payment into a late one.
- A payment seen on-chain as the invoice expires: the invoice is not expired immediately; we wait for the payment to become final.
- USD-priced TRX invoices: a late payment is repriced at the current rate, and the event’s
repricedfield shows the old and new amounts. - USDT invoices: never repriced, because USDT tracks the dollar.
Our rate lock article explains the reasoning behind locking and repricing in detail.
Transfers that do not count as payment
- Fake tokens: only transfers from the official USDT contract on TRON count. Another token named “USDT” is ignored, even if it is sent to the invoice address.
- Other networks: transfers sent on a different network never reach a TRON address.
- Test payments: simulations in test mode are marked
simulated: trueand never touch a real balance.
Talking to the customer
Most edge cases are resolved by a short message sent at the right time. Keep the tone clear, action-oriented and free of blame:
- Partial payment: “Part of your payment has arrived. To complete your order, send the remaining amount from the same checkout page.” Include the payment link and the amount due.
- Late payment: “Your payment arrived after the invoice expired and has been credited to us. We are reviewing your order and will get back to you shortly.”
- Overpayment: “You paid more than the invoice amount. If you would like the difference refunded, send us a TRON address.”
Hook these messages to webhook events and send them automatically, and many questions are answered before they ever reach your support team.
How your system should respond
Your webhook handler should make a clear decision for every event type. Fulfil orders only on invoice.paid and invoice.overpaid; for other events, inform the customer or release the stock.
if (!event.livemode) return; // test events never touch an order
switch (event.type) {
case 'invoice.paid':
case 'invoice.overpaid': {
const { invoice, payment } = event.data;
await orders.markPaid(invoice.order_id, {
underpaid: invoice.underpaid_amount,
overpaid: invoice.overpaid_amount,
late: payment.late, // late payment: review the order by hand
});
break;
}
case 'invoice.partial':
await orders.remindRemaining(event.data.invoice.order_id, event.data.invoice.remaining_amount);
break;
case 'invoice.expired':
case 'invoice.cancelled':
await orders.releaseStock(event.data.invoice.order_id);
break;
}X-HisarPay-Event-Id header to drop duplicate deliveries.Frequently asked questions
Where do I set the underpayment tolerance?
How long does the customer have after a partial payment?
Is a payment to an expired invoice lost?
How do I refund an overpayment?
- #Invoices
- #Underpayments
- #Late payments
- #Webhooks
Try crypto payments in test mode
No setup or monthly fees. Experiment as much as you like in test mode and go live when you are ready.