x402r-sdk/ repository. Each is a standalone project that demonstrates a specific integration pattern.
Examples
facilitator
Operator-agnostic HTTP service implementing x402’s facilitator protocol for escrow payments. Handles signature verification and on-chain settlement.
deploy-operator
Deploy a complete marketplace operator with escrow, freeze, and arbiter support.
server-express
Express merchant server using
EscrowServerScheme, HTTPFacilitatorClient, and refundable() to accept escrow payments via x402 middleware.server-hono
Hono merchant server using
EscrowServerScheme, HTTPFacilitatorClient, and refundable() to accept escrow payments via x402 middleware.merchant-cli
CLI tool for merchants to release payments, approve/deny refunds, and query escrow state.
client-cli
CLI tool for payers to
pay, preview-fee, request refunds, freeze payments, and check status.arbiter-cli
CLI tool for arbiters to review cases, make decisions, and manage registry.
shared
Shared utilities used by the CLI examples:
parsePaymentInfo, shortAddress, formatUSDC.Running Examples
The full payment flow requires the facilitator to be running before the merchant server:The facilitator must be running before the merchant server (Express or Hono) starts, as the merchant delegates payment verification and settlement to it.
deploy-operator
Deploys a complete marketplace operator usingdeployMarketplaceOperator():
Server Examples
Demonstrates minimal merchant servers (Express and Hono variants) that useEscrowServerScheme, HTTPFacilitatorClient, and refundable() via x402’s standard middleware:
- Returns 402 with
refundable()payment options - Delegates payment verification to the facilitator via
HTTPFacilitatorClient - Delegates on-chain settlement to the facilitator after the handler runs
- Returns weather data after successful payment
Next Steps
Deploy Operator
Deploy a PaymentOperator with escrow and freeze support.
refundable() Helper
Mark payment options as refundable with escrow configuration.
Core Concepts
Understand the payment lifecycle and key concepts.
GitHub
Browse all examples on GitHub.
