Back to Merchant Dashboard

REST API & Integration Documentation

Connect WHMCS, Kbilling, WooCommerce, or any custom PHP/Node.js website with your gateway.

API v1.0HMAC-SHA256 Signed
1. Authentication

Pass your secret API key via standard HTTP header:
Authorization: Bearer <API_KEY>

2. Drop-in PHP SDK

Ready-to-use CryptoGatewayClient.php included in the codebase for zero-setup PHP integration.

3. WHMCS Module

Pre-built WHMCS payment module located in integrations/whmcs/ ready to upload.

POST/api/v1/invoices

Creates a new crypto invoice with automatic exchange rate conversion and dynamic network fee buffer. Returns a dedicated payment link.

Request Parameters (JSON Body)

FieldTypeRequiredDescription
amountnumberYesUSD price amount (e.g. 50.00).
invoice_numberstringYesYour WHMCS / panel invoice # (e.g. 10492) to track all paid & unpaid attempts.
domainstringOptionalAuthorized domain for this account (or sent via X-Client-Domain header).
order_idstringOptionalInternal checkout order reference.
coinstringNo (default: USDT)BNB, BTC, ETH, USDT, USDC, SOL, LTC, DOGE.
networkstringNo (default: BSC)BSC, SOLANA, ETHEREUM, BITCOIN, LITECOIN, DOGECOIN.
webhook_urlstringNoEndpoint that receives payment callbacks.
return_urlstringNoRedirect URL after client completes payment.
cURL Example Request
curl -X POST "https://pay.yourdomain.com/api/v1/invoices" \
  -H "Authorization: Bearer cg_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 49.99,
    "currency": "USD",
    "order_id": "ORD-10024",
    "title": "Cloud Hosting Plan",
    "customer_email": "client@example.com",
    "coin": "USDT",
    "network": "BSC",
    "webhook_url": "https://yourdomain.com/api/crypto-webhook.php",
    "return_url": "https://yourdomain.com/clientarea"
  }'

PHP & Custom Billing Panel (Kbilling) Integration

Include CryptoGatewayClient.php in your project to accept crypto payments in 5 lines of code:

PHP Example (Checkout Page)
<?php
require_once 'CryptoGatewayClient.php';

$client = new CryptoGatewayClient('https://pay.yourdomain.com', 'cg_live_your_api_key');

$invoice = $client->createInvoice([
    'amount' => 50.00,
    'order_id' => 'INV-1092',
    'title' => 'Web Design Service',
    'coin' => 'USDT',
    'network' => 'BSC',
    'webhook_url' => 'https://yoursite.com/webhook.php'
]);

// Redirect customer to the payment page
header('Location: ' . $invoice['data']['payment_url']);
exit;

Webhook Signature Verification (HMAC-SHA256)

Every webhook sent by the gateway includes an X-Gateway-Signature header. Verify it to guarantee authenticity:

PHP Webhook Listener
<?php
// Verify incoming HMAC-SHA256 signature
$rawBody = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_GATEWAY_SIGNATURE'] ?? '';
$secret = 'whsec_your_webhook_secret';

$expected = hash_hmac('sha256', $rawBody, $secret);

if (!hash_equals($expected, $signature)) {
    http_response_code(401);
    die('Invalid signature');
}

$payload = json_decode($rawBody, true);
if ($payload['event'] === 'payment.completed') {
    $orderId = $payload['order_id'];
    $txHash = $payload['transactions'][0]['txHash'];
    // Mark order paid in your database...
}

WHMCS Gateway Module Setup (2 Minutes)

1
Upload Module Files to WHMCS:

Copy the files inside integrations/whmcs/ to your WHMCS server directory:

  • modules/gateways/cryptogateway.php
  • modules/gateways/callback/cryptogateway.php
2
Activate in WHMCS Admin:

Navigate to Setup > Payments > Payment Gateways > All Payment Gateways and activate Direct Crypto Payment Gateway.

3
Paste API Credentials:

Enter your Gateway URL, API Key, and Webhook Secret (available in your Wallet Settings tab). Save changes.