Automate Delivery: 1C-Bitrix & Nova Poshta Integration

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.
Showing 1 of 1All 1626 services
Automate Delivery: 1C-Bitrix & Nova Poshta Integration
Medium
~1-2 weeks
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1356
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    943
  • 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
    693
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    828
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    731
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1073

Automate Delivery: Integrating 1C-Bitrix with Nova Poshta

In Ukrainian e-commerce, Nova Poshta is the standard: about 80% of orders go through this service. According to Nova Poshta, up to 5% of waybills contain errors — for 150 orders per day, that's 7-8 incorrect shipments. Each mistake leads to returns and loss of loyalty. Integration via API reduces this figure to 0.5%. Automating waybill creation, tracking, and warehouse selection eliminates manual entry and cuts processing time by 60%.

We (TrueTech) have integrated Bitrix with Nova Poshta on dozens of projects over 5 years and developed an algorithm that eliminates failures. In this article, we'll walk through how to set up integration — from obtaining an API key to full tracking. You'll learn how to avoid common pitfalls and what opportunities a ready module opens up.

How Nova Poshta API Works

Nova Poshta provides a unified JSON API: https://api.novaposhta.ua/v2.0/json/. Authorization via apiKey in the request body. The request format is the same for all operations:

private function apiCall(string $model, string $method, array $props): array
{
    $payload = [
        'apiKey'           => $this->apiKey,
        'modelName'        => $model,
        'calledMethod'     => $method,
        'methodProperties' => $props,
    ];

    $ch = curl_init('https://api.novaposhta.ua/v2.0/json/');
    curl_setopt_array($ch, [
        CURLOPT_POST           => true,
        CURLOPT_POSTFIELDS     => json_encode($payload, JSON_UNESCAPED_UNICODE),
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    ]);

    $response = json_decode(curl_exec($ch), true);
    curl_close($ch);

    if (!$response['success']) {
        throw new \RuntimeException('НП API: ' . implode(', ', $response['errors']));
    }

    return $response;
}

Detailed specification is available in the Nova Poshta API Documentation.

City and Warehouse Search

Nova Poshta uses Ref identifiers for all objects. Mapping a Bitrix location to a Nova Poshta city Ref:

public function getCityRef(string $cityName): ?string
{
    $cache = \Bitrix\Main\Data\Cache::createInstance();
    $key   = 'np_city_' . md5($cityName);

    if ($cache->initCache(86400, $key, '/np/')) {
        return $cache->getVars();
    }

    $response = $this->apiCall('Address', 'getCities', [
        'FindByString' => $cityName,
        'Limit'        => 5,
    ]);

    $ref = $response['data'][0]['Ref'] ?? null;

    if ($ref) {
        $cache->startDataCache();
        $cache->endDataCache($ref);
    }

    return $ref;
}

The customer enters a Nova Poshta warehouse number (e.g., "5"), we look up its Ref:

public function getWarehouseRef(string $cityRef, string $warehouseNumber): ?string
{
    $response = $this->apiCall('Address', 'getWarehouses', [
        'CityRef'     => $cityRef,
        'WarehouseId' => $warehouseNumber,
    ]);
    return $response['data'][0]['Ref'] ?? null;
}

Creating a Waybill

public function createDocument(
    \Bitrix\Sale\Shipment $shipment,
    string $recipientCityRef,
    string $recipientWarehouseRef
): string {
    $order = $shipment->getOrder();
    $props = $order->getPropertyCollection();

    $response = $this->apiCall('InternetDocument', 'save', [
        'NewAddress'       => '1',
        'PayerType'        => 'Recipient',  // получатель платит за доставку
        'PaymentMethod'    => 'Cash',
        'CargoType'        => 'Cargo',
        'Weight'           => max($shipment->getWeight() / 1000, 0.1),
        'ServiceType'      => 'WarehouseWarehouse',
        'SeatsAmount'      => '1',
        'Description'      => 'Товар магазина',
        'Cost'             => (string)round($order->getPrice()),
        'CitySender'       => $this->getOption('SENDER_CITY_REF'),
        'Sender'           => $this->getOption('SENDER_COUNTERPARTY_REF'),
        'SenderAddress'    => $this->getOption('SENDER_WAREHOUSE_REF'),
        'ContactSender'    => $this->getOption('SENDER_CONTACT_REF'),
        'SendersPhone'     => $this->getOption('SENDER_PHONE'),
        'CityRecipient'    => $recipientCityRef,
        'RecipientAddress' => $recipientWarehouseRef,
        'RecipientsPhone'  => $props->getItemByOrderPropertyCode('PHONE')?->getValue(),
        'RecipientName'    => $props->getItemByOrderPropertyCode('FIO')?->getValue(),
    ]);

    return $response['data'][0]['IntDocNumber'] ?? '';
}

PayerType: Recipient is standard: the recipient pays for delivery upon receipt. PayerType: Sender means the store bears the cost.

Tracking and Error Handling

public function trackDocument(string $docNumber): array
{
    $response = $this->apiCall('TrackingDocument', 'getStatusDocuments', [
        'Documents' => [['DocumentNumber' => $docNumber]],
    ]);
    return $response['data'][0] ?? [];
}

Returns StatusCode, Status, ScheduledDeliveryDate, warehouse information. A Bitrix agent queries every 2 hours for active shipments.

Typical errors and their handling:

  • Invalid warehouse number: the customer enters a non-existent number — the module checks via API and highlights the error before saving.
  • City name discrepancies: the customer types "Kiev" instead of "Kyiv". Solution: input normalization and fuzzy search.
  • Outdated Ref identifiers: the API may return an error if the directory cache is stale. We use caching with a 24-hour TTL and automatic refresh.

All errors are logged, and the administrator receives a notification. Retries are performed with exponential backoff (up to 3 times).

Preventive measures include warehouse number validation via API before order saving, input normalization, and automatic city Ref substitution. Fuzzy search corrects typos on the fly.

Benefits and Case Study

Manual waybill creation takes 2-3 minutes per order. For 150 orders, that's 7-9 hours per week — the workload of a dedicated employee. Automation via API eliminates this burden and eliminates typos. Compared to manual entry, automation is 3 times faster and reduces delivery errors by 90%. No third-party plugin offers this level of integration without customization.

A clothing store client (~150 orders/day, 99% via Nova Poshta) had a major problem: customers entered warehouse numbers arbitrarily. We implemented input normalization and fuzzy search during checkout. After implementation, incorrectly created waybills dropped from ~15 per week to virtually zero.

Setup and Timelines

  1. Obtain API key — register in the Nova Poshta cabinet, create an API key.
  2. Install the module — connect a ready-made solution with sender settings.
  3. Configure order properties — bind fields for warehouse number, phone, full name.
  4. Test — create a test waybill, verify tracking.
  5. Deploy to production — enable the agent for status updates.
Click for more details on API failures If the Nova Poshta API is temporarily unavailable, the module does not block order placement. The order is saved with a "Pending shipment" flag, and the agent retries on the next run. Maximum delay is 2 hours. On validation errors, the administrator receives an email with a problem description.
Stage Time (working days)
Diagnostics and requirements 1–2
Core development (waybill creation) 4–5
Warehouse selection with hints +2
Tracking and notifications +2
Cash on delivery +1
Testing and deployment 1–2

The average full implementation time is up to 8 working days. We work strictly under a contract with fixed deadlines. We guarantee stable module operation after delivery. Certified 1C-Bitrix specialists with 5+ years of experience and 50+ integration projects with Nova Poshta.

What's Included

  • Integration module with source code for 1C-Bitrix;
  • Documentation for installation, configuration, and operation;
  • Administrator training (up to 2 hours);
  • Technical support for 30 days after delivery;
  • Transfer of all access rights (repository, admin panel, API key).

Want the same? Contact us for a project evaluation. Order a turnkey integration — we'll prepare a commercial proposal and show a demo on your data. Get a consultation today.

Delivery integration: from disparate APIs to a unified calculator in 5 days

A buyer abandons the cart at the shipping stage — they don't see a quote or see an obviously incorrect price. Each such case loses conversion. Automating logistics in 1C-Bitrix solves this problem: we connect delivery services so that the price appears instantly and tracking updates without manager intervention. Over 8 years, we have implemented more than 50 projects with catalogs ranging from 500 to 100,000 SKUs. Average time to connect one carrier is 4 days.

How to accelerate the connection of delivery services to 1C-Bitrix?

The main challenge is not the API call itself, but adapting to the logic of each carrier. CDEK, Boxberry, Russian Post, PEK, DPD — each has its own request format, pricing, and error handling. We use ready-made adapters for each carrier, which reduces integration time by three times compared to custom implementation. Detailed case: an online home goods store (15,000 items) — connected CDEK and Boxberry in 5 days, automated calculation and order creation. Support requests related to delivery dropped by 60%, average order value increased by 8% due to the free shipping indicator.

Why is each carrier's API a separate challenge?

CDEK — volumetric weight and pickup point map

API v2 (/api/v2/calculator/tarifflist) accepts dimensions, weight, and addresses — returns all available tariffs. Pitfalls: volumetric weight is calculated using the formula (L × W × H) / 5000. If physical weight is 2 kg and volumetric weight is 8 kg, CDEK charges by volumetric weight. If not accounted for in the calculator, the buyer sees one price but pays another. The pickup point map is loaded via /deliverypoints. The CDEK widget can be embedded, but it conflicts with Bitrix styles — we draw our own map using Yandex.Maps. Automatic order creation via /api/v2/orders — when placing an order, the request goes to CDEK and returns a tracking number. Printing waybills and labels from the admin panel — via /api/v2/print/orders. Tariffs: warehouse-warehouse, warehouse-door, door-door, express, parcel locker.

Boxberry — extensive pickup point network in regions

The most extensive pickup point network in small towns. API is simpler than CDEK, but there are nuances with cash on delivery and partial redemption. Pickup point map with filters: fitting, card payment, weekend operation. We always check correct handling of response 0 when no pickup points are available.

Russian Post — stability at the cost of speed

API "Sending" — cost calculation, automatic generation of forms 103 and 116, tracking by tracking number. Tariffs: parcel, printed matter, EMS. International shipments. API is slower than commercial carriers — we set 10-second timeouts, use asynchronous Bitrix agents for status updates.

PEK — heavy loads and groupage

When you need to ship a sofa or equipment. Calculation of groupage cargo, insurance, crate. Delivery to terminal and door-to-door. PEK terminal indices are loaded into an infoblock for auto-completion.

DPD — express delivery with time slots

DPD across Russia and abroad. Delivery within a selected time interval, return of signed documents. In the calculation, we account for volumetric weight using the formula (L×W×H)/4000 — different from CDEK.

Example: typical errors when integrating BoxberryThe absence of filtering pickup points by the `onlyPrepaid` attribute leads to errors with cash on delivery. Ignoring the `partialReturn` parameter breaks partial redemption. The API returns the city code in the format "770000000000" — requires mapping to the city index.

How to combine different carriers in a single calculator?

We use a hybrid approach: an aggregator module that routes requests to different APIs and normalizes responses. This allows comparing tariffs in real time without switching between personal accounts. The module response has a unified structure: tariff name, price, delivery time, delivery type. Tagged caching: when module settings change, only the cache for the selected city is cleared, the rest remains. We hook the OnBeforeDeliveryCalculate event to a custom handler — this replaces the standard delivery logic.

Cost calculation: what pitfalls are encountered?

The automatic calculator sums the physical and volumetric weight of items in the cart, adds packaging weight, and selects the largest. Sounds simple, but:

  • Dimensions must be filled for each item. No dimensions — no calculation. A catalog of 10,000 SKUs will inevitably have items without dimensions — we set default values (e.g., 0.1×0.1×0.1 m) and warn the manager via a mail event.
  • Promotions and free shipping thresholds — flexible configuration: by order amount, for VIP customers, with a specific payment method. Implemented via custom cart properties.
  • The indicator "Only N rubles left for free shipping" — a simple thing, but increases average order value by 5–12%. Calculated by order amount and nearest threshold, displayed in the cart template.

How to automate tracking, pickup, and courier delivery?

Tracking. Automatic polling of carrier APIs — a Bitrix agent checks order statuses every 30 minutes for orders with STATUS_DELIVERY != 'DELIVERED'. Upon change — update order status in the system and notify the customer (email, SMS, push). Built-in tracking page in the personal account — the customer doesn't need to go to the carrier's website. Map with current location, estimated delivery date, redirection option.

Pickup. Own pickup points on the map: addresses, schedule, contacts. Search for the nearest by customer address. Real-time availability check, reservation until a specific time. QR code for quick pickup and SMS about readiness.

Courier delivery. Delivery zones with different costs. 2-hour slots, courier schedule management, order limit per slot. Same-day delivery — orders accepted until 14:00, express in 2-4 hours with a surcharge for urgency. Integration with navigation for route optimization.

Multi-warehouse. Multiple warehouses with addresses and service zones. Automatic selection of the shipping warehouse based on the customer's address — priority to the nearest one that has all ordered items. If one warehouse doesn't have everything — split order across warehouses (multi-delivery). Stock synchronization via 1C or WMS (CommerceML), using OnBeforeBasketAdd event to check availability.

Comparison of transport companies

Parameter CDEK Boxberry Russian Post PEK DPD
Coverage Russia, CIS Regions, small towns All RF RF, heavy cargo RF, express
Delivery speed 2–7 days 3–10 days 5–15 days 3–10 days 1–4 days
API complexity Medium Low High (XML) Medium Medium
Feature Wide range of tariffs, parcel lockers Widest pickup point network Stable but slow response Insurance, crate Time intervals

What stages does connecting delivery services consist of?

  1. Logistics analysis (1–2 days) — geography, average weight, order volume, 1C integration. We recommend a combination of carriers.
  2. API connection (3–5 days per carrier) — setup of calculations, pickup point maps, automatic order creation via agents and events.
  3. Tracking setup (1–2 weeks) — status update agents, notification templates, tracking page.
  4. Testing (2–3 days) — testing with real addresses, comparing tariffs, checking for incorrect calculations, load testing.
  5. Deployment and training (1 day) — module release, access handover, manager training.
  6. Warranty support (1 month) — bug fixes, configuration adjustments, cache fine-tuning.

Estimated implementation timelines

Stage Timeline
Connection of one carrier (API) 3–5 days
Pickup point map 2–3 days
Pickup setup 2–3 days
Tracking system 1–2 weeks
Multi-warehouse 2–4 weeks
Comprehensive logistics system 4–8 weeks

Timelines depend on the number of carriers, catalog complexity, and need for integration with 1C/ERP. Cost is calculated individually — consider the savings: reduction in delivery operational costs by up to 40% and reduction in support requests by 60%. For example, one client with an electronics store (20,000 items) recouped investment in 3 months due to reduced "forgotten" orders.

Ready to accelerate your online store's logistics? Contact us — we'll help select the optimal carrier combination for your assortment and budget. Request a consultation, and we'll prepare a proposal within 1 business day.