OpenBCP / USDT checkout / Underpaid and overpaid USDT invoices

Underpaid or overpaid USDT invoices

Customers sometimes send slightly less or more than the invoice asks for, often because of how their wallet or exchange rounds or deducts fees. OpenBCP has clear rules for each case.

Why amounts differ

A customer who pays from an exchange may have a withdrawal fee deducted from the amount. Another may round down, or send a custom amount. The result is an on-chain transfer that is a little more or less than the invoice. OpenBCP applies fixed rules so you always know what to do.

The rules

Confirmed amountStatusFulfil the order?
Below 98% of the expected amountPARTIALNo. Wait for the rest.
98% to 105%PAIDYes
Above 105%OVERPAIDYes, and consider refunding the excess
Nothing before the invoice times outEXPIREDNo

Underpaid: the PARTIAL status

When a confirmed payment is below 98% of the amount, the invoice becomes PARTIAL. The checkout page shows the shortfall, and the expiry is extended by 30 minutes so the customer can send the remainder to the same address. The webhook includes the numbers:

{
  "invoice_id": 42,
  "status": "PARTIAL",
  "amount_usdt": "30.020000",
  "amount_received": "20.000000",
  "shortfall": "10.020000",
  "paid": false
}

When the rest arrives and the total reaches the 98% mark, the invoice moves to PAID and a new webhook is sent.

Overpaid: the OVERPAID status

Above 105%, the invoice becomes OVERPAID. The webhook reports the excess in overpaid_by. The order is safe to fulfil. You can request a refund of the excess from your dashboard.

What your server should do

if event["status"] in ("PAID", "OVERPAID"):
    fulfil_order(event["external_id"])        # idempotent
elif event["status"] == "PARTIAL":
    ask_customer_to_pay(event["shortfall"])   # do not fulfil yet
elif event["status"] in ("EXPIRED", "CANCELLED"):
    release_stock(event["external_id"])

Always verify the signature first. See webhooks and signature verification.

Test these cases

The sandbox can simulate each one with the sandbox_scenario field: overpaid, partial and expired. Test your handler before going live.

Back to the USDT checkout overview.

Frequently asked questions

How much can a customer underpay and still be marked paid?

An invoice counts as paid when the confirmed amount is between 98% and 105% of the expected amount.

What happens below 98%?

The invoice becomes PARTIAL. The shortfall is shown on the checkout page and sent in the webhook, and the expiry is extended by 30 minutes so the customer can pay the rest.

What happens above 105%?

The invoice becomes OVERPAID, and the excess is reported in the overpaid_by field of the webhook.

Should I fulfil an order on PARTIAL?

No. Wait for PAID or OVERPAID. Fulfil on those two statuses only.

Get started free Read the docs Try the sandbox

More guides