x402 turns HTTP’s long-reserved 402 Payment Required status code into a working payment protocol: a server that wants payment responds with 402 and machine-readable payment requirements, and the client pays by retrying the same request with a signed payment attached. This page explains the standard flow and the extensions SohoPay layers on top. It assumes you know HTTP and Ethereum basics, but no prior x402 knowledge.
x402 is an open standard initiated by Coinbase. See the official site and the x402 specification on GitHub for the canonical protocol definition.

Why x402

AI agents can’t fill in checkout forms, solve CAPTCHAs, or click through payment iframes. They speak HTTP. x402 makes payment a native part of the HTTP request/response cycle — no redirect, no session, no out-of-band callback. The payment is the retry. Compared to the usual integration patterns: Webhooks remain the right tool for notifications about payments (SohoPay uses them — see Webhooks). x402 replaces them for the payment itself.

The standard x402 flow

The protocol is a four-step handshake over plain HTTP:
  1. Request — the client requests a paid resource normally.
  2. 402 challenge — the server responds 402 Payment Required with the accepted payment requirements (scheme, network, asset, amount, payee) in the response body and headers.
  3. Signed retry — the client constructs a payment payload for one of the offered requirements, signs it (an EIP-712 typed-data signature over an ERC-3009 transfer authorization for USDC), and retries the same request with the payload base64-encoded in an X-PAYMENT header.
  4. 200 + settlement — the server (or a facilitator acting for it) verifies the signature, settles the transfer on-chain, and returns the resource with an X-PAYMENT-RESPONSE header containing the settlement result.

SohoPay’s implementation

SohoPay acts as the settlement layer behind the merchant’s 402 response. The payment requirements a SohoPay merchant returns point at SohoPay: the agent pays from its credit line, and SohoPay settles USDC on Base with ~1s finality. Two things are layered on top of the base protocol:
  • MPC co-signing. The agent’s signature alone can’t move funds. Every settlement requires a second signature from the Policy Service under SohoPay’s 2-of-3 MPC scheme. A stolen agent key cannot pay anyone on its own.
  • Allowlist enforcement. The Policy Service refuses to co-sign payments to merchants outside the agent’s on-chain allowlist, plus off-chain credit, rate-limit, and AML checks.
These extensions are transparent to the merchant: from the outside it is standard x402. The enforcement happens between the agent’s signature and on-chain settlement.

Example HTTP exchange

The initial request and the 402 challenge:
Request
402 Response
The agent signs an ERC-3009 authorization for 1 USDC (1000000 in 6-decimal units) and retries. The 10-minute timeout matches SohoPay’s order TTL.
Retry with payment
200 Response
Decoded, the X-PAYMENT-RESPONSE carries the settlement transaction hash — verifiable on Basescan. The merchant also receives payment.settled via webhooks.

Use cases

  • Agent-to-merchant purchases — an agent buys a dataset, report, or physical-goods order from a merchant API in one request cycle.
  • Agent-to-service metering — pay-per-call APIs (inference, search, scraping) charge per request without API-key billing plumbing.
  • Machine-to-machine commerce — services that are themselves agents can charge each other with no human in the loop.
In every case the operator stays in control: credit limits, daily limits, and the allowlist bound what an agent can spend, and the operator is liable for its agents’ transactions (see Operator Liability).

Next steps

Payment Flow

The end-to-end SohoPay payment lifecycle, from order to settlement.

ERC-3009

The gas-free transfer authorization that x402 payments are signed as.

Policy Service

The co-signer that enforces allowlists, credit, and AML on every payment.