Facilitator API Reference
The T402 Facilitator API provides payment verification and on-chain settlement services. The public facilitator is available at https://facilitator.t402.io.
Base URL
https://facilitator.t402.ioAuthentication
The public facilitator does not require authentication for basic usage. For rate limit increases or enterprise features, contact the T402 team.
Endpoints
GET /health
Health check endpoint for liveness probes.
Response
{
"status": "ok"
}GET /ready
Readiness check endpoint. Returns 200 when the service is ready to accept requests.
Response
{
"status": "ready",
"checks": {
"redis": "ok",
"rpc": "ok"
}
}GET /metrics
Prometheus metrics endpoint for monitoring.
Response: Prometheus text format
GET /supported
Returns the supported networks, schemes, and signers.
Response
{
"kinds": [
{
"t402Version": 2,
"scheme": "exact",
"network": "eip155:8453"
},
{
"t402Version": 2,
"scheme": "exact",
"network": "ton:mainnet"
}
],
"extensions": [],
"signers": {
"eip155:*": ["0xC88f67e776f16DcFBf42e6bDda1B82604448899B"],
"ton:*": ["EQDjv9CUEJ__D_3-3J4trQtqVklMBiNoGVSf3Fu6AaDGkEUe"]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
kinds | array | List of supported scheme/network combinations |
kinds[].t402Version | number | Protocol version supported (2 for v2) |
kinds[].scheme | string | Payment scheme (e.g., exact, upto) |
kinds[].network | string | CAIP-2 network identifier |
extensions | array | Extension identifiers the facilitator has implemented |
signers | object | Map of CAIP-2 patterns (e.g., eip155:*) to signer addresses |
POST /verify
Verify a signed payment authorization without executing settlement.
Request Body
{
"paymentPayload": {
"t402Version": 2,
"resource": {
"url": "https://api.example.com/premium",
"description": "Premium API access",
"mimeType": "application/json"
},
"accepted": {
"scheme": "exact",
"network": "eip155:8453",
"amount": "1000000",
"asset": "0x6C96dE32CEa08842dcc4058c14d3aaAD7Fa41dee",
"payTo": "0xRecipientAddress",
"maxTimeoutSeconds": 600,
"extra": {
"name": "USDT0",
"version": "2"
}
},
"payload": {
"signature": "0x...",
"authorization": {
"from": "0xPayerAddress",
"to": "0xRecipientAddress",
"value": "1000000",
"validAfter": "0",
"validBefore": "1706745600",
"nonce": "0x..."
}
}
},
"paymentRequirements": {
"scheme": "exact",
"network": "eip155:8453",
"amount": "1000000",
"asset": "0x6C96dE32CEa08842dcc4058c14d3aaAD7Fa41dee",
"payTo": "0xRecipientAddress",
"maxTimeoutSeconds": 600,
"extra": {
"name": "USDT0",
"version": "2"
}
}
}Response (Success)
{
"isValid": true,
"payer": "0xPayerAddress"
}Response (Invalid)
{
"isValid": false,
"invalidReason": "Signature verification failed",
"payer": "0xPayerAddress"
}Response Fields
| Field | Type | Description |
|---|---|---|
isValid | boolean | Whether the payment authorization is valid |
invalidReason | string | Reason for invalidity (omitted if valid) |
payer | string | Address of the payer’s wallet |
POST /settle
Execute on-chain settlement for a verified payment.
Headers
| Header | Required | Description |
|---|---|---|
Idempotency-Key | Recommended | Unique key (max 64 chars, alphanumeric/hyphens) to prevent duplicate settlements |
Request Body
{
"paymentPayload": {
"t402Version": 2,
"resource": {
"url": "https://api.example.com/premium",
"description": "Premium API access",
"mimeType": "application/json"
},
"accepted": {
"scheme": "exact",
"network": "eip155:8453",
"amount": "1000000",
"asset": "0x6C96dE32CEa08842dcc4058c14d3aaAD7Fa41dee",
"payTo": "0xRecipientAddress",
"maxTimeoutSeconds": 600,
"extra": {
"name": "USDT0",
"version": "2"
}
},
"payload": {
"signature": "0x...",
"authorization": {
"from": "0xPayerAddress",
"to": "0xRecipientAddress",
"value": "1000000",
"validAfter": "0",
"validBefore": "1706745600",
"nonce": "0x..."
}
}
},
"paymentRequirements": {
"scheme": "exact",
"network": "eip155:8453",
"amount": "1000000",
"asset": "0x6C96dE32CEa08842dcc4058c14d3aaAD7Fa41dee",
"payTo": "0xRecipientAddress",
"maxTimeoutSeconds": 600,
"extra": {
"name": "USDT0",
"version": "2"
}
}
}Response (Success)
{
"success": true,
"transaction": "0x...",
"network": "eip155:8453",
"payer": "0xPayerAddress"
}Response (Failure)
{
"success": false,
"errorReason": "Insufficient balance",
"transaction": "",
"network": "eip155:8453",
"payer": "0xPayerAddress"
}Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Whether settlement was successful |
transaction | string | Blockchain transaction hash (empty string if failed) |
network | string | Network where settlement occurred |
payer | string | Address of the payer’s wallet |
errorReason | string | Reason for failure (omitted if successful) |
Idempotency: Always use the Idempotency-Key header for settlement requests to prevent double payments in case of network errors or retries.
Error Responses
All endpoints return structured error responses:
{
"code": "INVALID_REQUEST",
"message": "Invalid request body"
}Error Codes
| Code | HTTP Status | Description |
|---|---|---|
INVALID_REQUEST | 400 | Malformed request body |
INVALID_IDEMPOTENCY_KEY | 400 | Invalid idempotency key format |
VERIFICATION_FAILED | 500 | Payment verification failed |
SETTLEMENT_FAILED | 500 | On-chain settlement failed |
REQUEST_IN_PROGRESS | 409 | Duplicate request still processing |
PAYLOAD_MISMATCH | 409 | Payload doesn’t match previous request with same idempotency key |
PREVIOUS_REQUEST_FAILED | 409 | Previous request with this key failed |
IDEMPOTENCY_UNAVAILABLE | 503 | Idempotency service unavailable |
Rate Limiting
The public facilitator implements rate limiting:
| Tier | Requests/Minute | Description |
|---|---|---|
| Default | 60 | Standard public access |
| Authenticated | 1000 | With API key |
Rate limit headers are included in responses:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1706745660Supported Networks
EVM Networks
| Network | Chain ID | CAIP-2 | Facilitator Address |
|---|---|---|---|
| Ethereum | 1 | eip155:1 | 0xC88f67e776f16DcFBf42e6bDda1B82604448899B |
| Base | 8453 | eip155:8453 | 0xC88f67e776f16DcFBf42e6bDda1B82604448899B |
| Arbitrum | 42161 | eip155:42161 | 0xC88f67e776f16DcFBf42e6bDda1B82604448899B |
| Optimism | 10 | eip155:10 | 0xC88f67e776f16DcFBf42e6bDda1B82604448899B |
| Ink | 57073 | eip155:57073 | 0xC88f67e776f16DcFBf42e6bDda1B82604448899B |
| Berachain | 80094 | eip155:80094 | 0xC88f67e776f16DcFBf42e6bDda1B82604448899B |
Non-EVM Networks
| Network | CAIP-2 | Facilitator Address |
|---|---|---|
| Solana | solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp | 8GGtWHRQ1wz5gDKE2KXZLktqzcfV1CBqSbeUZjA7hoWL |
| TON | ton:mainnet | EQDjv9CUEJ__D_3-3J4trQtqVklMBiNoGVSf3Fu6AaDGkEUe |
| TRON | tron:mainnet | TT1MqNNj2k5qdGA6nrrCodW6oyHbbAreQ5 |
| NEAR | near:mainnet | facilitator.t402.near |
| Stacks | stacks:1 | SP36B1B191JTQAZTRKKWRN7J0YHHM41W9P9P7EPR5 |
| Cosmos (Noble) | cosmos:noble-1 | noble1ejc2c2gvk46h7kyulx9fus85vdpq0zdjwkfav0 |
| Aptos | aptos:1 | Verification only (exact-direct) |
| Tezos | tezos:NetXdQprcVkpaWU | Verification only (exact-direct) |
| Polkadot | polkadot:68d56f15f85d3136970ec16946040bc1 | Verification only (exact-direct) |
Code Examples
# Check supported networks
curl https://facilitator.t402.io/supported
# Verify payment
curl -X POST https://facilitator.t402.io/verify \
-H "Content-Type: application/json" \
-d '{
"paymentPayload": {...},
"paymentRequirements": {...}
}'
# Settle payment
curl -X POST https://facilitator.t402.io/settle \
-H "Content-Type: application/json" \
-H "Idempotency-Key: unique-key-123" \
-d '{
"paymentPayload": {...},
"paymentRequirements": {...}
}'Self-Hosting
You can run your own facilitator for greater control and privacy. See the Deployment Guide for instructions.
# Docker
docker run -p 8080:8080 ghcr.io/t402-io/facilitator:latest
# Environment variables
export EVM_PRIVATE_KEY=0x...
export TON_MNEMONIC="word1 word2 ..."
export REDIS_URL=redis://localhost:6379Related
- Protocol Specification - Full protocol details
- TypeScript SDK - Client library
- Go SDK - Server library
- Deployment - Self-hosting guide