The 402 response
A 402 response carries aPaymentRequirements payload. In x402 version 1, the server returns it as a JSON body. In version 2, it arrives as a base64-encoded payment-required response header.
The payload contains an accepts array with one or more payment options. The client selects the option that matches its configured scheme and network, then constructs a signed payment from those terms.
Payment requirements fields
tokens are identified by their contract address in theasset field.
identifies the blockchain network in the network field.
| Field | Type | Description |
|---|---|---|
scheme | string | Payment scheme. 4mica-credit for 4Mica guarantee flow; exact for direct transfer. |
network | string | CAIP-2 chain identifier. eip155:8453 for Base mainnet. |
maxAmountRequired | string | Maximum amount the server charges, in token base units. |
asset | string | ERC-20 token contract address for the settlement asset. |
payTo | string | Recipient wallet address. |
resource | string | URL of the protected resource. |
description | string | Human-readable description of what the resource provides. |
mimeType | string | MIME type of the response the client receives after paying. |
maxTimeoutSeconds | number | Maximum seconds the server allows between the client signing and settlement. |
extra | object | Optional scheme-specific data, including V2 validation policy fields. |
Why the scheme is the server’s choice
The resource server decides which payment schemes it accepts, at what price, and on which networks. It publishes those terms in the 402 response. The client decides which of the offered options it can fulfill. Neither side is forced into a specific payment method. Theaccepts array lists options; the client picks what it can fulfill.
A server can list multiple entries in accepts to support different schemes or networks simultaneously. A client that supports both 4mica-credit and exact selects whichever it prefers.
Builder guidance
When you configure your 402 response:- Set
schemeto4mica-creditfor 4Mica guarantee-backed payments. - Use the CAIP-2 format for
network:eip155:8453for Base,eip155:1for Ethereum mainnet. - Set
maxAmountRequiredin token base units. For USDC (6 decimals), $1.00 is"1000000". - Set
payToto the wallet address that should receive payment after netting and settlement. - Set
maxTimeoutSecondsto the time you are willing to wait between the client signing and your call to/settle. 300 seconds is a reasonable default for most API flows.