HTTP 402 payment verification and settlement on TON

Checking...

How it works

1
Sign

Client signs a W5 transfer (TON or USDT) directly to the vendor

2
Verify

Facilitator validates signature, amount, recipient, seqno

3
Settle

Facilitator broadcasts via TONAPI gasless (USDT) or direct (TON)

Endpoints

GET /supported Facilitator capabilities

Returns supported payment schemes, network, asset configuration, and signer addresses.

Response
{ "kinds": [{ "x402Version": 2, "scheme": "exact", "network": "tvm:-239", "extra": { "relayAddress": "0:7ae5...", "maxRelayCommission": "500000", "assetDecimals": 6, "assetSymbol": "USDT" } }], "extensions": [], "signers": { "tvm:*": ["0:8165..."] } }
GET /health Server health and TON connectivity

Returns server status, version, uptime, and TON node connectivity.

Response
{ "status": "healthy", "version": "1.0.0", "uptime": 3600, "ton": { "connected": true, "network": "tvm:-239", "latestBlock": 58310477 } }
POST /verify Validate a signed payment

Validates a signed payment BOC without broadcasting. Checks signature, amount, recipient, seqno, and expiry.

Request body
{ "paymentPayload": { "x402Version": 2, "payload": { "signedBoc": "base64...", "walletPublicKey": "hex64...", "walletAddress": "0:...", "seqno": 1, "validUntil": 1773502200 } }, "paymentRequirements": { "scheme": "exact", "network": "tvm:-239", "asset": "native", "amount": "1000000000", "payTo": "0:...", "maxTimeoutSeconds": 120 } }
Response
{ "isValid": true, "payer": "0:82ee..." }
POST /settle Verify and broadcast payment

Verifies the payment then broadcasts the BOC to the TON network. Requires Idempotency-Key header.

Request body

Same structure as /verify

Response
{ "success": true, "payer": "0:82ee...", "transaction": "a4609b3f...", "network": "tvm:-239" }

Network

Blockchain
TON Mainnet
Network
tvm:-239
Assets
TON (native), USDT (gasless)
Wallet
W5 v5r1
x402 Version
2
Relay Commission
Loading...

Addresses

Facilitator
Loading...
TONAPI Relay
Loading...

SDK

$ npm install x402ton

Peer deps: @ton/core @ton/crypto @ton/ton

Links