Menu

x402 v1 to v2: every header and field that changed (migration cheat sheet)
📰

x402 v1 to v2: every header and field that changed (migration cheat sheet)

DEV Community·Penny·3 days ago
#KyBPrIxg
#dev#payment#resource#accepts#network
Reading 0:00
15s threshold

If your x402 client worked last spring and now chokes on a 402 , the server has probably moved to x402 version 2 . The flow is the same (request, get 402, sign, retry), but most field names and both headers changed. Here's the diff I wish I'd had, taken from the v1 and v2 spec documents and checked against a live v2 endpoint I run.

1. Headers

What v1 v2

Server says "pay me" JSON body of the 402 PAYMENT-REQUIRED response header (base64 JSON). Many servers also still put it in the body

Client sends payment X-PAYMENT request header PAYMENT-SIGNATURE request header

Server returns settlement X-PAYMENT-RESPONSE PAYMENT-RESPONSE

Tip: during the transition, servers often send both X-PAYMENT-RESPONSE and PAYMENT-RESPONSE . Clients should read either one.

2.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.