CryptoVault API
Accept Bitcoin, Ethereum, USDT and 10+ cryptocurrencies via REST API. All endpoints return JSON.
๐ Base URL:
https://yoursite.com/cv/api/v1/Authentication
Get your API Key from Dashboard โ API Keys โ Create Key.
# Required headers on every request:
Authorization: Bearer cv_yourapikey...
X-API-Secret: yoursecretkey...
Content-Type: application/jsonโ ๏ธ Never expose your API Secret in frontend/client-side code.
Invoices
POST /invoice.php โ Create Invoice
// Request body (JSON):
{
"order_id": "ORD-001", // Your order ID (optional)
"amount": 99.99, // Amount in USD (required)
"currency": "USD", // USD, EUR, INR
"title": "Product Name", // Optional
"customer_email": "user@email.com",// Optional
"callback_url": "https://...", // Webhook URL
"redirect_url": "https://...", // After payment
"lifetime": 3600 // Seconds (default: 1hr)
}
// Response:
{
"success": true,
"uuid": "a1b2c3d4-...",
"order_id": "ORD-001",
"url": "https://yoursite.com/cv/pay.php?id=a1b2c3d4",
"expires_at": "2026-03-20 15:00:00"
}GET /check-invoice.php?id=UUID โ Check Status
// No auth required โ public endpoint
// Response:
{
"success": true,
"uuid": "a1b2c3d4-...",
"status": "paid", // pending|paid|expired|cancelled
"amount_usd": 99.99,
"paid_at": "2026-03-20 14:32:00"
}Wallet Balance
GET /balance.php โ All wallets
GET /balance.php?coin=BTC โ Specific coin
{
"success": true,
"total_usd": 4521.34,
"wallets": [
{ "coin": "BTC", "balance": "0.12345678", "balance_usd": "7463.21" },
{ "coin": "USDT", "balance": "500.0", "balance_usd": "500.00" }
]
}Live Prices
GET /prices.php โ All coin prices (public, no auth)
{
"success": true,
"prices": {
"BTC": { "price_usd": 60420, "change_24h": 2.4 },
"ETH": { "price_usd": 2831, "change_24h": 1.1 },
"USDT": { "price_usd": 1, "change_24h": 0.01 }
}
}Webhooks
Subscribe to events from Dashboard โ Webhooks. We send a POST with JSON payload.
// Payload example (invoice.paid):
{
"event": "invoice.paid",
"uuid": "a1b2c3d4-...",
"order_id": "ORD-001",
"status": "paid",
"amount_usd": 99.99,
"coin": "USDT",
"paid_at": "2026-03-20 14:32:00"
}
// PHP verification:
$payload = file_get_contents('php://input');
$sig = $_SERVER['HTTP_X_CV_SIGNATURE'];
$expected = hash_hmac('sha256', $payload, 'YOUR_WEBHOOK_SECRET');
if (!hash_equals($expected, $sig)) die('Invalid');
$data = json_decode($payload, true);Embed Payment Button
Add crypto payment button to any website in 2 lines.
<!-- Step 1: Load script (once per page) -->
<script src="https://yoursite.com/cv/assets/js/payment-button.js"></script>
<!-- Step 2: Add button -->
<button
class="cv-pay-btn"
data-uuid="YOUR_BUTTON_UUID"
data-amount="29.99"
data-currency="USD">
Pay $29.99
</button>
// Or via JavaScript:
CryptoVault.openPayment('UUID', 49.99, 'USD');WHMCS Integration
| Step | Action |
|---|---|
| 1 | Admin โ Plugins โ WHMCS โ Enable โ Download Module |
| 2 | Upload cryptovault.php to WHMCS /modules/gateways/ |
| 3 | WHMCS Admin โ Setup โ Payment Gateways โ Activate CryptoVault |
| 4 | Enter API Key, API Secret, Gateway URL โ Save |
WooCommerce Integration
| Step | Action |
|---|---|
| 1 | Admin โ Plugins โ WooCommerce โ Enable โ Download Plugin |
| 2 | WordPress Admin โ Plugins โ Upload โ Activate |
| 3 | WooCommerce โ Settings โ Payments โ CryptoVault โ Configure |
Error Codes
| Code | Meaning |
|---|---|
200 | Success |
400 | Bad request โ missing or invalid parameters |
401 | Unauthorized โ invalid or missing API key |
404 | Resource not found |
405 | Method not allowed |
500 | Server error โ check logs |