API v1

Kriptopago API

REST over HTTPS, JSON in and out. Base URL: https://kriptopago.com/api/v1. Amounts are decimal strings, in USD by default or in your local currency. Funds never touch Kriptopago: the customer pays your own wallet and we detect it.

Authentication

Create a key in Dashboard → Developers and send it as a Bearer token. Keys are shown once; store them server-side only.

Authorization: Bearer kp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Rate limit: 120 requests/minute per key.

Payment flow

  1. Your server creates a charge and redirects the customer to checkout_url.
  2. The customer picks a coin. We lock the rate for 30 minutes and assign a unique amount (e.g. 25.03 USDT).
  3. They send it to your wallet. We detect it on-chain, wait for confirmations and mark it paid.
  4. We POST charge.paid to your webhook and send the customer back to redirect_url.

Statuses: new → pending → detected → paid, or expired / cancelled. A payment that arrives after expiry is still matched for 2 hours and flagged late: true.

Create a charge

POST /charges

FieldTypeDescription
amountstringRequired. Decimal string in currency (2 decimals max; none for CLP, JPY…). Min. 0.50 USD equivalent.
currencystringOptional, default USD. Any ISO code we quote (EUR, GBP, CLP, MXN, INR…). Converted to USD at creation (daily rate, rounded up); the crypto amount comes from that USD value. The response returns your amount/currency plus amount_usd.
order_idstringYour reference. Idempotent: same order_id returns the same charge.
assetsarrayRestrict coins, e.g. ["usdt_trc20"]. Default: every coin you have a wallet for.
descriptionstringShown on checkout.
customer_emailstringOptional.
redirect_url / cancel_urlurlWhere to send the customer after paying / on expiry.
metadataobjectReturned untouched in API and webhooks.
curl -X POST https://kriptopago.com/api/v1/charges \
  -H "Authorization: Bearer $KP_KEY" -H "Content-Type: application/json" \
  -d '{"amount":"25.00","order_id":"1042","redirect_url":"https://shop.example/ok"}'
{
  "id": "ch_k2v9x4m1q7aa", "object": "charge", "status": "new", "late": false,
  "amount": "25.00", "currency": "USD", "order_id": "1042",
  "assets_allowed": ["usdt_trc20", "usdt_bep20", "bnb"],
  "payment": null,
  "checkout_url": "https://kriptopago.com/pay/ch_k2v9x4m1q7aa",
  "expires_at": "2026-12-07T15:04:05Z", "paid_at": null
}

Once the customer picks a coin, payment holds asset, coin, network, address, amount, rate_usd, tx_hash, confirmations.

PHP

$ch = curl_init('https://kriptopago.com/api/v1/charges');
curl_setopt_array($ch, [
  CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('KP_KEY'), 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode(['amount' => '25.00', 'order_id' => $orderId]),
]);
$charge = json_decode(curl_exec($ch), true);
header('Location: ' . $charge['checkout_url']);

Retrieve & list

GET  /charges/{id}
GET  /charges?status=paid&limit=25&starting_after=ch_…
GET  /charges?order_id=1042
POST /charges/{id}/cancel
GET  /account      # plan, credits, enabled assets
GET  /rates        # USD price per asset

Reusable URLs with a fixed or open amount. Every visit creates its own charge.

POST /payment_links   {"title":"Top-up", "amount":"10.00"}   # omit amount = customer types it
GET  /payment_links

Pay button

Paste this HTML anywhere (replace the link id):

<a href="https://kriptopago.com/l/pl_xxxxxxxx" style="display:inline-block;padding:12px 20px;
  background:#f2c14e;color:#1a1405;border-radius:6px;font:600 15px sans-serif;text-decoration:none">
  Pay with crypto</a>

Webhooks

Add an HTTPS endpoint in Dashboard → Developers. Events: charge.created, charge.detected, charge.paid, charge.expired, charge.cancelled, subscription.renewed, subscription.past_due, subscription.cancelled.

Verify every request: compute HMAC-SHA256 of t + "." + raw_body with your endpoint secret and compare with v1. Reply 2xx; failures are retried with backoff for ~2 days.

Kriptopago-Signature: t=1796551200,v1=5f1c…

// PHP
$raw = file_get_contents('php://input');
parse_str(str_replace(',', '&', $_SERVER['HTTP_KRIPTOPAGO_SIGNATURE']), $sig);
$ok = abs(time() - (int)$sig['t']) < 300
   && hash_equals(hash_hmac('sha256', $sig['t'] . '.' . $raw, $secret), $sig['v1']);
$event = json_decode($raw, true);
if ($ok && $event['type'] === 'charge.paid') { /* credit order $event['data']['order_id'] */ }

Always confirm the amount and order on your side; process each event id once.

Assets

assetCoin / networkWalletConfirmations
usdt_trc20USDT · TRONTRONsolidified
usdt_bep20USDT · BNB Smart ChainEVM 0x5
usdt_erc20USDT · EthereumEVM 0x3
bnbBNB · BNB Smart ChainEVM 0x5
ethETH · EthereumEVM 0x3
btcBTC · BitcoinBTC1
ltcLTC · LitecoinLTC2
usdt_binanceUSDT · Binance PayBinance Pay ID0

One 0x address receives USDT-BEP20, BNB, USDT-ERC20 and ETH. Binance Pay requires a paid plan.

Errors

{ "error": { "code": "no_credits", "message": "No credits left…" } }
401unauthorized
402no_credits — buy a pack or upgrade; open charges are still detected
422invalid_amount, no_wallet_for_asset, invalid_redirect_url
429rate_limited