←All articles
Telegram Mini Apps & HoReCa2026-11-27 · 16 min

Разработка Telegram Mini Apps и AI-агентов для ресторанов, кафе и Dark Kitchen в Казахстане: отказ от 30% комиссий Wolt/Glovo, QR-заказ со столов, Kaspi QR и интеграция с iiko / r_keeper (Алматы, Астана, Шымкент)

Практическое руководство по запуску собственного Telegram Mini App и AI-сомелье для ресторанного бизнеса. Прямой заказ без комиссий маркетплейсов, моментальная оплата через Kaspi QR, двусторонняя синхронизация меню и стоп-листов с iiko и r_keeper, QR-заказ со столиков и реальные кейсы заведений Алматы, Астаны и Шымкента.

The Restaurant Margin Crisis: Escaping the 30% Third-Party Delivery Trap

The restaurant and hospitality industry (HoReCa) in Central Asia and across the globe is experiencing a structural profitability crisis. In booming metropolitan markets such as Almaty, Astana, and Shymkent, as well as international culinary hubs from Dubai to London, restaurateurs find their operating margins crushed between soaring food supply costs, prime real estate rents, and exorbitant third-party delivery marketplace commissions.

Third-party food delivery aggregators (such as Wolt, Glovo, Deliveroo, UberEats, and DoorDash) initially served as great acquisition channels. However, for repeat customers, relying on these intermediaries has turned into a destructive cycle:

  • •Exorbitant Take-Rates of 25% to 35% per order: In an industry where typical net operating profit margins hover between 12% and 20%, paying a 30% commission effectively forces the restaurant to lose money or break even on every single meal delivered.
  • •Customer Disintermediation and Data Lockdown: Aggregators deliberately conceal guest phone numbers and customer behavioral data. The restaurant is stripped of its ability to run retention campaigns, personalized WhatsApp follow-ups, or custom loyalty programs.
  • •Settlement Lag and Working Capital Strain: Platform payouts often lag by 14 to 30 business days, while daily procurement of fresh produce, meat, and dairy demands immediate cash liquidity.

Meanwhile, attempting to steer diners towards native iOS and Android apps in 2026 is an obsolete strategy:

1

User Acquisition Costs (CAC/CPI) have surged past $5–$8 per install.

2

Diners stubbornly refuse to clutter smartphone storage with heavy 200MB apps just to order sushi or pizza once a week.

3

Lengthy registration flows, SMS OTP verification drops, and forgotten passwords lead to over 40% cart abandonment.

This is precisely why Telegram Mini Apps (TMA) built on Next.js 15 and React 19 have emerged as the single most profitable digital channel for restaurant groups, fine dining bistros, coffee chains, and ghost/dark kitchens. A Telegram Mini App opens in under 0.8 seconds without installation via an Instagram bio link, a table QR code, or local directory. It offers instant identity verification via Telegram ID and supports one-tap Kaspi QR / Apple Pay / card payments, preserving up to 98% of your gross margins.


System Architecture: Next.js 15, Telegram WebApp SDK, iiko / r_keeper POS, and Kaspi QR

A modern digital restaurant infrastructure seamlessly connects guest mobile interactions inside Telegram with back-of-house kitchen display systems (KDS) and fiscal registers. Orders flow directly into the kitchen without manual re-entry by hostesses.

```

┌────────────────────────────────────────────────────────────────────────┐

│ RESTAURANT GUESTS │

│ [Tabletop QR Code] [Instagram Bio] [Telegram Channel] │

└───────────────────────────────────┬────────────────────────────────────┘

│ Scan / Tap Link

▼

┌────────────────────────────────────────────────────────────────────────┐

│ TELEGRAM MINI APP (Next.js 15 TMA) │

│ • Cryptographic Telegram initData Validation (HMAC-SHA-256) │

│ • Real-Time POS Sync (Live Modifiers, Combos, Stop-Lists) │

│ • AI Sommelier & Digital Waiter (Upselling, Allergens, Wine Pairing) │

│ • Dynamic Geocoding or Automated Table Number Binding │

└──────────────────┬─────────────────────────────────┬───────────────────┘

│ │

Checkout Flow │ │ POS Webhooks / API

▼ ▼

┌───────────────────────────────────┐ ┌──────────────────────────────────┐

│ KASPI PAY / STRIPE GATEWAY │ │ POS IIKO / R_KEEPER / TOAST │

│ • Instant Dynamic QR Generation │ │ • iiko Transport Cloud API │

│ • Kaspi Mobile App Deeplinking │ │ • r_keeper White Server API │

│ • Automated Webhook Verification │ │ • Automated KDS Kitchen Ticket │

│ • Flat 0.95% fee vs 30% take-rate│ │ • Real-Time Inventory Deduction │

└──────────────────┬────────────────┘ └──────────────────┬───────────────┘

│ │

└──────────────────┬──────────────────┘

▼

┌────────────────────────────────────────────────────────────────────────┐

│ DISPATCH & INTELLIGENT RETENTION │

│ • Automated Courier Dispatch via Yandex Delivery / Wolt Drive API │

│ • Real-time WhatsApp / Telegram Kitchen Status Tracking │

│ • Lifetime Value (LTV) Analytics & MurdaSoft Vibe Map Feature │

└────────────────────────────────────────────────────────────────────────┘

```

Core Capabilities Engineered by MurdaSoft:

1

Frictionless QR Table Ordering: Diners take their seats, scan an elegant acrylic or laser-engraved tabletop QR stand, and the menu opens pre-bound to their table number. Guests can browse, order appetizers, re-order drinks, and pay their bill via Kaspi QR without waiting for floor staff during peak dinner rushes.

2

Automated POS Stop-List Synchronization: The Mini App syncs with your POS (iiko, r_keeper, Syrve, Poster, Toast) every 30 seconds. If kitchen inventory runs out of ribeye steaks or fresh burrata, the item is instantly locked or grayed out across the menu, eliminating guest disappointment.

3

AI Sommelier & Generative Upsell Engine: An integrated Large Language Model evaluates basket contents in real time and offers context-aware recommendations: “With your roasted rack of lamb, our sommelier recommends a glass of vintage Saperavi and warm sourdough bread. Would you like to add them?”. This increases average check size by 18–26%.

4

Direct B2B Courier Logistics: For delivery orders, the platform connects directly with Yandex Delivery B2B API or Wolt Drive API. A courier is auto-assigned the moment the kitchen marks the ticket as packing, costing a flat distance fee (700–1200 ₸ / $1.50–$2.50) rather than surrendering 30% of a $50 family dinner.


Technical Implementation: Next.js 15 Route Handlers & Integration SDK

Here are the production-grade TypeScript modules governing cryptographic authentication, iiko Cloud POS synchronization, and Kaspi QR payment generation.

1. Telegram WebApp Cryptographic Validation: `app/api/telegram/auth/route.ts`

Protecting order integrity requires authenticating every incoming Telegram WebApp request using HMAC-SHA-256 against your verified bot token.

```typescript

import { NextRequest, NextResponse } from 'next/server';

import crypto from 'crypto';

interface TelegramUser {

id: number;

first_name: string;

last_name?: string;

username?: string;

language_code?: string;

}

export async function POST(req: NextRequest) {

try {

const { initData } = await req.json();

if (!initData) {

return NextResponse.json({ error: 'Missing initData parameter' }, { status: 400 });

}

const botToken = process.env.TELEGRAM_BOT_TOKEN;

if (!botToken) {

throw new Error('TELEGRAM_BOT_TOKEN is not configured');

}

const urlParams = new URLSearchParams(initData);

const hash = urlParams.get('hash');

urlParams.delete('hash');

if (!hash) {

return NextResponse.json({ error: 'Missing cryptographic hash' }, { status: 401 });

}

// Sort parameters lexicographically per Telegram Bot API standards

const sortedKeys = Array.from(urlParams.keys()).sort();

const dataCheckString = sortedKeys

.map((key) => ${key}=${urlParams.get(key)})

.join('\n');

const secretKey = crypto

.createHmac('sha256', 'WebAppData')

.update(botToken)

.digest();

const calculatedHash = crypto

.createHmac('sha256', secretKey)

.update(dataCheckString)

.digest('hex');

if (calculatedHash !== hash) {

return NextResponse.json({ error: 'Signature verification failed' }, { status: 403 });

}

const userRaw = urlParams.get('user');

const user: TelegramUser = userRaw ? JSON.parse(userRaw) : null;

const authDate = parseInt(urlParams.get('auth_date') || '0', 10);

const currentTime = Math.floor(Date.now() / 1000);

// Guard against replay attacks (24-hour expiration window)

if (currentTime - authDate > 86400) {

return NextResponse.json({ error: 'Session expired' }, { status: 401 });

}

return NextResponse.json({

success: true,

user,

authenticatedAt: new Date().toISOString()

});

} catch (error: any) {

return NextResponse.json({ error: error.message }, { status: 500 });

}

}

```


2. POS Order Push & Live Stop-Lists: `lib/integrations/iiko-cloud.ts`

This service establishes a bi-directional pipe to iiko Transport Cloud API, checking inventory balances and routing kitchen tickets directly to kitchen printers and KDS monitors.

```typescript

interface CartItem {

productId: string;

name: string;

amount: number;

price: number;

modifiers?: Array<{ id: string; amount: number; price: number }>;

}

export class IikoCloudService {

private apiLogin: string;

private baseUrl = 'https://api-ru.iiko.services/api/1';

private cachedToken: string | null = null;

private tokenExpiry: number = 0;

constructor() {

this.apiLogin = process.env.IIKO_API_LOGIN || '';

}

private async getAuthToken(): Promise<string> {

if (this.cachedToken && Date.now() < this.tokenExpiry) {

return this.cachedToken;

}

const res = await fetch(${this.baseUrl}/access_token, {

method: 'POST',

headers: { 'Content-Type': 'application/json' },

body: JSON.stringify({ apiLogin: this.apiLogin })

});

const data = await res.json();

this.cachedToken = data.token;

this.tokenExpiry = Date.now() + 50 60 1000;

return this.cachedToken!;

}

public async getActiveStopLists(organizationId: string): Promise<string[]> {

const token = await this.getAuthToken();

const res = await fetch(${this.baseUrl}/stop_lists, {

method: 'POST',

headers: {

'Content-Type': 'application/json',

Authorization: Bearer ${token}

},

body: JSON.stringify({ organizationIds: [organizationId] })

});

const data = await res.json();

const outOfStockIds: string[] = [];

for (const group of data.terminalGroupStopLists || []) {

for (const item of group.items || []) {

if (item.balance <= 0) {

outOfStockIds.push(item.productId);

}

}

}

return outOfStockIds;

}

public async dispatchOrder(

orgId: string,

terminalId: string,

orderId: string,

table: string | undefined,

customer: { phone: string; name: string },

items: CartItem[]

): Promise<string> {

const token = await this.getAuthToken();

const payload = {

organizationId: orgId,

terminalGroupId: terminalId,

order: {

id: orderId,

date: new Date().toISOString(),

phone: customer.phone,

customer: { name: customer.name },

items: items.map((i) => ({

productId: i.productId,

price: i.price,

type: 'Product',

amount: i.amount,

modifiers: i.modifiers?.map((m) => ({

productId: m.id,

amount: m.amount,

price: m.price

}))

})),

comment: table ? [TABLE #${table}] Paid via Kaspi QR : 'Telegram WebApp Direct Delivery'

}

};

const res = await fetch(${this.baseUrl}/deliveries/create, {

method: 'POST',

headers: {

'Content-Type': 'application/json',

Authorization: Bearer ${token}

},

body: JSON.stringify(payload)

});

const result = await res.json();

return result.orderInfo?.id || orderId;

}

}

```


3. Kaspi QR & Mobile Deeplink Generator: `lib/payments/kaspi-qr.ts`

Kaspi QR dominates consumer payments in Kazakhstan with over 90% mobile market share. This module produces dynamic payment links that launch the Kaspi.kz app seamlessly from Telegram.

```typescript

import crypto from 'crypto';

interface InvoiceRequest {

orderId: string;

amountKzt: number;

description: string;

returnUrl: string;

}

export class KaspiPayGateway {

private merchantId: string;

private secret: string;

private apiUrl: string;

constructor() {

this.merchantId = process.env.KASPI_PAY_MERCHANT_ID || '';

this.secret = process.env.KASPI_PAY_SECRET_KEY || '';

this.apiUrl = process.env.KASPI_PAY_API_URL || 'https://kaspi.kz/api/pay/v2';

}

public async generateInvoice(params: InvoiceRequest) {

const ts = Math.floor(Date.now() / 1000);

const signature = crypto

.createHmac('sha256', this.secret)

.update(${this.merchantId};${params.orderId};${params.amountKzt};${ts})

.digest('hex');

const res = await fetch(${this.apiUrl}/orders, {

method: 'POST',

headers: {

'Content-Type': 'application/json',

'X-Kaspi-Signature': signature

},

body: JSON.stringify({

merchantId: this.merchantId,

externalId: params.orderId,

amount: params.amountKzt,

currency: 'KZT',

comment: params.description,

returnUrl: params.returnUrl,

timestamp: ts

})

});

const data = await res.json();

const deeplink = https://kaspi.kz/pay/qr?id=${data.paymentId}&externalId=${params.orderId};

return {

paymentId: data.paymentId,

qrBase64: data.qrCodeBase64,

deeplink

};

}

}

```


Regional Deployments: Almaty, Astana, Shymkent & International Ghost Kitchens

Case 1: Almaty — Fine Dining Bistro & Wine Bar (Medeu District / Dostyk Ave)

  • •Challenge: Two vibrant summer terraces with 220 seats suffered severe floor bottlenecks. Diners waited 12 minutes for printed menus and up to 15 minutes for check splitting. Delivery via Wolt drained 32% in commissions.
  • •Solution: Deployment of Table QR Ordering via Telegram Mini App integrated with MurdaSoft Vibe Map. Diners browse high-resolution dish photography, order cocktails, and settle tabs via Kaspi QR.
  • •Results in 60 Days:

- Table seating to first drink order time reduced from 12 minutes to 45 seconds.

- Weekend table turnover increased by +28%.

- Monthly direct delivery volume reached 4.8M KZT, generating 1,536,000 KZT in monthly commission savings.

Case 2: Astana — Executive Coffee & Bistro Chain (Left Bank / Mangilik El Ave)

  • •Challenge: Peak morning rush hours (08:30–10:15) created long queues of government and tech corridor employees, causing significant walk-aways and order errors.
  • •Solution: Implementation of a Pre-Order & Pickup module in Telegram Mini App. Customers order their custom flat whites and breakfast bowls 15 minutes ahead, pay via Kaspi QR, and grab their order from an express counter.
  • •Results in 90 Days:

- Peak morning throughput expanded by +42%.

- Built an active proprietary Telegram audience of 8,500+ verified guests.

- Lunchtime repeat order retention increased by +34%.

Case 3: Shymkent — Traditional Grill & Event Dining (Al-Farabi District)

  • •Challenge: High-volume phone and WhatsApp inquiries for barbecue and banquet takeaways created order mix-ups and delayed payments upon courier arrival.
  • •Solution: Bilingual Kazakh and Russian Mini App with custom banquet catering builders, Poster POS sync, and an automated 30% Kaspi QR reservation deposit.
  • •Results in 45 Days:

- 100% elimination of misplaced order tickets.

- Call center workload reduced by 65%.

- Banquet takeout revenues grew by 2.4M KZT per month.

Case 4: International Ghost Kitchen Network (Dubai, Business Bay)

  • •Challenge: Cloud kitchen running 4 virtual culinary concepts surrendered 28%–34% in marketplace fees to Talabat and Deliveroo with zero customer relationship retention.
  • •Solution: Unified multi-concept Telegram Mini App with Stripe Apple Pay / Google Pay and USDT crypto settlement, routing tickets to dedicated kitchen line stations.
  • •Results: Over $12,500 monthly fee savings with a 46% 30-day repeat order rate.

Turnkey Pricing & Delivery Timelines at MurdaSoft

MurdaSoft builds bespoke, enterprise-grade restaurant digital infrastructure with zero dependence on slow no-code wrappers, ensuring sub-second WebApp loading speeds and carrier-grade reliability:

Package & TierScope of EngineeringDelivery TimelinePricing (KZT / USD)
MVP: Menu & Kaspi QR ExpressDigital catalog, modifier engine, cart, instant Kaspi QR & Deeplink, Telegram manager alerts, baseline sales analytics.1.5 – 2 Weeksfrom 490,000 ₸ (~$1,050 USD)
PRO FoodTech: iiko / r_keeper POS Sync2-way POS integration (iiko/r_keeper/Poster), Table QR ordering, real-time stop-list locking, Yandex Delivery API dispatch, loyalty engine.3 – 4 Weeksfrom 1,190,000 ₸ (~$2,500 USD)
ENTERPRISE: Franchise & AI SommelierMulti-branch architecture, autonomous AI sommelier (generative upsell & allergy guard), Kaspi QR + Freedom Pay + Stripe, custom CRM, and featured listing on MurdaSoft Vibe Map.5 – 7 Weeksfrom 2,490,000 ₸ (~$5,200 USD)

5-Step Turnkey Deployment Roadmap

1

Phase 1: Menu & POS Systems Audit (3–5 Days): Full mapping of your iiko Cloud, r_keeper, or Poster POS data models, modifier hierarchies, and logistics delivery boundaries.

2

Phase 2: High-Performance UI/UX Prototyping (5–7 Days): Designing bespoke OLED-optimized visual flows with tactile 44px+ tap targets, friction-free cart interactions, and staff tipping flows.

3

Phase 3: Backend & POS Integration (7–10 Days): Constructing Next.js 15 route handlers, HMAC cryptographic validation, POS bidirectional synchronization, and Kaspi Pay webhook pipelines.

4

Phase 4: AI Agent & Automated Dispatch Integration (4–6 Days): Equipping the RAG-powered AI sommelier with recipes and pairing guidelines, connecting Yandex Delivery B2B API for instant courier dispatch.

5

Phase 5: Staff Onboarding, QR Print Collateral & Go-Live (3–4 Days): Distributing laser-etched wooden table QR stands, training front-of-house staff, and launching initial guest acquisition promotions.


FAQ: Key Questions About Telegram Mini Apps & AI Agents for Restaurants

1. Why should a restaurant choose a Telegram Mini App over a native iOS/Android application?

Native iOS and Android development costs upwards of $10,000 to $20,000, incurs painful Apple App Store review delays, and requires expensive app maintenance. Worse, customers resist downloading 150MB apps for individual restaurants. A Telegram Mini App opens in under 0.8 seconds without installation, uses 0MB of device storage, leverages pre-verified Telegram accounts, and reaches over 14 million active Telegram users in Kazakhstan alone.

2. How does a direct ordering system bypass 30% third-party marketplace commissions (Wolt, Glovo, DoorDash)?

Third-party marketplaces extract 25% to 35% of every transaction, drastically eroding restaurant profitability. By migrating your repeat customer base to your own Telegram Mini App via tabletop QR cards, packaging flyers, and Instagram bio links, you keep 100% of the food margin. Logistics are fulfilled via flat-rate B2B dispatch (e.g. Yandex Delivery) for approximately 800–1200 KZT ($2), saving mid-sized restaurants $3,000–$8,000 in monthly net profit.

3. How does the real-time sync with iiko, r_keeper, Toast, and Poster POS work?

Our cloud integration layer connects directly to official POS Transport APIs. When a diner places an order in the Mini App, the system verifies inventory stop-lists, debits ingredients, and instantly prints kitchen tickets or displays them on kitchen display screens (KDS). Floor staff never have to manually re-enter digital tickets from tablets.

4. How are Kaspi QR and international card payments processed inside the Telegram WebApp?

Upon checkout, our gateway generates a secure Kaspi Deeplink. On mobile devices, this seamlessly transitions the diner into their native Kaspi.kz application with the invoice pre-populated. On desktop or tablet views, a high-resolution dynamic QR code is displayed for camera scanning. Funds settle directly into your merchant account at an ultra-low 0.95% transaction fee.

5. How does the AI Sommelier and upselling engine increase average order value (AOV)?

The AI assistant is indexed against your complete culinary menu, ingredient compositions, and beverage lists. When diners ask natural language questions (e.g., «What wine pairs best with the dry-aged ribeye?» or «What do you offer for a gluten-free lunch?»), the agent offers tasteful, personalized recommendations that elevate average check values by 18% to 26%.

6. How can our restaurant brand be featured on the MurdaSoft Vibe Map?

Every restaurant network and dining concept deploying a digital ordering solution with MurdaSoft receives prioritized placement on our curated interactive guide, the MurdaSoft Vibe Map. This connects your venue directly to high-income entrepreneurs, tech professionals, and international visitors across Almaty, Astana, and Shymkent looking for premier venues with contactless digital ordering.

7. What is the typical development timeline and cost for deploying a turnkey Telegram Mini App?

A production-ready MVP with custom menu architecture and Kaspi QR takes 10–14 business days. A comprehensive enterprise deployment with bi-directional iiko/r_keeper POS sync, automated courier dispatch, and AI sommelier capabilities launches in 3–4 weeks. MurdaSoft handles the end-to-end scope from UI design and API engineering to table stand production.


Transform Your Restaurant's Digital Margins Today

Stop surrendering your hard-earned restaurant margins to third-party marketplaces. Launch your proprietary digital ordering ecosystem with instant Kaspi QR payments, automated kitchen dispatch, and AI guest experiences.

Contact studio founder Alexander Murdasov on Telegram: @murdasoft for a comprehensive restaurant technology audit, live demo, and custom quotation.

Need a website or Telegram bot?

Free consultation - let's discuss your project.

Discuss project→