Plugins
Telegram bot
A ~100-line template that sells one product in a Telegram bot: a private channel, a file, a license key. /buy creates an invoice, the bot sends a Pay button, and after the webhook says paid it delivers the product. No database: the chat id travels in the invoice metadata.
Run
shell
cd examples/telegram-bot
npm install
TELEGRAM_BOT_TOKEN=123:abc \
AXIOMISPAY_API_KEY=axp_test_... \
AXIOMISPAY_WEBHOOK_SECRET=... \
PRICE_USD=10 PRODUCT_NAME="Private channel, 1 month" \
DELIVERY_TEXT="Welcome! https://t.me/+invite" \
npm startSet the webhook URL in the dashboard to https://your-host/axiomis-pay/webhook. Locally, expose port 3000 with a tunnel and use its URL.
How it works
JavaScript
const invoice = await pay.createInvoice({
amount_usd_cents: PRICE_CENTS,
external_order_id: `tg-${chatId}-${Date.now()}`,
customer_ref: `tg-${userId}`,
description: PRODUCT,
metadata: { telegram_chat_id: chatId },
});
// webhook: verifyWebhook(rawBody, header, secret) → paid → sendMessage(chatId, DELIVERY_TEXT)For production: switch to a live key, keep delivered invoice ids in a database instead of memory, and give one-time invite links (createChatInviteLink with member_limit: 1) instead of a static text.