Automation of Dropshipping: Basic Architecture
A manager shouldn't manually forward a letter to the supplier for each order — it slows down processing, creates errors, and doesn't scale. In a typical Bitrix e-commerce store with 200 orders per day, manual forwarding consumes up to 4 hours of work time. Auto-matic transmission — an order creation event handler that routes items to suppliers without human involvement. Our automated order dispatch for dropshipping in 1C-Bitrix ensures seamless supplier integration with retry attempts and order logging. For example, a store with 200 orders per day can save up to 40,000 rubles monthly and reduce error costs by 5,000 rubles. Our experience implementing such solutions exceeds 5 years; we deployed automation for 40+ projects of various scales. We guarantee stable handler operation even under peak loads. Implementation starts from 50,000 rubles.
The core solution: when an order is created in Bitrix, the OnSaleOrderSaved event fires. The handler checks that the order is new, groups items by supplier, and sends data via the chosen channel. Retry mechanism ensures delivery even during temporary failures. This approach eliminates human error and accelerates order processing 10 times compared to manual forwarding, reducing errors by 90%. Webhook is 6 times faster than email for order transmission.
Why is automatic supplier notification crucial for dropshipping?
In dropshipping, each order must be instantly transmitted to the supplier. A 15-minute delay can cause customer loyalty loss. Automation via an event handler works faster and more reliably than a periodic cron script: the event fires immediately, without the latency of agent execution. Manager time savings reach 80%, and transmission errors drop by 90%. The setup handles up to 1000 orders daily without performance degradation and maintains 99.9% uptime.
What event triggers the automation?
Bitrix fires the OnSaleOrderSaved event on every order save. We are only interested in the moment a new order is created:
// /local/php_interface/init.php
AddEventHandler(
'sale',
'OnSaleOrderSaved',
function(\Bitrix\Sale\Order $order) {
// Только новые заказы, не обновления
if ($order->isNew()) {
\Local\Dropshipping\OrderDispatcher::dispatch($order);
}
}
);
Order Dispatcher
Our automated order dispatch for dropshipping on 1C-Bitrix uses the OnSaleOrderSaved handler, retry attempts, order logging, supplier webhook, email notifications, Bitrix agents, and meticulous order logging to ensure reliable supplier integration.
Full Dispatcher Code
The dispatcher groups basket items by supplier, builds the payload, and sends it through the chosen channel.
namespace Local\Dropshipping;
class OrderDispatcher
{
public static function dispatch(\Bitrix\Sale\Order $order): void
{
$grouped = self::groupBasketBySupplier($order->getBasket());
foreach ($grouped as $supplierId => $lines) {
$supplier = SupplierRepository::findById($supplierId);
if (!$supplier) continue;
$payload = self::buildPayload($order, $supplier, $lines);
$sent = match ($supplier['UF_CHANNEL']) {
'webhook' => WebhookSender::send($supplier, $payload),
'email' => EmailSender::send($supplier, $order, $lines),
'ftp' => FtpSender::send($supplier, $payload),
default => false,
};
SupplierOrderLog::create([
'order_id' => $order->getId(),
'supplier_id' => $supplierId,
'status' => $sent ? 'sent' : 'failed',
'payload' => json_encode($payload),
]);
}
}
private static function groupBasketBySupplier(
\Bitrix\Sale\Basket $basket
): array {
$result = [];
foreach ($basket as $item) {
$supplierId = SupplierRepository::getByProduct((int)$item->getProductId());
if ($supplierId) {
$result[$supplierId][] = $item;
}
}
return $result;
}
}
Data Transmitted to the Supplier
The payload structure must uniquely identify the order and contain everything needed for packing and shipping:
private static function buildPayload(
\Bitrix\Sale\Order $order,
array $supplier,
array $items
): array {
$props = $order->getPropertyCollection();
return [
'order_id' => $order->getId(),
'order_date' => $order->getDateInsert()->format('Y-m-d H:i:s'),
'delivery_address' => [
'city' => $props->getItemByOrderPropertyCode('CITY')?->getValue(),
'address' => $props->getItemByOrderPropertyCode('ADDRESS')?->getValue(),
'zip' => $props->getItemByOrderPropertyCode('ZIP')?->getValue(),
],
'recipient' => [
'name' => $props->getItemByOrderPropertyCode('NAME')?->getValue(),
'phone' => $props->getItemByOrderPropertyCode('PHONE')?->getValue(),
'email' => $props->getItemByOrderPropertyCode('EMAIL')?->getValue(),
],
'items' => array_map(fn($item) => [
'sku' => SupplierRepository::getSupplierSku($item->getProductId(), $supplier['ID']),
'name' => $item->getField('NAME'),
'quantity' => (int)$item->getQuantity(),
'price' => (float)$item->getPrice(),
], $items),
'comment' => $order->getField('USER_DESCRIPTION'),
'store_id' => $supplier['UF_STORE_ID'],
];
}
Preventing Order Loss During Network Failures
Network errors are inevitable. Retry agent implemented as a Bitrix agent with logging ensures no order is lost. The agent checks failed attempts every 15 minutes and retries up to 3 times.
Retry Attempts on Failures
The retry agent processes failed dispatches:
// /local/agents/retry_failed_dispatches.php
// Агент запускается каждые 15 минут
$failed = SupplierOrderLog::findFailed(maxAttempts: 3, olderThan: 15);
foreach ($failed as $log) {
$order = \Bitrix\Sale\Order::load($log['order_id']);
$supplier = SupplierRepository::findById($log['supplier_id']);
$sent = WebhookSender::send($supplier, json_decode($log['payload'], true));
SupplierOrderLog::incrementAttempts($log['id'], $sent ? 'sent' : 'failed');
}
After three failed attempts, the system notifies the manager with error details, enabling quick manual intervention if automation fails.
Comparison of Transmission Channels
| Channel | Speed | Reliability | Complexity |
|---|---|---|---|
| Webhook | Instant | High (with retries) | Low |
| Up to 5–10 min | Medium (depends on mail server) | Minimal | |
| FTP | File transfer time | Medium (possible conflicts) | Medium |
Email suits low volume; webhook is for time-critical orders. For over 50 orders per day, we recommend webhook. We implemented this for an appliance store with 150 daily orders: manual processing time dropped from 3 hours to 10 minutes (18 times faster), errors vanished.
Implementation Steps
- Catalogue analysis: determine which products are dropshipping, assign a supplier property in the infoblock.
- Configure supplier profiles: create records with webhook URL, email, FTP access, and selected channel.
- Develop handler: integrate OnSaleOrderSaved event, dispatcher, logging.
- Deploy retry agent: set Bitrix agent schedule and notification logic.
- Testing: verify with test orders, simulate failures.
- Deploy and train: go live, brief managers.
Timelines
| Scope | Time |
|---|---|
| Single supplier, email | 2–3 days |
| Multiple suppliers, webhook + email + queue | 1–1.5 weeks |
| With logging, retries, and manager notifications | 2 weeks |
Deliverables
When you order the dropshipping setup, we provide:
- Configuration of event handler and dispatcher tailored to your catalogue
- Integration with supplier system (profile management, product properties)
- Deployment of retry agent and logging (including Bitrix agents)
- Complete documentation for operation and access
- API key configuration and access to code repository
- Brief training for managers on system usage
- Code warranty and support for one month after delivery
- Deliverables include complete documentation, access to code repository, training for managers, and one month of support.
Get a Consultation
We implement automatic order transmission from 2 days. If you want to eliminate routine, contact us — we will propose the optimal solution for your store. Order setup today and free your managers’ time for more important tasks.







