Documentation

x402 Facilitator Guide

Everything you need to know about RAIL's x402 facilitator and how to integrate programmatic payments into your applications.

What is an x402 Facilitator?

An x402 facilitator is the infrastructure layer that makes programmatic payments actually work. Think of it as the bridge between your application and the blockchain—handling all the messy details so you don't have to.

RAIL is an industry-leading x402 facilitator built on Solana. We verify payments, execute settlements, and provide a simple API that just works. No blockchain expertise required.

Why Use a Facilitator?

Building payment infrastructure from scratch is hard. Maintaining it across multiple chains? Even harder. Facilitators solve this by providing shared infrastructure that handles the complexity for you.

Abstract Complexity

No need to manage wallets, RPCs, or chain-specific logic. We handle all blockchain operations.

Multi-Chain Support

One API works across Solana, Ethereum, Base, and more. Add new chains without changing your code.

Built-in Security

Automatic signature verification, replay protection, and idempotency. We've handled the edge cases.

Reliable Infrastructure

99.99% uptime, automatic retries, and real-time monitoring. Your payments just work.

Architecture Overview

The x402 protocol involves four main components working together:

1

Client

The application or user making requests to protected resources. Constructs payment payloads and sends them with HTTP requests.

2

Resource Server

Your API or service that requires payment. Advertises payment requirements, verifies payments via the facilitator, and fulfills requests.

3

Facilitator (RAIL)

The infrastructure layer that verifies payment payloads and executes settlements on-chain. Provides /verify and /settle endpoints.

4

Blockchain Networks

The underlying networks (Solana, Ethereum, Base, etc.) that execute and confirm payment transactions.

Payment Flow

Here's how a payment flows through the system from the facilitator's perspective:

Step 1

Resource server receives a request with a payment payload and sends it to the facilitator's /verify endpoint.

Step 2

Facilitator validates the payload (signatures, amounts, nonces) and returns a verification response. No blockchain interaction yet—this is fast.

Step 3

When ready to execute, the resource server sends the same payload to the facilitator's /settle endpoint.

Step 4

Facilitator submits the transaction to the blockchain, waits for confirmation, and returns a payment execution response with the transaction hash.

Verification Endpoint

The /verify endpoint checks if a payment payload is valid without executing it on-chain. This is fast and free.

POST https://rail.capital/facilitator/verify

{
  "paymentPayload": { ... },
  "paymentRequirements": { ... }
}

The facilitator validates signatures, checks amounts match requirements, ensures nonces haven't been used, and returns a success or error response. Use this to give users immediate feedback before settlement.

Settlement Endpoint

The /settle endpoint executes the payment on-chain. This is where the money actually moves.

POST https://rail.capital/facilitator/settle

{
  "paymentPayload": { ... },
  "paymentRequirements": { ... }
}

The facilitator submits the transaction, monitors for confirmation, and returns the transaction hash. Settlements are idempotent—calling it multiple times with the same payload won't result in duplicate payments.

Facilitator Responsibilities

A good facilitator handles all the infrastructure details you don't want to think about:

  • Expose secure, reliable /verify and /settle endpoints
  • Validate payment payloads per scheme and network specifications
  • Prevent replay attacks and ensure idempotency
  • Submit transactions and monitor confirmations
  • Provide clear error responses for failures
  • Maintain RPC infrastructure and wallet management
  • Implement observability, rate limiting, and alerting

Getting Started with RAIL

RAIL provides a hosted x402 facilitator that makes integration dead simple. No configuration, no blockchain infrastructure, no headaches.

Key Features

Zero-configuration setup
Multi-chain support (Solana, Ethereum, Base)
Built-in security and replay protection
Real-time settlement with monitoring

Live Facilitator URL

https://rail.capital/facilitator

Just point your resource server to our facilitator endpoints and you're ready to accept payments. No manual blockchain code required.

Additional Resources

Want to dive deeper into the x402 protocol? Check out the official specification and guides.

External Documentation

x402 Protocol Specification

Official x402 documentation from Coinbase Developer Platform with detailed protocol specifications and implementation guides.