Migrating off X-PAYMENT (x402 v1 to v2)
Blocky402 speaks x402 v2. If your integration still sends an X-PAYMENT
header, a base64 paymentHeader field, or a v1-shaped payload, this page
tells you what to change and what happens if you do nothing.
What to use instead
| You are… | Today you use | Use instead |
|---|---|---|
Calling the facilitator directly (/verify, /settle) | X-PAYMENT header or body paymentHeader | A JSON body with paymentPayload and paymentRequirements (both objects). See API Reference. |
| A client paying a protected resource | Building X-PAYMENT by hand, or an x402 / x402-fetch v1 package | @x402/fetch wrapFetchWithPayment, or x402HTTPClient for manual control. The client sends PAYMENT-SIGNATURE. |
| A resource server charging for an endpoint | Reading X-PAYMENT yourself, or an x402-express v1 package | @x402/express paymentMiddleware pointed at Blocky402 as the facilitator. The middleware reads PAYMENT-SIGNATURE and calls /verify and /settle for you. |
In the x402 flow the resource server talks to the facilitator, not the
client. A client never needs to call /verify or /settle.
Headers
| v1 | v2 | Direction | Carries |
|---|---|---|---|
X-PAYMENT | PAYMENT-SIGNATURE | client to resource server | base64 JSON PaymentPayload |
response body of the 402 | PAYMENT-REQUIRED | resource server to client | base64 JSON PaymentRequired (the accepts list) |
X-PAYMENT-RESPONSE | PAYMENT-RESPONSE | resource server to client | base64 JSON settlement result |
The facilitator API itself is JSON-only: /verify and /settle take a
JSON request body and return JSON. The three headers above travel between the
client and the resource server, never to the facilitator.
Body shape differences
| v1 | v2 | |
|---|---|---|
| Version | x402Version: 1 | x402Version: 2 |
| Price field | maxAmountRequired | amount |
| Network | Friendly names such as base-sepolia | CAIP-2 ids such as eip155:84532, hedera:testnet |
| Scheme and network in the payload | Top level of paymentPayload | Inside paymentPayload.accepted (the requirements the client chose) |
| Resource description | Fields inside each requirement | Top-level resource object |
A v2 PaymentPayload is { x402Version, resource?, accepted, payload, extensions? }.
There is no top-level scheme or network.
{
"x402Version": 2,
"accepted": {
"scheme": "exact",
"network": "hedera:testnet",
"amount": "100000",
"payTo": "0.0.8011510",
"maxTimeoutSeconds": 300,
"asset": "0.0.0",
"extra": { "feePayer": "0.0.7162784" }
},
"payload": { "transaction": "<base64-encoded TransferTransaction bytes>" }
}
SDK packages
| Role | v1 | v2 |
|---|---|---|
| Core types and HTTP client | x402 | @x402/core |
| Client fetch wrapper | x402-fetch | @x402/fetch |
| Resource server middleware | x402-express | @x402/express |
| Chain support | bundled | @x402/evm, @x402/svm, @x402/hedera |
What Blocky402 accepts
| Input | Status |
|---|---|
JSON body with paymentPayload | Preferred. No deprecation signal. |
X-PAYMENT header | Still works, deprecated. Will be removed in a future release. |
Body paymentHeader (base64 string) | Still works, deprecated. Will be removed in a future release. |
| v1-shaped request | Rejected with a 400 Bad Request (for example No facilitator registered for x402 version: 1). |
Responses to the two deprecated inputs carry a Deprecation: true header and a
Link header pointing at this page with rel="deprecation". No removal date
is announced. When one is, it will be sent as a Sunset header and noted in
the Changelog.
If a request carries both an X-PAYMENT header and a body paymentPayload,
the header wins.
Step by step
- Direct callers: decode your base64 payload once and send it as the
paymentPayloadobject. KeeppaymentRequirementsas it is. - Clients: replace hand-built
X-PAYMENTheaders withwrapFetchWithPayment. - Resource servers: replace your own header parsing with
paymentMiddlewareand set the facilitator URL tohttps://api.testnet.blocky402.com. - Check responses for a
Deprecationheader. If none is present you are on the preferred path.
See Code Examples for runnable versions of each role.
Scope of this guide
This guide has been verified against the TypeScript SDK only
(@x402/* 2.29). Python and Go SDK behaviour is not covered.
Hedera transferExecutor
Experimental and unreleased.
transferExecutoris testnet only and opt-in per executor. It runs on an unreleased@x402/hederabuild from x402 PR #4030, which is open and has not been reviewed by the maintainers (checked 2026-11-05), so its option names, exports and the behaviour changes may change before a release. The npm client scheme cannot build this payload. The public spec sectionscheme_exact_hedera.md(merged 2026-09-24) is separate from that unreleased reference implementation.
It is not part of the migration. For the payload, error codes and behaviour changes, see API Reference.