Payments & Walt Ledger (THV)
Accept in-platform THV payments inside bots and Mini Apps with sendInvoice, createInvoiceLink, and successful_payment updates.
Theaver includes a built-in Walt ledger (@walt) for virtual internal THV units inside bots and Mini Apps. For legacy currency-code aliases when porting existing checkout flows, see Migrating Bots.
Creating invoices via Bot API
Use sendInvoice to post an interactive payment card into chat, or createInvoiceLink to obtain an invoice_url that opens in-app via window.Theaver.WebApp.openInvoice(url):
/bot<token>/sendInvoice {
"chat_id": 849201432,
"title": "Pro Plan — 1 Month",
"description": "Unlock custom automation templates and priority queue processing.",
"payload": "order_pro_30d_user42",
"currency": "THV",
"prices": [
{ "label": "30-day access", "amount": 50 }
]
}
If reply_markup does not specify a pay: true button, the backend automatically prepends a native payment button (Pay 50 THV).
Handling successful_payment
When a user completes payment in Walt:
THVbalances settle atomically from the buyer to the bot ledger.- Your bot receives an
Updatecontainingmessage.successful_paymentviagetUpdatesor webhook:
{
"update_id": 1094,
"message": {
"chat": { "id": 849201432, "type": "private" },
"from": { "id": 491827364, "username": "alex" },
"successful_payment": {
"currency": "THV",
"total_amount": 50,
"invoice_payload": "order_pro_30d_user42",
"provider_payment_charge_id": "walt_tx_..."
}
}
}
Withdrawing earned THV
Bot owners inspect earnings and withdraw accrued THV to their personal @walt account directly inside the @BotMother Studio Mini App.
Always match successful_payment.invoice_payload and total_amount against an open order record in your database before provisioning perks or digital goods.