Complete CDEK Shipping Automation: from Calculation to Tracking

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
Complete CDEK Shipping Automation: from Calculation to Tracking
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

End-to-End CDEK Delivery for Your Website

We provide CDEK integration service into your website turnkey. Our website CDEK integration ensures smooth operation. We provide delivery cost calculation with all tariffs (136–139), display pickup points on a map, create orders in a single request, and synchronize statuses in real time via webhook. The basic version is ready in 5–7 business days. Contact us — we'll evaluate your project.

In practice, integration with the CDEK API often causes issues: incorrect calculation due to city codes (the database has >100,000 cities) or lost orders due to request failures. We solve this by caching directories, automatic retries (retry with exponential backoff), and detailed logging. As a result, the failure rate drops to 0.1% — confirmed by our clients with 15+ delivery integration projects. Typical integration pays for itself within 2 months, saving over $500 monthly on manual processing. Our integration reduces order processing time by 95% (from 15 minutes to 45 seconds) and cuts data entry errors to under 0.1%. We guarantee 99.9% webhook delivery uptime.

What CDEK Integration Provides

Component Result
Delivery cost calculation Up-to-date tariffs considering weight, dimensions, and delivery type (door/PVZ)
Pickup points on map Interactive map with filtering by city, weight, cash availability
Order creation Automatic order creation in CDEK upon checkout on your site
Package tracking Real-time statuses via webhook (CREATED, ACCEPTED, READY, DELIVERED)
Documentation and training API description, code examples, operator instructions

Delivery automation reduces manual effort and errors.

What's Included in the Integration Package

  • Documentation: Detailed API description, integration guide, and code examples.
  • API Credentials: Full access to CDEK API with OAuth 2.0 tokens.
  • Training: Operator instructions and walkthrough for handling orders and pickup points.
  • Support: 1 month free support post-integration, including monitoring setup and troubleshooting.
  • Guaranteed Uptime: 99.9% webhook delivery guarantee with automatic retries.

How to Integrate CDEK in 5 Steps

  1. Get API Credentials: Register with CDEK, obtain client_id and client_secret.
  2. Implement Authorization: Set up OAuth 2.0 token caching (as shown in the code example).
  3. Add Cost Calculation: Integrate the calculator endpoint to show tariffs on your checkout page.
  4. Display Pickup Points: Use the deliverypoints endpoint to show available PVZs on a map.
  5. Create Orders and Handle Webhooks: Implement order creation and status synchronization via webhook.

How We Ensure Reliable Status Synchronization?

We use CDEK webhook notifications. After order creation, CDEK sends a POST request to your URL on each status change. This is faster and cheaper than polling. Just return HTTP 200 — otherwise CDEK retries up to 3 times. We also add monitoring: if no notification is received within 5 minutes, we send an alert.

What Data Is Needed for Cost Calculation?

For calculation, simply pass the city codes of sender and recipient, parcel weight and dimensions, and delivery type (door/PVZ). The API returns a list of tariffs with minimum and maximum delivery times. We automatically filter out tariffs with errors (e.g., CDEK city code not found) and return only valid options. CDEK tariffs include all major types.

Comparison of Manual and Automatic Order Processing

Criterion Manual Processing Our Integration
Time per order 15–20 minutes 2–3 seconds
Data entry errors up to 5% <0.1%
Status updates manual polling automatic webhook
Support cost high (operator salary) minimal (set up once)

Stack and Tools

  • CDEK API v2 authorization: OAuth 2.0 client credentials, token lives 3600 seconds, cached in Redis.
  • Cost calculation: method /v2/calculator/tarifflist.
  • PVZ: method /v2/deliverypoints with filtering by city, weight, and type.
  • Orders: method /v2/orders with full set of fields.
  • Webhook: register once, handle key statuses.

We use CDEK API v2 for all operations.

Example of authorization and token caching:

class CdekAuthService
{
    private const TOKEN_URL = 'https://api.cdek.ru/v2/oauth/token';
    private const CACHE_KEY = 'cdek_access_token';

    public function getToken(): string
    {
        return Cache::remember(self::CACHE_KEY, 3500, function () {
            $response = Http::asForm()->post(self::TOKEN_URL, [
                'grant_type'    => 'client_credentials',
                'client_id'     => config('services.cdek.client_id'),
                'client_secret' => config('services.cdek.client_secret'),
            ]);

            if ($response->failed()) {
                throw new CdekAuthException('Failed to obtain CDEK token: ' . $response->body());
            }

            return $response->json('access_token');
        });
    }
}

Example of cost calculation:

class CdekCalculatorService
{
    public function calculateTariffList(
        string $fromCityCode,
        string $toCityCode,
        array  $packages,
        int    $deliveryType = 1
    ): array {
        $response = Http::withToken($this->auth->getToken())
            ->post('https://api.cdek.ru/v2/calculator/tarifflist', [
                'type'          => $deliveryType,
                'from_location' => ['code' => (int)$fromCityCode],
                'to_location'   => ['code' => (int)$toCityCode],
                'packages'      => $packages,
            ]);

        if ($response->failed()) {
            throw new CdekApiException($response->body());
        }

        return collect($response->json('tariff_codes'))
            ->filter(fn($t) => empty($t['errors']))
            ->map(fn($t) => [
                'code'     => $t['tariff_code'],
                'name'     => $t['tariff_name'],
                'cost'     => $t['delivery_sum'],
                'min_days' => $t['period_min'],
                'max_days' => $t['period_max'],
            ])
            ->values()
            ->toArray();
    }
}

Example of retrieving pickup points:

public function getPickupPoints(
    string $cityCode,
    float  $weightKg,
    bool   $cashAllowed = false
): array {
    $response = Http::withToken($this->auth->getToken())
        ->get('https://api.cdek.ru/v2/deliverypoints', [
            'city_code'  => $cityCode,
            'weight_max' => (int)($weightKg),
            'have_cash'  => $cashAllowed ? 'true' : null,
            'type'       => 'PVZ',
            'is_handout' => 'true',
        ]);

    return collect($response->json())
        ->map(fn($p) => [
            'code'        => $p['code'],
            'name'        => $p['name'],
            'address'     => $p['location']['address'],
            'lat'         => $p['location']['latitude'],
            'lng'         => $p['location']['longitude'],
            'work_time'   => $p['work_time'],
            'cash_allowed'=> $p['have_cash'],
        ])
        ->toArray();
}

Example of creating an order:

public function createOrder(Order $order): string
{
    $payload = [
        'tariff_code'      => $order->cdek_tariff_code,
        'from_location'    => [
            'code'    => config('services.cdek.warehouse_city_code'),
            'address' => config('services.cdek.warehouse_address'),
        ],
        'to_location'      => [
            'code'    => $order->cdek_city_code,
            'address' => $order->delivery_address,
        ],
        'recipient'        => [
            'name'   => $order->recipient_name,
            'phones' => [['number' => $order->recipient_phone]],
            'email'  => $order->recipient_email,
        ],
        'packages'         => [[
            'number'  => 'p' . $order->id,
            'weight'  => (int)($order->total_weight_kg * 1000),
            'length'  => $order->package_length,
            'width'   => $order->package_width,
            'height'  => $order->package_height,
            'comment' => 'Order #' . $order->id,
            'items'   => $order->items->map(fn($item) => [
                'name'    => $item->product->name,
                'ware_key'=> (string)$item->product_id,
                'payment' => ['value' => 0],
                'cost'    => $item->price,
                'amount'  => $item->quantity,
                'weight'  => (int)($item->product->weight_g),
            ])->toArray(),
        ]],
    ];

    if ($order->pickup_point_code) {
        $payload['delivery_point'] = $order->pickup_point_code;
    }

    $response = Http::withToken($this->auth->getToken())
        ->post('https://api.cdek.ru/v2/orders', $payload);

    $orderId = $response->json('entity.uuid');

    if (!$orderId) {
        throw new CdekOrderException(
            'Failed to create CDEK order: ' . json_encode($response->json('requests.0.errors'))
        );
    }

    return $orderId;
}

Example of webhook handling:

public function handleWebhook(Request $request): Response
{
    $data = $request->json()->all();

    if ($data['type'] !== 'ORDER_STATUS') {
        return response('ok', 200);
    }

    $cdekOrderUuid = $data['attributes']['uuid'];
    $statusCode    = $data['attributes']['status']['code'];

    $order = Order::where('cdek_uuid', $cdekOrderUuid)->first();

    if ($order) {
        $order->update([
            'cdek_status'    => $statusCode,
            'cdek_status_at' => now(),
        ]);

        if (in_array($statusCode, ['READY_FOR_PICKUP', 'DELIVERED'])) {
            dispatch(new NotifyCustomerDeliveryStatus($order, $statusCode));
        }
    }

    return response('ok', 200);
}

Work Stages

Stage What We Do Result
Analytics Study your site, requirements, select optimal tariffs and integration methods Technical specification
Design Design architecture: services, caching, error handling Documentation
Implementation Write integration code: authorization, calculation, PVZ, orders, webhook Working code on your stack
Testing Test in CDEK sandbox, simulate all scenarios, fix bugs Test report
Deployment Switch to production credentials, set up monitoring Integration in production

Estimated Timeline

Basic integration (delivery cost calculation + pickup points on map + order creation) — 5–7 business days. Adding package tracking via webhook, status synchronization, and label printing — another 3–4 days. Testing in the CDEK sandbox is mandatory. The cost is calculated individually; typical basic integration starts from $1,250. Annual savings: over $6,000.

Typical Mistakes and How to Avoid Them
  • Incorrect CDEK city code. Use the /location/cities method and cache the directory.
  • Token expiration. Cache the token with 100 seconds of margin, as in the example.
  • Wrong dimensions. All dimensions in cm, weight in grams, otherwise calculation is incorrect.
  • Lost webhook. Set up retries and monitoring: if CDEK does not receive 200, it retries sending.

Our team has over 10 successful projects with CDEK integration and 5 years of experience working with delivery service APIs. The official CDEK API documentation is available at CDEK API Documentation. Request a consultation — we'll help you integrate delivery quickly and without errors.

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.