Integrate ChainPayments into your workflow with our self-custodial infrastructure and real-time polling engine.
ChainPayments is a self-custodial cryptocurrency payment infrastructure. Our REST API allows you to integrate direct on-chain payments into your application with instant verification and no escrow.
# Base URL
https://chainpayments.io/api/public/v1All API requests require an API key starting with 'crypt_' (Live) or 'test_' (Sandbox/Test). You can pass it via the 'Authorization: Bearer' header or the 'x-api-key' header.
curl -X GET "https://chainpayments.io/api/public/v1/payments/pay_123" \
-H "Authorization: Bearer crypt_YOUR_KEY"When using a 'test_' API key, the generated payment will be flagged as 'isTest: true' with stricter rate limits. In the checkout UI, users will see a 'Simulate Payment' flow instead of real wallet connections.
// Test Mode Response
{
"success": true,
"payment": {
"id": "pay_test123",
"isTest": true,
"checkoutUrl": "https://chainpayments.io/checkout/pay_test123"
}
}Initiate a payment with a specific chain and token preset. The customer will be prompted to pay exactly this amount on the specified network.
curl -X POST "https://chainpayments.io/api/public/v1/payments" \
-H "x-api-key: crypt_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"chain": "eth",
"token": "usdc",
"amount": 49.99,
"customerEmail": "[email protected]",
"externalId": "order_777",
"webhookUrl": "https://your-app.com/webhooks"
}'Create a payment without specifying a chain or token. The customer can select their preferred network from your active wallets during checkout.
curl -X POST "https://chainpayments.io/api/public/v1/payments" \
-H "x-api-key: crypt_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 49.99,
"customerEmail": "[email protected]"
}'Create reusable payment links. Each visit to the link dynamically generates a unique payment session. Configure optional expiration and maximum payment limits.
curl -X POST "https://chainpayments.io/api/public/v1/payment-links" \
-H "x-api-key: crypt_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Premium Subscription",
"amount": 99.99,
"chain": "sol",
"token": "usdc"
}'Retrieve real-time status, received amounts, nested payment link data, and transaction hashes for any payment.
curl -X GET "https://chainpayments.io/api/public/v1/payments/pay_abc123" \
-H "x-api-key: crypt_YOUR_KEY"For flexible payments, use this endpoint to lock in a specific chain and token once the user makes a selection.
curl -X PATCH "https://chainpayments.io/api/public/v1/payments/pay_abc123" \
-H "x-api-key: crypt_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"chain": "sol",
"token": "usdc"
}'We send a signed POST to your configured 'webhookUrl' on every payment status change, including expiry. Verify the 'X-Signature' header (HMAC-SHA256 of the raw body with your webhook secret). Each event carries an 'eventId' (also sent as the 'X-Webhook-Id' header) built as '{paymentId}:{status}:{receivedAmount}': it is stable per payment status and amount, and identical across retries and manual resends — use it to deduplicate. A top-up that changes the received amount without changing the status is a new event with a new 'eventId'. Respond with a 2xx within 10 seconds; redirects are not followed and count as a failed delivery, and failed deliveries are retried with backoff.
{
"event": "payment.confirmed",
"eventId": "pay_abc123:confirmed:49.99",
"payment": {
"id": "pay_abc123",
"externalId": "order_1042",
"status": "confirmed",
"chain": "eth",
"token": "usdc",
"expectedAmount": 49.99,
"receivedAmount": 49.99,
"txHash": "0xabc...def",
"createdAt": "2024-03-20T11:58:02Z",
"updatedAt": "2024-03-20T12:00:00Z"
},
"timestamp": "2024-03-20T12:00:00Z"
}We support Ethereum, Bitcoin, Solana, XRP, BNB Smart Chain, Polygon, Tron, Dogecoin, Zcash and Cardano. XRP additionally supports Destination Tags for shared wallet routing. Zcash payments are watched on transparent (t1…/t3…) addresses only — shielded balances can't be observed. All chain and token inputs are case-insensitive.
Supported Chains/Tokens:
- eth / eth
- eth / usdc
- eth / usdt
- sol / sol
- sol / usdc
- sol / usdt
- btc / btc
- xrp / xrp (supports Destination Tags)
- bsc / bnb
- bsc / usdc (BEP20)
- bsc / usdt (BEP20)
- polygon / pol
- polygon / usdc
- polygon / usdt
- tron / trx
- tron / usdt (TRC20)
- doge / doge
- zec / zec (transparent addresses only)
- ada / ada
Note: All chain/token inputs are case-insensitive.Join our Discord community or reach out to our dedicated developer support team for custom integrations.