Take crypto payments inside Telegram
We are building a Telegram bot and Mini App checkout, so your customers will be able to pay without leaving Telegram. It is not available yet. Today you can get payment alerts in Telegram, run the ready-made ArionPay Telegram shop bot, or have your own bot send customers an ArionPay checkout link created with the REST API.
Northwind Coffee
bot
/buy
12:04Coffee beans, 1 kg
Total: $29.99 USD
Paid straight to the shop's own wallet
Works today: send a checkout link from your own bot
Your bot creates an invoice with one signed API request and sends the customer the invoice_url as a button. The customer pays on the ArionPay checkout page, straight to your wallet.
import hashlib, hmac, json, os, time
import requests
import telebot # pip install pyTelegramBotAPI requests
bot = telebot.TeleBot(os.environ["TELEGRAM_BOT_TOKEN"])
API_KEY = os.environ["ARIONPAY_API_KEY"] # pk_...
API_SECRET = os.environ["ARIONPAY_API_SECRET"] # your store's secret
BASE_URL = os.environ["ARIONPAY_URL"] # your ArionPay address
def create_invoice(payload):
body = json.dumps(payload, separators=(",", ":"))
ts = str(int(time.time()))
sig = hmac.new(API_SECRET.encode(), f"{ts}.{body}".encode(), hashlib.sha256).hexdigest()
res = requests.post(
f"{BASE_URL}/api/v1/invoices",
data=body, # send exactly the bytes you signed
headers={
"Content-Type": "application/json",
"x-api-key": API_KEY,
"x-timestamp": ts,
"x-signature": sig,
},
timeout=15,
)
res.raise_for_status()
return res.json()
@bot.message_handler(commands=["buy"])
def buy(message):
user_id = message.from_user.id
invoice = create_invoice({
"amount": "29.99",
"currency": "USD",
"orderId": f"tg-{user_id}-{int(time.time())}",
"metadata": {"telegramUserId": user_id},
})
markup = telebot.types.InlineKeyboardMarkup()
markup.add(telebot.types.InlineKeyboardButton("Pay with crypto", url=invoice["invoice_url"]))
bot.send_message(message.chat.id, "Your order: $29.99. Tap below to pay.", reply_markup=markup)
# Deliver the order when your webhook endpoint receives invoice.paid
# (check the ArionPay-Signature header first; see /docs).
bot.infinity_polling()What works today
Payment alerts. Get a message in Telegram, Discord or by email when a payment arrives. Turn them on in your dashboard.
A shop bot. Run the ready-made Telegram shop bot on your own server, or create an invoice with the REST API from your own bot, as in the code above.
Delivery. Your server gets a signed invoice.paid webhook and can then send the customer what they bought.