Everything you need to integrate crypto payments. Clear documentation, working code examples, and APIs designed by developers, for developers.
Everything you can do with CryptoRails, in one place
/v1/walletsGenerate a unique address so you know exactly who paid
{
"network": "ethereum",
"label": "user_123_deposit",
"callback_url": "https://your-app.com/webhooks"
}{
"id": "wal_abc123",
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f...",
"network": "ethereum",
"label": "user_123_deposit",
"created_at": "2024-01-15T10:30:00Z"
}/v1/wallets/{wallet_id}Check if your customer has paid without refreshing block explorer
{
"id": "wal_abc123",
"address": "0x742d35Cc6634C0532925a3b844Bc9e...",
"network": "ethereum",
"balance": "1000.00",
"currency": "USDT",
"last_activity": "2024-01-15T11:00:00Z"
}/v1/transactionsGet a complete history for reconciliation and reporting
{
"data": [
{
"id": "txn_xyz789",
"wallet_id": "wal_abc123",
"type": "deposit",
"amount": "500.00",
"currency": "USDT",
"status": "confirmed",
"tx_hash": "0x..."
}
],
"has_more": true
}/v1/consolidateCollect funds from multiple wallets in one API call
{
"source_wallets": ["wal_abc123", "wal_def456"],
"destination": "treasury_main",
"amount": "all"
}{
"id": "cons_abc123",
"status": "processing",
"transactions": [
{ "from": "wal_abc123", "amount": "500.00", "tx_hash": "0x..." },
{ "from": "wal_def456", "amount": "300.00", "tx_hash": "0x..." }
]
}Native libraries that feel right at home in your stack
npm install @cryptorails/sdkimport { CryptoRails } from '@cryptorails/sdk';
const client = new CryptoRails(process.env.CRYPTORAILS_API_KEY);
// Generate a wallet for a new user
async function onUserSignup(userId: string) {
const wallet = await client.wallets.create({
network: 'ethereum',
label: `user_${userId}_deposit`
});
// Save wallet.address to your database
await db.users.update(userId, {
depositAddress: wallet.address
});
return wallet;
}
// Handle incoming payment webhook
client.webhooks.on('payment.confirmed', async (event) => {
const { wallet_id, amount, currency } = event.data;
// Credit user account
await db.transactions.create({
walletId: wallet_id,
amount,
currency,
status: 'completed'
});
// Notify user
await sendEmail(user.email, 'Payment received!');
});pip install cryptorailsfrom cryptorails import CryptoRails
import os
client = CryptoRails(os.environ['CRYPTORAILS_API_KEY'])
# Generate a wallet for a new merchant
def setup_merchant(merchant_id: str):
wallet = client.wallets.create(
network='tron', # Low fees for merchants
label=f'merchant_{merchant_id}'
)
# Store the address
db.merchants.update(merchant_id, {
'deposit_address': wallet.address
})
return wallet
# Check merchant balance
def get_merchant_balance(wallet_id: str):
wallet = client.wallets.get(wallet_id)
return {
'balance': wallet.balance,
'currency': wallet.currency,
'pending': wallet.pending_balance
}
# Consolidate funds daily
def daily_consolidation():
wallets = client.wallets.list(min_balance='100')
result = client.consolidation.create(
source_wallets=[w.id for w in wallets],
destination='treasury_main'
)
return resultgo get github.com/cryptorails/cryptorails-gopackage main
import (
"context"
"log"
"os"
cryptorails "github.com/cryptorails/cryptorails-go"
)
func main() {
client := cryptorails.NewClient(os.Getenv("CRYPTORAILS_API_KEY"))
ctx := context.Background()
// Create wallet for exchange user
wallet, err := client.Wallets.Create(ctx, &cryptorails.WalletParams{
Network: "bsc",
Label: "exchange_user_deposit",
})
if err != nil {
log.Fatal(err)
}
log.Printf("Wallet created: %s", wallet.Address)
// List recent transactions
txns, err := client.Transactions.List(ctx, &cryptorails.ListParams{
Limit: 50,
Status: "confirmed",
})
if err != nil {
log.Fatal(err)
}
for _, txn := range txns.Data {
log.Printf("Transaction: %s %s", txn.Amount, txn.Currency)
}
}Get notified the instant something happens
payment.receivedA payment has been detected on-chain (0 confirmations)
Use case: Show pending status to user immediately
payment.confirmedPayment has reached required confirmations
Use case: Credit user account, fulfill order
consolidation.initiatedFund sweep has started processing
Use case: Log for audit, update dashboard
consolidation.completedFunds successfully moved to treasury
Use case: Update treasury balance, close batch
wallet.createdNew wallet address generated
Use case: Sync with your user database
Every webhook includes everything you need to process the event
{
"id": "evt_abc123xyz",
"event": "payment.confirmed",
"created_at": "2024-01-15T10:30:00Z",
"data": {
"wallet_id": "wal_xyz789",
"transaction_id": "txn_def456",
"amount": "1000.00",
"currency": "USDT",
"network": "ethereum",
"tx_hash": "0x742d35Cc6634C0532925a3b844Bc9e7595f...",
"confirmations": 12,
"from_address": "0x123...",
"block_number": 18500000
},
"signature": "sha256=abc123..." // Verify this!
}From zero to accepting payments in 15 minutes
Contact our team to receive your sandbox and production API keys.
# Store your API key securely
export CRYPTORAILS_API_KEY="cr_live_abc123..."Test the connection by creating a wallet.
curl -X POST "https://api.cryptorails.tech/v1/wallets" \
-H "Authorization: Bearer $CRYPTORAILS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"network": "ethereum", "label": "test_wallet"}'Configure your endpoint to receive payment notifications.
// Express.js webhook handler
app.post('/webhooks/cryptorails', (req, res) => {
const event = req.body;
if (event.event === 'payment.confirmed') {
// Process the payment
handlePayment(event.data);
}
res.status(200).send('OK');
});Switch to production keys and start accepting real payments.
# Sandbox (testing)
CRYPTORAILS_API_KEY="cr_test_..."
# Production (real money)
CRYPTORAILS_API_KEY="cr_live_..."Get your API keys and start integrating CryptoRails today. Our team is here to help.