How to get Telegram notifications for crypto payments
Get a Telegram message for every confirmed crypto payment on Solana, and send your customers a Telegram confirmation, with SolKnife Gateway and its Telegram bot.
Who gets a message
Gateway sends Telegram messages from @solknife_bot. When a payment is confirmed, your business chat gets a payment received notice and the customer chat gets a payment confirmed notice. For subscriptions, the customer chat also gets a message when a subscribe, collect, cancel, or resume is confirmed, and when a subscription goes past due or expires.
1. Get your chat ID from the bot
Open @solknife_bot in Telegram and send /start. The bot replies with your chat ID, a number such as 123456789.
To get the notices in a group, add the bot to the group and send /start there. Group chat IDs start with a minus sign.
2. Register your business with that chat ID
Put the chat ID in telegramChatId when you register. Every payment Gateway confirms for your business then sends a notice to that chat.
customerTelegramChatId is required when you create a payment. Ask the customer to send /start to @solknife_bot and paste the chat ID into your app, then pass it with the payment. Customer subscriptions take the same field.
Create a payment with the customer chat ID
const GATE_URL = "https://gate.solknife.xyz";
await fetch(`${GATE_URL}/api/payments`, {
method: "POST",
headers: {
"content-type": "application/json",
"x-gateway-key": process.env.GATE_API_KEY,
},
body: JSON.stringify({
checkoutReference: "order-1001",
// The chat ID the customer got from the bot.
customerTelegramChatId: "987654321",
merchantAmountRaw: "25000000",
}),
});
What the messages say
Amounts are raw token units, the same as in the API. With USDC (6 decimals), 25000000 is 25 USDC.
A Telegram message is a notice for people, not a signal for your app. A failed Telegram message does not stop the confirmation. Your backend should act on the signed payment.confirmed callback.
The messages
To your business chat:
SolKnife payment received.
Payment ID: 9ea83884-6c3f-40fb-bfb1-768e7a6d7d12
Checkout reference: order-1001
Merchant amount: 25000000 raw token units
Signature: 5VERv8NMvz...
To the customer chat:
SolKnife payment confirmed.
Checkout reference: order-1001
Merchant amount: 25000000 raw token units
Gateway fee: 1200000 lamports
Signature: 5VERv8NMvz...
Register your business to get a Gateway API key and a webhook secret. Payments go straight to your wallet; Gateway takes a fixed 0.0012 SOL fee per payment.