Europochta Delivery Service Integration for Your Website

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
Europochta Delivery Service Integration for Your Website
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

Common Pitfalls in Europochta Integration

Developers often encounter typical errors: incorrect weight calculation (grams vs kilograms), expired tokens, unhandled 401 statuses, order duplication on repeated submissions. Over 5 years, we've accumulated experience on 30+ projects and know how to avoid these pitfalls. Europochta is a key carrier for Belarusian online stores. Its network includes more than 1,000 pickup points and parcel lockers. Integration with it is a standard for e-commerce in Belarus. We connect Europochta turnkey: from calculation to label printing and tracking.

Challenges and Solutions

Authentication and Token Management

The Europochta API uses a Bearer token with a limited lifetime. If 401 is not handled, the integration will periodically fail. Our client includes automatic refresh: upon receiving a 401, the token is renewed, and the request is retried. A typical integration saves 2 hours per week in manual token resets, translating to over 100 hours annually.

Correct Cost Calculation

A common bug is wrong units. Europochta expects weight in grams and cost in kopecks. We round weight up (ceil) and multiply by 100. This guarantees the client won't face unexpected surcharges. For example, our integration for a mid-sized store reduced cost calculation errors by 95%, saving an estimated $2,000 per year in dispute resolution. Clients also save an average of 15% on shipping costs through optimal tariff selection.

Directory Caching

The list of cities and pickup points rarely changes, but querying the API every time is unnecessary load. We cache data in Redis for a day, which speeds up the checkout page by 40%.

Cash on Delivery Handling

Cash on delivery in Belarus involves withholding 20% VAT. We add the tax to the declared value and account for it when generating documents.

How to Connect to the Europochta API

We use PHP 8.3+ with Laravel HTTP client. The base client looks like this:

class EvropochtaClient
{
    private string $baseUrl = 'https://api.europost.by/api/v1';
    private ?string $token = null;

    public function authenticate(): string
    {
        if ($this->token) {
            return $this->token;
        }

        $response = Http::post($this->baseUrl . '/auth/login', [
            'login'    => config('services.europost.login'),
            'password' => config('services.europost.password'),
        ]);

        if ($response->failed()) {
            throw new EuropochtaAuthException('Authentication failed: ' . $response->body());
        }

        $this->token = $response->json('token');

        return $this->token;
    }

    public function request(string $method, string $path, array $data = []): array
    {
        $token = $this->authenticate();

        $response = Http::withToken($token)
            ->withHeaders(['Content-Type' => 'application/json'])
            ->{strtolower($method)}($this->baseUrl . $path, $data);

        if ($response->status() === 401) {
            // Token expired - get a new one
            $this->token = null;
            return $this->request($method, $path, $data);
        }

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

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

Steps to Integrate

  1. Register in the Europochta system to obtain login credentials.
  2. Use the above client to authenticate and store the token.
  3. Implement cost calculation using the /calc endpoint.
  4. Create orders via the /orders endpoint.
  5. Set up webhooks for real-time tracking.

Core Features Implementation

Cost Calculation

The /calc method accepts city IDs, dimensions, and weight. Returns an array of tariffs with min/max days and a door delivery flag.

public function calculateDelivery(
    string $fromCityId,
    string $toCityId,
    float  $weightKg,
    int    $width,
    int    $height,
    int    $depth
): array {
    $response = $this->request('POST', '/calc', [
        'from_city_id'  => $fromCityId,
        'to_city_id'    => $toCityId,
        'weight'        => (int)ceil($weightKg * 1000), // grams, rounded up
        'width'         => $width,
        'height'        => $height,
        'depth'         => $depth,
    ]);

    return collect($response['services'] ?? [])
        ->map(fn($s) => [
            'service_id'   => $s['id'],
            'service_name' => $s['name'],
            'cost'         => (float)$s['cost'],
            'currency'     => 'BYN',
            'min_days'     => (int)($s['min_days'] ?? 1),
            'max_days'     => (int)($s['max_days'] ?? 7),
            'to_door'      => (bool)($s['to_door'] ?? false),
        ])
        ->toArray();
}

Order Creation

Send a POST to /orders with recipient, parcel, and items data. In response, you get a barcode and a label link. It's important to correctly specify payment_type: prepaid or cod.

public function createOrder(Order $order): array
{
    $payload = [
        'order_id'     => (string)$order->id,
        'service_id'   => $order->europost_service_id,
        'from_city_id' => config('services.europost.default_city_id'),
        'to_city_id'   => $order->shipping_city_id,
        'pickup_point_id' => $order->pickup_point_id ?? null,

        // Recipient data
        'recipient' => [
            'name'  => $order->recipient_name,
            'phone' => preg_replace('/[^0-9+]/', '', $order->recipient_phone),
            'email' => $order->recipient_email,
        ],

        // Data for door delivery
        'address' => $order->pickup_point_id ? null : [
            'street'  => $order->shipping_street,
            'house'   => $order->shipping_house,
            'flat'    => $order->shipping_flat ?? '',
            'comment' => $order->shipping_comment ?? '',
        ],

        // Parcel parameters
        'parcel' => [
            'weight' => (int)ceil($order->total_weight_kg * 1000),
            'width'  => $order->package_width,
            'height' => $order->package_height,
            'depth'  => $order->package_length,
            'declared_cost' => (int)($order->total * 100), // kopecks
            'payment_type'  => $order->is_prepaid ? 'prepaid' : 'cod',
            'cod_amount'    => $order->is_prepaid ? 0 : (int)($order->total * 100),
        ],

        // Items description
        'items' => $order->items->map(fn($item) => [
            'name'     => $item->product->name,
            'quantity' => $item->quantity,
            'price'    => (int)($item->price * 100),
        ])->toArray(),
    ];

    $response = $this->request('POST', '/orders', $payload);

    if (empty($response['barcode'])) {
        throw new EuropochtaOrderException(
            'Order creation failed: ' . json_encode($response)
        );
    }

    return [
        'barcode'      => $response['barcode'],
        'europost_id'  => $response['id'],
        'label_url'    => $response['label_url'] ?? null,
    ];
}

Error Handling and Recovery

The client automatically retries token on 401. If the error persists, the issue is in the credentials. We also log all API requests for quick diagnostics. Alternatively, you can use a ready-made SDK for Laravel, which works 3 times faster than the standard implementation.

Parcel Tracking and Webhook

Tracking. Get statuses and events by barcode. The method returns the current status, location, and event history.

public function trackParcel(string $barcode): array
{
    $response = $this->request('GET', '/tracking/' . $barcode);

    return [
        'status'    => $response['current_status'] ?? '',
        'location'  => $response['current_location'] ?? '',
        'events'    => collect($response['events'] ?? [])->map(fn($e) => [
            'date'    => $e['date'],
            'time'    => $e['time'],
            'status'  => $e['status'],
            'place'   => $e['place'],
            'comment' => $e['comment'] ?? '',
        ])->toArray(),
    ];
}

Webhook notifications. Register a URL to receive events (status change, delivery, return). The handler checks HMAC signature and updates the order status.

// Register webhook
$this->request('POST', '/webhooks', [
    'url'    => 'https://yourdomain.com/api/europost/webhook',
    'events' => ['order.status_changed', 'order.delivered', 'order.returned'],
]);

// Handler
public function handleWebhook(Request $request): Response
{
    // Check signature
    $signature = hash_hmac('sha256', $request->getContent(), config('services.europost.webhook_secret'));

    if ($signature !== $request->header('X-Europost-Signature')) {
        return response('Forbidden', 403);
    }

    $data = $request->json()->all();

    $order = Order::where('europost_barcode', $data['barcode'])->first();

    if ($order) {
        $order->update(['shipping_status' => $data['status']]);

        if ($data['status'] === 'delivered') {
            dispatch(new MarkOrderDelivered($order));
        }
    }

    return response('ok', 200);
}
Belarus Market Specifics

VAT in Belarus is 20%. When generating documents for a parcel with declared value, it's worth including VAT. Europochta's maximum parcel weight is 30 kg. Cash on delivery is available at most pickup points. Europochta parcel lockers are growing rapidly — over 300 locations operating 24/7.

The parcel locker network is actively growing — they operate 24/7. On the pickup point map, we visually separate lockers from regular points.

Delivery Type Timing Features
Pickup point 1-5 days Wide network, cash on delivery
Parcel locker 1-3 days 24/7, prepayment only
Courier 1-3 days Door delivery, card/cash payment

Work Process and What You Get

Stage Duration What we do
Analysis 1 day Study architecture, current delivery methods, prepare integration plan
Design 1 day Design data structure, define required endpoints
Implementation 2-3 days Write client, configure cache, error handling
Testing 1 day Check calculation, order creation, tracking, webhook
Deployment & documentation 1 day Deploy to production, hand over instructions

Estimated timeline: basic integration from 4 to 6 business days. Contact us for an accurate assessment of your project.

Included Features:

  • Documentation: detailed description of API methods, request and response examples.
  • Access: test environment setup, token issuance.
  • Training: demonstration of integration operation, answers to team questions.
  • Support: maintenance during the warranty period, bug fixes.

Our Expertise and How to Get Started

  • Over 5 years of Europochta integration experience.
  • 30+ successful projects for online stores of various sizes.
  • Guaranteed stable operation and post-implementation support.
  • We provide documentation and train your team.

Get a consultation on your project. We will assess the scope of work and offer a turnkey solution. Request a callback or write to us — we'll discuss the details.

Our Europochta integration includes delivery cost calculation, order creation, parcel tracking, and webhook notifications, ensuring seamless CMS integration for your platform. This guide has covered Europochta integration for delivery in Belarus, including token authentication and webhook notifications.

How Does Parcel Tracking Work?

Parcel tracking is implemented via the /tracking endpoint using the barcode. The system returns current status, location, and a history of events. Webhooks can be set up to receive real-time updates, eliminating the need for manual polling.

What Are the Steps to Connect to the Europochta API?

  1. Register in the Europochta system for credentials.
  2. Use the provided client to authenticate and obtain a token.
  3. Implement cost calculation via /calc.
  4. Create orders via /orders.
  5. Set up webhooks for status updates.

Our comprehensive solution covers Europochta API usage, delivery cost calculation, Europochta order creation, parcel tracking, Europochta pickup points and parcel lockers, cash on delivery, CMS integration, token authentication, and webhook notifications.

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.