Skip to main content
This is the “you’re getting paid” side of x402: your API responds 402 to unpaid requests, then verifies and settles a payment once the caller attaches one.

Define what you accept

Use facilitator.getSupported() (see Quickstart) to find valid blockchainId/assetId values for the network and token you want to accept.

Challenge, verify, settle

1

No X-PAYMENT header

Respond 402 with { x402Version: 1, accepts: [requirement] }. This is the machine-readable challenge the payer’s agent parses to know what, where, and how much to pay.
2

X-PAYMENT header present

Base64-decode it into a PaymentPayload and call facilitator.verify(payload, requirement). This checks the EIP-712 signature, amount, recipient, and validity window against your requirement — no funds move yet.
3

Verified — settle it

Call facilitator.settle(payload, requirement). Your organization’s WAAS wallet relays the TransferWithAuthorization on-chain and pays the gas; funds land at payTo.
4

Serve the content

Once settle() resolves, return the actual paid resource along with the txHash for the caller’s records.
Both verify() and settle() throw on failure rather than returning a { isValid: false }-shaped result — catch the error and fold its message into your own 402 response’s error field, as shown above. See Error Handling for the exact error classes and HTTP status mapping.

Next steps

Payer Guide

See the other side of this flow.

API Reference

Full verify/settle/getSupported signatures and types.