Skip to main content
Customers send payments from their own wallets, so the amount and timing are not always exact. This page covers each case and what your integration should do.

Underpayments

Small shortfalls

A payment that falls slightly short still completes the checkout. How short is set under Settings, then Underpayment, in the dashboard:
  • Percent of the total. The default is 0.5%.
  • Fixed amount in USD. Off by default.
If both are set, the smaller allowance applies. A checkout completed this way has the status completed, and underpaid is true if it was short by one cent or more.

Partial payments

A payment that falls short by more than the allowance moves the checkout to partial and sends a checkout.partial event. The checkout stays open, and the customer can send the rest to the same address. When the total reaches the full amount, the checkout becomes completed. If the checkout reaches expires_at while it is still partial, it becomes expired with underpaid set to true. The USDC from the partial payment has already reached your wallet.

Resolving an underpaid checkout

When a checkout is partial or expired and has received a payment, you have two options:
  • Accept what was paid. Resolve the checkout, or select Mark as resolved on the checkout in the dashboard. Its status becomes resolved and a checkout.resolved event is sent.
  • Return the payment. Send the customer a refund from your own wallet. CoinStack does not send refunds.
resolved is final. Treat it as paid in your own system.

Overpayments

If the customer pays more than 2% over the full amount, the checkout is completed with overpaid set to true. All of it is settled to your wallet. Compare received with what you expected and refund the difference from your own wallet if you choose to.

Late payments

A payment that arrives after expires_at is still recorded against the checkout.
  • If it brings the total to the full amount, the checkout changes from expired to completed, late is set to true, and a checkout.completed event is sent.
  • If it does not, the checkout stays expired with underpaid set to true. You can resolve it or refund the customer.
Decide in advance how your system handles a checkout.completed event for an order you already cancelled.

Payments after the price lock

When a customer chooses a token, the amount is fixed at the price at that moment. That price is held for a limited time: A payment sent after that time, in a token that is not a stablecoin, is counted at the market price when it arrived. If the price has fallen, the payment may no longer cover the full amount and the checkout becomes partial.

Returned payments

Sometimes a payment cannot be processed. It is returned to the sender, and the payment’s status becomes refunded with the reason in fail_reason. A payment.refunded event is sent. A returned payment does not count towards the checkout.

Summary