API Documentation

Integrate crypto payment acceptance into your application in minutes.

Base URL: https://cryptopayment.center/api/v1

Overview

CryptoPayment is a crypto payment gateway that lets you accept BTC, LTC, ETH, USDT (TRC20) and USDT (BEP20) payments. Each payment generates a unique blockchain address — no shared wallets.

The typical flow:

1. Your backend calls POST /invoices → receives a unique address + checkout URL 2. Redirect your customer to the checkout URL (or display the address yourself) 3. Customer sends crypto to the address 4. We notify your webhook when payment is detected and confirmed 5. Funds appear in your merchant balance

Authentication

All API requests require an Authorization header using your API key and secret:

Authorization: Bearer {api_key}:{api_secret}

Get your API credentials from the merchant dashboard after your account is approved.

Supported Networks

Bitcoin
BTC
network: "btc"
Litecoin
LTC
network: "ltc"
Ethereum
ETH
network: "eth"
USDT — Tron
USDT (TRC20)
network: "trc20"
USDT — BSC
USDT (BEP20)
network: "bep20"

Create Invoice

POST /api/v1/invoices

Creates a new payment invoice and returns a unique deposit address.

Request Body

FieldTypeRequiredDescription
networkstringrequiredbtc | ltc | eth | trc20 | bep20
amount_usdfloatrequiredAmount in USD (min: 1.00)
order_idstringoptionalYour internal order reference
metadataobjectoptionalAny additional data (customer_id, etc.)

Example Request

POST /api/v1/invoices Authorization: Bearer pk_abc123:sk_xyz789 { "network": "trc20", "amount_usd": 50.00, "order_id": "ORD-12345", "metadata": { "customer_id": "usr_001" } }

Response

{ "success": true, "invoice": { "id": "550e8400-e29b-41d4-a716-446655440000", "order_id": "ORD-12345", "status": "pending", "network": "trc20", "network_label": "USDT (TRC20)", "coin": "USDT", "amount_usd": 50.00, "amount_crypto": 50.00, "address": "TXxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "paid_amount": 0, "txid": null, "confirmations": { "received": 0, "required": 19 }, "expires_at": "2024-01-15T10:30:00+00:00", "created_at": "2024-01-15T10:00:00+00:00" }, "checkout_url": "https://cryptopayment.center/pay/550e8400-..." }

Get Invoice

GET /api/v1/invoices/{id}

Retrieve the current status of an invoice.

Invoice Status Values

StatusDescription
pendingWaiting for payment. Customer hasn't sent funds yet.
confirmingPayment detected on blockchain, waiting for confirmations.
confirmedPayment fully confirmed. Funds credited to your balance.
expiredInvoice expired before payment was received (30 min default).

List Invoices

GET /api/v1/invoices

Returns paginated list of your invoices (20 per page).

GET /api/v1/invoices?page=2

Get Balances

GET /api/v1/merchant/balances
{ "success": true, "balances": { "USDT-TRC20": { "available": 450.00, "pending": 0 }, "BTC": { "available": 0.025, "pending": 0 } } }

Request Withdrawal

POST /api/v1/withdrawals

Request a withdrawal to your external wallet. Requests over $500 require manual admin review.

CoinMinimumNetwork Fee
BTC0.00050.00005
LTC0.010.001
ETH0.0050.001
USDT-TRC205 USDT1 USDT
USDT-BEP205 USDT0.5 USDT

Example

POST /api/v1/withdrawals { "coin": "USDT-TRC20", "amount": 100.00, "address": "TXxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }

Webhook Events

Set your webhook URL in the merchant dashboard. We send a POST request when invoice status changes.

{ "event": "payment_confirmed", "invoice_id": "550e8400-...", "order_id": "ORD-12345", "status": "confirmed", "network": "trc20", "coin": "USDT", "amount_usd": 50.00, "amount_crypto": 50.00, "paid_amount": 50.00, "txid": "a1b2c3...", "confirmations": 19, "address": "TXxx...", "timestamp": "2024-01-15T10:05:00+00:00", "signature": "hmac-sha256-hash" }
EventDescription
payment_detectedTransaction seen on blockchain, awaiting confirmations
payment_confirmedRequired confirmations reached, funds credited

We retry failed webhooks up to 5 times with exponential backoff (1min, 5min, 15min, 1h, 6h). Respond with HTTP 200 to acknowledge.

Verify Webhook Signature

// PHP $expected = hash_hmac('sha256', $invoiceId . '.' . $event, YOUR_APP_SECRET); if (!hash_equals($expected, $receivedSignature)) { http_response_code(401); exit; }

PHP Example

$apiKey = 'pk_your_key'; $apiSecret = 'sk_your_secret'; // Create invoice $ch = curl_init('https://cryptopayment.center/api/v1/invoices'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . $apiKey . ':' . $apiSecret, 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => json_encode([ 'network' => 'trc20', 'amount_usd' => 50.00, 'order_id' => 'ORD-001', ]), CURLOPT_RETURNTRANSFER => true, ]); $response = json_decode(curl_exec($ch), true); curl_close($ch); if ($response['success']) { $checkoutUrl = $response['checkout_url']; // Redirect customer: header('Location: ' . $checkoutUrl); }

Node.js Example

const response = await fetch('https://cryptopayment.center/api/v1/invoices', { method: 'POST', headers: { 'Authorization': `Bearer pk_your_key:sk_your_secret`, 'Content-Type': 'application/json', }, body: JSON.stringify({ network: 'trc20', amount_usd: 50.00, order_id: 'ORD-001', }), }); const data = await response.json(); // Redirect to: data.checkout_url

Python Example

import requests response = requests.post( 'https://cryptopayment.center/api/v1/invoices', headers={ 'Authorization': 'Bearer pk_your_key:sk_your_secret', 'Content-Type': 'application/json', }, json={ 'network': 'trc20', 'amount_usd': 50.00, 'order_id': 'ORD-001', } ) data = response.json() checkout_url = data['checkout_url']