Short answer: x402 v2 moved the payment challenge out of the 402 response body into a base64 PAYMENT-REQUIRED header, renamed the client's X-PAYMENT header to PAYMENT-SIGNATURE and the server's X-PAYMENT-RESPONSE to PAYMENT-RESPONSE, switched network names such as base to CAIP-2 identifiers such as eip155:8453, and moved the SDKs from x402-* to the scoped @x402/* packages. The facilitator accepts both versions and a v2 server still takes v1 payments, so nothing stops working the day you upgrade. What does happen is that a v1 server meets v2 clients that put their payment where it doesn't look, and logs invalid_payload or counts the request as unpaid. One curl tells you which version an endpoint speaks, and the migration is a list of mechanical edits. This post goes through them, as of 1 November 2026.
Some background: v2 was announced on 11 December 2025 as a restructuring without breaking changes, "fully backward-compatible with V1" at the SDK level, and the reference implementation has since moved to the x402 Foundation's x402-foundation/x402 repository (the TypeScript core changelog records the move in 2.9.0). The official migration guide has the code; this post adds what the guide leaves out, which is how the two versions look on the wire and what goes wrong when they meet. ToolVet parses both formats when it checks a listed endpoint, and the free x402 checker reports the version as one of its nine checks (how we check and score).
What changed on the wire
| v1 | v2 | |
|---|---|---|
| Where the challenge is | JSON body of the 402 |
PAYMENT-REQUIRED header, base64 JSON; body left to the server (the spec's example is {}) |
| Client's payment header | X-PAYMENT |
PAYMENT-SIGNATURE |
| Server's receipt header | X-PAYMENT-RESPONSE |
PAYMENT-RESPONSE |
| Version field | x402Version: 1 |
x402Version: 2 |
| Network | base, base-sepolia |
eip155:8453, eip155:84532 |
| Price field | maxAmountRequired |
amount |
| Resource, description, MIME type | inside each accepts entry |
one top-level resource object with url, description, mimeType |
The headers and the body rule come from the v2 HTTP transport spec, which calls PAYMENT-REQUIRED "the canonical HTTP transport location for the PaymentRequired object" and says "Response bodies are a server implementation concern." The field changes come from the v1 and v2 core specifications. In v1 each entry in accepts carried its own resource, description and mimeType and the required fields were scheme, network, maxAmountRequired, asset, payTo, resource, description and maxTimeoutSeconds. In v2 an entry is scheme, network, asset, amount, payTo, maxTimeoutSeconds and an optional extra, and the resource is described once. The client's payload changed shape too: v1 sent {x402Version, scheme, network, payload}, v2 sends {x402Version, resource, accepted, payload, extensions}, where accepted is the whole requirements entry the client chose. The payload itself (an EIP-712 signature over an EIP-3009 authorization with from, to, value, validAfter, validBefore, nonce) is the same.
The network mapping from the migration guide:
| v1 | v2 (CAIP-2) |
|---|---|
base |
eip155:8453 |
base-sepolia |
eip155:84532 |
ethereum |
eip155:1 |
sepolia |
eip155:11155111 |
solana |
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp |
solana-devnet |
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1 |
The Python SDK's 2.26.0 release on 28 October 2026 added a check to "Reject malformed V2 network identifiers that do not match CAIP-2 syntax", so a v2 config that still says base is refused instead of failing at the first payment.
Which version is this endpoint speaking?
Send the unpaid request and look at the headers:
curl -si https://api.example.com/paid \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decode
If that prints JSON with "x402Version":2, the endpoint is v2. If grep finds nothing and the body of the 402 is JSON with "x402Version":1 and maxAmountRequired inside accepts, it is v1. The checker does the same and marks the version check as passing only for a v2 header; a v1 challenge still parses, prices and lists, but the fix text tells the owner to upgrade. Catalogs are stricter in places: one developer's migration notes from July 2026 report that submitting a v1 origin to x402scan produced a rejection saying a v1 response was detected and the service should migrate.
Why a v1 server sees invalid_payload
invalid_payload is one of the error reasons the core spec defines, alongside invalid_x402_version, invalid_network, unsupported_scheme and the rest. On a v1 server it tends to mean something specific. A v2 client reads the 402, finds no PAYMENT-REQUIRED header, and either gives up or, if it also understands v1 bodies, pays and sends PAYMENT-SIGNATURE. The v1 middleware looks for X-PAYMENT, finds nothing, and treats the request as unpaid, or finds a v2-shaped payload where it expected a v1 one and logs invalid_payload without saying why. The same developer notes describe exactly this: weeks of invalid_payload entries from "V2-capable clients attempting payment against V1 middleware", recognised only after the fact. The checklist in those notes starts with "Confirm you're on V1 (check for invalid_payload errors in your logs)".
The reverse direction is friendlier. The migration guide says a v2 server "can still accept payments from V1 clients" and "the facilitator supports both V1 and V2 protocols". SDKs that handle both look for the v2 header first: thirdweb's v2 changelog from 13 January 2026 says "Payment data retrieval now prioritizes v2 headers with fallback to v1", and the Python SDK's 2.26.0 release notes that its "HTTP resource server now rejects V1 payloads in the PAYMENT-SIGNATURE header with a 402 instead of failing with a 500". If you run a dual-version endpoint for browsers, the transport spec's CORS note applies: name X-PAYMENT next to PAYMENT-SIGNATURE in Access-Control-Allow-Headers and X-PAYMENT-RESPONSE next to PAYMENT-RESPONSE in Access-Control-Expose-Headers, because "a dual-version endpoint that names only one spelling fails the same way for the other version's clients".
The migration, step by step
The guide covers TypeScript and Python. The steps, condensed:
- Packages.
x402becomes@x402/core;x402-express,x402-hono,x402-next,x402-axiosandx402-fetchbecome@x402/express,@x402/hono,@x402/next,@x402/axiosand@x402/fetch; chain support moves into@x402/evmand@x402/svm. Python keeps thex402package but moves the import paths:x402.fastapi.middlewareis nowx402.http.middleware.fastapi,x402.clients.httpxisx402.http.clients, and the extras arex402[httpx],x402[requests],x402[fastapi],x402[flask]andx402[svm]. Upgrade the@x402/*packages together, to one version. - Server wiring. Create an
x402ResourceServeraround anHTTPFacilitatorClientand register a scheme explicitly:server.register("eip155:*", new ExactEvmScheme()). Python'srequire_paymentfunction becomes thePaymentMiddlewareASGIclass withRouteConfigandPaymentOptionmodels; Flask usesx402ResourceServerSyncandHTTPFacilitatorClientSync. - Route config. Routes are keyed by method and path, for example
"GET /paid", each with anacceptsarray namingscheme,network(CAIP-2) andpayToper option, anddescriptionandmimeTypeas siblings ofacceptsrather than inside it. The migration notes add one thing the guide doesn't: v2 no longer readsX-Forwarded-Proto, so behind a TLS-terminating proxy the advertised resource URL can revert tohttp://unless you set an explicitresourceon each paid route. ToolVet's checker has a separate check for exactly that, and anhttp://resource URL is one of the seven reasons a listing never reaches the Bazaar. - Client wiring.
withPaymentInterceptorfromx402-axiosis nowwrapAxiosWithPaymentfrom@x402/axios, around anx402Clientwith.register("eip155:*", new ExactEvmScheme(signer)); the client picks the network from the challenge, so no chain config is needed. Python wraps the account inEthAccountSignerand callsregister_exact_evm_client; the environment variable in the examples changed fromPRIVATE_KEYtoEVM_PRIVATE_KEY. - Bazaar metadata. In v1 the input and output schemas went in
config.inputSchemaandconfig.outputSchema. In v2 usedeclareDiscoveryExtension()from@x402/extensions/bazaarand spread the result intoextensions.bazaar; a hand-writtenextensions.bazaar.schema"passes through@x402/coreunchanged but fails silently during discovery-crawler verification", which is a quiet way to stay out of the catalog. - Test with one real payment. The guide's troubleshooting section blames most verification failures on a network string that isn't CAIP-2, a wrong
payTo, or a facilitator URL that doesn't match the network; Stripe's x402 guide callshttps://x402.org/facilitatorthe "public test facilitator" for Base Sepolia, so it won't settle mainnet. The transaction hash comes back in thetransactionfield of thePAYMENT-RESPONSEheader, per the transport spec.
Two more reasons not to stay on a v1 package line, both from the TypeScript core changelog: 2.27.0 closed a paywall bypass by matching protected routes against both the escaped and the decoded request path, and 2.26.0 passes the resolved spendControls cap to every scheme. The changelogs list these fixes under the scoped packages; the three SDK flaws disclosed on 22 October 2026 had been fixed there in August's 2.23.0, and nothing in the changelogs says a x402-* 1.x line received them.
Checklist
For sellers: run the curl above against your own endpoint; if the challenge is in the body, you are on v1. Upgrade the packages together, rewrite the route config, set an explicit resource per route, declare the Bazaar extension with the helper, keep the 402 ahead of any input validation (the migration notes recommend the opposite order, but a 400 before the paywall keeps you out of the Bazaar), and confirm one settlement on mainnet. Then put the URL into the checker and look for passes on the version, resource URL and discovery schema checks.
For buyers and agent builders: use a client that reads PAYMENT-REQUIRED first and falls back to a v1 body, send PAYMENT-SIGNATURE, and treat a 402 whose PAYMENT-RESPONSE says success: false as a failed payment rather than a new challenge. The seven challenge checks apply to both versions; the version itself is the first of them.
Frequently asked questions
How do I know if an x402 endpoint is v1 or v2?
Send an unpaid request. A v2 endpoint answers 402 with a PAYMENT-REQUIRED header holding base64 JSON with "x402Version": 2; the body is left to the server (the spec's example is {}). A v1 endpoint answers 402 with the challenge as JSON in the body, "x402Version": 1 and maxAmountRequired inside accepts. ToolVet's free checker reports this as its version check.
Does a v2 server still accept v1 clients?
Yes. The official migration guide says a v2 server "can still accept payments from V1 clients" and that the facilitator supports both versions. The other direction is the problem: a v1 server doesn't read PAYMENT-SIGNATURE, so v2 clients are treated as unpaid or logged as invalid_payload.
What does invalid_payload mean in x402?
It is the error reason for a payment payload the server or facilitator can't parse or verify. On a v1 server the usual cause is a v2 client sending a v2-shaped payload, or sending it in the PAYMENT-SIGNATURE header the v1 middleware doesn't read. On a v2 server, check that the network is in CAIP-2 form and that the client's accepted entry matches one of the server's accepts.
Do I have to change my network names?
Yes, for v2: base becomes eip155:8453, base-sepolia becomes eip155:84532, and Solana mainnet becomes solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp. Since the Python SDK's 2.26.0 release on 28 October 2026, v2 network IDs that aren't CAIP-2 are rejected.
The specifications, migration guide and changelogs quoted above were read on 1 November 2026. How we check and score explains how ToolVet parses v1 and v2 challenges when it checks a listed endpoint.