HTTP 402 payment protocol field guide

Build with x402 without copying stale payment examples.

x402docs.com explains the current v2 flow, headers, server setup, buyer policy, facilitators, networks, schemes, migration traps, and agent-commerce patterns with primary sources attached.

x402 HTTP 402 protocol sequence diagram
402 challenge
signed retry
settlement

3

v2 headers to recognize

PAYMENT-REQUIRED, PAYMENT-SIGNATURE, and PAYMENT-RESPONSE are the names new x402 implementations should understand.

CAIP-2

network identifiers

v2 uses identifiers such as eip155:8453 rather than ambiguous local aliases such as "Base mainnet."

0

standard browser payment UI

HTTP 402 is reserved in HTTP semantics, but generic browser behavior is still not a universal payment experience.

Protocol map

The shortest correct mental model

1

Request

The client asks for a paid HTTP resource.

2

402

The server returns payment requirements.

3

Sign

The client signs a scheme-specific payload.

4

Verify

The server or facilitator checks the payload.

5

Serve

The server returns content plus payment response.

Read first

Core guides

Source map
HTTP 402stablecoins

What Is x402?

A plain-English but implementation-aware explanation of x402, the HTTP 402 payment protocol for paid APIs, content, and AI agents.

headersv2

The HTTP 402 Flow

A step-by-step map of the x402 v2 request flow, including PAYMENT-REQUIRED, PAYMENT-SIGNATURE, and PAYMENT-RESPONSE.

sellermiddleware

Server Integration Guide

How to decide what to protect with x402, configure route requirements, choose a facilitator, and test paid API endpoints.

buyeragents

Client and Agent Guide

How x402 buyers, HTTP clients, and AI agents should evaluate payment requirements, sign payloads, and retry safely.

facilitatorverify

Facilitators: Verify and Settle

What x402 facilitators do, when to use one, and how to evaluate facilitator trust, uptime, and settlement behavior.

CAIP-2USDC

Networks and Assets

A practical guide to x402 network identifiers, default assets, stablecoin choices, and chain-specific implementation tradeoffs.

Implementation depth

Migration, agents, security, and sources

Payment Schemes

A scheme defines what the client authorizes and what the server or facilitator can settle. Pick the scheme based on pricing semantics, not just SDK availability.

Security and Reliability Checklist

x402 makes payment easy to attach to HTTP. That does not make payment easy to secure. The main risks are replay, wrong destination, wrong amount, unlimited wallet authority, unclear refunds, and retry ambiguity.

v1 to v2 Migration

Many search results and older examples still show v1 patterns. New integrations should recognize the differences before copying code.

MCP and Agent Commerce

x402 is compelling for agents because it gives tools a way to ask for payment in the same protocol the agent already uses to fetch resources. The hard part is giving the agent safe authority.

Primary Source Map

This site is intentionally citation-heavy. x402 is moving quickly, so source selection matters: protocol docs and specs first, provider docs second, commentary last.