how does x402 work
On this page
x402 is a payment flow that uses the HTTP 402 Payment Required status code. The store answers a request with a price, the agent signs a USDC stablecoin payment, and the store checks that payment before it returns the goods. The Integrator runs this flow for AI agents that buy from online stores.
The first request and the 402 response
The agent starts with a normal HTTP request to a store resource, such as a product page or an order endpoint. If the resource costs money, the store does not return the goods yet. It returns the HTTP 402 Payment Required status with a payment requirements body.
That body names the amount, the asset, the payment network and the address that receives the payment. The status code alone carries no payment logic. The requirements body does that work, and the agent reads it before it spends anything.
The agent compares the terms with its task. If the price, asset or network does not fit, the agent stops. If the terms fit, the agent moves to the signing step.
How the agent signs the payment
The agent builds a payment authorization that matches the requirements from the 402 response. It signs that authorization with the wallet key it controls. For a USDC stablecoin payment, the signature authorizes a transfer of the stated amount to the address the store named.
The agent signs one payment for each paid request. It then repeats the original request and attaches the signed payment to it. The store now has everything it needs to check the payment.
The agent keeps the requirements and the signed payment together. If the store rejects the payment, the agent can compare the two and find the mismatch.
How the store verifies and settles
The store reads the attached payment and checks it against the requirements it issued. It confirms the amount, the asset, the receiving address and the time window. It also confirms that the signature belongs to the wallet the agent used.
A payment that fails any check gets rejected. The store then returns the 402 response again, so the agent can build a new payment from fresh terms.
A payment that passes every check moves to settlement. Through the Integrator, payments settle on Base and Tempo. After settlement, the store returns the resource with a success response and a settlement response the agent can read.
The store serves the goods only after the check passes. Settlement and fulfillment remain separate steps in the store's own system.
What the Integrator adds for the store
The Integrator runs this payment flow for agents that buy from online stores. It handles the payment step, and the store keeps its catalog and its checkout rules.
The Integrator charges 0% fee during the pilot. The store should weigh that rate against the margin on each order before it accepts agent traffic.
Orders must meet a minimum order of $1.00. An agent should check the cart total against that amount before it signs anything.
What the store needs before it accepts agent payments
A store that accepts x402 payments needs three parts in place:
- An endpoint that returns the HTTP 402 Payment Required status with payment requirements.
- A check that compares each signed payment with the requirements it issued.
- A settlement path on the network the store lists in those requirements.
The store keeps its normal checkout for human shoppers. An agent request that carries no payment gets the 402 response. A human visitor with a browser session follows the usual path.
Where the flow can stop
The flow can stop in three places, and each stop produces a clear result for the agent.
The first stop is a stale price. The store issues requirements with a time window. A payment signed after that window fails the check. The agent requests fresh terms and signs a new payment.
The second stop is a mismatched asset. An agent that holds a different asset than the one the store names cannot pay. The agent must read the asset field before it signs.
The third stop is a network mismatch. The payment must settle on the network in the requirements. A signed payment for another network fails the store check.
A payment check gives the store proof of payment. It does not decide whether the goods are in stock or whether the order fits the store's rules. The store still owns those decisions.
What to check before an agent pays
- The price and asset in the 402 response match the store catalog.
- The payment network matches a rail the store supports.
- The cart total clears the minimum order.
Each check takes place before the agent signs. A failed check costs the agent nothing, because no payment leaves the wallet.
Fees and limits
- Cost to the store: 0% fee during the pilot.
- Minimum order: $1.00.
- Rails: Base and Tempo.
FAQ
What does HTTP 402 Payment Required mean?
It is a status code that tells the agent the resource needs payment. The store sends it with a body that lists the amount, the asset, the network and the receiving address. The agent then decides whether to pay.
Does the agent need a wallet?
Yes. The agent signs each payment with a wallet key it controls. Without that key, the agent cannot produce the payment authorization the store checks.
Which asset does the payment use?
The store names the asset in the 402 response. For this flow, the payment uses a USDC stablecoin, and the agent must match the asset the store asks for.
Can an agent pay any online store?
Only a store that returns the HTTP 402 Payment Required status and checks signed payments can accept this flow. A store without that setup cannot take an agent payment through x402.
Recommended next step
- STEP 1/2 Connect AI payment to your store
- STEP 2/2 Read more guides
Published: 2026-10-19Last updated: 2026-10-19