Skip to main content
XPayLabs (often called xpay) is an open-source, self-hosted crypto payment infrastructure that lets you accept and manage stablecoin payments across multiple blockchains through a single API. Multi-tenant by design — a single deployment can host unlimited merchants, each with isolated API credentials and independent configuration. Set your own fee structure and earn from every transaction. Unlike hosted payment gateways, XPayLabs runs entirely on your infrastructure — your private keys stay on your servers, your funds go directly to your wallets, and you pay zero gateway fees. Process up to 100 transactions per second per gateway instance with no per-transaction fees — only blockchain gas costs (0.010.01–0.50 per transaction).
XPayLabs is the first self-hosted gateway to support the x402 protocol for AI agent micropayments. Enable pay-per-call USDC billing for LLM APIs, AI agents, and any HTTP-based service — no API key management required. This is a capability no hosted competitor (BitPay, Coinbase Commerce, NowPayments) offers.

Quick Start

Deploy your payment gateway and create your first collection in minutes

Authentication

Generate merchant tokens and sign your requests securely

API Reference

Explore every endpoint, parameter, and response field

Guides

Step-by-step walkthroughs for collection and payout flows

Supported Blockchains

XPayLabs natively supports the following blockchain networks:
ChainTypeStablecoins
TRONTRC20USDT, USDC
EthereumERC20USDT, USDC, DAI
BNB ChainBEP20USDT, USDC, BUSD
PolygonERC20USDT, USDC, DAI
ArbitrumERC20USDT, USDC
OptimismERC20USDT, USDC
BaseERC20USDT, USDC
Avalanche C-ChainERC20USDT, USDC
SUINativeUSDC

Architecture

XPayLabs runs as 11 Docker containers orchestrated via Docker Compose. A single Nginx gateway serves as the public entry point, routing requests to backend services and frontend UIs. 11 microservices: 1 gateway, 2 data stores, 3 blockchain scanners, 1 SUI RPC proxy, 2 backend APIs, 2 frontend UIs.

How does XPayLabs process payments?

1

Deploy the gateway

Run docker compose up -d on your server. All services start together — Java backends (xpay-user, xpay-merchant, xpay-eth, xpay-tron, xpay-sui), blockchain scanners, webhook dispatcher, and the checkout UI.
2

Generate API credentials

Configure your merchant token in the gateway dashboard. This token is used to sign every API request with HMAC-SHA256.
3

Create a collection

Send a POST /v1/order/createCollection request with amount, symbol, and chain. XPayLabs returns a unique deposit address and checkout URL.
4

Listen for webhooks

Register your callback URL. When the blockchain scanner detects the incoming transaction, XPayLabs delivers a signed webhook notification.

Key Concepts

ConceptDescription
CollectionA request for payment that generates a unique deposit address
PayoutA funds transfer from your gateway wallet to an external address
SettlementAutomatic sweep of received funds from hot wallets to your cold storage
WebhookAn HTTP callback triggered by order or collection status changes
ScannerA blockchain indexer that monitors incoming transactions in real-time
Since XPayLabs is self-hosted, you have complete control over your funds. No third party holds your private keys, and no gateway fees are deducted from your transactions — you only pay blockchain network gas fees.
Last modified on July 3, 2026