Current behavior
Our 402 response does not include an x402Version field:
{
"accepts": [...],
"version": "1"
}
The version field is our own; it's not the x402 protocol version.
Required behavior
Add x402Version: 2 to:
- 402 response (PAYMENT-REQUIRED): Top-level field in the response body
- PAYMENT-SIGNATURE header: Include in the payment payload
- PAYMENT-RESPONSE header: Include in the settlement result
{
"x402Version": 2,
"accepts": [...],
"version": "1"
}
Changes needed
Resource server (resource-server.js)
- Add
x402Version: 2 to the 402 JSON response
Client (client.js) and dApp (dapp/components/X402Fetch.tsx)
- Include
x402Version: 2 in the payment payload
Facilitator (facilitator.js)
- Include
x402Version: 2 in verify/settle responses
References
Current behavior
Our 402 response does not include an
x402Versionfield:{ "accepts": [...], "version": "1" }The
versionfield is our own; it's not the x402 protocol version.Required behavior
Add
x402Version: 2to:{ "x402Version": 2, "accepts": [...], "version": "1" }Changes needed
Resource server (
resource-server.js)x402Version: 2to the 402 JSON responseClient (
client.js) and dApp (dapp/components/X402Fetch.tsx)x402Version: 2in the payment payloadFacilitator (
facilitator.js)x402Version: 2in verify/settle responsesReferences