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 POST requests to your configured 'webhookUrl' when payment status changes. The payload includes nested paymentLink details if applicable.
{
"event": "payment.confirmed",
"payment": {
"id": "pay_abc123",
"status": "confirmed",
"chain": "eth",
"token": "usdc",
"expectedAmount": 49.99,
"receivedAmount": 49.99,
"txHash": "0xabc...def",
"paymentLink": {
"title": "Premium Subscription",
"description": "Monthly access"
}
},
"timestamp": "2024-03-20T12:00:00Z"
}We support Ethereum, Bitcoin, Solana, and XRP networks. XRP additionally supports Destination Tags for shared wallet routing. 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)
Note: All chain/token inputs are case-insensitive.Join our Discord community or reach out to our dedicated developer support team for custom integrations.