Checkout & Tocler Pay
Create an order for a buyer and take its payment with Tocler Pay — Tocler’s fee applies exactly as in the shop.
/v1/coins Your shop’s API keycheckout:write The coins and networks this shop can take with Tocler Pay right now. Use one key when you start a payment.
Errors
403missing_scope— The key lacks checkout:write.409tocler_pay_unavailable— Tocler Pay is not open for this shop right now (the message says why).401invalid_key— No key, a wrong key, or a revoked / expired key (key_revoked, key_expired).429rate_limited— Over the key’s requests per minute — wait for RateLimit-Reset.
curl -X GET 'https://api.tocler.com/v1/coins' \
-H 'Authorization: Bearer tk_live_…'{
"object": "list",
"data": [
{
"key": "usdt_tron",
"symbol": "USDT",
"name": "Tether USD (TRC-20)",
"network": "tron",
"network_name": "TRON",
"stable": true
}
]
} /v1/checkout Your shop’s API keycheckout:write Makes an order in the shop for a buyer’s email, through the shop’s own checkout: live prices, stock held, tax, discount and shipping as in the shop, and Tocler’s fee as in the shop. The buyer is emailed the order. Pay it with Tocler Pay — send the buyer to pay_url (the shop’s own pay page), or start the payment yourself with POST /v1/orders/{id}/tocler-pay and show the address and exact amount in your own page. Keys and accounts show on the order page only after the buyer opens the link in their email. Send an Idempotency-Key header.
- Idempotency-Keystringheaderrequired1–64 letters, digits,
_ - : .— the same one when you retry. The same key with another body → 409 idempotency_mismatch. - emailstringbodyrequiredThe buyer’s email — the order and its delivery are sent there.
- itemsarraybodyrequired[{ product_id, variant_id?, quantity, answers? }] — up to 50 lines. answers = { "<question id or key>": "value" } for products that ask questions.
- paymentstringbodyrequired"tocler_pay" (the way of paying for API orders).
- billingobjectbody{ country: "DE", vat_id? } — required when the shop collects tax.
- shippingobjectbodyFor physical goods: { address: { name, line1, line2?, city, postcode, region?, country, phone? }, choices: { "<group>": "<rate id>" } }.
- discount_codestringbodyA discount code of the shop.
Errors
403missing_scope— The key lacks checkout:write.400invalid_request— A field is missing or wrong (see field).400tax_country— The shop collects tax: send billing.country.400answer_required— A product needs an answer to its question.400shipping_required— Physical goods need a shipping address and a rate.403checkout_unavailable— Tocler stopped orders without an account for this shop.409tocler_pay_unavailable— Tocler Pay is not open for this shop right now.409discount— The discount code can’t be used.429too_many_open— Too many unpaid orders for this email or shop.401invalid_key— No key, a wrong key, or a revoked / expired key (key_revoked, key_expired).429rate_limited— Over the key’s requests per minute — wait for RateLimit-Reset.
curl -X POST 'https://api.tocler.com/v1/checkout' \
-H 'Authorization: Bearer tk_live_…' \
-H 'Content-Type: application/json' \
-d '{
"email": "buyer@example.com",
"payment": "tocler_pay",
"billing": {
"country": "DE"
},
"items": [
{
"product_id": "665f1c2e9b1e8a00aaaaaaaa",
"variant_id": "665f1c2e9b1e8a00bbbbbbbb",
"quantity": 2,
"answers": {
"player_id": "88231"
}
}
]
}'{
"email": "buyer@example.com",
"payment": "tocler_pay",
"billing": {
"country": "DE"
},
"items": [
{
"product_id": "665f1c2e9b1e8a00aaaaaaaa",
"variant_id": "665f1c2e9b1e8a00bbbbbbbb",
"quantity": 2,
"answers": {
"player_id": "88231"
}
}
]
}{
"order": {
"id": "TRX8F2K1",
"object": "order",
"status": "pending",
"via": "api",
"currency": "EUR",
"charge": {
"amount": "21.72",
"currency": "USD"
},
"…": "…"
},
"pay_url": "https://teststore.tocler.com/checkout/TRX8F2K1#access=b.…",
"coins": [
{
"key": "usdt_tron",
"symbol": "USDT",
"network": "tron"
}
]
} /v1/orders/{id}/tocler-pay Your shop’s API keycheckout:write For an order made with this API that is still waiting: the address, the EXACT amount, the network and the time left. Show them to the buyer (with a QR code of the address). Choosing another coin replaces the waiting payment. The order becomes paid only after Tocler Pay’s checks on the blockchain — follow it with GET /v1/orders/{id} (or the order.paid webhook). Send an Idempotency-Key header.
- Idempotency-Keystringheaderrequired1–64 letters, digits,
_ - : .— the same one when you retry. The same key with another body → 409 idempotency_mismatch. - idstringpathrequiredThe order id.
- coinstringbodyrequiredA coin key from GET /v1/coins.
Errors
403missing_scope— The key lacks checkout:write.404not_found— No such order made with the API in this shop.409not_payable— The order is not waiting for a Tocler Pay payment (paid, expired, or made in the shop).409coin_unavailable— That coin is not available right now.409payment_in_progress— A payment is already on its way — wait for it.401invalid_key— No key, a wrong key, or a revoked / expired key (key_revoked, key_expired).429rate_limited— Over the key’s requests per minute — wait for RateLimit-Reset.
curl -X POST 'https://api.tocler.com/v1/orders/{id}/tocler-pay' \
-H 'Authorization: Bearer tk_live_…' \
-H 'Content-Type: application/json' \
-d '{
"coin": "usdt_tron"
}'{
"coin": "usdt_tron"
}{
"order": {
"id": "TRX8F2K1",
"status": "pending",
"…": "…"
},
"payment": {
"object": "tocler_pay_payment",
"id": "TCP-7KQ2M9XA",
"status": "pending",
"coin": {
"key": "usdt_tron",
"symbol": "USDT",
"name": "Tether USD (TRC-20)"
},
"network": {
"key": "tron",
"name": "TRON"
},
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"amount": "21.7213",
"token_contract": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"expires_at": "2026-11-03T10:30:00.000Z",
"seconds_left": 1790,
"confirmations": {
"current": 0,
"needed": 20
},
"transaction": null
}
} /v1/orders/{id}/tocler-pay Your shop’s API keycheckout:write Asks the blockchain now (at most every 10 seconds) and answers the payment and the order — for an “I have paid” button. The order completes by itself either way.
- idstringpathrequiredThe order id.
Errors
403missing_scope— The key lacks checkout:write.404not_found— No such order made with the API in this shop.401invalid_key— No key, a wrong key, or a revoked / expired key (key_revoked, key_expired).429rate_limited— Over the key’s requests per minute — wait for RateLimit-Reset.
curl -X GET 'https://api.tocler.com/v1/orders/{id}/tocler-pay' \
-H 'Authorization: Bearer tk_live_…'{
"order": {
"id": "TRX8F2K1",
"status": "paid",
"…": "…"
},
"payment": {
"object": "tocler_pay_payment",
"id": "TCP-7KQ2M9XA",
"status": "paid",
"coin": {
"key": "usdt_tron",
"symbol": "USDT",
"name": "Tether USD (TRC-20)"
},
"network": {
"key": "tron",
"name": "TRON"
},
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"amount": "21.7213",
"token_contract": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"expires_at": "2026-11-03T10:30:00.000Z",
"seconds_left": 1790,
"confirmations": {
"current": 20,
"needed": 20
},
"transaction": null
}
}