Tocler Pay: take crypto payments
Create a payment, show the address and amount, wait for the signed webhook, read it back, deliver.
Get a key
You receive an API key
tp_live_<id>.<secret>with its features (scopes, coins, limits, allowed IPs) and a webhook secret. Each is shown once — keep them on your server.Ask which coins you can take
GET /api/pay/v1/coins— only coins that are on and have a ready address.Create a payment
POST /api/pay/v1/paymentswithamount_usd,coinand yourreference(your order id) and anIdempotency-Key. Show the payeraddressand the exactamount(and a QR code).Wait for the webhook
On
payment.paid, check the signature, then read the payment back withGET /api/pay/v1/payments/{id}. Deliver only ifstatusispaid.
curl https://api.tocler.com/api/pay/v1/payments \
-H "Authorization: Bearer $TOCLER_PAY_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1001-usdt_tron" \
-d '{"amount_usd":"25.00","coin":"usdt_tron","reference":"order-1001","address_mode":"own"}'const res = await fetch('https://api.tocler.com/api/pay/v1/payments', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.TOCLER_PAY_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'order-1001-usdt_tron',
},
body: JSON.stringify({ amount_usd: '25.00', coin: 'usdt_tron', reference: 'order-1001', address_mode: 'own' }),
});
const payment = await res.json(); // show payment.address and payment.amountimport os, requests
r = requests.post('https://api.tocler.com/api/pay/v1/payments',
headers={'Authorization': 'Bearer ' + os.environ['TOCLER_PAY_KEY'], 'Idempotency-Key': 'order-1001-usdt_tron'},
json={'amount_usd': '25.00', 'coin': 'usdt_tron', 'reference': 'order-1001', 'address_mode': 'own'}, timeout=15)
payment = r.json() Payment statuses
pending → confirming → paid. Or expired (nothing arrived in time), cancelled, review (something odd — late, after a cancel — Tocler decides) and refused (after review).
Five checks before “paid”
Tocler Pay marks a payment paid only after five checks: (1) the transaction pays one payment only, (2) the official token contract (or the network’s own coin), (3) the exact address, (4) the exact amount of an open payment, sent after it was created and before its timer ended, and (5) the network’s confirmations. Anything odd goes to review — it never completes by itself.
Retries and duplicates
Send an Idempotency-Key with every POST: the same key and body return the first answer for 24 hours. Webhooks are retried after 1 m, 5 m, 30 m, 2 h, 6 h, 12 h and 24 h until you answer 2xx.