API Reference
Complete documentation for Blocky402 facilitator API endpoints. The wire
format is x402 v2 (x402Version: 2); the facilitator does not accept
v1 envelopes. Upgrading from x402 v1? See the
migration guide.
Base URLs
- Testnet:
https://api.testnet.blocky402.com(orhttp://localhost:3002for local development) - Mainnet:
https://api.blocky402.com(coming soon)
Authentication
- Testnet: No authentication required (open access)
- Mainnet: API key required in
X-Api-Keyheader (format:b402_<64_character_hex_string>)
Endpoints
GET /supported
Returns supported payment schemes and networks for the current environment.
Request:
GET /supported
Response:
{
"kinds": [
{ "scheme": "exact", "network": "eip155:80002", "x402Version": 2 },
{
"scheme": "exact",
"network": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
"x402Version": 2,
"extra": { "feePayer": "7B6Q2MvcJvNcy1A13wHmAzmmdo3L8DVriaXML7bvkojm", "transactionVersions": [0] }
},
{
"scheme": "exact",
"network": "hedera:testnet",
"x402Version": 2,
"extra": { "feePayer": "0.0.7162784" }
}
],
"extensions": [],
"signers": {
"eip155:*": ["0xDCF7D72C2eE049DE4269ac6AAf925F33efdA18de"],
"solana:*": ["7B6Q2MvcJvNcy1A13wHmAzmmdo3L8DVriaXML7bvkojm"],
"hedera:*": ["0.0.7162784"]
}
}
Solana and Hedera entries carry extra.feePayer — the account the facilitator co-signs as. Clients must place the same value into paymentRequirements.extra.feePayer when building the payment payload, or the client SDK will throw before signing.
Hedera transferExecutor (experimental). When the operator admits at least
one executor, the hedera:testnet entry also carries extra.assetTransferMethods
and extra.executors. Without an admitted executor these fields are absent and
the response is exactly as above.
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 listed below 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.
{
"scheme": "exact",
"network": "hedera:testnet",
"x402Version": 2,
"extra": {
"feePayer": "0.0.7162784",
"assetTransferMethods": ["cryptoTransfer", "transferExecutor"],
"executors": ["0.0.11141171"]
}
}
Status Codes:
200 OK: Success401 Unauthorized: Invalid or missing API key (mainnet only)429 Too Many Requests: Rate limit exceeded
POST /verify
Verifies a payment payload against the x402 protocol. In the x402 flow the
resource server calls this endpoint, not the client. The canonical form is
a JSON body with a paymentPayload object, matching @x402/[email protected]
HTTPFacilitatorClient. Two older inputs still work but are
deprecated.
Request (canonical — paymentPayload object, Hedera example):
The same HTTP envelope works for EVM and SVM — only the payload shape inside paymentPayload differs (see Payload shapes by scheme below). Hedera additionally requires extra.feePayer and must match the fee-payer the facilitator advertises in GET /supported.
POST /verify
Content-Type: application/json
{
"x402Version": 2,
"paymentPayload": {
"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>"
}
},
"paymentRequirements": {
"scheme": "exact",
"network": "hedera:testnet",
"amount": "100000",
"payTo": "0.0.8011510",
"maxTimeoutSeconds": 300,
"asset": "0.0.0",
"extra": { "feePayer": "0.0.7162784" }
}
}
Request (deprecated — X-PAYMENT header): a Blocky402 convenience input,
not part of the x402 v2 facilitator API. The same paymentPayload object,
base64-encoded, sent in the X-PAYMENT header; the body then only carries
paymentRequirements. It still works, but responses carry Deprecation and
Link headers and it will be removed in a future release (no date announced).
Send the JSON body above instead. See the migration guide.
POST /verify
X-PAYMENT: <base64(JSON(paymentPayload))>
Content-Type: application/json
{ "paymentRequirements": { /* same shape as above */ } }
Request (deprecated — base64 paymentHeader in body): equivalent to the
X-PAYMENT header form but with the base64 string in the body. Accepted
for backwards-compatibility with pre-2.12 clients, and deprecated on the same
terms: Deprecation and Link response headers, removal in a future release,
no date announced.
{
"x402Version": 2,
"paymentHeader": "<base64(JSON(paymentPayload))>",
"paymentRequirements": { /* same shape as above */ }
}
Response (valid):
{
"isValid": true,
"payer": "0.0.7326075"
}
Response (invalid):
{
"isValid": false,
"invalidReason": "invalid_exact_hedera_payload_signature_invalid",
"invalidMessage": "signature_invalid: payer 0.0.7326075 did not sign the transaction",
"payer": "0.0.7326075"
}
Optional response fields: extensions, extra (scheme-specific blobs).
Status Codes:
200 OK: Verification completed (checkisValid)400 Bad Request: Invalid request format, unknown scheme, unsupported network, or a v1-shaped request401 Unauthorized: Invalid or missing API key (mainnet only)429 Too Many Requests: Rate limit exceeded
POST /settle
Settles a payment by broadcasting the transaction. Same inputs as /verify
(the JSON body is preferred; X-PAYMENT and paymentHeader are deprecated);
the body shape is identical, so you can reuse the same paymentPayload +
paymentRequirements pair.
Request: identical to /verify. POST to /settle instead.
Response (success):
{
"success": true,
"transaction": "[email protected]",
"network": "hedera:testnet",
"payer": "0.0.7326075"
}
The transaction field is network-native: 0.0.<feePayer>@<seconds>.<nanos> for Hedera, a 0x… hash for EVM, base58 signature for SVM.
Response (error):
{
"success": false,
"errorReason": "invalid_exact_hedera_payload_signature_invalid",
"errorMessage": "signature_invalid: payer 0.0.7326075 did not sign the transaction",
"transaction": "",
"network": "hedera:testnet",
"payer": "0.0.7326075"
}
Optional response fields: amount (for schemes that allow partial
settlement, e.g. upto), extensions, extra.
Status Codes:
200 OK: Settlement attempt completed (checksuccess)400 Bad Request: Invalid request format, unknown scheme, unsupported network, or a v1-shaped request401 Unauthorized: Invalid or missing API key (mainnet only)429 Too Many Requests: Rate limit exceeded
GET /health
Health check endpoint for monitoring API status.
Request:
GET /health
Response:
{
"status": "ok",
"timestamp": "2026-05-17T10:30:00Z",
"version": "1.0.0"
}
Status Codes:
200 OK: Service is healthy
Payload shapes by scheme
The paymentPayload.payload field is scheme-specific. The facilitator
detects the shape automatically.
Hedera exact (and SVM exact)
{ "transaction": "<base64-encoded transaction bytes>" }
For Hedera this is a partially-signed TransferTransaction produced by @x402/hedera’s ExactHederaScheme.createPaymentPayload(...). The facilitator’s fee-payer co-signs at settlement time.
Hedera transferExecutor (experimental)
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 below 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.
The payer does not sign a Hedera transaction. The payload names an executor
contract and carries an opaque authorization that the executor validates:
{
"payer": "0.0.7326075",
"executor": "0.0.11141171",
"authorization": "0x..."
}
paymentRequirements.extramust carryassetTransferMethod: "transferExecutor"andexecutors, both copied fromGET /supported.paymentPayload.acceptedmust echo the requirements, includingextra.assetTransferMethod.- The fee payer funds the gas. The facilitator builds the executor call,
simulates it on the Mirror Node during
/verify, and submits it at/settle. - Executors are matched as
0.0.xids.payTomust not be the facilitator account, and HTS tokens with custom fees are rejected.
@x402/hedera behaviour changes in the transferExecutor build
Integrators will notice these when they move to a build that includes
transferExecutor. They are part of the same unreleased change and may change
before a release.
- An
extra.assetTransferMethodthe package does not define is now rejected withinvalid_exact_hedera_asset_transfer_method. It used to be paid ascryptoTransfer, which the spec forbids. - For
cryptoTransferrequirements, a payment whoseacceptednames a different method is rejected withaccepted_payment_requirements_mismatch. 2.28.0 ignored the method. - The server scheme’s
defaultAssetTransferMethodis"cryptoTransfer"instead of"default". Routes that omit the method get the same flows and the same wire output, so this only matters to code that reads the constant. transferExecutorquotes fail to build if they list an executor the facilitator does not advertise, or if they carryextra.splitsother than[]ornull. They may useupfront.
EVM exact — EIP-3009 (default)
{
"signature": "0x...",
"authorization": {
"from": "0x...", "to": "0x...", "value": "1000000",
"validAfter": "0", "validBefore": "9999999999",
"nonce": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
}
EVM exact — Permit2
{
"signature": "0x...",
"permit2Authorization": {
"from": "0x...", "spender": "0x...",
"nonce": "0", "deadline": "9999999999",
"permitted": { "token": "0x...", "amount": "1000000" },
"witness": { "facilitator": "0x...", "to": "0x...", "validAfter": "0" }
}
}
Rate Limiting
Testnet
- Type: Per-IP
- Limit: 100 requests per minute
- Burst: 10 requests
Mainnet (Coming Soon)
- Type: Per-API-Key
- Limit: 10 requests per second
- Daily Quota: 10,000 settlements per day per key
Error Responses
NestJS-style error bodies on 4xx:
{
"statusCode": 400,
"message": "Network unsupported-network is not supported",
"error": "Bad Request"
}
For validation failures, message is a comma-joined list of constraint
violations, e.g. "Validation failed: amount must be a string, extra should not be null or undefined".
Common Error Messages
| HTTP Status | Trigger |
|---|---|
400 | DTO validation, unknown scheme/network, missing x402Version, malformed base64, v1-shaped request: x402Version: 1 returns No facilitator registered for x402 version: 1; v1 field names such as maxAmountRequired fail validation |
401 | Mainnet only — missing or invalid X-Api-Key |
429 | Rate limit exceeded |
500 | Unexpected facilitator error |
Verification and settlement reasons
/verify and /settle answer 200 even when the payment is rejected; read
invalidReason (verify) or errorReason (settle). Hedera reasons are prefixed
invalid_exact_hedera_. The ones below belong to transferExecutor and are
experimental, like the method itself (see the banner above).
| Reason | Meaning |
|---|---|
invalid_exact_hedera_unsupported_asset_transfer_method | The method is not enabled on this network: no executor is admitted. |
invalid_exact_hedera_asset_transfer_method | extra.assetTransferMethod is not a method the package defines. |
invalid_exact_hedera_executor_not_admitted | payload.executor is not one of the admitted executors. |
invalid_exact_hedera_payload_transfer_executor, ..._payload_payer, ..._payload_executor, ..._payload_authorization | payload is missing, or payer / executor is not a Hedera id, or authorization is not a valid value. It must be exactly { payer, executor, authorization }. |
invalid_exact_hedera_custom_fee_asset | The HTS token has custom fees. |
accepted_payment_requirements_mismatch | accepted names a different asset transfer method than the requirements. |
address_resolution_failed | payer or payTo is unknown to the Mirror Node. |
simulation_reverted | The executor rejected the call (bad signature, expired intent, wrong nonce, missing allowance). |
simulation_gas_exceeded | The gas estimate is above the operator’s configured ceiling. |
settlement_pending | Submitted, but the record is not available yet. Look up the returned transaction id before retrying. |
settlement_payee_credit_mismatch, settlement_payer_debit_mismatch, settlement_fee_payer_debit_mismatch, settlement_unexpected_debit, settlement_unexpected_transfer | The call succeeded but did not move exactly the requested funds (the payee was not credited the amount, or the payer or fee payer was debited a different amount, or an account nobody asked to pay was debited); reported as failed. |
settlement_status_not_success | The transaction record’s status is not SUCCESS; reported as failed. |
settlement_check_failed | The facilitator could not check the transaction record against the request (for example, a malformed record or log); reported as failed. |
Payment Flow
- The client requests a paid resource. The resource server answers
402with aPAYMENT-REQUIREDheader. - The client signs a v2 PaymentPayload with
@x402/hedera,@x402/evm, or@x402/svmand retries with aPAYMENT-SIGNATUREheader. - The resource server calls Blocky402
POST /verify(checkisValid), thenPOST /settle(checksuccess, readtransaction), with a JSON body. - The resource server returns the resource with a
PAYMENT-RESPONSEheader.
Calling the facilitator yourself, for example in a test or a custom server? Use GET /supported to discover capabilities, then send the same JSON body to /verify and /settle.
For complete examples, see the Code Examples page.