Task and my work.
The goal was to pull orders from RetailCRM, map them to one structure, show a summary and alert on orders that match a rule.
- Implemented order fetching through the API with pagination and field normalization.
- Set up upserts in Supabase keyed on the CRM order ID.
- Built a web dashboard and a Telegram bot with alert acknowledgement.
- Worked through RetailCRM API limits when loading orders and saving custom fields.
Key decisions.
Verify saved fields after writing to the CRM.
Custom fields in RetailCRM need to be configured first. A successful API response did not mean the UTM data was actually saved. I found the cause and prepared a restore from the original export.
Keep the order separate from the alert event.
Orders are updated by CRM ID, while sent and acknowledged alerts live in a separate log. Before sending, the bot checks for existing records.
How it works.
- Fetch orders from the CRM
The API returns pages of orders. Fields are mapped to an agreed structure.
- Update the database and analytics
Data is written to Supabase and used by the web dashboard.
- Alert and acknowledge
The bot checks the amount rule and the alert log, then stores the employee's acknowledgement.
Implementation and example.
Diagram of the demo integration: how orders move between the CRM, the database, the dashboard and the bot.
DIAGRAM OF THE IMPLEMENTED SYSTEM
- RetailCRM API
Orders, statuses, items, totals and custom fields.
- Python → Supabase
Paged fetching, normalization and upsert by CRM ID.
- Web dashboard + Telegram
Metrics, order card and alert acknowledgement.
Architecture diagram of the project. Live data and connections are not shown.
Project result.
RetailCRM orders are available in Supabase and the web dashboard. The bot sends alerts and stores acknowledgements separately from the order status.
Technologies and implementation details
Python, RetailCRM REST API, Supabase/PostgreSQL, JavaScript/Chart.js, Vercel and the Telegram Bot API. The integration handles pagination, timeouts and API limits.
Let's discuss your task.
Tell me your CRM, the services to connect, the fields you need and the event that should start the process. We will check what the API allows and scope the integration.
Discuss a CRM integration ↗︎