Integration and API

Everything you need to accept crypto in your bot: how to get connected in one evening, where to send requests, what a webhook delivers and what to do when things do not add up.

Connect bot Request sandbox Home

To try a request live, use the sandbox (it loads its interface from an external network; if it does not open, the schema lives at /openapi.json — that is JSON for programs, not for reading).

How it works

Four steps. The key point: the money goes past us — to the address you added. We hold neither keys nor funds.

1. Your bot

Calls POST /v1/invoices with its key and gets an address and an exact amount.

→

2. The customer pays

Sends exactly that amount to the address from your wallet.

→

3. Invora reads the chain

Finds the payment by amount and waits for the required number of confirmations.

→

4. A webhook to you

payment.confirmed arrives with a signature. That is your cue to deliver.

Connected in one evening

  1. Open the bot https://t.me/IamInvora_bot and press "Connect". A Telegram account is all you need: we do not ask for documents.
  2. Add a wallet — the address where you receive payments. The address is checked immediately: a typo or a foreign address format is the most common cause of "lost" payments.
  3. Verify with a test payment. The bot will invoice the minimum amount to yourself. Pay it — and you will see the whole path end to end.
  4. Issue an API key and set the webhook URL in the same bot section.
  5. Create your first invoice with the request below and pay it.

A test payment is not a formality. It checks three things at once, each of which would otherwise surface with a live customer: the wallet accepts transfers, the network is readable, your bot receives the webhook.

Authentication

The key is passed one of two ways — whichever is easier:

X-API-Key: inv_live_…
Authorization: Bearer inv_live_…

The key is shown in the bot once, at issue time. Keep it on the server, not in the bot code that ships to customers.

Creating an invoice

POST /v1/invoices

curl -X POST https://invora.aikeybot.ru/v1/invoices \
  -H "X-API-Key: inv_live_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1042" \
  -d '{
    "network": "tron",
    "asset": "USDT",
    "amount": "10.00",
    "ttl_seconds": 1800,
    "description": "Monthly subscription"
  }'

Idempotency-Key is optional, but with it a retry after a dropped connection returns the same invoice instead of creating a second one.

The response is 201 with the amount to pay:

{
  "public_id": "C8Ow-aj5TyVpUtg1IqoB4Q",
  "status": "pending",
  "network": "tron",
  "asset": "USDT",
  "address": "TQ5d…8fKa",
  "amount": "10.004271",
  "amount_raw": 10004271,
  "decimals": 6,
  "amount_base": "10.000000",
  "received": "0.000000",
  "overpaid": "0.000000",
  "confirmations_required": 19,
  "tolerance_bps": 100,
  "expires_at": "2026-10-15T11:30:00+00:00",
  "paid_at": null,
  "created_at": "2026-10-15T11:00:00+00:00",
  "links": {
    "eip681": "ethereum:0x55d398326f99059ff775485246999027b3197955@56/transfer?address=0x650b…&uint256=5000348000000000000",
    "trust": "trust://send?asset=c20000714_t0x55d398326f99059ff775485246999027b3197955&address=0x650b…&amount=5.000348",
    "metamask": "https://link.metamask.io/send/0x55d3…@56/transfer?address=0x650b…&uint256=5000348000000000000"
  },
  "links_go": {
    "eip681": "https://invora.example/go/dEVDaGV0dW06…",
    "trust": "https://invora.example/go/dHJ1c3Q6Ly9zZW5k…"
  }
}

Wallet links: links and links_go

Both fields carry the address and the amount already filled in, so the customer does not have to type them. The keys are the same in both, so you can read either field by one name: eip681, trust, metamask, trust_web, solana_pay, tonkeeper, ton. The set depends on the network, so read the dictionary by key, never by order, and assume a key may be absent.

FieldWhat to do with it
linksRaw values. Anything starting with https:// can go into a Telegram button. Schemes (ethereum:, solana:, ton://, trust://) are for QR codes or plain text only.
links_goThe same schemes as https addresses of our redirect: they fit into a button and open the wallet. Built from the address you used to call the API, so it works through your own domain or proxy. An empty field means the service address is unknown or local: compose the button yourself or show the address and amount as text.

Verified on real phones on 2026-10-17: tonkeeper opens the send screen with the address and amount; trust through links_go does too, but the amount has to be entered manually in the app. And https://link.metamask.io/… as well as the https form of link.trustwallet.com do not reach the send screen — they open the wallet home screen. Do not build UI on them: use links_go, or show the address and amount as text. The address and amount are always present in the other response fields, so payment remains possible even when no link works.

Show the customer amount in full, not amount_base. The amount carries a unique tail: it is what ties the payment to this exact order. If the customer rounds the amount, the transfer is not lost — it lands in "Unmatched", and you attach it with one button. But it will no longer be found automatically.

amount_raw is the amount in the smallest unit (an integer), for databases and calculations without losing precision. All money fields in the response are strings: a JSON floating-point number loses precision on large amounts.

Request fields

FieldValue
networkNetwork: tron, bsc, ton, solana. Defaults to tron.
assetAsset: USDT (on Solana also USDC). Defaults to USDT.
amountAmount in units of the asset, as a string or a number: "10.50". Not in the smallest unit.
ttl_secondsInvoice lifetime, from 60 to 86,400. Defaults to 1800 (30 minutes).
tolerance_bpsUnderpayment tolerance in basis points, 0…1000. Defaults to 100 (1%).
descriptionYour own note, up to 255 characters. Never reaches the chain.
currency_fiat, amount_fiatReserved for "at rate" payments. Not working yet: the request returns fx_not_supported.

Invoice statuses

StatusMeaning
pendingThe invoice is issued, no payment yet.
partialLess than expected arrived: waiting for the rest.
confirmingPayment found, confirmations are accumulating. Do not deliver yet.
paidEnough confirmations. You can deliver — this is payment.confirmed.
expiredThe lifetime elapsed, no payment arrived.
cancelledCancelled by you: it no longer needs to be paid, and the reserved amount is back in circulation.

Check an invoice at any time: GET /v1/invoices/{public_id}. List: GET /v1/invoices?limit=50.

POST /v1/invoices/{public_id}/cancel

Cancel an invoice that is still awaiting payment. You need this when the order amount turned out wrong: the invoice holds a unique tail until it expires, and without cancelling you cannot issue a new invoice with the same amount.

POST /v1/invoices/inv_live_7f3a/cancel
Authorization: Bearer inv_live_…

{ "public_id": "inv_live_7f3a", "status": "cancelled", … }

A 409 response with code invoice_not_cancellable means it is too late to cancel: money is already visible on the invoice (partial, confirming) or it is closed. Cancelling after a transfer arrived would break the link between the money and the order, so it is not allowed. Cancelling twice returns 200: the state is already reached.

Webhooks

An event arrives as a POST request to the URL set in the bot. Two events: payment.confirmed and payment.reverted (the block was reorged and the payment vanished — revoke the goods).

Headers

X-Invora-Signature: t=1760000000,v1=6f1c…
X-Invora-Event: payment.confirmed
X-Invora-Delivery: dlv_4821

The signature works like Stripe's: v1 = HMAC-SHA256(secret, "{t}.{raw request body}"). The time inside the signature blocks replays: a captured request cannot be sent again an hour later — a signature older than 5 minutes is rejected.

Verifying the signature

import hashlib, hmac, time

TOLERANCE = 300  # seconds

def verify(secret: str, header: str, raw_body: bytes) -> bool:
    parts = dict(item.split("=", 1) for item in header.split(","))
    timestamp, mac = int(parts["t"]), parts["v1"]
    if abs(time.time() - timestamp) > TOLERANCE:
        return False
    expected = hmac.new(
        secret.encode(), f"{timestamp}.".encode() + raw_body, hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(expected, mac)

If your server did not answer, delivery is retried (up to three attempts). The same event will not arrive twice as new: it carries X-Invora-Delivery, an idempotency key. Store the processed values and skip the repeats.

Delivery history: GET /v1/webhooks/deliveries. Resend a failed one manually: POST /v1/webhooks/deliveries/{id}/resend.

Telegram Stars

Your bot accepts Stars, not us: a payment cannot be run through us. What we do is account for them — so that revenue, refunds and stats reconcile in one place.

RequestWhat it does
POST /v1/stars/payments Record a successful_payment from your bot. Idempotent on telegram_payment_charge_id: sending it again does not double the revenue.
POST /v1/stars/refunds Mark a Stars refund. Without it, revenue in the report would stay overstated.
GET /v1/stars/payments List of recorded payments and refunds.

Onboarding and account statuses

Access is opened by a human, not by signing up. A new merchant joins the review queue: we look at the bot or site and at where the payments will come from. This cuts off criminal flows before the first payment, not after. Usually it takes less than a day on business days.

Account statusWhat happens to the API
pendingInvoices are not created, the answer is 403 with merchant_pending. This is neither a rejection nor a block: the request is waiting for a decision. You can fill it in inside the bot — three questions: what you sell, a link to the bot or site, and how the flow works.
activeEverything works.
suspendedInvoices are not created, the answer is 403 with merchant_inactive. That is how the owner pauses an account without deleting it or its data. Only the owner can lift the pause; if the reason is unclear, write to support from the bot — there is a button on the pause screen.
rejectedThe request was rejected with a reason: invoices are not created, the answer is 403 with merchant_inactive. The request can be fixed in the bot and sent again — the account becomes pending again.

The codes differ on purpose: merchant_pending tells an integration to wait, while merchant_inactive tells it to contact the service owner. Message texts may change, codes will not.

Errors

One format for every case:

{
  "detail": {
    "code": "wallet_not_found",
    "message": "the merchant has no active wallet for tron:USDT. Add a wallet in the bot."
  }
}
CodeHTTP statusWhat happened
unauthorized401The key is missing or wrong.
wallet_not_found404You have no active wallet for this network and asset.
unknown_asset400We do not know this network+asset pair.
asset_not_verified400The asset has not been verified with a live payment and cannot be used.
invalid_amount400The amount could not be parsed (for example, more than 18 decimal places).
amount_too_small400The amount is below the smallest unit of the asset.
fx_not_supported400Fiat was passed: conversion is not implemented yet.
validation_error422The request failed validation. The response lists the fields with reasons.
quota_exhausted402The free invoices are used up and the balance is empty. A package is bought in the bot.
rate_limited429Too many requests.

Limits and rules

Service endpoints

EndpointPurpose
/healthzThe process is alive. For automated availability checks.
/readyzReady for traffic: also checks the database connection. This is the one for humans.
/versionFingerprint of the running code and the build number.
/openapi.json Machine-readable API schema: for client generators and checks. JSON, nothing for a human to read.
/swaggerSandbox: send a request straight from the browser.

Something does not add up?

Write to the bot — a human answers, not an auto-reply. Describe what you sent and what came back: that is the fastest way to sort it out.

Open bot Home