Welcome to the CoinsSend API documentation. This guide will help you integrate cryptocurrency payments, wallets, and withdrawals into your application with our simple yet powerful API. Follow these steps to get started quickly.
Integration Overview
Section titled “Integration Overview”Create a Merchant Account
Sign up for a merchant account to get your unique merchant ID and API credentials. Our simple onboarding process helps you get started in minutes.
Create Account →Generate API Keys
Create API keys with specific permissions for invoice creation, wallet management and withdrawals. Our granular permissions system ensures you have the right security controls.
Learn More →Implement Payment Flow
Choose between invoices for one-time payments or static wallets for recurring transactions. Both options provide seamless integration with your existing systems.
Set Up Withdrawals (Optional)
Configure cryptocurrency withdrawals to allow your merchants to transfer funds to external wallets securely with minimal effort.
Withdrawals Guide →Set Up Webhooks
Configure webhooks to receive real-time payment notifications and transaction updates. Our robust event system keeps your application in sync with invoice status changes and static wallet transactions.
Webhook Guide →Account Setup
Section titled “Account Setup”Create Merchant Account
Section titled “Create Merchant Account”- Go to CoinsSend Sign Up
- Complete the registration form with your business information (no KYC required)
- Verify your email address
Generate API Credentials
Section titled “Generate API Credentials”After setting up your merchant account:
- Log in to your merchant dashboard
- Create merchant
- Navigate to Merchant Settings
- Note your Merchant ID (you’ll need this for all API requests)
- Find your API key (generated automatically when the merchant is created) - withdrawal permissions are configured in merchant settings
Payment Integration Options
Section titled “Payment Integration Options”Start with Supported Coins & Networks to see the available assets, network identifiers, and how to keep payment options current.
CoinsSend offers two primary methods for accepting cryptocurrency payments:
Invoices
Generate single-use payment links for specific order amounts. Ideal for e-commerce and one-time payments.
- Fixed payment amounts in USD with automatic crypto conversion
- Stablecoin support including USDT and other stablecoins
- 24-hour expiration with automatic status updates
- Webhook notifications for payment status updates
Static Wallets
Permanent cryptocurrency addresses for receiving payments. Great for donations or recurring clients.
- Dedicated blockchain addresses for each supported network
- Multiple networks for stablecoins including TRON and BSC
- Custom labels for better organization
- Instant webhook notifications for all received transactions
Code Example: Create an Invoice
Section titled “Code Example: Create an Invoice”Here’s a quick server-side example. Each language generates the canonical JSON body from Authentication, signs it, and sends the same string. Never put the merchant API key in browser code.
<?php// Replace with your actual credentials$merchantId = 'your_merchant_id';$apiKey = 'your_api_key';
// Create request data$data = [ 'order_id' => 'test_order_' . time(), 'amount' => '100.50', 'is_customer_fee' => true];
// Generate signature$jsonData = json_encode($data, JSON_THROW_ON_ERROR);$base64Data = base64_encode($jsonData);$signature = md5($base64Data . $apiKey);
// Create HTTP client$ch = curl_init('https://api.coinssend.com/v1/invoices');curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Merchant: ' . $merchantId, 'Sign: ' . $signature]);
// Execute request$response = curl_exec($ch);$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);curl_close($ch);
// Process response$result = json_decode($response, true);
// Handle resultif ($httpCode >= 200 && $httpCode < 300 && $result['status'] === 'success') { echo "Invoice created! Payment URL: {$result['data']['url']}\n"; echo "Invoice code: {$result['data']['code']}\n";} else { echo "Error: " . json_encode($result) . "\n";}// Replace with your actual credentialsconst merchantId = 'your_merchant_id';const apiKey = 'your_api_key';
// Create request dataconst data = { order_id: `test_order_${Date.now()}`, amount: '100.50', is_customer_fee: true};
// Generate signatureconst jsonData = JSON.stringify(data) .replace(/\//g, '\\/') .replace(/[\u0080-\uFFFF]/g, character => `\\u${character.charCodeAt(0).toString(16).padStart(4, '0')}` );const base64Data = Buffer.from(jsonData, 'utf8').toString('base64');const crypto = require('node:crypto');const signature = crypto.createHash('md5').update(base64Data + apiKey).digest('hex');
// Make the API requestfetch('https://api.coinssend.com/v1/invoices', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Merchant': merchantId, 'Sign': signature }, body: jsonData}).then(response => response.json()).then(result => { if (result.status === 'success') { console.log(`Invoice created! Payment URL: ${result.data.url}`); console.log(`Invoice code: ${result.data.code}`); } else { console.error('Error:', result); }}).catch(error => console.error('API Request failed:', error));import requestsimport jsonimport base64import hashlibimport time
# Replace with your actual credentialsmerchant_id = 'your_merchant_id'api_key = 'your_api_key'
# Create request datadata = { 'order_id': f'test_order_{int(time.time())}', 'amount': '100.50', 'is_customer_fee': True}
def canonical_json(payload): encoded = json.dumps( payload, ensure_ascii=False, separators=(',', ':'), allow_nan=False ) escaped = [] for character in encoded: codepoint = ord(character) if character == '/': escaped.append(r'\/') elif codepoint < 0x80: escaped.append(character) elif codepoint <= 0xFFFF: escaped.append(f'\\u{codepoint:04x}') else: codepoint -= 0x10000 escaped.append(f'\\u{0xD800 + (codepoint >> 10):04x}') escaped.append(f'\\u{0xDC00 + (codepoint & 0x3FF):04x}') return ''.join(escaped)
# Generate signature from the exact body that will be sentjson_data = canonical_json(data)base64_data = base64.b64encode(json_data.encode()).decode()signature = hashlib.md5((base64_data + api_key).encode()).hexdigest()
# Make the API requestresponse = requests.post( 'https://api.coinssend.com/v1/invoices', headers={ 'Content-Type': 'application/json', 'Merchant': merchant_id, 'Sign': signature }, data=json_data)
# Process responseresult = response.json()
# Handle resultif response.status_code >= 200 and response.status_code < 300 and result['status'] == 'success': print(f"Invoice created! Payment URL: {result['data']['url']}") print(f"Invoice code: {result['data']['code']}")else: print(f"Error: {result}")Implementing Webhooks
Section titled “Implementing Webhooks”To receive real-time payment notifications, set up a webhook endpoint:
- Create an HTTP endpoint in your application to receive webhook events
- Configure the merchant callback URL in your dashboard; static-wallet creation may also specify its own
webhook_url - Implement signature verification to validate incoming webhooks
- Process webhook events asynchronously
See the Webhooks documentation for details on webhook formats and best practices.
Next Steps
Section titled “Next Steps”Now that you have the basics set up, you can:
Build with an AI assistant
Section titled “Build with an AI assistant”Support
Section titled “Support”If you need help with your integration:
- Check our API reference documentation
- Review common HTTP errors and troubleshooting
- Contact our support team at support@coinssend.com