Modern JSON REST v1 · Retire Legacy Form-Encoded IPNs & Custodial Sweeps

Миграция с CoinPayments to Non-Custodial XPayr

Upgrade from legacy form-encoded `cmd=create_transaction` APIs, custodial merchant balances, and regional shutdowns to modern OpenAPI 3.1.0 JSON endpoints, Web3 1-Click signing, and 99.5% direct wallet finality.

Cutover Time~15 Minutes (Parallel Safe)
CoinPayments Fee0.5%–1.0% + coin sweeping & withdrawal network fees
XPayr Комиссия шлюзаFlat 0.5% ($0/mo · $0 Sweep)
XPayr Модель хранения100% Некастодиально (99.5% Direct)

Why Engineering & Finance Teams Switch Away From CoinPayments

CoinPayments legacy API uses URL-encoded POST commands (`cmd=create_transaction`) and integer `status >= 100` IPN codes from 2014.
Custodial wallet storage exposes merchants to jurisdiction pullbacks, account freezes, and secondary sweep/withdrawal fees.
Checkout UI lacks modern EIP-6963 1-Click Web3 signing, ERC-2612 безгазовый Permits, and Solana Wallet Standard.

Field-by-Field API & Webhook Mapping (CoinPayments → XPayr v1)

Keep your existing database order schema intact — map these 6 fields to cut over cleanly.

Integration Layer CoinPayments (Legacy) XPayr Non-Custodial v1
API Transport POST form-urlencoded (cmd=create_transaction) POST JSON https://xpayr.com/api/v1/payments
Currency Pair currency1 ("USD") + currency2 ("USDT.TRC20") currency ("USD") + network ("tron") + token ("USDT")
Invoice Reference invoice / item_number + custom order_id + metadata (typed JSON)
IPN / Webhook Format application/x-www-form-urlencoded (status >= 100) application/json (event === "payment.completed")
Signature Header HMAC (SHA-512 over form body) X-XPayr-Signature (SHA-256 over raw JSON body)
Auto-Sweep Cost Extra network fee for nightly forwarding $0 sweep fee — 99.5% settles directly on checkout

Drop-In Migration Adapter (PHP (WHMCS / Custom))

Copy-paste replacement ready for Testnet (sk_test_...) and Mainnet (sk_live_...).
<?php
declare(strict_types=1);

/**
 * Replaces CoinPayments IPN status >= 100 check with XPayr JSON webhook handler.
 */
$raw = (string) file_get_contents('php://input');
$sig = preg_replace('/^sha256=/i', '', (string) ($_SERVER['HTTP_X_XPAYR_SIGNATURE'] ?? ''));
$calc = hash_hmac('sha256', $raw, (string) getenv('XPAYR_WEBHOOK_SECRET'));

if (!hash_equals($calc, $sig)) {
    http_response_code(401);
    exit('Bad HMAC');
}

$payload = json_decode($raw, true, 512, JSON_THROW_ON_ERROR);
$event = (string) ($payload['event'] ?? '');

// Replaces CoinPayments ($status >= 100 || $status == 2)
if ($event === 'payment.completed' || $event === 'payment.underpaid_accepted') {
    $invoiceId = (string) ($payload['data']['order_id'] ?? '');
    $txHash = (string) ($payload['data']['tx_hash'] ?? '');
    // Credit WHMCS / OpenCart / Zen Cart order immediately
}
http_response_code(200);
echo 'OK';

4-Step Zero-Downtime Canary Cutover Checklist

1

Connect non-custodial wallets & generate sk_test_ API keys

Register at /merchant/register, paste your destination EVM, Solana, TRON, or multisig wallet addresses, and generate a free API тестовой сети key.

2

Deploy the X-XPayr-Signature HMAC-SHA256 webhook adapter

Add the raw-body HMAC-SHA256 verification handler alongside your existing CoinPayments callback endpoint and test events in /tools/webhook-tester.

3

Canary 10%–25% of live checkout sessions in parallel

Route a slice of live crypto orders to POST /api/v1/payments (or enable the XPayr storefront plugin) to verify instant прямым зачислением 99.5% на кошелёк.

4

Cut over 100% of traffic & export clean ERP ledgers

Switch primary crypto checkout routing to XPayr, withdraw any remaining custodial float from CoinPayments, and export QuickBooks/Xero CSVs via /accounting.

Часто задаваемые вопросы — Switching From CoinPayments

Do you have direct replacements for CoinPayments WHMCS, OpenCart, and Zen Cart modules?

Yes! XPayr maintains official integrations for WHMCS (/plugins/whmcs), Blesta (/plugins/blesta), OpenCart (/plugins/opencart), Zen Cart (/plugins/zen-cart), and WooCommerce (/plugins/woocommerce).

Does XPayr charge nightly forwarding fees like CoinPayments PayByName / Auto-Sweep?

Zero forwarding fees. Payments split atomically on-chain or arrive directly in your own wallet at the moment of checkout.

Can buyers still pay with LTC, DOGE, TRX, XRP, BTC, and USDT?

Yes — inspect all flagship currencies at /currencies and 500+ programmatic token routes.

Explore All 10 инструкций по миграции с других шлюзов