REST sobre HTTPS, JSON de entrada y salida. URL base: https://kriptopago.com/api/v1. Los montos son strings decimales, en USD por defecto o en tu moneda local. El dinero nunca pasa por Kriptopago: el cliente paga a tu propia wallet y nosotros lo detectamos.
Crea una key en Panel → Desarrolladores y envíala como token Bearer. Se muestra una sola vez; guárdala solo en tu servidor.
Authorization: Bearer kp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Límite: 120 solicitudes/minuto por key.
checkout_url.paid.charge.paid a tu webhook y devolvemos al cliente a redirect_url.Estados: new → pending → detected → paid, o expired / cancelled. Un pago que llega después de expirar se sigue asociando durante 2 horas y se marca late: true.
POST /charges
| Campo | Tipo | Descripción |
|---|---|---|
amount | string | Obligatorio. Decimal en la currency indicada (máx. 2 decimales; sin decimales en CLP, JPY…). Mín. equivalente a 0.50 USD. |
currency | string | Opcional, por defecto USD. Cualquier código ISO que cotizamos (EUR, GBP, CLP, MXN, INR…). Se convierte a USD al crear el cobro (tasa diaria, redondeada hacia arriba) y el monto en cripto sale de ese valor. La respuesta trae tu amount/currency más amount_usd. |
order_id | string | Tu referencia. Idempotente: el mismo order_id devuelve el mismo cobro. |
assets | array | Limita monedas, ej. ["usdt_trc20"]. Por defecto: todas las que tienes con wallet. |
description | string | Se muestra en el checkout. |
customer_email | string | Opcional. |
redirect_url / cancel_url | url | Adónde enviar al cliente al pagar / al expirar. |
metadata | object | Se devuelve tal cual en API y 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
}
Cuando el cliente elige moneda, payment trae 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']);
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
URLs reutilizables con monto fijo o libre. Cada visita crea su propio cobro.
POST /payment_links {"title":"Top-up", "amount":"10.00"} # omit amount = customer types it
GET /payment_links
Pega este HTML donde quieras (cambia el id del link):
<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>
Agrega un endpoint HTTPS en Panel → Desarrolladores. Eventos: charge.created, charge.detected, charge.paid, charge.expired, charge.cancelled, subscription.renewed, subscription.past_due, subscription.cancelled.
Verifica cada solicitud: calcula HMAC-SHA256 de t + "." + cuerpo_crudo con el secreto del endpoint y compáralo con v1. Responde 2xx; los fallos se reintentan con espera creciente por ~2 días.
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'] */ }
Confirma siempre el monto y el pedido de tu lado; procesa cada id de evento una sola vez.
| asset | Moneda / red | Wallet | Confirmaciones |
|---|---|---|---|
usdt_trc20 | USDT · TRON | TRON | solidified |
usdt_bep20 | USDT · BNB Smart Chain | EVM 0x | 5 |
usdt_erc20 | USDT · Ethereum | EVM 0x | 3 |
bnb | BNB · BNB Smart Chain | EVM 0x | 5 |
eth | ETH · Ethereum | EVM 0x | 3 |
btc | BTC · Bitcoin | BTC | 1 |
ltc | LTC · Litecoin | LTC | 2 |
usdt_binance | USDT · Binance Pay | Binance Pay ID | 0 |
Una dirección 0x recibe USDT-BEP20, BNB, USDT-ERC20 y ETH. Binance Pay requiere plan pagado.
{ "error": { "code": "no_credits", "message": "No credits left…" } }
| 401 | unauthorized |
| 402 | no_credits — compra un paquete o sube de plan; los cobros abiertos se siguen detectando |
| 422 | invalid_amount, no_wallet_for_asset, invalid_redirect_url |
| 429 | rate_limited |