Crypto Payment API Webhooks: Merchant Reconciliation Guide for 2026

A crypto payment API is only as useful as its reconciliation design. Before developers write code, the merchant should define order states, webhook handling, idempotency, refund records, and finance exports. Otherwise the integration may accept payments but still leave operations unable to answer the basic question: which order is paid?
The strongest crypto API setup treats blockchain confirmation as one event inside a broader order lifecycle. The customer sees checkout. The developer sees an invoice or payment intent. Finance sees a transaction hash, asset, network, amount, fee, wallet, and settlement status tied to an order ID.
- Do not build crypto checkout as a one-off payment page with no order state machine.
- Use webhooks to update payment status, but make every event idempotent.
- Store the asset, network, expected amount, received amount, wallet, and transaction hash.
- Aurpay’s REST API is relevant for payin, payout, orders, invoices, testnet, mainnet, and Postman-based testing.
The Minimum Order State Machine
Every crypto checkout should have a state machine. At minimum, use created, pending, underpaid, paid, expired, canceled, refunded, and failed. Your exact labels can differ, but the system needs more than “paid” and “not paid.” Crypto payments can be late, partial, sent on the wrong network, or confirmed after an invoice window expires.
Created means the order exists but no payment has been detected. Pending means a payment has been detected but not fully confirmed or matched. Paid means the required amount has been received on the correct asset and network. Expired means the invoice window has closed.
Underpaid deserves its own state. A buyer may send less than the requested amount because of wallet fees, exchange withdrawal limits, or manual entry. If you collapse underpaid into failed, support will struggle. If you collapse it into paid, finance loses money.
Webhook Events to Expect
| Event | System action | Finance record |
|---|---|---|
| Invoice created | Attach payment ID to order | Expected amount, asset, network |
| Payment detected | Move order to pending | Detected amount and wallet details |
| Payment confirmed | Mark order paid and release fulfillment | Transaction hash and confirmation timestamp |
| Invoice expired | Disable payment page or refresh quote | Unpaid or late-payment note |
| Refund sent | Update order refund status | Outgoing transaction hash |
Idempotency Is Not Optional
Webhook delivery can repeat. Your system must handle the same event more than once without duplicating fulfillment, issuing multiple refunds, or marking a canceled order paid incorrectly. Idempotency means each event has a unique identifier and your system records whether it has already processed that event.
For order updates, idempotency should be paired with state-transition rules. A paid order should not return to pending because an older webhook arrives late. A refunded order should not trigger fulfillment again. A canceled order that receives a late payment should be routed to manual review.
Developers often treat this as engineering hygiene. Finance teams should care because duplicate webhook handling becomes duplicate shipments, incorrect revenue, and messy reconciliation.
Reconciliation Fields to Store
Store more than the order ID and payment status. For each payment, record asset, network, expected amount, received amount, wallet address, transaction hash, confirmation timestamp, gateway fee, refund status, and internal ledger account. If the customer paid with USDT TRC-20, that should be visible without reading support notes.
Also store the fiat reference value used for the order. If the product was priced at $499 and paid in crypto, finance needs the fiat order value even if the crypto amount differs slightly by quote time. This is especially important for refunds, sales tax, and revenue reporting.
For multiple payments, store each transaction separately. A customer may underpay, then send the remainder. Do not overwrite the first transaction. Use a payment table that can attach multiple on-chain transactions to one order.
Developer Handoff Checklist
The business owner should give developers a written payment-state document before implementation. It should define each state, the webhook that can trigger it, whether fulfillment is allowed, and who handles exceptions. This turns payment integration from guesswork into a shared contract.
Developers should also build a replay tool. If a webhook fails because your server is down or a bug blocks processing, the team needs a safe way to replay the event without duplicating fulfillment. That tool should respect idempotency keys and state-transition rules.
Finally, create a reconciliation export from day one. Finance should be able to download order ID, customer ID, asset, network, expected amount, received amount, fee, wallet, transaction hash, status, and timestamps. If this export is postponed until after launch, finance will build manual spreadsheets that are hard to unwind.
Testing Scenarios Before Launch
Test full payment, underpayment, overpayment, expired invoice, duplicate webhook, delayed webhook, refund, and canceled order with late payment. These are not edge cases in crypto; they are normal operational events. A payment API is production-ready only when the unhappy paths are tested as carefully as the happy path.
A final useful control is a daily exception report. List payments that are pending too long, underpaid, overpaid, expired after payment, or missing a transaction hash. If the team reviews this report every morning, most crypto payment issues are solved before customers open tickets.
FAQ
Can I rely only on the blockchain explorer?
No. Explorers are useful for verification, but your system needs internal order state. A finance team should not manually search transaction hashes to understand paid, underpaid, refunded, or expired orders.
What is the most common crypto payment API mistake?
The most common mistake is treating payment confirmation as the only event. Merchants also need created, pending, expired, underpaid, refunded, and manual-review states.
Should fulfillment wait for confirmation?
For most merchants, yes. The required confirmation policy depends on asset and network, but fulfillment should be tied to the payment state defined by your gateway and internal risk rules.
How should refunds be reconciled?
Record refunds as outbound transactions connected to the original order. Store asset, network, wallet, amount, timestamp, reason, approval user, and transaction hash.
If your team is building a crypto payment workflow, start with Aurpay’s REST API documentation and test the full order lifecycle before going live. A good integration is not just a payment button. It is a reconciliation system that finance, support, and developers can all trust.

