Setting Up Automatic Reordering from Suppliers in 1C-Bitrix

Setting Up Automatic Reordering from Suppliers in 1C-Bitrix Imagine a manager spending 3 hours a day manually monitoring stock levels across 80,000 items. An item runs out, but the replenishment order isn't placed — lost sales and emergency deliveries at your expense. Or the opposite: ordering "b

Our competencies:

Frequently Asked Questions

Setting Up Automatic Reordering from Suppliers in 1C-Bitrix

Imagine a manager spending 3 hours a day manually monitoring stock levels across 80,000 items. An item runs out, but the replenishment order isn't placed — lost sales and emergency deliveries at your expense. Or the opposite: ordering "by eye" ties up working capital. We solve this through automatic ordering based on CommerceML and native Bitrix mechanisms.

Our architecture eliminates the human factor: an agent checks stock, compares it with the reorder point, and creates an order. The order is sent via API, email, or EDI — depending on the supplier's capabilities. Over years of implementations, we've reduced purchasing time by 70% for retail and distribution clients.

Problems We Solve

A typical scenario: average lead time is 10 days, but the reorder point is not set — by the time the goods arrive, you've already run out. Or the opposite: the reorder point is too high, tying up 40% safety stock instead of 20%. Manual control leads to errors:

  • Manually monitoring thousands of items takes up to 3 hours a day.
  • Different sending formats (email, API, EDI) for each supplier.
  • Duplicate orders due to integration failures.

We address each problem architecturally: predictive reorder points, an agent with a NOT EXISTS safeguard, and flexible sending adapters.

How the Reorder Agent Works

The AutoReorderAgent runs on a schedule (hourly or daily) and executes a query: it selects products whose current stock is below the reorder point and for which there is no active order with the same supplier. The NOT EXISTS condition is key — it prevents duplicates even if the cron job fails.

function AutoReorderAgent(): string { $db = \Bitrix\Main\Application::getConnection(); $result = $db->query(" SELECT rs.product_id, rs.reorder_qty, rs.supplier_id, SUM(sp.AMOUNT) AS current_stock FROM bl_reorder_settings rs LEFT JOIN b_catalog_store_product sp ON sp.PRODUCT_ID = rs.product_id WHERE rs.active = 1 GROUP BY rs.product_id, rs.reorder_qty, rs.supplier_id HAVING current_stock < rs.reorder_point AND NOT EXISTS ( SELECT 1 FROM bl_supplier_orders so WHERE so.product_id = rs.product_id AND so.status IN ('pending', 'sent', 'confirmed') ) "); while ($row = $result->fetch()) { SupplierOrderService::create( $row['supplier_id'], $row['product_id'], $row['reorder_qty'] ); } return 'AutoReorderAgent();'; } 

Why Use Predictive Reorder Points?

A simple fixed number ignores seasonality and trends. We use average sales over the last 90 days, multiply by lead time, and add a 20% safety stock. The formula is recalculated automatically once a week via an agent. Results: forecast accuracy of 85–90% and a 30% reduction in safety stock.

How We Eliminate Order Duplication

Duplication is a common problem in self-built automation. We implement double protection:

  • In the agent's SQL query — the NOT EXISTS condition (a new order is not created while the previous one is in pending, sent, or confirmed status).
  • Blocking logic: if an order is not confirmed by the supplier within 24 hours, the agent does not create a duplicate but notifies the administrator.

We also maintain a log of all operations (following official Bitrix agent creation guidelines).

How We Do It: A Real Case Study

Our client — a chain of 15 auto parts stores with a catalog of 80,000 items and 200 suppliers. They needed to automate ordering via API for the top 10 suppliers and via email for the rest. We designed three tables:

  • bl_reorder_settings — thresholds per product linked to supplier.
  • bl_supplier_orders — order history with statuses.
  • bl_supplier_shipping_methods — method and configuration for sending.

The agent creates a record in bl_supplier_orders, then SupplierOrderService picks the appropriate adapter (API/Email/EDI) and sends it. After the supplier confirms, the status is updated via webhook or manually. When goods arrive, the manager creates a receipt document — stock levels adjust automatically.

Result: managers stopped spending 3 hours a day on ordering; stockout rate dropped from 12% to 2%. The project paid for itself in 3 months due to reduced downtime and emergency shipping costs.

What's Included in the Work

Component Description
Analysis Requirements gathering, audit of current stock and suppliers
Design Database schema, agent architecture, and adapters
Development Tables, agent, sending classes, admin interface
Testing Duplicate checks, edge cases (zero stock, API errors)
Deployment Agent schedule setup, migrations, documentation
Training Instructions for managers on order confirmation and receipt

Estimated time: from 5 to 20 days depending on the number of suppliers and integration methods. Pricing is determined after analysis. Contact us — we'll assess your project within 1 day.

Comparison: Manual vs. Automatic Ordering

Parameter Manual Ordering Automatic Ordering
Time spent on purchasing per day 3-4 hours 15 minutes (oversight)
Stockout rate 12-15% 2-3%
Emergency shipping costs 5-7% of turnover 0.5-1%
Order error rate 5-8% <1%
Typical Mistakes in Self-Setup - Missing duplicate-order lock: the agent creates a new order while the previous one is still pending. - Threshold without considering lead time: delays cause stockouts. - Ignoring API errors: the order isn't sent, but its status remains "sent". We add logging and retries.

We guarantee stable operation: after commissioning, we provide 30 days of support. Our team has 10+ years of experience with Bitrix. Get a consultation to learn how automation can solve your procurement challenges.