Developer documentation

Webstriva API — full integration guide

Install crypto deposits and withdrawals on Laravel, PHP, WordPress, Node.js, Python, or any language that can send HTTP requests. Every example below uses your live API domain.

Webstriva — production endpoints

Sitehttps://cfdpax.com
API base URLhttps://cfdpax.com/api/v1
Auth headerAuthorization: Bearer pgk_your_api_key

Use these exact URLs in your Laravel, PHP, Node, or Python project. Get your API key from https://cfdpax.com/dashboard/api-keys.

Supported assets

USDT on Tron and USDT on Ethereum are different assets. Never send the wrong network — use the exact crypto code below.

USDT = USDT on TRC20 (Tron). USDT-ERC20 = USDT on ERC20 (Ethereum).

API codeAssetNetworkWithdrawal gas wallet
BTCBitcoinBitcoin
TRXTron TRXTron
USDTUSDT (TRC20)Tron TRC20TRX gas wallet
USDCUSDC (TRC20)Tron TRC20TRX gas wallet
ETHEthereumEthereum
USDT-ERC20USDT (ERC20)Ethereum ERC20ETH gas wallet
USDC-ERC20USDC (ERC20)Ethereum ERC20ETH gas wallet

Same rule for USDC: USDC is TRC20, USDC-ERC20 is ERC20.

Quick start — 5 steps

  1. 1

    Create account at https://cfdpax.com/register

    Complete onboarding: business profile, KYC, webhook URL, and API key generation.

  2. 2

    Copy API key from https://cfdpax.com/dashboard/api-keys

    Format: pgk_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxx. Shown once — store in your server .env only.

  3. 3

    Register webhook at https://cfdpax.com/dashboard/webhooks

    Example URL: https://your-trading-site.com/webhooks/webstriva — save the webhook secret to WEBSTRIVA_WEBHOOK_SECRET.

  4. 4

    Fund gas wallets at https://cfdpax.com/dashboard/hot-wallets

    TRC20 USDT/USDC withdrawals need TRX (≥20 TRX). ERC20 USDT/USDC need ETH (≥0.01 ETH). Wallets are created automatically when your account is activated.

  5. 5

    Test deposits — two separate USDT assets

    USDT (TRC20): "crypto":"USDT". USDT (ERC20): "crypto":"USDT-ERC20". Same for USDC vs USDC-ERC20. Each call returns a unique deposit address on that network.

Environment variables

Add these to your project. Never put the API key in frontend JavaScript or mobile apps — always call Webstriva from your backend server.

# Add to your .env (Laravel, Symfony, Node, etc.)
WEBSTRIVA_API_KEY=pgk_your_key_from_dashboard
WEBSTRIVA_BASE_URL=https://cfdpax.com/api/v1
WEBSTRIVA_WEBHOOK_SECRET=whsec_from_dashboard_webhooks

# Dashboard (get credentials here)
# https://cfdpax.com/dashboard/api-keys
# https://cfdpax.com/dashboard/webhooks
# https://cfdpax.com/dashboard/hot-wallets

Laravel integration

No package to install — Laravel's built-in HTTP client is enough. Copy each file below into your project. All requests go to https://cfdpax.com/api/v1.

Laravel full setup
# ─── Step 1: .env ───────────────────────────────────────
WEBSTRIVA_API_KEY=pgk_your_key_here
WEBSTRIVA_BASE_URL=https://cfdpax.com/api/v1
WEBSTRIVA_WEBHOOK_SECRET=your_webhook_secret

# ─── Step 2: config/webstriva.php ───────────────────────────
<?php
return [
    'api_key' => env('WEBSTRIVA_API_KEY'),
    'base_url' => env('WEBSTRIVA_BASE_URL', 'https://cfdpax.com/api/v1'),
    'webhook_secret' => env('WEBSTRIVA_WEBHOOK_SECRET'),
];

# ─── Step 3: app/Services/WebstrivaService.php ──────────────
<?php
namespace App\Services;

use Illuminate\Support\Facades\Http;

class WebstrivaService
{
    private function client()
    {
        return Http::baseUrl(config('webstriva.base_url'))
            ->withToken(config('webstriva.api_key'))
            ->acceptJson();
    }

    public function createDeposit(string $amount, string $crypto, string $merchantRef): array
    {
        return $this->client()->post('/payments', [
            'amount' => $amount,
            'crypto' => $crypto,
            'merchant_ref' => $merchantRef,
        ])->throw()->json();
    }

    public function getPayment(string $id): array
    {
        return $this->client()->get("/payments/{$id}")->throw()->json();
    }

    public function getBalances(): array
    {
        return $this->client()->get('/balances')->throw()->json();
    }

    public function quoteWithdrawal(string $crypto, string $amount, string $address): array
    {
        return $this->client()->get('/withdrawals/quote', [
            'crypto' => $crypto,
            'amount' => $amount,
            'destination_address' => $address,
        ])->throw()->json('quote');
    }

    public function createWithdrawal(string $crypto, string $amount, string $address, string $merchantRef): array
    {
        return $this->client()->post('/withdrawals', [
            'crypto' => $crypto,
            'amount' => $amount,
            'destination_address' => $address,
            'merchant_ref' => $merchantRef,
        ])->throw()->json();
    }
}

# ─── Step 4: routes/api.php ───────────────────────────────
use App\Http\Controllers\DepositController;
use App\Http\Controllers\WebstrivaWebhookController;

Route::post('/deposits', [DepositController::class, 'store']);
Route::post('/webhooks/webstriva', [WebstrivaWebhookController::class, 'handle']);

# ─── Step 5: DepositController.php ────────────────────────
public function store(Request $request, WebstrivaService $webstriva)
{
    $deposit = $webstriva->createDeposit(
        amount: $request->input('amount'),
        crypto: 'USDT',
        merchantRef: 'dep_' . auth()->id() . '_' . time(),
    );

    // Show $deposit['address'] and $deposit['amountCrypto'] to user
    return response()->json($deposit);
}

# ─── Step 6: WebstrivaWebhookController.php ─────────────────
public function handle(Request $request)
{
    $payload = $request->getContent();
    $sig = $request->header('X-Webstriva-Signature');
    $expected = hash_hmac('sha256', $payload, config('webstriva.webhook_secret'));

    if (!hash_equals($expected, $sig ?? '')) {
        abort(401);
    }

    $body = json_decode($payload, true);
    if ($body['event'] === 'payment.paid') {
        // Credit user: $body['data']['merchantRef'], $body['data']['amount']
    }

    return response()->json(['received' => true]);
}

# Get API key: https://cfdpax.com/dashboard/api-keys

PHP integration (Guzzle, CodeIgniter, Symfony)

webstriva.php
<?php
// composer require guzzlehttp/guzzle
// .env: WEBSTRIVA_API_KEY=pgk_...  WEBSTRIVA_BASE_URL=https://cfdpax.com/api/v1

$client = new GuzzleHttp\Client([
    'base_uri' => 'https://cfdpax.com/api/v1/',
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('WEBSTRIVA_API_KEY'),
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
    ],
]);

// Create deposit
$response = $client->post('payments', [
    'json' => [
        'amount' => '250.00',
        'crypto' => 'USDT',
        'merchant_ref' => 'deposit_' . uniqid(),
    ],
]);
$deposit = json_decode($response->getBody(), true);

// Show to user:
echo 'Send ' . $deposit['amountCrypto'] . ' ' . $deposit['crypto'];
echo ' to address: ' . $deposit['address'];

// Webhook handler (public/webhook-webstriva.php):
$payload = file_get_contents('php://input');
$sig = $_SERVER['HTTP_X_WEBSTRIVA_SIGNATURE'] ?? '';
$expected = hash_hmac('sha256', $payload, getenv('WEBSTRIVA_WEBHOOK_SECRET'));
if (!hash_equals($expected, $sig)) { http_response_code(401); exit; }
$event = json_decode($payload, true);
if ($event['event'] === 'payment.paid') {
    // credit user balance
}
http_response_code(200);

Node.js integration (Express, Next.js, NestJS)

webstriva.js
// .env
// WEBSTRIVA_API_KEY=pgk_...
// WEBSTRIVA_BASE_URL=https://cfdpax.com/api/v1

const API_KEY = process.env.WEBSTRIVA_API_KEY;
const BASE = process.env.WEBSTRIVA_BASE_URL || 'https://cfdpax.com/api/v1';

// Create deposit
const deposit = await fetch(`${BASE}/payments`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    amount: '250.00',
    crypto: 'USDT',
    merchant_ref: `dep_${Date.now()}`,
  }),
}).then((r) => r.json());

console.log('Pay to:', deposit.address);

// Webhook (Express)
import crypto from 'crypto';
app.post('/webhooks/webstriva', express.raw({ type: 'application/json' }), (req, res) => {
  const sig = req.headers['x-webstriva-signature'];
  const expected = crypto.createHmac('sha256', process.env.WEBSTRIVA_WEBHOOK_SECRET)
    .update(req.body).digest('hex');
  if (sig !== expected) return res.status(401).send('bad sig');
  const body = JSON.parse(req.body.toString());
  if (body.event === 'payment.paid') { /* credit user */ }
  res.json({ received: true });
});

Python integration (Django, Flask, FastAPI)

webstriva.py
import os, hmac, hashlib, requests

API_KEY = os.environ["WEBSTRIVA_API_KEY"]
BASE = os.environ.get("WEBSTRIVA_BASE_URL", "https://cfdpax.com/api/v1")

# Create deposit
deposit = requests.post(
    f"{BASE}/payments",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={"amount": "250.00", "crypto": "USDT", "merchant_ref": "dep_88421"},
    timeout=30,
).json()

print("Pay to:", deposit["address"])

# Flask webhook
@app.post("/webhooks/webstriva")
def webhook():
    payload = request.get_data()
    sig = request.headers.get("X-Webstriva-Signature", "")
    expected = hmac.new(
        os.environ["WEBSTRIVA_WEBHOOK_SECRET"].encode(), payload, hashlib.sha256
    ).hexdigest()
    if not hmac.compare_digest(expected, sig):
        abort(401)
    body = request.get_json()
    if body["event"] == "payment.paid":
        pass  # credit user
    return {"received": True}

WordPress integration

Drop-in plugin snippet using wp_remote_post. Creates deposits via REST API route for logged-in users.

webstriva.php (plugin)
<?php
/**
 * Plugin: add to wp-content/plugins/webstriva-deposits/webstriva.php
 * Or paste into your theme functions.php (not recommended for production)
 */

define('WEBSTRIVA_API_KEY', 'pgk_your_key');
define('WEBSTRIVA_BASE_URL', 'https://cfdpax.com/api/v1');

function webstriva_create_deposit($amount, $merchant_ref) {
    $response = wp_remote_post(WEBSTRIVA_BASE_URL . '/payments', [
        'headers' => [
            'Authorization' => 'Bearer ' . WEBSTRIVA_API_KEY,
            'Content-Type' => 'application/json',
        ],
        'body' => wp_json_encode([
            'amount' => $amount,
            'crypto' => 'USDT',
            'merchant_ref' => $merchant_ref,
        ]),
        'timeout' => 30,
    ]);
    return json_decode(wp_remote_retrieve_body($response), true);
}

// REST route: POST /wp-json/webstriva/v1/deposit
add_action('rest_api_init', function () {
    register_rest_route('webstriva/v1', '/deposit', [
        'methods' => 'POST',
        'callback' => function ($req) {
            $user_id = get_current_user_id();
            $ref = 'wp_' . $user_id . '_' . time();
            return webstriva_create_deposit($req['amount'], $ref);
        },
        'permission_callback' => function () { return is_user_logged_in(); },
    ]);
});

// Webhook: create page template or use https://cfdpax.com/wp-json/webstriva/v1/webhook
// Verify X-Webstriva-Signature with hash_hmac('sha256', $body, WEBHOOK_SECRET)

cURL — test every endpoint

Copy-paste these commands to test your integration before writing code. Replace pgk_your_key with your real key.

all-endpoints.sh
# All examples use https://cfdpax.com/api/v1
# Replace pgk_your_key with your key from dashboard

# ── Create deposit — USDT on TRC20 (Tron) ──
curl -X POST https://cfdpax.com/api/v1/payments \
  -H "Authorization: Bearer pgk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"amount":"250.00","crypto":"USDT","merchant_ref":"dep_88421"}'

# ── Create deposit — USDT on ERC20 (Ethereum) ──
curl -X POST https://cfdpax.com/api/v1/payments \
  -H "Authorization: Bearer pgk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"amount":"250.00","crypto":"USDT-ERC20","merchant_ref":"dep_88422"}'

# ── Create deposit — USDC on ERC20 (Ethereum) ──
curl -X POST https://cfdpax.com/api/v1/payments \
  -H "Authorization: Bearer pgk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"amount":"100.00","crypto":"USDC-ERC20","merchant_ref":"dep_88423"}'

# ── Get deposit by ID ──
curl https://cfdpax.com/api/v1/payments/PAYMENT_ID \
  -H "Authorization: Bearer pgk_your_key"

# ── Get deposit by your reference ──
curl "https://cfdpax.com/api/v1/payments?merchant_ref=dep_88421" \
  -H "Authorization: Bearer pgk_your_key"

# ── Check merchant balance ──
curl https://cfdpax.com/api/v1/balances \
  -H "Authorization: Bearer pgk_your_key"

# ── Quote withdrawal fees ──
curl "https://cfdpax.com/api/v1/withdrawals/quote?crypto=USDT&amount=100&destination_address=T..." \
  -H "Authorization: Bearer pgk_your_key"

# ── Request withdrawal — USDT on ERC20 ──
curl -X POST https://cfdpax.com/api/v1/withdrawals \
  -H "Authorization: Bearer pgk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"crypto":"USDT-ERC20","amount":"100.00","destination_address":"0x...","merchant_ref":"payout_2"}'

# ── Request withdrawal — USDT on TRC20 ──
curl -X POST https://cfdpax.com/api/v1/withdrawals \
  -H "Authorization: Bearer pgk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"crypto":"USDT","amount":"100.00","destination_address":"T...","merchant_ref":"payout_1"}'

# ── List hot wallets ──
curl https://cfdpax.com/api/v1/hot-wallets \
  -H "Authorization: Bearer pgk_your_key"

Deposits API

Each call to POST /payments generates a unique deposit address for that user/transaction. Your users never share one address — every merchant_ref gets its own wallet to send crypto to.

POSThttps://cfdpax.com/api/v1/payments

Create a deposit. Returns a unique wallet address. Idempotent — same merchant_ref returns the existing payment.

Request body — USDT on TRC20 (Tron):
{
  "amount": "250.00",
  "crypto": "USDT",
  "merchant_ref": "deposit_88421",
  "fiat": "USD",
  "metadata": { "user_id": 42 }
}

Request body — USDT on ERC20 (Ethereum):
{
  "amount": "250.00",
  "crypto": "USDT-ERC20",
  "merchant_ref": "deposit_88422",
  "fiat": "USD"
}

Request body — USDC on ERC20 (Ethereum):
{
  "amount": "100.00",
  "crypto": "USDC-ERC20",
  "merchant_ref": "deposit_88423",
  "fiat": "USD"
}

HTTP 201 Created
{
  "id": "clx9f2a1b2c3d4e5f",
  "status": "pending",
  "crypto": "USDT",
  "amount": "250.00",
  "amountCrypto": "250.00000000",
  "address": "TXyz9k2mPqR8vN3wL5hJ7cF4dA6bE1gH2",
  "merchantRef": "deposit_88421",
  "externalId": "abc12345_deposit_88421",
  "createdAt": "2026-08-13T12:00:00.000Z"
}
GEThttps://cfdpax.com/api/v1/payments/PAYMENT_ID

Get payment status by internal ID. Poll this if webhooks are delayed.

GEThttps://cfdpax.com/api/v1/payments?merchant_ref=deposit_88421

Look up payment by your merchant_ref.

GEThttps://cfdpax.com/api/v1/balances

Your merchant settlement balance after confirmed deposits.

{
  "balances": [
    { "crypto": "USDT", "available": "1250.00", "pending": "100.00" },
    { "crypto": "USDT-ERC20", "available": "500.00", "pending": "0" },
    { "crypto": "USDC-ERC20", "available": "200.00", "pending": "0" }
  ]
}

Webhooks

Webstriva POSTs JSON to your URL when status changes. Register your URL at https://cfdpax.com/dashboard/webhooks. Always verify X-Webstriva-Signature before crediting users.

Deposit events

payment.created · payment.pending · payment.paid · payment.expired

Withdrawal events

withdrawal.created · withdrawal.processing · withdrawal.completed · withdrawal.cancelled

POST https://your-platform.com/webhooks/webstriva
Headers:
  Content-Type: application/json
  X-Webstriva-Event: payment.paid
  X-Webstriva-Signature: a1b2c3d4e5f6...

Body:
{
  "event": "payment.paid",
  "created_at": "2026-08-13T12:05:00.000Z",
  "data": {
    "id": "clx9f2a1b2c3d4e5f",
    "amount": "250.00",
    "crypto": "USDT",
    "merchantRef": "deposit_88421",
    "status": "paid",
    "paidAt": "2026-08-13T12:05:00.000Z"
  }
}

Signature verification

// PHP
$expected = hash_hmac('sha256', $rawBody, WEBSTRIVA_WEBHOOK_SECRET);
if (!hash_equals($expected, $_SERVER['HTTP_X_WEBSTRIVA_SIGNATURE'])) { die('401'); }

// Node.js
const expected = crypto.createHmac('sha256', SECRET).update(rawBody).digest('hex');

// Python
expected = hmac.new(SECRET.encode(), raw_body, hashlib.sha256).hexdigest()

Withdrawals API

Automatic payouts. Quote fees first, then submit. TRC20 network fees are debited from your TRX gas wallet; ERC20 fees from your ETH gas wallet — both at https://cfdpax.com/dashboard/hot-wallets.

GEThttps://cfdpax.com/api/v1/withdrawals/quote?crypto=USDT&amount=100&destination_address=T...

Get platform fee, network fee, and exact receive amount before submitting.

{
  "quote": {
    "amount_requested_usd": "100.00",
    "platform_fee_usd": "1.00",
    "network_fee_usd": "2.11",
    "network_fee_crypto": "6.4000",
    "network_fee_crypto_symbol": "TRX",
    "network_fee_paid_from": "merchant_gas_wallet",
    "total_fees_usd": "3.11",
    "receive_amount_usd": "96.89",
    "receive_amount_crypto": "96.89000000"
  }
}
POSThttps://cfdpax.com/api/v1/withdrawals

Execute payout to any valid wallet address.

// USDT on TRC20 (Tron)
{
  "crypto": "USDT",
  "amount": "500.00",
  "destination_address": "TUserWalletAddress...",
  "merchant_ref": "payout_4421"
}

// USDT on ERC20 (Ethereum)
{
  "crypto": "USDT-ERC20",
  "amount": "500.00",
  "destination_address": "0xUserWalletAddress...",
  "merchant_ref": "payout_4422"
}
GEThttps://cfdpax.com/api/v1/withdrawals

List last 50 withdrawals.

POSThttps://cfdpax.com/api/v1/withdrawal-addresses

Optional — pre-save whitelisted payout addresses.

// USDT on TRC20
{
  "crypto": "USDT",
  "address": "TUserWalletAddress...",
  "label": "user_88421",
  "network": "TRC20"
}

// USDT on ERC20
{
  "crypto": "USDT-ERC20",
  "address": "0xUserWalletAddress...",
  "label": "user_88422",
  "network": "ERC20"
}

Hot wallets (merchant only)

Hot wallets are not user deposit addresses. They are your merchant treasury and gas wallets for withdrawal network fees. User deposits always get a fresh address from POST /payments — pass USDT-ERC20 or USDC-ERC20 for Ethereum deposits, not USDT / USDC (those are Tron only).

GEThttps://cfdpax.com/api/v1/hot-wallets

TRX + ETH gas wallets and treasury balances for merchant withdrawals.

{
  "gas_wallet": {
    "crypto": "TRX",
    "purpose": "gas",
    "network": "TRX",
    "address": "TMerchantGasWallet...",
    "balance_crypto": "45.2000",
    "label": "TRX gas wallet — USDT (TRC20) / USDC (TRC20) withdrawal fees"
  },
  "eth_gas_wallet": {
    "crypto": "ETH",
    "purpose": "gas",
    "network": "Ethereum",
    "address": "0xMerchantEthGas...",
    "balance_crypto": "0.015000",
    "label": "ETH gas wallet — USDT (ERC20) / USDC (ERC20) withdrawal fees"
  },
  "hot_wallets": [
    { "crypto": "USDT", "purpose": "treasury", "network": "TRC20", "address": "T...", "balance_crypto": "0" },
    { "crypto": "USDC", "purpose": "treasury", "network": "TRC20", "address": "T...", "balance_crypto": "0" },
    { "crypto": "USDT-ERC20", "purpose": "treasury", "network": "ERC20", "address": "0x...", "balance_crypto": "0" },
    { "crypto": "USDC-ERC20", "purpose": "treasury", "network": "ERC20", "address": "0x...", "balance_crypto": "0" },
    { "crypto": "BTC", "purpose": "treasury", "network": "BTC", "address": "bc1...", "balance_crypto": "0" }
  ]
}

Error responses

HTTP 401 Unauthorized
{ "error": "Invalid API key" }

HTTP 400 Bad Request
{ "error": "amount, crypto, and merchant_ref are required" }

HTTP 503 Service Unavailable
{ "error": "Platform is in maintenance mode" }