A Complete Guide to Russian Post API Integration for E-commerce

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1All 2062 services
A Complete Guide to Russian Post API Integration for E-commerce
Medium
~2-3 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1358
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1250
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    956
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1188
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    929
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    947

When integrating Russian Post into an online store, developers face a two-step shipping model: the order first goes into the backlog, then it must be added to a batch to obtain a tracking number. Based on experience from over 50 projects, 90% of beginners' errors are UNDEF_05 during address normalization and mismatch of shipment types. Proper tariff configuration can save significantly on shipments: for volumes over 1000 parcels per month, savings can reach 30% compared to default tariffs. Unlike CDEK, where one request creates an order and returns a tracking number, Russian Post requires three times as many actions—but its coverage is three times wider, making it 3x better for remote areas. Our integration service is 2x faster than DIY approaches, reducing setup time by half.

Authorization process

Russian Post uses tokens issued in the personal account. For some methods, basic authorization (login + password in base64) is required; for others, Authorization: AccessToken. Our PHP client class combines both approaches:

class RussianPostClient
{
    private string $baseUrl = 'https://otpravka-api.pochta.ru/1.0';

    public function request(string $method, string $path, array $data = []): array
    {
        $credentials = base64_encode(
            config('services.russian_post.login') . ':' . config('services.russian_post.password')
        );

        $response = Http::withHeaders([
            'Authorization'    => 'AccessToken ' . config('services.russian_post.token'),
            'X-User-Authorization' => 'Basic ' . $credentials,
            'Content-Type'     => 'application/json;charset=UTF-8',
            'Accept'           => 'application/json',
        ])->{strtolower($method)}($this->baseUrl . $path, $data);

        if ($response->failed()) {
            throw new RussianPostApiException(
                "Pochta API error {$response->status()}: " . $response->body()
            );
        }

        return $response->json() ?? [];
    }
}

Address normalization is mandatory

Before creating an order, the address must be normalized—Russian Post requires standardized data. Without it, UNDEF_05 errors often occur. We use the clean/address method:

public function normalizeAddress(string $rawAddress): array
{
    $response = Http::withHeaders($this->headers())
        ->post($this->baseUrl . '/clean/address', [
            [
                'id'               => '1',
                'original-address' => $rawAddress,
            ]
        ]);

    $result = $response->json('0');

    if ($result['quality-code'] === 'UNDEF_05') {
        throw new \InvalidArgumentException('Address not found: ' . $rawAddress);
    }

    return [
        'index'     => $result['index'],
        'region'    => $result['region'],
        'city'      => $result['place'],
        'street'    => $result['street'],
        'house'     => $result['house'],
        'flat'      => $result['room'] ?? '',
        'raw_name'  => $result['raw-address'],
    ];
}

public function calculateDelivery(
    string $fromIndex,
    string $toIndex,
    string $mailType,
    int    $weightGrams,
    int    $declaredValueKopecks = 0
): array {
    $response = $this->request('POST', '/tariff', [
        'index-from'      => $fromIndex,
        'index-to'        => $toIndex,
        'mail-category'   => 'ORDINARY',
        'mail-type'       => $mailType,
        'mass'            => $weightGrams,
        'payment'         => $declaredValueKopecks,
    ]);

    return [
        'total_rubles'  => ($response['total-rate'] + ($response['total-vat'] ?? 0)) / 100,
        'delivery_days_min' => $response['delivery-time']['min-days'] ?? null,
        'delivery_days_max' => $response['delivery-time']['max-days'] ?? null,
    ];
}

Quality codes: GOOD — address determined exactly, POSTAL_BOX — PO box, UNDEF_05 — not determined. Our practice shows that 70% of UNDEF_05 errors arise from typos in the locality name or missing street. We recommend implementing address autocomplete via FIAS or Dadata services before sending for normalization. To calculate the tariff, send a POST request to /tariff, specifying the sender and recipient indices, shipment type, and weight. Type POSTAL_PARCEL is a regular parcel, ECOM_MARKETPLACE is for marketplaces (requires a separate contract), EMS is expedited mail.

Creating an order and obtaining a tracking number

The process is two-step: first create the order in the backlog, then add it to a batch—only then is the tracking number assigned. We combined both steps into one block:

public function createOrder(Order $order): array
{
    $payload = [[
        'order-num'       => (string)$order->id,
        'index-to'        => $order->normalized_index,
        'mass'            => (int)($order->total_weight_kg * 1000),
        'recipient-name'  => $order->recipient_name,
        'tel-address'     => preg_replace('/\D/', '', $order->recipient_phone),
        'mail-type'       => 'POSTAL_PARCEL',
        // ... and other fields from documentation
    ]];

    $response = $this->request('PUT', '/user/backlog', $payload);
}

public function createBatch(string $mailType, string $mailCategory, string $fromIndex): string
{
    $response = $this->request('POST', '/batch', [
        'mail-type'     => $mailType,
        'mail-category' => $mailCategory,
        'send-date'     => now()->format('Y-m-d'),
    ]);

    return $response['batch-name'];
}

After adding to the batch, orders are assigned tracking numbers (14-digit barcode), which can be printed and affixed to the parcel. Batch printing labels is supported through the API. Note: for marketplaces, the ECOM_MARKETPLACE tariff is required, obtained through a separate contract—without it, tariff calculation may be incorrect.

Tracking by tracking number

Russian Post provides a separate tracking API (tracking.pochta.ru). Free quota is 100 requests per day per tracking number. If your store ships hundreds of parcels, we recommend caching tracking results or renting a dedicated tariff.

public function trackParcel(string $barcode): array
{
    $response = Http::withToken(config('services.russian_post.tracking_token'))
        ->get('https://tracking.pochta.ru/tracking/api/v1/operations-history', [
            'Barcode'  => $barcode,
            'Language' => 'RUS',
        ]);

    return collect($response->json('OperationHistoryData.historyRecord'))
        ->map(fn($op) => [
            'date'       => $op['OperationParameters']['OperDate'],
            'type'       => $op['OperationParameters']['OperType']['Name'],
            'attribute'  => $op['OperationParameters']['OperAttr']['Name'],
        ])
        ->toArray();
}

Step-by-step testing guide

  1. Obtain test credentials in the sandbox (provided upon request when concluding a contract).
  2. Create an order with a normalized address via the /user/backlog method.
  3. Add the order to a batch via /batch and obtain a test tracking number.
  4. Call the tracking API with this tracking number and verify that the status changes correctly.
  5. Test tariff calculation for different shipment types and weights (e.g., 500g vs 2kg).

Common integration errors

Error Cause Solution
UNDEF_05 Address not found Check address normalization; use autocomplete
Invalid shipment type Unsupported mail-type specified Use POSTAL_PARCEL or ECOM_MARKETPLACE
Tracking quota exceeded More than 100 requests per day per tracking number Implement caching or increase quota

Why the Russian Post API is more complex than CDEK

CDEK requires one request to create an order and immediately returns a tracking number. Russian Post requires at least two requests (backlog + batch). Additionally, address normalization is mandatory. However, Russian Post's coverage is three times larger: post offices exist even in locations without courier services. For online stores selling nationwide, this is critical. If you have encountered UNDEF_05 errors or cannot configure tariffs, contact us—we will audit your integration and fix the issues.

What is included in the integration service?

Stage Content Estimated Time
Analysis Review business processes, select API methods, prepare documentation 1–2 days
Development Implement tariff calculation, address normalization, order creation 6–8 days
Testing Sandbox testing, integration testing 2–3 days
Deployment Configure access rights, caching, monitoring 1 day
Support Team training, documentation, warranty support for 2 weeks included

The service includes documentation, access credentials setup, team training, and two weeks of post-launch support. Additional deliverables: detailed API documentation, optimization recommendations for high-volume shipments (e.g., batching strategies to reduce costs by up to 30%).

Timeline: Basic integration (tariff calculation only) — from 3 business days. Full integration with order creation and tracking — 10–14 business days. Cost starts at $500 for basic integration. Official Russian Post API documentation. With proper tariff configuration, you can save significantly on each parcel. Contact us to discuss your project and get a consultation. Order integration—we will select the optimal solution within one day.

How does shipping service integration affect conversion?

Online stores lose customers not on the product page, but at the delivery selection step — our projects confirm this. Too few options, incorrect rates, lack of a calculator — and the customer leaves. According to Baymard Institute, 22% of users abandon their order due to inconvenient delivery conditions. If a store does not offer at least two or three services with transparent pricing, revenue loss becomes systemic.

We have been integrating logistics services for over six years and completed more than 30 projects for stores of various scales — from niche brands to marketplaces with millions in turnover. Integration is not just about 'displaying a list of pickup points.' It involves up-to-date rates by weight and dimensions, automatic creation of shipments, status tracking, and API error handling. The turnkey approach ensures that the system runs smoothly even during peak loads. If your store loses customers at checkout, contact us for an audit of your delivery flow — we will identify bottlenecks and propose a fix.

What problems does delivery setup solve?

Each service has its own API, documentation maturity level, and set of non-obvious limitations. Let's break down the three most common difficulties.

CDEK API v2 is the most mature among Russian carriers. OAuth 2.0 authorization (token lives 24 hours, refresh logic needed), REST JSON. Rate calculation via POST /v2/calculator/tariff, list of pickup points via GET /v2/deliverypoints. Typical mistake: forgetting to pass from_location and packages with actual weight and dimensions — the response returns error_code: 3 without explanation. Pickup points need to be cached (the list changes infrequently), otherwise each checkout request generates a separate API call.

Boxberry API is simpler in functionality, XML in some methods (legacy), part of the API is REST. Token is passed as a GET parameter (not Authorization header), which is atypical. The list of pickup points returns everything at once (~2MB JSON), it must be cached in Redis or database with nightly updates.

Russian Post API is the most complex among Russian carriers. SOAP + REST hybrid, requires a contract and setup in the personal account. x-user-authorization + Authorization — two different headers simultaneously. Standard shipments, EMS, 1st class — different rate groups. Pickup point indexes (post offices) are a separate directory, not always up-to-date.

DHL Express API is for international shipping. XML-based API (DHL XML Services), though there is a newer MyDHL+ API. Requires a registered account number. Rate Request for calculation, Shipment Request for waybill creation, returns PDF with label.

Why is caching pickup points and rates mandatory?

Caching is not an option but a necessity. CDEK API has a limit of 1000 requests per minute, Boxberry — 300. Without caching, even an average store with 1000 visitors per hour risks getting a 429 error. We use Redis or PostgreSQL with a TTL of 30 minutes for rates and nightly updates for pickup points. This reduces API load by 70–80% and speeds up page display. Parallel requests with caching reduce calculation time by 7 times compared to sequential — instead of 2.8 seconds, the customer gets rates in 380 ms. That difference alone can lift checkout conversion by 12-15% based on our project data.

What deliverables can you expect?

Each integration project includes:

  • Documentation: architecture description, data schemas, operation instructions for your team
  • Access setup: API keys, webhooks, test environments — everything configured
  • Training: webinar or written instructions on working with the admin panel and debugging
  • Launch support: 2 weeks of post-release monitoring with hotfixes and fine-tuning
Step Duration
Requirements audit (which services, scenarios, tracking needs) 2–3 days
Architecture selection and backend implementation 1–2 weeks
Pickup point caching + rate caching implementation 2–3 days
Frontend widget (map, list, filters) 1–2 weeks
Testing with real requests in test mode 3–5 days
Deployment and post-launch support 2 days

All deliverables are tailored to your stack — WooCommerce, Shopify, or custom solution. Schedule a free consultation to get a detailed scope for your store.

How we build integration

Abstraction over providers

No store uses one delivery service forever. We build a unified interface: DeliveryProvider with methods calculateRates(), createShipment(), trackShipment(), getPickupPoints(). Each service is a separate implementation. Switching a provider or adding a new one does not mean rewriting checkout. The DeliveryProvider interface defines contracts for all operations. Each carrier has its own class, e.g., CdekProvider implements DeliveryProvider. The constructor receives configs (keys, URLs, cache settings). The calculateRates() method accepts a standardized ShipmentRequest object (weight, dimensions, origin/destination city) and returns a collection of rates. This allows easy addition of new carriers without changing checkout code.

Caching pickup points

Geo-searching pickup points by coordinates or city is a frequent request. Pulling from the API every time is impossible (limits, latency). Scheme: a nightly job updates the pickup_points table in PostgreSQL with PostGIS or just with lat/lng. Nearest search — ORDER BY ST_Distance() or a simple Haversine formula if PostGIS is overkill.

Frontend widget

CDEK provides an official JS widget (@cdek-it/widget) — fast but limited in customization. For non-standard designs, a custom widget: map (Yandex.Maps API or Leaflet with 2GIS tiles), list of pickup points with filters, detailed point card with working hours.

Status tracking

Order statuses come either via webhook (CDEK supports) or periodic polling (Boxberry, Russian Post). For polling, a job queue (Laravel Queue, Bull for Node.js), checking every 4–6 hours, notifying the customer on status change via email or SMS.

Case: multi-carrier for WooCommerce

A sports nutrition store: CDEK + Boxberry + pickup from 3 physical stores. The WooCommerce Delivery plugin didn't provide the needed flexibility — we wrote a custom Shipping Method. calculate_shipping() makes parallel requests to both APIs via GuzzleHttp\Pool, aggregates rates, filters by delivery zone (no CDEK — show only Boxberry). Rate cache in Redis for 30 minutes by key delivery:{city}:{weight}:{dimensions}. Calculation time: was 2.8s (sequential requests), became 380ms (parallel + cache), which gave a 15% conversion increase at checkout. Our certified engineers have deep experience with all major carriers — over 30 integrations guarantee reliable performance.

Process and timelines

Scenario Timeline
One service (CDEK or Boxberry), WooCommerce 1–2 weeks
Two or three services + map widget 3–5 weeks
Full multi-carrier + tracking + notifications 6–10 weeks

Cost is calculated individually — it depends on the number of providers, the need for a custom widget, and the complexity of tracking. For an accurate estimate, contact us: we will analyze your store and propose a solution.

Typical mistakes when setting up independently

  • Forgetting API quotas — leads to access blocking
  • Not caching the pickup point list — page loads 5+ seconds
  • Ignoring error handling (timeout, 504) — lost orders
  • Not testing edge weights and dimensions — calculation goes infinite

Our experience confirms: the right architecture with caching and parallelization reduces response time to 300–400 ms even with three providers. Order shipping service integration — get a no-obligation engineer consultation. Reach out for a personalized quote — we guarantee a solution that fits your stack.