x402 & HTTP 402: Machine-Native Agent Payments on Base L2
x402 activates HTTP status code 402 ('Payment Required') so autonomous AI agents can pay for API resources or structured commerce data in stablecoins on Base L2 (eip155:8453) with zero API keys, zero credit-card forms, and zero human login flows. BoxNCase implemented @x402/next and fail-closed x402 v2 verification contracts (lib/agentic-commerce/x402.ts) starting April 20, 2026; the paid catalog-summary route remains fail-closed until a production Base mainnet facilitator is configured, while catalog search stays free via /mcp/mcp.
- HTTP Status
- 402 Payment Required
- Headers (x402 v2)
- PAYMENT-REQUIRED / PAYMENT-SIGNATURE / PAYMENT-RESPONSE
- Target Network
- Base L2 Mainnet (eip155:8453)
- SDK Stack
- @x402/core, @x402/evm, @x402/next, @x402/extensions
- Safety Model
- Fail-closed verification separate from settlement saga
- Free Alternative
- Public catalog search at /mcp/mcp ($0)
# Step 1: Agent requests a metered wholesale intelligence endpoint
GET /api/x402 HTTP/1.1
Host: www.boxncase.com
# Step 2: Server challenges with HTTP 402 + PAYMENT-REQUIRED payload
HTTP/1.1 402 Payment Required
PAYMENT-REQUIRED: <base64 exact eip155:8453 USDC quote + payTo + maxTimeoutSeconds>
# Step 3: Agent signs EIP-3009 transfer authorization & retries
GET /api/x402 HTTP/1.1
PAYMENT-SIGNATURE: <signed x402 v2 payload + payment-identifier>
# Step 4: Facilitator verifies & settles on Base L2 -> HTTP 200 + PAYMENT-RESPONSEHTTP 402 was reserved in 1997—AI agents finally need it
Humans click 'Subscribe', enter a billing address, pass 3DS verification, and copy an API key. Autonomous procurement agents running dozens of supplier comparisons per minute cannot complete 40 separate SaaS signups just to check live inventory feeds or proprietary mineral/nutrition datasets.
The x402 protocol turns payment into a standard HTTP header handshake. An agent requests a resource, receives HTTP 402 with exact price and settlement details, signs a deterministic micro-payment on Base L2, and receives the JSON payload in a single round-trip.
Why BoxNCase enforces strict fail-closed verification on x402
After shipping an early x402 prototype on April 20, 2026 (PR #51–#52), BoxNCase upgraded the underlying architecture on August 8, 2026 (commit bc807edd) into a full x402 v2 contract in lib/agentic-commerce/x402.ts. Verification is cleanly decoupled from order settlement, payment identifiers are validated against replay, and the endpoint refuses to issue broken challenges unless an approved Base mainnet facilitator is configured.
Meanwhile, BoxNCase keeps core product search, pricing, collections, and water mineral data 100% free and unauthenticated on /mcp/mcp so AI shopping assistants face zero friction when recommending BoxNCase products.
Frequently Asked Questions
No. Searching BoxNCase's catalog via /mcp/mcp, /llms.txt, and /llms-full.txt is completely free and requires no authentication or crypto wallet. x402 is reserved for future metered machine-to-machine data and autonomous settlement flows.
Continue Exploring the Protocol Stack
Deep-dive technical guides across UCP, Stripe ACP, MCP, x402, BSIN, and BoxNCase's Wholesale OS.
Stripe & OpenAI ACP (Agentic Commerce Protocol) for B2B Wholesale
Inside BoxNCase's Stripe & OpenAI ACP (2026-04-17) architecture: checkout_sessions, idempotency, Shared Payment Tokens (SPT), and wholesale gates.
UCP (Universal Commerce Protocol) for Wholesale & B2B Commerce
How BoxNCase implements Google's Universal Commerce Protocol (UCP 2026-08-25) for wholesale food discovery, RFC 9421 verification, and B2B procurement.
Building Agentic Wholesale Infrastructure Before the Category Had a Name
The verifiable engineering record of how BoxNCase pioneered MCP, UCP, Stripe ACP, x402, and multi-tenant wholesale agent infrastructure ahead of the market.