Introduction
The KryptaGate API is organized around REST. Requests and responses use JSON over HTTPS. Every request is made on behalf of a single store, identified by its API key.
https://kryptagate.com/api/v1- Amounts are returned as decimal strings (for example
"249.99") to avoid floating-point errors. In requests,amountaccepts a string or a number. - Timestamps are ISO 8601 strings in UTC.
- Asset codes combine a coin and a network, for example
USDT_TRC20orUSDC_SOL. - Invoice IDs start with
inv_, webhook event IDs start withevt_.
Authentication
Create an API key in the dashboard under Store → API & webhooks. Keys start with kg_live_ and belong to a single store. Send the key in the X-API-Key header or as a Bearer token in the Authorization header.
curl https://kryptagate.com/api/v1/me \ -H "X-API-Key: kg_live_your_api_key"curl https://kryptagate.com/api/v1/me \ -H "Authorization: Bearer kg_live_your_api_key"Quick start
A complete integration takes four steps.
- 1
Create a store
Sign up, create a store and enable the networks and assets you want to accept.
- 2
Get credentials
Create an API key, set your webhook URL and copy the webhook signing secret (
whsec_…). - 3
Create an invoice
Call
POST /invoicesfrom your server and redirect the customer to theurlfrom the response. - 4
Handle the webhook
Verify the signature and fulfil the order when you receive
invoice.paidorinvoice.overpaid.
curl -X POST https://kryptagate.com/api/v1/invoices \ -H "X-API-Key: kg_live_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "amount": "249.00", "currency": "USD", "order_id": "1042", "description": "Pro plan, 12 months", "customer_email": "jane@example.com", "success_url": "https://example.com/thanks", "metadata": { "user_id": 7781 } }'The invoice object
Every endpoint that works with invoices returns this object. Webhook events carry it in data. The payment field stays null until an asset is selected — by the customer on the checkout, or by you with the asset parameter.
idstring- Unique invoice ID, starts with
inv_. objectstring- Always
"invoice". store_idstring- ID of the store the invoice belongs to.
statusstring- Current status. See Invoice statuses.
urlstring- Hosted checkout link. Redirect the customer here or send it to them.
sourcestring- How the invoice was created:
api,manual(dashboard) orlink(payment link). order_idstring | null- Your order reference, if provided.
descriptionstring- Text shown to the customer on the checkout.
priceobject- The price exactly as you set it:
amountandcurrency. price_usdstring- The price converted to USD when the invoice was created.
customerobject- Customer email and name, if provided.
custom_fieldsobject- Values collected by a payment-link form.
metadataobject- Your own key-value data, returned unchanged.
allowed_assetsstring[] | null- Assets the customer can choose from, or
nullfor all assets enabled in the store. paymentobject | null- The selected asset, deposit address and amounts.
nulluntil an asset is selected. payment.addressstring- Unique deposit address for this invoice.
payment.amount_duestring- Exact amount to send in the selected asset. Includes the fee when the customer pays it.
payment.receivedstring- Confirmed amount received so far.
payment.pendingstring- Amount detected on-chain but not yet confirmed.
payment.remainingstring- Amount still to be paid.
payment.rate_usdstring- USD rate of the asset used for the quote.
payment.quote_expires_atstring- The quoted amount is locked until this time (up to 60 minutes, never later than
expires_at). payment.explorer_urlstring- Link to the deposit address in a block explorer.
payment.refundobject | nullnull, or a refund of excess funds:status(awaiting_address,queued,sent,failed),amount,refunded,network_fee,address.feeobject- Service fee:
percent,paid_by(merchantorcustomer) andamountin the payment asset once paid. The amount ispercentof the payment, but not less than the network minimum (min_fee_usdinGET /assets). settlementobject | null- What was credited to your balance:
asset,amountandusd. With auto-conversion enabled,assetis your conversion target. is_latebooleantrueif the payment arrived afterexpires_at.accepted_partialbooleantrueif you accepted an underpaid invoice as paid.success_urlstring | null- Where the checkout sends the customer after payment.
cancel_urlstring | null- Where the customer goes if they leave the checkout.
expires_atstring- When the payment window closes.
paid_atstring | null- When the invoice was paid, or
null. created_atstring- When the invoice was created.
{ "id": "inv_4fQm8ZtR2xLp9KcW7vNb3D", "object": "invoice", "store_id": "9b2f6c1e-3d4a-4f7b-8e21-5c6d7a8b9f01", "status": "paid", "url": "https://kryptagate.com/pay/inv_4fQm8ZtR2xLp9KcW7vNb3D", "source": "api", "order_id": "1042", "description": "Pro plan, 12 months", "price": { "amount": "249", "currency": "USD" }, "price_usd": "249", "customer": { "email": "jane@example.com", "name": "Jane Cooper" }, "custom_fields": {}, "metadata": { "user_id": 7781 }, "allowed_assets": ["USDT_TRC20", "USDC_SOL", "USDT_BEP20"], "payment": { "id": 5121, "asset": "USDT_TRC20", "network": "tron", "symbol": "USDT", "address": "TXqH3vE9pXo2nU7cWb6RkLmS4aYdF8gJzQ", "amount_due": "249", "received": "249", "pending": "0", "remaining": "0", "rate_usd": "1", "quote_expires_at": "2026-11-23T12:41:07.000Z", "explorer_url": "https://tronscan.org/#/address/TXqH3vE9pXo2nU7cWb6RkLmS4aYdF8gJzQ", "refund": null }, "fee": { "percent": "1.00", "paid_by": "merchant", "amount": "3" }, "settlement": { "asset": "USDT_TRC20", "amount": "246", "usd": "249" }, "is_late": false, "accepted_partial": false, "success_url": "https://example.com/thanks", "cancel_url": null, "expires_at": "2026-11-23T12:41:07.000Z", "paid_at": "2026-11-23T11:44:51.903Z", "created_at": "2026-11-23T11:41:07.000Z"}Endpoints
All paths are relative to the base URL. Every request must be authenticated with the API key of the store.
/invoicesCreate an invoice
Creates an invoice and returns it with status 201. Redirect the customer to url to pay on the hosted checkout.
amountstring | numberrequired- Price, greater than 0. String or number. The minimum is the equivalent of $0.10, and each asset has its own minimum (see
GET /assets). currencystringoptionalDefault:USD- Price currency: USD, EUR, RUB, USDT, USDC, SOL, ETH, BNB or TRX. USD prices are paid 1:1 in USDT and USDC; other combinations are converted at the current rate.
order_idstringoptional- Your order reference, up to 100 characters. You can filter
GET /invoicesby it. descriptionstringoptional- Shown to the customer on the checkout, up to 1000 characters.
customer_emailstringoptional- Customer email address.
customer_namestringoptional- Customer name, up to 120 characters.
success_urlstringoptionalhttp(s)URL to return the customer to after payment. Defaults to the store setting.cancel_urlstringoptionalhttp(s)URL for customers who leave the checkout. Defaults to the store setting.assetsstring[]optional- Asset codes the customer may choose from (up to 20). Defaults to all assets enabled in the store.
assetstringoptional- Preselect an asset. The invoice is returned with status
pending, andpaymentalready contains the deposit address andamount_due— useful if you show payment details in your own interface. lifetime_minutesintegeroptional- How long the invoice can be paid, from 10 to 43200 minutes (30 days). Defaults to the store setting.
metadataobjectoptional- Any JSON object up to 4 KB. Returned in the invoice and in webhooks.
curl -X POST https://kryptagate.com/api/v1/invoices \ -H "X-API-Key: kg_live_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "amount": "249.00", "currency": "USD", "order_id": "1042", "description": "Pro plan, 12 months", "customer_email": "jane@example.com", "success_url": "https://example.com/thanks", "metadata": { "user_id": 7781 } }'{ "id": "inv_4fQm8ZtR2xLp9KcW7vNb3D", "object": "invoice", "store_id": "9b2f6c1e-3d4a-4f7b-8e21-5c6d7a8b9f01", "status": "new", "url": "https://kryptagate.com/pay/inv_4fQm8ZtR2xLp9KcW7vNb3D", "source": "api", "order_id": "1042", "description": "Pro plan, 12 months", "price": { "amount": "249", "currency": "USD" }, "price_usd": "249", "customer": { "email": "jane@example.com", "name": null }, "custom_fields": {}, "metadata": { "user_id": 7781 }, "allowed_assets": null, "payment": null, "fee": { "percent": "1.00", "paid_by": "merchant", "amount": null }, "settlement": null, "is_late": false, "accepted_partial": false, "success_url": "https://example.com/thanks", "cancel_url": null, "expires_at": "2026-11-23T12:41:07.000Z", "paid_at": null, "created_at": "2026-11-23T11:41:07.000Z"}Preselecting an asset
Pass asset to skip the asset selection step. The response already contains the deposit address and the exact amount to pay.
curl -X POST https://kryptagate.com/api/v1/invoices \ -H "X-API-Key: kg_live_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "amount": "249.00", "currency": "USD", "asset": "USDT_TRC20" }'{ "id": "inv_4fQm8ZtR2xLp9KcW7vNb3D", "status": "pending", "payment": { "id": 5121, "asset": "USDT_TRC20", "network": "tron", "symbol": "USDT", "address": "TXqH3vE9pXo2nU7cWb6RkLmS4aYdF8gJzQ", "amount_due": "249", "received": "0", "pending": "0", "remaining": "249", "rate_usd": "1", "quote_expires_at": "2026-11-23T12:41:07.000Z", "explorer_url": "https://tronscan.org/#/address/TXqH3vE9pXo2nU7cWb6RkLmS4aYdF8gJzQ", "refund": null }, …}/invoicesList invoices
Returns invoices of the store, newest first.
limitintegeroptionalDefault:20- Number of invoices to return, up to 100. Default 20.
offsetintegeroptionalDefault:0- Number of invoices to skip. Default 0.
statusstringoptional- Return only invoices with this status.
order_idstringoptional- Return only invoices with this
order_id.
curl "https://kryptagate.com/api/v1/invoices?status=paid&limit=20" \ -H "X-API-Key: kg_live_your_api_key"{ "data": [ { "id": "inv_4fQm8ZtR2xLp9KcW7vNb3D", "object": "invoice", "status": "paid", "order_id": "1042", … } ], "limit": 20, "offset": 0}/invoices/{id}Retrieve an invoice
Returns a single invoice. Use it to check the latest state, for example after receiving a webhook.
idstringrequired- Invoice ID, for example
inv_4fQm8ZtR2xLp9KcW7vNb3D.
curl https://kryptagate.com/api/v1/invoices/inv_4fQm8ZtR2xLp9KcW7vNb3D \ -H "X-API-Key: kg_live_your_api_key"{ "id": "inv_4fQm8ZtR2xLp9KcW7vNb3D", "object": "invoice", "status": "confirming", "payment": { "asset": "USDT_TRC20", "amount_due": "249", "received": "0", "pending": "249", "remaining": "249", … }, …}/invoices/{id}/cancelCancel an invoice
Cancels an invoice and returns it. Only invoices with status new or pending and no detected payment can be cancelled; otherwise the API responds with 409.
idstringrequired- Invoice ID.
curl -X POST https://kryptagate.com/api/v1/invoices/inv_4fQm8ZtR2xLp9KcW7vNb3D/cancel \ -H "X-API-Key: kg_live_your_api_key"{ "id": "inv_4fQm8ZtR2xLp9KcW7vNb3D", "object": "invoice", "status": "cancelled", …}/assetsList assets
Returns the assets currently enabled for the store, with the live USD rate, the minimum invoice amount and the minimum service fee per payment (min_fee_usd), both in USD.
curl https://kryptagate.com/api/v1/assets \ -H "X-API-Key: kg_live_your_api_key"{ "assets": [ { "id": "USDT_TRC20", "network": "tron", "network_name": "TRON", "standard": "TRC-20", "symbol": "USDT", "name": "Tether USD", "decimals": 6, "rate_usd": "1", "min_amount_usd": "3.00", "min_fee_usd": "3.00" }, { "id": "SOL", "network": "solana", "network_name": "Solana", "standard": "SPL", "symbol": "SOL", "name": "Solana", "decimals": 9, "rate_usd": "142.18", "min_amount_usd": "0.50", "min_fee_usd": "1.00" } ]}/balancesGet balances
Returns the store balance for every asset, with its USD equivalent (null if no rate is available).
curl https://kryptagate.com/api/v1/balances \ -H "X-API-Key: kg_live_your_api_key"{ "balances": [ { "asset": "USDT_TRC20", "network": "tron", "symbol": "USDT", "amount": "1520.5", "usd": "1520.5" }, { "asset": "ETH", "network": "ethereum", "symbol": "ETH", "amount": "0", "usd": "0" } ]}/meGet the current store
Returns the store that the API key belongs to. Handy for checking that a key works.
curl https://kryptagate.com/api/v1/me \ -H "Authorization: Bearer kg_live_your_api_key"{ "store": { "id": "9b2f6c1e-3d4a-4f7b-8e21-5c6d7a8b9f01", "name": "Nova Studio", "website": "https://nova.example.com", "payout_mode": "direct", "convert_to": null }}Invoice statuses
An invoice moves through these statuses. Every change is sent to your webhook as invoice.<status>.
| Status | Meaning | Final |
|---|---|---|
newAwaiting method | Created. The customer has not selected a payment asset yet. | |
pendingAwaiting payment | An asset is selected and a deposit address is issued. Waiting for the transaction. | |
confirmingConfirming | A transaction is detected on-chain and is waiting for the required confirmations. | |
partialUnderpaid | Less than amount_due was received. The checkout shows the remaining amount; the payment window is extended to at least 30 minutes. | |
paidPaid | The full amount is confirmed and credited to your balance. Fulfil the order. | |
overpaidOverpaid | More than amount_due was received. You are credited the invoice amount; the excess can be refunded to the customer. Fulfil the order. | |
expiredExpired | The payment window ended without full payment. | |
cancelledCancelled | Cancelled before any payment was detected. |
paid, overpaid, expired and cancelled are final. One exception: if a full payment arrives within 24 hours after expiry, an expired invoice becomes paid with is_late: true.Underpayment & overpayment
Customers sometimes send a slightly different amount. These rules decide what happens.
Underpayment
- If the confirmed amount is less than
amount_due, the invoice becomespartialand the checkout showspayment.remaining. The customer can top up the same address. - The payment window is extended once, to at least 30 minutes after the first partial payment.
- You can set an underpayment tolerance (%) in the store settings. A payment within the tolerance counts as paid.
- If the invoice expires underpaid, you can accept it as paid in the dashboard (
accepted_partialbecomestrueand the received amount minus the fee is credited). Otherwise the received funds are refundable to the customer.
Overpayment
- If more than
amount_duearrives, the invoice becomesoverpaidand you are credited exactly the invoice amount (minus the fee if you pay it). - The excess appears in
payment.refundwith statusawaiting_address. The customer enters a wallet address on the checkout page and receives the excess minus the network fee. - If the excess is smaller than the network fee, it is added to your balance instead.
Who pays the fee
- The fee is 1% of the payment, but not less than the network minimum: $3 on TRON, $2 on Ethereum, $1 on Solana and BNB Smart Chain. The minimum is converted to the paid asset at the invoice rate.
fee.paid_by = merchant:amount_dueequals the price, and the fee is deducted from the amount credited to you. Example: a $50 USDT payment on TRON credits 47 USDT.fee.paid_by = customer: the fee is added toamount_due, and you receive the full price. Example: a $50 invoice paid in USDT on TRON hasamount_due= 53.- The fee never exceeds the amount received, for example when you accept a small underpayment.
Late payments
- Deposit addresses are watched for 24 hours after expiry. A full payment that arrives late marks the invoice as
paidwithis_late: true.
"refund": { "status": "awaiting_address", "amount": "30", "refunded": "0", "network_fee": "2.5", "address": null}Webhooks
KryptaGate sends a POST request with a JSON body to your webhook URL every time an invoice changes status. Set the URL and copy the signing secret in Store → API & webhooks.
Request headers
| Header | Description |
|---|---|
Content-Type | Always application/json. |
User-Agent | KryptaGate-Webhooks/1.0 — Identifies KryptaGate deliveries. |
X-KryptaGate-Event | Event name, for example invoice.paid. |
X-KryptaGate-Delivery | Delivery ID. Stays the same across retries — use it to detect duplicates. |
X-KryptaGate-Signature | Timestamp and HMAC-SHA256 signature: t=<unix seconds>,v1=<hex>. |
POST /webhooks/kryptagate HTTP/1.1Content-Type: application/jsonUser-Agent: KryptaGate-Webhooks/1.0X-KryptaGate-Event: invoice.paidX-KryptaGate-Delivery: 48213X-KryptaGate-Signature: t=1795434292,v1=5f2c9a0e7b4d1c8a3f6e2b9d0c7a4e1f8b5d2c9a6e3f0b7d4c1a8e5f2b9c6d3aPayload
Every delivery has the same envelope: id, event, created_at and data. For invoice events, data is the invoice object at the moment of the change.
{ "id": "evt_7hKq2VbN9xRt4LmZcP8w", "event": "invoice.paid", "created_at": "2026-11-23T11:44:52.118Z", "data": { "id": "inv_4fQm8ZtR2xLp9KcW7vNb3D", "object": "invoice", "status": "paid", "order_id": "1042", "price": { "amount": "249", "currency": "USD" }, "fee": { "percent": "1.00", "paid_by": "merchant", "amount": "3" }, "settlement": { "asset": "USDT_TRC20", "amount": "246", "usd": "249" }, "paid_at": "2026-11-23T11:44:51.903Z", … }}{ "id": "evt_Qp3sW8nKd2LxVc7Rt1Ym", "event": "test", "created_at": "2026-11-23T11:50:03.441Z", "data": { "message": "KryptaGate test webhook", "store_id": "9b2f6c1e-3d4a-4f7b-8e21-5c6d7a8b9f01" }}Events
| Event | Description |
|---|---|
invoice.pending | The customer selected an asset and a deposit address was issued. |
invoice.confirming | A transaction was detected and is waiting for confirmations. |
invoice.partial | The invoice is underpaid; waiting for the rest. |
invoice.paid | Paid in full (also sent when you accept an underpaid invoice). Fulfil the order. |
invoice.overpaid | Paid with excess. Fulfil the order. |
invoice.expired | Expired without full payment. |
invoice.cancelled | The invoice was cancelled. |
test | Sent from the dashboard to test your endpoint. |
No event is sent when an invoice is created — you already have it in the API response.
Verifying signatures
Always verify the signature before trusting a webhook:
- 1Read the raw request body exactly as received, before parsing JSON.
- 2Split the
X-KryptaGate-Signatureheader intotandv1. - 3Compute HMAC-SHA256 of the string
"{t}.{raw body}"with your webhook secret, hex-encoded. - 4Compare it with
v1using a constant-time comparison and reject timestamps older than 5 minutes.
import crypto from 'node:crypto';import express from 'express'; const app = express();const SECRET = process.env.KRYPTAGATE_WEBHOOK_SECRET; // whsec_... // The signature covers the raw body, so do not parse JSON before verifyingapp.post('/webhooks/kryptagate', express.raw({ type: 'application/json' }), (req, res) => { const header = req.get('X-KryptaGate-Signature') ?? ''; const parts = Object.fromEntries(header.split(',').map((p) => p.split('='))); const raw = req.body.toString('utf8'); const expected = crypto .createHmac('sha256', SECRET) .update(`${parts.t}.${raw}`) .digest('hex'); const valid = typeof parts.v1 === 'string' && parts.v1.length === expected.length && crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected)) && Math.abs(Date.now() / 1000 - Number(parts.t)) < 300; if (!valid) return res.status(400).send('invalid signature'); const event = JSON.parse(raw); if (event.event === 'invoice.paid' || event.event === 'invoice.overpaid') { // fulfil the order: event.data.order_id } res.sendStatus(200);});Retries
Respond with any 2xx status within 10 seconds. Otherwise the delivery is retried with growing delays, up to 8 attempts in total. Redirects are not followed.
Next retry after a failure
- Attempt #1→ 1 min
- Attempt #2→ 5 min
- Attempt #3→ 15 min
- Attempt #4→ 1 h
- Attempt #5→ 3 h
- Attempt #6→ 6 h
- Attempt #7→ 12 h
- Attempt #8Marked as failed
Best practices
- Make your handler idempotent: the same event can arrive more than once. Use the event
idorX-KryptaGate-Deliveryto skip duplicates. - Do not rely on the order of deliveries. When in doubt, fetch
GET /invoices/{id}for the latest state. - Respond quickly and move heavy work to a background job.
- Fulfil orders on
invoice.paidandinvoice.overpaidonly.
Asset codes
Use these codes in the assets and asset parameters. Only assets enabled in your store are offered to customers; GET /assets returns them with live rates, minimum amounts and minimum fees.
| Code | Asset | Network | Standard | Decimals | Confirmations | Min fee |
|---|---|---|---|---|---|---|
USDT_TRC20 | USDT | TRON | TRC-20 | 6 | Solidified block | $3 |
TRX | TRX | TRON | native | 6 | Solidified block | $3 |
USDT_SOL | USDT | Solana | SPL | 6 | Finalized | $1 |
USDC_SOL | USDC | Solana | SPL | 6 | Finalized | $1 |
SOL | SOL | Solana | native | 9 | Finalized | $1 |
USDT_ERC20 | USDT | Ethereum | ERC-20 | 6 | 12 blocks | $2 |
USDC_ERC20 | USDC | Ethereum | ERC-20 | 6 | 12 blocks | $2 |
ETH | ETH | Ethereum | native | 18 | 12 blocks | $2 |
USDT_BEP20 | USDT | BNB Smart Chain | BEP-20 | 18 | 15 blocks | $1 |
USDC_BEP20 | USDC | BNB Smart Chain | BEP-20 | 18 | 15 blocks | $1 |
BNB | BNB | BNB Smart Chain | native | 18 | 15 blocks | $1 |
Errors
Errors use conventional HTTP status codes and a JSON body with a machine-readable code and a human-readable message. Validation errors may also include details.
HTTP/1.1 400 Bad RequestContent-Type: application/json { "error": { "code": "amount_too_small", "message": "Minimum invoice amount is $0.10" }}HTTP status codes
| HTTP | Description |
|---|---|
| 400 | Invalid request: a parameter is missing or has a wrong value. |
| 401 | Missing or invalid API key. |
| 403 | The store is disabled. |
| 404 | The invoice or route does not exist. |
| 409 | The action is not allowed in the current state of the invoice. |
| 429 | Too many requests. See Rate limits. |
| 503 | An exchange rate is temporarily unavailable. Retry a bit later. |
Error codes
| Code | HTTP | Description |
|---|---|---|
validation_error | 400 | A parameter is missing or has a wrong type or format. The message names the field. |
invalid_amount | 400 | amount is not a positive number. |
amount_too_small | 400 | Below the $0.10 minimum, or below the minimum of the selected asset. |
invalid_currency | 400 | Unsupported price currency. |
invalid_assets | 400 | Unknown asset code in assets. |
invalid_asset | 400 | Unknown asset code in asset. |
asset_not_available | 400 | The asset is not enabled for this store or invoice. |
no_assets | 400 | No payment assets are enabled for the store. |
invalid_url | 400 | success_url or cancel_url is not an http(s) URL. |
metadata_too_large | 400 | metadata is larger than 4 KB. |
unauthorized | 401 | Missing or invalid API key. |
store_disabled | 403 | The store has been disabled. |
not_found | 404 | Invoice or route not found. |
not_allowed | 409 | For example, cancelling an invoice that is not new or pending. |
payment_in_progress | 409 | A payment has already been detected for this invoice. |
rate_limited | 429 | Rate limit exceeded. |
rates_unavailable | 503 | Exchange rate temporarily unavailable. |
address_pool_empty | 503 | No payment address is available right now (the pool is being refilled). Retry in a minute. |
Rate limits
The API allows up to 600 requests per minute per IP address. Above the limit, requests fail with HTTP 429 and the error code rate_limited; the message says how many seconds to wait.
per IP
HTTP/1.1 429 Too Many Requests { "error": { "code": "rate_limited", "message": "Too many requests, retry in 23s" }}Ready to integrate?
Create a store and an API key in a couple of minutes.