Skip to content
HisarPay
  • Product
  • Published:
  • Reading time: 5 min read
  • Türkçe oku

Handling underpayments, overpayments and late payments

With cards, the amount is always exact. With a crypto transfer, the customer types it. Exchange fees, rounding mistakes and last-minute payments mean some invoices fall outside the “exact and on time” path. Here is how each edge case is handled and how to shape your order flow around them.

On this page
  1. Why edge cases happen
  2. Invoice statuses at a glance
  3. Underpayments
  4. Overpayments
  5. Late payments
  6. Transfers that do not count as payment
  7. Talking to the customer
  8. How your system should respond
  9. Frequently asked questions

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:

StatusMeaningEvent sent
pendingOpen, nothing paid yet—
partialPart of the amount paid, outside the toleranceinvoice.partial
paidPaid in full, or short within the toleranceinvoice.paid
overpaidMore than the amount was paidinvoice.overpaid
expiredTime ran out without enough paymentinvoice.expired
cancelledThe invoice was cancelledinvoice.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.

Save the orderDo not cancel an order the moment it is partially paid. An email reminding the customer of the remaining amount, with the payment link, is the easiest way to save the sale.

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 repriced field 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: true and 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.

Order flow by event typeTypeScript
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;
}
Do not rely on orderingWebhook ordering is not guaranteed and the same event can be delivered more than once. Base decisions on the invoice’s current status rather than the order events arrive in, and use the X-HisarPay-Event-Id header to drop duplicate deliveries.

Frequently asked questions

Where do I set the underpayment tolerance?
In the dashboard under Settings → Store, choose a value from 0% to 20%. Shortfalls within the tolerance count as paid, and the difference is recorded in underpaid_amount.
How long does the customer have after a partial payment?
The invoice is extended by at least 30 minutes. When the customer sends the rest to the same address, the invoice moves to paid.
Is a payment to an expired invoice lost?
No. Late payments are always credited to your balance and flagged as late. USD-priced TRX invoices are repriced at the current rate; USDT invoices are not.
How do I refund an overpayment?
The extra is credited to your balance. Ask the customer for an address and send the difference as a separate withdrawal; do not send it back to the paying address, which may belong to an exchange.
  • #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.

More guides that go well with this one.