Integrating 1C-Bitrix with the Shiptor shipping aggregator

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1175
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

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.) or auto for 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:

  1. Agent once per hour calls GET /inventory — list of items with quantities.
  2. Map by sku or external code: find product in b_iblock_element by article.
  3. Update quantity via CCatalogProduct::Update() or directly in b_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