1C-Bitrix Integration with Russian Post: API, Normalization, Batches

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
1C-Bitrix Integration with Russian Post: API, Normalization, Batches
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

1C-Bitrix Integration with Russian Post: API, Normalization, Batches

When a Bitrix store starts delivering orders to remote areas, courier services are often helpless — no coverage?

The only operator that reaches every settlement is Russian Post. But integration with its API Otpravka 2.0 is not just POST requests. It involves two-factor authorization, mandatory address normalization according to FIAS, batch mode, and cash on delivery. Without understanding these nuances, parcels go out with errors, and money gets stuck in accounts. The average savings on returns after implementing normalization is 15%, and order processing speed doubles. On one project, savings per month amounted to 120,000 RUB. We have completed dozens of such integrations and compiled a typical solution. Contact us for a consultation to evaluate your project in one day.

We are a team with 10+ years of experience in Bitrix and integrations with Russian Post. Behind us are 50+ projects where the postal API works in production. Below is a technical breakdown of how we do it: from normalization to tracking.

Russian Post API: Operating Principles

Base URL: https://otpravka-api.pochta.ru. Authorization: two tokens simultaneously — Authorization: AccessToken TOKEN and X-User-Authorization: Basic BASE64(login:password). To obtain tokens, you need to register in the Russian Post personal account and create an application. AccessToken is issued automatically, and Basic authorization is formed from the login and password in Base64 format. More details in the official API documentation.

Key method groups:

  • /1.0/user/shipping-points — sender addresses (from where)
  • /1.0/clean/address — address normalization
  • /1.0/tariff — tariff calculation
  • /1.0/user/backlog — batch shipment upload
  • /1.0/batch/{batchName}/shipment — creating shipments in a batch
  • /1.0/shipment/search — tracking by barcode
Shipment TypesThe API supports POSTAL_PARCEL (parcel), EMS, EMS_OPTIMAL, FIRST_CLASS (first class), and small package. The choice of type affects the tariff and delivery time. For cash on delivery, ORDINARY or CASH_ON_DELIVERY is used.

How Address Normalization Works?

The main pain point of Russian Post is the quality of addresses entered by customers. The API requires correct addresses in the FIAS format. Normalization is the first step before any operation. If the address is not normalized (quality-code is not GOOD), the parcel cannot be sent — it will not pass sorting. Our clients save up to 15% on returns thanks to this check.

private function normalizeAddress(string $rawAddress): array
{
    $response = $this->apiPost('/1.0/clean/address', [
        [
            'id'            => 'addr1',
            'original-address' => $rawAddress,
        ]
    ]);

    $normalized = $response[0] ?? [];

    if (($normalized['quality-code'] ?? '') === 'GOOD') {
        return $normalized;
    }

    // Если качество плохое — возвращаем ошибку, не создаём отправление
    throw new \RuntimeException(
        'Адрес не нормализован: ' . ($normalized['quality-code'] ?? 'unknown')
    );
}

Quality codes: GOOD — fully normalized, POSTAL_BOX — PO box, ON_DEMAND — poste restante, UNDEF_* — various normalization problems. Only GOOD guarantees correct delivery.

How to Calculate Tariff?

private function calcTariff(
    array $normalizedAddress,
    int $weightGram,
    string $mailType = 'POSTAL_PARCEL'
): float {
    $response = $this->apiPost('/1.0/tariff', [
        'object-type'        => $mailType,
        'mail-category'      => 'ORDINARY',
        'from-index'         => $this->getOption('FROM_INDEX'), // индекс отправки
        'to-index'           => $normalizedAddress['index'],
        'mass'               => $weightGram,
        'dimension'          => [
            'height' => 200,
            'length' => 300,
            'width'  => 200,
        ],
    ]);

    return ($response['total-rate'] ?? 0) / 100; // копейки → рубли
}

Russian Post returns the cost in kopecks — don't forget to divide by 100. Shipment types: POSTAL_PARCEL (parcel), EMS (express), EMS_OPTIMAL (optimal EMS), FIRST_CLASS (first class). Tariff comparison shows that EMS_OPTIMAL is 30% faster than a regular parcel at a similar cost.

Why Is Batch Mode Mandatory?

Russian Post does not accept single shipments — all parcels are grouped into batches. This simplifies logistics and printing. Batch mode processes up to 1000 shipments in one request, which is 5 times faster than sequential creation. First, a batch is created, then shipments are added to it, after which it is sent to print.

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

    // 1. Получаем или создаём партию
    $batchName = $this->getOrCreateBatch($shipment);

    // 2. Создаём отправление в партии
    $payload = [[
        'address-type-to'     => 'DEFAULT',
        'mail-type'           => 'POSTAL_PARCEL',
        'mail-category'       => 'ORDINARY',
        'mass'                => $this->getWeight($shipment),
        'index-to'            => $this->getNormalizedIndex($props),
        'recipient-name'      => $props->getItemByOrderPropertyCode('FIO')?->getValue(),
        'tel-address'         => $props->getItemByOrderPropertyCode('PHONE')?->getValue(),
        'str-index-to'        => $this->getNormalizedIndex($props),
        'order-num'           => (string)$order->getId(),
        'payment'             => $this->getCashOnDelivery($order), // наложенный платёж
    ]];

    $response = $this->apiPost("/1.0/batch/{$batchName}/shipment", $payload);
    $barcode = $response['result-ids'][0] ?? null;

    if ($barcode) {
        $props->getItemByOrderPropertyCode('POCHTA_BARCODE')?->setValue($barcode);
        $order->save();
    }

    return $barcode ?? '';
}

How to Perform Integration Step by Step

  1. Obtain access tokens in the Russian Post personal account.
  2. Implement address normalization during order checkout.
  3. Implement real-time tariff calculation.
  4. Configure batch shipment creation.
  5. Connect tracking and status updates.
  6. Organize printing of stamps and forms.

Cash on Delivery

Cash on delivery (COD) is a key Russian Post function for e-commerce. The payment field in the request contains the amount to be collected from the customer in kopecks. If no COD is needed — pass 0. With COD, Russian Post deducts a commission of ~2–3% and transfers the remainder to the store's bank account. Transfer time is up to 10 business days. Savings on delivery when using COD due to automation reach up to 20%, which in monetary terms can amount to 50,000 RUB with a turnover of 500,000 RUB.

Tracking via Russian Post API

For automatic status updates, we use cron tasks run once an hour.

public function trackShipment(string $barcode): array
{
    $response = $this->apiGet('/1.0/shipment/search', ['query' => $barcode]);
    $events = $response['trackingData']['trackingItem']['trackingHistoryItem'] ?? [];

    $lastEvent = end($events);
    return [
        'status'    => $lastEvent['humanStatus'] ?? '',
        'date'      => $lastEvent['eventDateTime'] ?? '',
        'city'      => $lastEvent['cityName'] ?? '',
        'barcode'   => $barcode,
    ];
}

Tracking via the main API is rate-limited. For high-load stores, a separate Tracking API with a different quota is used.

Printing Stamps and Forms

After adding shipments to a batch, printing of f7 (address label) and f107/f112 (accompanying documents) is available:

GET /1.0/forms/{barcode}/f7pdf — address label
GET /1.0/batch/{batchName}/checkin — batch submission to the post office

What's Included in the Work?

We use HL-blocks to store integration settings and tagged caching for caching.

Stage Result
Store and cart analysis Determining the data schema: orders, properties, delivery types. Unlike 1C exchange via CommerceML, integration with Russian Post does not require XML parsing.
Address normalization on frontend and backend FIAS hints during checkout, cleaning before sending
Real-time tariff calculation Automatic selection of shipment type by weight and amount
Creating shipments in a batch Barcode generation and linking to orders
Cash on delivery and tracking Automatic status updates in admin panel
Printing stamps and reports Direct printing from order in 1 click

Indicative Timeline

Scope Duration
Tariff calculation + address normalization 3–4 days
+ Shipment creation (batch mode) +2 days
+ Cash on delivery + tracking +2 days
+ Printing stamps in admin section +1 day

Turnkey integration takes 5 to 8 days depending on catalog complexity and individual requirements. Reversibility — when switching to another delivery service, the module is easily replaced.

We guarantee that your parcels will go out with the correct address, barcode, and tariff. Contact us — we will evaluate your project in 1 day and give you a working integration prototype. Get a consultation and a working solution for your store.

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.