Documentation Index
Fetch the complete documentation index at: https://docs.x402r.org/llms.txt
Use this file to discover all available pages before exploring further.
PaymentRequirements (402 Response)
Server sends this to request payment:accepts[] entry with different assetTransferMethod values so clients can pick the method matching their token approvals.
Signing the payload (client)
Clients do not hand-build these payloads. The client half of the scheme ships in the x402 monorepo asAuthCaptureEvmScheme on the @x402/evm/auth-capture/client subpath. Register it on an x402Client and it reads the extra fields, reconstructs the PaymentInfo struct, derives the payer-agnostic nonce, and emits the ERC-3009 (default) or Permit2 payload shown below.
address and signTypedData, so a bare viem LocalAccount works with no PublicClient. The scheme selects ERC-3009 or Permit2 from extra.assetTransferMethod.
PaymentPayload: EIP-3009 (default)
Client sends this with a signed ERC-3009 authorization:PaymentPayload: Permit2
Whenextra.assetTransferMethod === "permit2", the client signs a Permit2 PermitTransferFrom:
Field Reference
Required Extra Fields
| Field | Type | Description |
|---|---|---|
name | string | EIP-712 token-domain name (for example, "USDC"). Used for ERC-3009 signing only. |
version | string | EIP-712 token-domain version (for example, "2"). |
captureAuthorizer | address | Address that may call authorize, capture, void, refund, or charge. Committed on-chain as PaymentInfo.operator. |
captureDeadline | uint48 | Absolute Unix seconds: capture must occur before this. Encoded as authorizationExpiry. |
refundDeadline | uint48 | Absolute Unix seconds: refunds allowed until this. Encoded as refundExpiry. |
feeRecipient | address | Fee recipient. Set to address(0) to let the captureAuthorizer specify any non-zero recipient at capture/charge time. |
minFeeBps | uint16 | Lowest fee in basis points the captureAuthorizer must take. 0 = no floor. |
maxFeeBps | uint16 | Highest fee in basis points the captureAuthorizer can take. |
Optional Extra Fields
| Field | Type | Description | Default |
|---|---|---|---|
autoCapture | bool | true → facilitator calls charge() (atomic). false → authorize() (two-phase). | false |
assetTransferMethod | "eip3009" | "permit2" | Which token collector to use. | "eip3009" |
Fee Configuration: The escrow enforces fees on-chain via the
PaymentInfo struct. The escrow rejects captures/charges that fall outside [minFeeBps, maxFeeBps]. If feeRecipient is non-zero, the actual fee recipient at capture/charge must match.Nonce Derivation
The signature nonce is the payer-agnosticPaymentInfo hash. The encoding zeros out the payer; every other field carries the value that will appear on-chain.
salt field enforces freshness: each signing call generates a fresh bytes32 salt, so two payers signing concurrently produce distinct nonces with no collision risk.
Next Steps
Verification and Settlement
The 13-step verification flow and error codes.
PaymentInfo Struct
How wire fields map to the on-chain struct.
