Перейти до вмісту
CoinsSendРозробникам
Документація Payments

Getting Started with CoinsSend API

Відкрити MarkdownПідключити агента

Цей контент ще не доступний вашою мовою.

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.

1

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
2

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
3

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.

4

Set Up Withdrawals (Optional)

Configure cryptocurrency withdrawals to allow your merchants to transfer funds to external wallets securely with minimal effort.

Withdrawals Guide
5

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
  1. Go to CoinsSend Sign Up
  2. Complete the registration form with your business information (no KYC required)
  3. Verify your email address

After setting up your merchant account:

  1. Log in to your merchant dashboard
  2. Create merchant
  3. Navigate to Merchant Settings
  4. Note your Merchant ID (you’ll need this for all API requests)
  5. Find your API key (generated automatically when the merchant is created) - withdrawal permissions are configured in merchant settings
Security Best Practice: Always store your API keys securely in environment variables or a secure key vault. Never expose API keys in client-side code, public repositories, or include them directly in your application's source code.

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

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 result
if ($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 credentials
const merchantId = 'your_merchant_id';
const apiKey = 'your_api_key';
// Create request data
const data = {
order_id: `test_order_${Date.now()}`,
amount: '100.50',
is_customer_fee: true
};
// Generate signature
const 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 request
fetch('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 requests
import json
import base64
import hashlib
import time
# Replace with your actual credentials
merchant_id = 'your_merchant_id'
api_key = 'your_api_key'
# Create request data
data = {
'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 sent
json_data = canonical_json(data)
base64_data = base64.b64encode(json_data.encode()).decode()
signature = hashlib.md5((base64_data + api_key).encode()).hexdigest()
# Make the API request
response = requests.post(
'https://api.coinssend.com/v1/invoices',
headers={
'Content-Type': 'application/json',
'Merchant': merchant_id,
'Sign': signature
},
data=json_data
)
# Process response
result = response.json()
# Handle result
if 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}")

To receive real-time payment notifications, set up a webhook endpoint:

  1. Create an HTTP endpoint in your application to receive webhook events
  2. Configure the merchant callback URL in your dashboard; static-wallet creation may also specify its own webhook_url
  3. Implement signature verification to validate incoming webhooks
  4. Process webhook events asynchronously
Developer Tip: During development, use a webhook testing tool like webhook.site or ngrok to inspect and debug incoming webhook payloads. These tools provide temporary endpoints that you can use to test your webhook integration before setting up your production endpoint.

See the Webhooks documentation for details on webhook formats and best practices.

Now that you have the basics set up, you can:

If you need help with your integration: