# Getting Started with CoinsSend API

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
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.

View Invoices API View Static Wallets API
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
## Account Setup ### Create Merchant Account 1. Go to [CoinsSend Sign Up](https://app.coinssend.com/sign-up) 2. Complete the registration form with your business information (no KYC required) 3. Verify your email address ### Generate API Credentials 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.
## Payment Integration Options 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
View Invoices API

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
View Static Wallets API
## Code Example: Create an Invoice Here's a quick example to create your first invoice:
```php 'test_order_' . time(), 'amount' => '100.50', 'is_customer_fee' => true ]; // Generate signature $jsonData = json_encode($data); $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"; } ``` ```javascript // 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); const base64Data = Buffer.from(jsonData).toString('base64'); // For Node.js // OR: const base64Data = btoa(jsonData); // For Browsers const crypto = require('crypto'); // For Node.js 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)); ``` ```python 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 } # Generate signature json_data = json.dumps(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 }, 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}") ```
## Implementing Webhooks 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 webhook URL in your merchant dashboard or specify it in API requests 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](./webhooks.md) for details on webhook formats and best practices. ## Next Steps Now that you have the basics set up, you can:
📃

Create Invoices

Generate payment links for specific amounts with multiple crypto options

👛

Set Up Static Wallets

Create permanent cryptocurrency addresses for recurring payments

📤

Process Withdrawals

Send funds to external wallets securely with automatic verification

🔔

Configure Webhooks

Receive real-time payment notifications for all transaction events

## Support If you need help with your integration: - Check our [API reference documentation](./api-reference.md) - Review common [error codes and troubleshooting](./error-handling.md) - Contact our support team at [support@coinssend.com](mailto:support@coinssend.com)