Description NewOrderBot script for monitoring new orders from marketplaces and notifications in Telegram
This powerful PHP script is designed to automatically track new orders from several popular marketplaces, such as Epicentr.ua, Prom.ua, Rozetka.ua, as well as from your own website based on OCStore / OpenCart. After detecting a new order, it sends a beautifully designed notification via Telegram, including detailed information about the customer, products, amount, and shipping method.
In addition, each notification begins with a funny phrase to make the process of receiving information more friendly and positive!
Main functions of the script
1. Automatic collection of new orders:
Checks new orders from:
Own website (OpenCart / OCStore) - via SQL query to the database. (tested on ocStore 3.0.3.7)
Epicentr.ua - via the official API.
Prom.ua - via API with the ability to filter by date.
Rozetka.ua - via API with support for retries in case of error.
2. Smart notification system:
Sending notifications to Telegram in HTML format:
Customer name
Phone and email
Order date and amount
Delivery and payment method
List of products
3. Funny messages:
Each notification starts with a random funny phrase from a list of 20+ jokes, for example:
Hurray! A new customer found us on Google!"
Order received, launching space delivery!" A new order is a new opportunity to make someone happy!"
and many others. You can add your own.
4. Protection against duplication:
For each marketplace, the IDs of already processed orders are saved:
processed_ocstore_orders.txt
processed_epicentr_orders.txt
processed_prom_orders.txt
processed_rozetka_orders.txt
This prevents the same notifications from being sent again.
5. Error logging:
All errors are written to the error.log file, including:
Connection issues
API errors
JSON parsing errors
6. State saving:
The time of the last check is saved in last_checked_order.txt.
7. Saving API responses:
Full responses from the API of each marketplace are saved in JSON files:
last_epicentr_response.json
last_prom_response.json
last_rozetka_response.json
Useful for diagnostics and problem analysis.
⚙️ Settings and how to get them:
Settings are stored in the my_site_settings.php file
Where to get settings:
Telegram:
Bot token: Create a new bot via @BotFather and get a token.
Chat ID: Can be found out by writing any message to your bot and calling the getUpdates method.
OCStore / OpenCart: (tested on ocStore 3.0.3.7)
Access to the database must be provided by the site administrator or hosting provider.
Epicentr.ua:
API key is provided after registering as a seller on merchant-api.epicentrm.com.ua.
Prom.ua:
API key is issued in your personal account on prom.ua.
Rozetka.ua:
The API key is requested through the support service or in the integrations section on the seller panel rozetka.com.ua.
How to use:
Upload all files to the server.
Configure access in my_site_settings.php.
Make sure the server supports:
PHP 7.3+
cURL support
Ability to write files
Configure a cron task for periodic checking (for example, once every 5-10 minutes):
Features:
Multilingualism: Messages can be easily translated into any language.
Flexibility: Each marketplace can be enabled or disabled separately.
Backup diagnostics: Saving the full response from the API allows you to quickly find and fix errors.
Smart sending of messages: The limit of Telegram API requests is taken into account to avoid blocking.
Funny lines: Make automatic notifications lively and pleasant.
Hooray! A new buyer found us in google!
Shop: Prom.ua
Date: 15.04.2025 14:30
Amount: 899.99 UAH
Client: Ivan Petrenko
Phone: +380971234567
Products:
- Table lamp (×1)
- Mug with print (×2)
Conclusion:
This script is a great solution for online store owners who work simultaneously on their website and on large marketplaces. It saves time, increases the speed of response to new orders and ensures reliable communication between systems.
Adding humorous phrases makes notifications not only informative, but also heartfelt, which is especially important for small businesses and family projects.
If you need an automated and convenient way to track orders, this script will be your best assistant!










