Imagine: an online store manager manually fills in delivery data in the Business Lines personal account. One order takes up to 15 minutes. With 50 orders per day — that's over 12 hours of pure routine. Errors in addresses, lost statuses, mis-sorting by dimensions — a typical picture without API integration. We automate this process: cost calculation, order creation, and tracking via the Business Lines REST API. One client — a furniture store — after implementation reduced order processing time from 15 to 2 minutes and lowered delivery operational costs by 15%. Significant savings on manual labor costs.
Why Automation of Delivery via API is Important
Without integration, stores spend up to 20% of working time on manual delivery processing. Business Lines is the largest transport company with a network of 2000+ terminals. Their API with JWT authorization allows flexible shipment management. We have completed over 30 projects on integrating 1C-Bitrix with transport companies, guaranteeing stable operation and updates when the API changes. Read more about the protocol in the official documentation of the REST API of Business Lines.
How to Automate Delivery via Integration with Business Lines?
How is the Business Lines API structured? — 1C-Bitrix Integration
Base URL: https://api.dellin.ru/v3/. Authorization is two-step: first get a session token via /v3/auth/login.json, then use it in the Cookie: session=TOKEN header or as a parameter.
private function getSession(): string
{
$cacheKey = 'dellin_session_' . md5($this->appKey);
$cached = \Bitrix\Main\Data\Cache::createInstance();
if ($cached->startDataCache(3600 * 8, $cacheKey, '/dellin')) {
$response = $this->httpPost('/v3/auth/login.json', [
'appkey' => $this->appKey,
'login' => $this->login,
'password' => $this->password,
]);
$session = $response['data']['sessionID'] ?? '';
$cached->endDataCache(['session' => $session]);
}
return $cached->getVars()['session'];
}
The session lives 8+ hours. Cache it for 8 hours to avoid authentication on every calculation.
Example cost calculation request:
private function calcCost(
string $fromCity,
string $toCity,
float $weightKg,
float $volumeM3
): float {
$response = $this->apiPost('/v3/calculator.json', [
'appkey' => $this->appKey,
'sessionID' => $this->getSession(),
'delivery' => [
'deliveryType' => ['type' => 'auto'],
'arrival' => ['variant' => 'address'],
'dispatch' => ['variant' => 'terminal'],
],
'cargo' => [
'quantity' => 1,
'weight' => $weightKg,
'volume' => $volumeM3,
'totalEnvelopesWeight' => 0,
],
'members' => [
'from' => ['terminalID' => $this->findTerminalId($fromCity)],
'to' => ['city' => $toCity],
],
]);
return (float)($response['data']['price'] ?? 0);
}
The parameter delivery.dispatch.variant: terminal means the store itself brings the cargo to the terminal. arrival.variant: address — delivery to the buyer's door. Combinations of variant affect the price: terminal-terminal is cheaper, address-address is more expensive.
Searching for a Terminal by City
public function findTerminalId(string $cityName): string
{
$response = $this->apiPost('/v3/public/terminals.json', [
'appkey' => $this->appKey,
]);
foreach ($response['data']['terminals'] ?? [] as $terminal) {
if (mb_stripos($terminal['city']['name'], $cityName) !== false) {
return $terminal['id'];
}
}
return '';
}
The list of terminals is large — cache the search result for a day.
Order Creation
public function createOrder(\Bitrix\Sale\Shipment $shipment): string
{
$order = $shipment->getOrder();
$props = $order->getPropertyCollection();
$payload = [
'appkey' => $this->appKey,
'sessionID' => $this->getSession(),
'delivery' => [
'deliveryType' => ['type' => 'auto'],
'dispatch' => ['variant' => 'terminal'],
'arrival' => [
'variant' => 'address',
'address' => [
'search' => $props->getItemByOrderPropertyCode('ADDRESS')?->getValue(),
],
],
],
'cargo' => $this->buildCargo($shipment),
'members' => [
'from' => ['terminalID' => $this->getOption('FROM_TERMINAL_ID')],
'to' => [
'contactPersons' => [[
'name' => $props->getItemByOrderPropertyCode('FIO')?->getValue(),
'phone' => $props->getItemByOrderPropertyCode('PHONE')?->getValue(),
]],
],
],
'payment' => [
'type' => 'cash',
'payer' => 'receiver',
],
];
$response = $this->apiPost('/v3/orders.json', $payload);
return (string)($response['data']['orderID'] ?? '');
}
The parameter payment.payer: receiver means the delivery is paid by the recipient. sender — by the sender (store). The choice depends on the store's business model.
Order Tracking
public function getOrderState(string $orderId): array
{
$response = $this->apiPost('/v3/orders/state.json', [
'appkey' => $this->appKey,
'sessionID' => $this->getSession(),
'orders' => [['orderID' => $orderId]],
]);
$state = $response['data'][0] ?? [];
return [
'status' => $state['orderState']['name'] ?? '',
'deliveryDate' => $state['deliveryDate'] ?? '',
];
}
Business Lines does not support webhooks for tracking. A Bitrix agent polls the status of active shipments every 3–4 hours.
What are the Special Considerations for Oversized Goods?
Business Lines supports pallet shipments. For furniture or construction materials stores, shipments need to be split into multiple pieces with individual dimensions. The cargo.oversizedWeight field is used for non-standard pieces (>80 kg or >3 m long). In one project for an online furniture store, we encountered a problem with incorrect dimension calculation: goods arrived damaged. After implementing integration with oversizedWeight parameters and pallet grouping, the number of returns decreased by 15%.
How the Integration Process Works: Step by Step
- Analysis — we study your catalog, delivery types, 1C-Bitrix settings.
- Design — we select API methods, define field mapping.
- Implementation — we write code for calculation, order creation, tracking.
- Testing — we test on sample orders, measure response time.
- Deployment — we roll out to production, set up agents.
- Documentation and training — we provide instructions, train managers.
What is Included in the Integration Work?
- Registering an application in the Business Lines personal account.
- Setting up authorization and session caching.
- Implementing cost calculation on the cart page.
- Creating orders from the admin panel.
- Tracking with status change notifications.
- Technical support for 30 days after launch.
| Delivery | Option | Average Cost (conditional) | Timeframe |
|---|---|---|---|
| Terminal → Terminal | Self-pickup | Low | 3–5 days |
| Terminal → Address | Door delivery | Medium | 3–5 days |
| Address → Address | Courier | High | 2–4 days |
How Long Does Integration Take?
| Scope of Work | Time |
|---|---|
| Authorization + Calculation + Terminal mapping | 3–4 days |
| + Order creation + Tracking | +2 days |
| + Dimension calculation + Pallets | +1 day |
What Typical Mistakes are Made During Integration?
Common pitfalls and how to avoid them
- Ignoring session caching — frequent authorizations can lead to blocking.
- Incorrect city mapping — terminal not found.
- Lack of API error handling — order not created without notification. For example, when request limits are exceeded, the API returns code 429, which needs to be handled with a retry.
- Forgetting the oversized parameters for heavy cargo.
Order integration today — get a free consultation and project estimate. We have over 5 years of experience in integrating 1C-Bitrix with transport companies. Contact us to discuss the details of your store.







