Integration of 1C-Bitrix with Shiptor delivery aggregator
Shiptor is a delivery service aggregator and fulfillment operator. Two products: logistics aggregator (unified API for accessing carriers — CDEK, Boxberry, DPD, Russian Post and others) and fulfillment (storing goods at Shiptor warehouses with shipment under order). For an online store on Bitrix, integration with Shiptor solves both tasks through a single API.
Shiptor API functionality
Base URL: https://api.shiptor.ru. Authorization — Bearer token. Documentation available at shiptor.ru.
Main capabilities:
- Cost calculation at multiple carriers in one request
- Creating, updating, canceling shipments
- Managing warehouse inventory (fulfillment)
- List of pickup points and lockers
- Shipment tracking
- Automatic label printing
Integration architecture in Bitrix
Shiptor in a project can solve two different tasks, and their architecture differs:
Option 1: logistics only. The store stores and collects goods itself, Shiptor is only the carrier. Integration is limited to the delivery module: calculation → creating request → tracking → label.
Option 2: fulfillment. Goods are stored at the Shiptor warehouse. When creating an order in Bitrix — send an assembly and shipment request to Shiptor. Synchronize product quantities from Shiptor to Bitrix via agent. This is more complex and requires bidirectional exchange setup.
Delivery module (option 1)
Class — inheritor of \Bitrix\Sale\Delivery\Services\Base. Parameters:
-
SHIPTOR_TOKEN— Bearer token -
WAREHOUSE_ID— ID of warehouse-sender in Shiptor system -
PROVIDER— carrier code (cdek, boxberry, dpd etc.) orautofor auto-selection
Cost calculation:
$calcRequest = [
'warehouse_id' => $warehouseId,
'destination' => [
'city' => $city,
'address' => $address,
'type' => 'door', // or 'point'
'point_id' => $pvzId,
],
'packages' => [[
'weight' => $weightGram,
'length' => $lengthCm,
'width' => $widthCm,
'height' => $heightCm,
]],
'declared_value' => $declaredValue,
'payment_method' => $isPrepaid ? 'prepaid' : 'cod',
];
Response — array of offers from carriers. With provider = auto select minimum price or preferred carrier per settings.
Creating a shipment
$shipmentPayload = [
'warehouse_id' => $warehouseId,
'provider' => $selectedProvider,
'order_number' => 'SHOP-' . $bitrixOrderId,
'recipient' => ['name' => $name, 'phone' => $phone],
'destination' => $destination,
'packages' => $packages,
'items' => $items,
'declared_value' => $declaredValue,
'cash_on_delivery' => $codAmount,
];
Response contains shipment_id (ID in Shiptor) and tracking_number (carrier's). Get label via GET /shipments/{id}/label — PDF.
Fulfillment: inventory synchronization
With fulfillment model, product quantities are physically at the Shiptor warehouse. Synchronize to Bitrix:
- Agent once per hour calls
GET /inventory— list of items with quantities. - Map by
skuor external code: find product inb_iblock_elementby article. - Update quantity via
CCatalogProduct::Update()or directly inb_catalog_product.
If product not found in Bitrix by SKU — add to log for manual check.
Creating an assembly request (fulfillment)
Instead of physical shipment from own warehouse, send assembly task to Shiptor:
$fulfillmentOrder = [
'order_number' => 'SHOP-' . $bitrixOrderId,
'recipient' => $recipient,
'destination' => $destination,
'provider' => $selectedProvider,
'items' => array_map(fn($item) => [
'sku' => $item['sku'],
'quantity' => $item['qty'],
], $basketItems),
];
$response = $httpClient->post('/fulfillment/orders', $fulfillmentOrder);
Shiptor itself assembles order, packs and transfers to carrier. Tracking number returned once order transferred to carrier.
Pickup points and map
List of PVZ: GET /pickup-points?city={city}&provider={provider}. Cache in HL-block, update once per day. On map Yandex/Google show aggregated across all carriers.
Timeline
| Variant | Composition | Timeline |
|---|---|---|
| Logistics only | Calculation + requests + tracking | 4–5 days |
| + Pickup point map | HL-block + widget | +2–3 days |
| Fulfillment: inventory sync | Agent + SKU mapping | +3–4 days |
| Fulfillment: assembly order creation | Hook on order confirmation | +2 days |







