TelegramSearchBot: from a photo of a handwritten order to a cart in minutes

TelegramSearchBot: from a photo of a handwritten order to a cart in minutes превью

Industry:

Retail / e-commerce

Services provided:

Telegram bot development
AI integration
Backend development
E-commerce API integration

Technology stack:

Python
aiogram
FastAPI
OpenAI Vision
Sellwin API
MinIO
Docker

Timeline:

MVP in 2–3 months with iterations on OCR and search quality

Project highlights

Sales managers and salon admins collect orders from photos every day: handwritten lists, receipts, price-list fragments. Manually transferring line items into the catalog takes time and causes errors. The WEB24 team built TelegramSearchBot — a bot where you send up to three images. OpenAI Vision reads the text, the bot builds an editable product list, searches via the Sellwin Search API, and adds matched items to the cart in one tap. OCR prompts and search synonyms are configured in the admin panel without redeploying the bot.

Challenge

Collecting B2B orders from photos is a familiar workflow, but still digital-manual: an employee gets a snapshot, decipheres line items by hand, looks up SKUs in the catalog, and adds them to the cart. Speed and accuracy suffer along the way. The client needed a solution that:

  • Accepts photos and documents directly in Telegram — no separate app
  • Recognizes handwritten and printed text from receipts, lists, and price sheets
  • Lets the manager review and edit the list before submit
  • Automatically matches names to catalog products
  • Creates a cart order with a ready link to open it
  • Authenticates the user by Tax ID (UNP) for safe API access

They needed more than OCR — an end-to-end flow: photo → list → search → cart.

Our approach

We designed TelegramSearchBot as a link between the Telegram UI, AI recognition, and Sellwin integrations. Key building blocks:

Telegram bot and user flows

Long polling on aiogram: Tax ID (UNP) auth, up to 3 images, list building, line-item editing, and cart submit via inline buttons and /start, /unp, /list, /add commands.

OCR via OpenAI Vision

The recognition service loads system/user prompts from the admin API (ocr-ai-settings). If the API is unavailable, fallback prompts from config are used. The result is a structured line-item list for manager review.

Sellwin search and cart

Batch search over the name list, auth by Tax ID (token/refreshToken), and order line creation via Basket API. Search synonyms are managed in the admin panel and improve matching without bot code changes.

Image storage in MinIO

Photos are uploaded to object storage before cart creation. Keys like user_{id}/{timestamp}_{uuid}.{ext} support audit and reprocessing.

Infrastructure and health checks

Docker Compose for deploy, a dedicated FastAPI GET /health endpoint for monitoring. Modular layout: handlers, services (ocr, sellwin, store, minio_storage), and a factory to register handlers.

TelegramSearchBot: from a photo of a handwritten order to a cart in minutes подход — изображение 1

Impact

The bot cut the path from order photo to a ready cart from several minutes of manual work to a single Telegram scenario:

  • Managers send photos and get an editable line-item list without typing
  • Catalog search runs in batch — across the full list at once
  • A ready “Open cart” link shortens checkout time
  • OCR prompts and synonyms update via the admin panel without bot deploys
  • Tax ID auth limits cart access to verified clients

The solution fit the familiar channel — Telegram — and removed the routine of moving handwritten orders into a digital cart.

What we delivered

  • Full user flow: Tax ID → photos → OCR → edit → cart
  • OpenAI Vision integration with admin-configurable prompts
  • Sellwin Auth, Search (batch-query), and Basket API
  • In-memory session state: list, image buffer, tokens
  • File upload to MinIO and a Docker production environment

How the bot works

Data flows through: Telegram → OCR → edit → search → cart.

  • The user enters a Tax ID and uploads up to 3 images
  • OpenAI Vision extracts the line-item list
  • The manager reviews, adds, or removes rows
  • Batch search finds products in the Sellwin catalog
  • Basket API creates the order and returns a cart link
TelegramSearchBot: from a photo of a handwritten order to a cart in minutes итоги — изображение 1

Telegram UI: photo upload, list building, and cart submit

TelegramSearchBot: from a photo of a handwritten order to a cart in minutes итоги — изображение 2

OpenAI Vision + configurable prompts and search synonyms for accurate product matching

What we learned

Bot quality comes from three layers: photo readability, OCR prompt accuracy, and search relevance with synonyms. That is why we moved prompts and synonyms into the admin panel, and kept fallbacks plus a clear list-edit step before cart submit in code. In-memory state suits an MVP on a single instance; scaling will need external session storage.

Need a bot that turns photos into orders?

At WEB24 we build Telegram bots with AI recognition and integration into your catalogs, CRMs, and carts. Get in touch to discuss order-intake automation!

Let'sCollaborate!

г. Минск, ул. Попова, 24А, пом 406 флагг. Минск, ул. Попова, 24А, пом 406

Общество с ограниченной ответственностью «НИКПА-СТРОЙ»

УНП 193184561

© 2026 WEB24Все права защищены