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 useUse instead
Calling the facilitator directly (/verify, /settle)X-PAYMENT header or body paymentHeaderA JSON body with paymentPayload and paymentRequirements (both objects). See API Reference.
A client paying a protected resourceBuilding 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 endpointReading 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

v1v2DirectionCarries
X-PAYMENTPAYMENT-SIGNATUREclient to resource serverbase64 JSON PaymentPayload
response body of the 402PAYMENT-REQUIREDresource server to clientbase64 JSON PaymentRequired (the accepts list)
X-PAYMENT-RESPONSEPAYMENT-RESPONSEresource server to clientbase64 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

v1v2
Versionx402Version: 1x402Version: 2
Price fieldmaxAmountRequiredamount
NetworkFriendly names such as base-sepoliaCAIP-2 ids such as eip155:84532, hedera:testnet
Scheme and network in the payloadTop level of paymentPayloadInside paymentPayload.accepted (the requirements the client chose)
Resource descriptionFields inside each requirementTop-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

Rolev1v2
Core types and HTTP clientx402@x402/core
Client fetch wrapperx402-fetch@x402/fetch
Resource server middlewarex402-express@x402/express
Chain supportbundled@x402/evm, @x402/svm, @x402/hedera

What Blocky402 accepts

InputStatus
JSON body with paymentPayloadPreferred. No deprecation signal.
X-PAYMENT headerStill 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 requestRejected 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

  1. Direct callers: decode your base64 payload once and send it as the paymentPayload object. Keep paymentRequirements as it is.
  2. Clients: replace hand-built X-PAYMENT headers with wrapFetchWithPayment.
  3. Resource servers: replace your own header parsing with paymentMiddleware and set the facilitator URL to https://api.testnet.blocky402.com.
  4. Check responses for a Deprecation header. 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. transferExecutor is testnet only and opt-in per executor. It runs on an unreleased @x402/hedera build 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 section scheme_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.