Skip to main content

x402 payments

x402 is an open payment protocol built on HTTP 402 status codes. When a Prudra-protected endpoint returns 402, it includes a PAYMENT-REQUIRED header containing the payment options in base64-encoded JSON. The agent decodes this header, signs an ERC-3009 authorization off-chain, and resubmits with the signature in the PAYMENT-SIGNATURE header. The agent’s wallet never sends a transaction directly. Prudra’s server receives the signed authorization, verifies it cryptographically, does the work, then settles on-chain. The agent pays with a signature — Prudra handles the blockchain interaction.

How the challenge works

The PAYMENT-REQUIRED header contains a base64-encoded array of payment options:
The agent selects an option matching its token preference (USDC), signs an ERC-3009 transferWithAuthorization off-chain, and returns it as the PAYMENT-SIGNATURE header (base64-encoded).

Settlement flow

Settlement happens after your handler responds. The agent doesn’t wait for on-chain confirmation — Prudra handles that asynchronously. The PAYMENT-RESPONSE header in the 200 response includes the txHash and a settlementPending flag.

When to use x402

x402 does not support session payments. For multi-step workflows under one payment, use MPP or session payments.

Tokens and chains

x402 currently supports: