Integration of 1C-Bitrix with the DostavkaBy delivery service (Belarus)

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

1C-Bitrix Integration with DostavkaBy Delivery Service (Belarus)

DostavkaBy is a Belarusian courier delivery service oriented to e-commerce on RB market. Delivery to Minsk and regions, cash on delivery support, returns. For shops operating on Belarusian market, DostavkaBy is one of local alternatives to major operators.

DostavkaBy API

DostavkaBy provides REST API for partners. Documentation and credentials provided upon contract conclusion. Authorization via Basic Auth or token depending on API version. Format — JSON.

Basic operations:

  • Creating delivery request
  • Getting request status
  • Cost calculation
  • Getting tracking
  • Canceling/changing request

Delivery Module in Bitrix

Class inherits \Bitrix\Sale\Delivery\Services\Base. Parameters in b_sale_delivery_service_params:

  • DOSTAVKA_API_KEY — API key
  • SENDER_NAME — sender name
  • SENDER_PHONE — sender phone
  • SENDER_ADDRESS — warehouse or pickup point address

Features of Belarusian Logistics

Working with Belarusian delivery services has specifics common to most RB operators:

Phone format. All numbers — +375XXXXXXXXX. Normalize incoming number before sending: remove spaces, brackets, dashes, add 375 if entered in local format 80XXXXXXXX.

Currency BYN. All sums in Belarusian rubles. Multi-currency shop — convert via CCurrencyRates Bitrix.

Addressing. Belarus doesn't use FIAS/KLADR system. Addresses — free string or via service's own classifiers. Sometimes enough to pass city + address string.

Cash on delivery. Standard operation for RB market. With cash on delivery, DostavkaBy collects money from customer and transfers to shop minus commission per schedule (usually once per week).

Cost Calculation

In calculateConcrete() request delivery cost for recipient address. Minimum calculation parameters: delivery city, package weight, delivery type (courier). Additionally — declared value, dimensions (affect cost for oversized packages).

If received HTTP 200 with price — return in CalculationResult object. If address outside coverage or API unavailable — return error without blocking order (customer sees "delivery unavailable for your address").

Creating and Managing Requests

Requests created automatically on order confirmation (hook to OnSaleStatusOrder event) or manually by manager. In order card in admin part add "DostavkaBy Delivery" block with buttons:

  • "Create request" (if not created yet)
  • "Show status"
  • "Print label"
  • "Cancel request"

DostavkaBy request ID saved to b_sale_order_props as custom property DOSTAVKA_BY_ID.

Status Synchronization

With small order volume (up to 50–100 per day), polling sufficient: Bitrix agent every 30 minutes checks statuses of active requests. With higher volume — setup webhooks: DostavkaBy sends notifications on status change.

Typical status mapping:

DostavkaBy Status Bitrix Order Status
New Sent for delivery
Accepted by courier In transit
Delivered Delivered
Canceled Canceled
Return Return

Payment Integration

For shops with cash on delivery, reconciliation is important: how much DostavkaBy collected and when transferred. Implement report in admin part: export orders with cash on delivery for period with sums and transfer dates. Get data via DostavkaBy API (if payout report export method exists) or maintain manually.

Timeline

Scope Components Duration
Basic integration Calculation + creating requests + statuses 3–4 days
+ Admin interface Request management block in order +1–2 days
+ COD reconciliation Report + settlement reconciliation +2 days