Webhooks
Webhooks let the payment provider (x402) notify you asynchronously when a payment changes state (confirmed, failed, refunded). They are critical for final reconciliation — do not rely only on immediate HTTP responses.Typical webhook events
payment.confirmed— payment finalized on-chain or off-chainpayment.failed— processing or on-chain failurepayment.refunded— refund processed
Security: verify the webhook
Always verify webhook authenticity. x402 likely provides either:- an
X-Provider-Signatureheader (HMAC), or - a signing key + signature you verify with public key cryptography.
