Overview
Returns enriched payment requirements with facilitator-specific details for resource servers.
Endpoint : POST https://facilitator.corbits.dev/accepts
Purpose
This endpoint is called by resource server middleware when handling an initial request (before payment). The facilitator receives partially-filled payment requirements and enriches them with blockchain-specific parameters needed for clients to construct valid payment proofs.
Request Body
The x402 protocol version. Currently 1.
Array of payment requirements to be enriched. Show Payment Requirements Object
Payment scheme identifier. Example: "exact"
Network identifier. Examples: "solana-devnet", "base-sepolia"
Maximum payment amount as a string (supports large numbers). Example: "1000000"
URL of the protected resource. Example: "https://api.example.com/data"
Human-readable payment description. Example: "API access fee"
Content type of the protected resource. Example: "application/json"
Recipient wallet address (merchant). Example: Solana public key or EVM address.
Payment validity window in seconds. Example: 300
Token mint (Solana) or contract address (EVM). Example: "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU" for USDC on Solana Devnet.
Optional JSON schema describing the response structure.
Optional handler-specific metadata. Initially empty or undefined.
Response
The x402 protocol version. Returns 1.
Array of enriched payment requirements that the facilitator can handle. Show Enriched Requirements
Handler-specific enrichment data added by the facilitator. The facilitator’s public key that will co-sign as fee payer.
Token decimals for the specified asset.
Recent blockhash for transaction validity.
EIP-712 domain name. Example: "USDC"
EIP-712 domain version. Example: "2"
Chain identifier. Example: 84532 for Base Sepolia.
Token contract address or forwarder address for EIP-712 verification.
All other fields from the request are preserved unchanged.
Example Request (Solana)
{
"x402Version" : 1 ,
"accepts" : [
{
"scheme" : "exact" ,
"network" : "solana-devnet" ,
"maxAmountRequired" : "1000000" ,
"resource" : "https://api.example.com/data" ,
"description" : "API access fee" ,
"mimeType" : "application/json" ,
"payTo" : "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM" ,
"maxTimeoutSeconds" : 300 ,
"asset" : "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"
}
]
}
Example Response (Solana)
{
"x402Version" : 1 ,
"accepts" : [
{
"scheme" : "exact" ,
"network" : "solana-devnet" ,
"maxAmountRequired" : "1000000" ,
"resource" : "https://api.example.com/data" ,
"description" : "API access fee" ,
"mimeType" : "application/json" ,
"payTo" : "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM" ,
"maxTimeoutSeconds" : 300 ,
"asset" : "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU" ,
"extra" : {
"feePayer" : "FacilitatorPublicKey123..." ,
"decimals" : 6 ,
"recentBlockhash" : "4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ..."
}
}
]
}
Example Request (EVM)
{
"x402Version" : 1 ,
"accepts" : [
{
"scheme" : "exact" ,
"network" : "base-sepolia" ,
"maxAmountRequired" : "1000000" ,
"resource" : "https://api.example.com/data" ,
"description" : "API access fee" ,
"mimeType" : "application/json" ,
"payTo" : "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" ,
"maxTimeoutSeconds" : 300 ,
"asset" : "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
}
]
}
Example Response (EVM)
{
"x402Version" : 1 ,
"accepts" : [
{
"scheme" : "exact" ,
"network" : "base-sepolia" ,
"maxAmountRequired" : "1000000" ,
"resource" : "https://api.example.com/data" ,
"description" : "API access fee" ,
"mimeType" : "application/json" ,
"payTo" : "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" ,
"maxTimeoutSeconds" : 300 ,
"asset" : "0x036cbd53842c5426634e7929541ec2318f3dcf7e" ,
"extra" : {
"name" : "USDC" ,
"version" : "2" ,
"chainId" : 84532 ,
"verifyingContract" : "0x036cbd53842c5426634e7929541ec2318f3dcf7e"
}
}
]
}
Usage in Middleware
Resource servers typically call this endpoint through middleware:
import { createMiddleware } from '@faremeter/middleware/express' ;
import { x402Exact } from '@faremeter/info/solana' ;
app . get (
'/protected' ,
await createMiddleware ({
facilitatorURL: 'https://facilitator.corbits.dev' ,
accepts: [
x402Exact ({
network: 'devnet' ,
asset: 'USDC' ,
amount: '10000' , // 0.01 USDC
payTo: merchantAddress ,
}),
],
}),
( _ , res ) => {
res . json ({ data: protectedData });
}
);
Handler Behavior
When the facilitator receives an /accepts request:
Iterates through handlers : Each registered handler’s getRequirements() method is called
Filters by scheme/network : Handlers only process requirements they support
Enriches requirements : Matching handlers add blockchain-specific data to the extra field
Aggregates results : All enriched requirements are combined and returned
When No Handlers Match
If no handlers match a requirement (unsupported scheme/network/asset combination), it won’t appear in the response. The facilitator returns an empty accepts array.
Example - Unsupported Network:
Request:
{
"x402Version" : 1 ,
"accepts" : [
{
"scheme" : "exact" ,
"network" : "ethereum-mainnet" ,
"maxAmountRequired" : "1000000" ,
"resource" : "https://api.example.com/data" ,
"description" : "API access fee" ,
"mimeType" : "application/json" ,
"payTo" : "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" ,
"maxTimeoutSeconds" : 300 ,
"asset" : "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
}
]
}
Response (no matching handlers):
{
"x402Version" : 1 ,
"accepts" : []
}
This indicates the facilitator cannot handle payments on ethereum-mainnet. The client should try a different network or use a different facilitator.
Error Responses
Invalid request format, missing required fields, or malformed JSON. Example: {
"error" : "Invalid request: missing required field 'accepts'"
}
500 Internal Server Error
Facilitator encountered an internal error (blockchain RPC failure, handler timeout, etc.). Example: {
"error" : "Handler timeout"
}
See Also