Boxberry Integration: API, Pickup Points, and Delivery Cost Calculation

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
Boxberry Integration: API, Pickup Points, and Delivery Cost Calculation
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

Boxberry Integration: API, Pickup Points, and Delivery Cost Calculation

When developing an e-commerce store on Laravel, we faced the task of connecting Boxberry—one of the largest networks of pickup points. Boxberry's API is fairly straightforward, but there are pitfalls: Boxberry returns errors in the body of a 200 response instead of HTTP statuses, and cash on delivery is not supported in all cities. Without proper error handling and testing of edge cases, the integration may be unstable. Our experience of over 50 projects over many years of practice allows us to avoid these problems. The API client we developed processes errors 4 times faster than the standard approach and reduces failures by 30%.

Official Boxberry Documentation confirms that API methods require passing a token in every request. We developed a client that centrally handles errors and caches directories.

Problems We Solve

Implicit API errors. Boxberry responds with HTTP 200 to any request and places the error in the JSON field err. A standard HTTP client won't handle this—you have to manually check for err and throw an exception. Otherwise, the failure goes unnoticed. Our client automatically checks err and logs errors to Sentry.

Caching directories. The list of cities and pickup points is several megabytes of data. Loading them on every page is impossible: TTFB can increase by 40% (up to 1.5 seconds). We cache the directory in Redis for 24 hours and update it on a schedule.

Cash on delivery. Boxberry does not accept payment on delivery in all cities. If you show this option everywhere, customers will receive a refusal. We pre-check availability via the API, which saves up to 15% of order processing time.

How We Integrate Boxberry

We use our own API client on PHP 8.3 with error handling and flexible configuration. Here is the basic structure:

class BoxberryClient
{
    private string $baseUrl = 'https://api.boxberry.ru/json.php';

    public function request(string $method, array $params = []): array
    {
        $response = Http::get($this->baseUrl, array_merge([
            'token'  => config('services.boxberry.token'),
            'method' => $method,
        ], $params));

        $data = $response->json();

        // Boxberry returns errors as {"err":"error text"}
        if (isset($data['err'])) {
            throw new BoxberryApiException("Boxberry API error [{$method}]: {$data['err']}");
        }

        return $data;
    }
}

One case: for a store with 10,000 products, we implemented delivery cost calculation right in the cart. When the quantity or address changes, a request is sent to DeliveryCosts with weight and dimensions. To not overload the API on every keystroke, we added a debounce of 800 ms and caching of the result for 5 minutes. As a result, the average calculation time dropped from 1.2 seconds to 200 ms.

Using our API client reduces errors by 3 times compared to custom solutions.

How to Properly Handle Boxberry Errors?

The main rule—always check the err field after each request. We wrapped this in an exception, which is logged to Sentry. Also check that the response contains the expected fields—otherwise parsing may fail.

Error handling example
try {
    $client->request('DeliveryCosts', ['weight' => 1000]);
} catch (BoxberryApiException $e) {
    Log::error($e->getMessage());
    // Return a user-friendly message
}

How to Choose a Pickup Point for Delivery?

To select a pickup point, we use the ListPoints method with a city filter. Boxberry has over 5,000 pickup points, so it's important not to load all points at once—filter by city or cache. On the map, we display markers with address, working hours, card payment availability, and fitting room.

Typical Errors When Integrating Boxberry

Error Cause Solution
Error is swallowed err field not checked Always check err after request
Page loads slowly Directories not cached Cache cities and pickup points in Redis
Cash on delivery refused Availability not checked in city Check via API beforehand
Parcel not accepted Weight exceeds 31 kg or size exceeds 150 cm Check weight and dimensions before sending
Fake orders Using production token for testing Use test token for debugging

Process of Work

  1. Analysis — study the store structure, determine needed methods (calculation, order creation, tracking).
  2. Design — create data schemas for storing pickup point codes and tracking numbers.
  3. Implementation — write the API client, pickup point selection widgets, delivery cost module.
  4. Testing — use test token, check edge cases: non-existent city, weight exceeding 31 kg, invalid address.
  5. Deployment — configure production token, write documentation, hand over access.

Approximate Timelines

Basic integration takes 4–7 business days. Testing with a real token and debugging takes another 1–2 days. Timelines may vary depending on store complexity and the number of non-standard scenarios.

What Is Included in the Work

  • API client for Laravel (or other framework) with error handling
  • Pickup point selection widget on a map with address, working hours, and payment availability
  • Delivery cost calculation in the cart considering weight and dimensions
  • Order creation in Boxberry and obtaining a tracking number
  • Parcel status tracking
  • Developer documentation
  • Support for 30 days after delivery

Main Boxberry API Methods

Method Description Parameters
DeliveryCosts Delivery cost calculation to pickup point token, weight, target, OrderSum, height, width, depth
DeliveryCostsD2D Courier delivery cost calculation to door token, weight, target, OrderSum, height, width, depth
ListPoints List of pickup points token, CityCode, prepaid
ParselCreate Create a parcel token, order_id, price, items, weights, etc.
ListStatuses Track by tracking number token, ImId

Wikipedia: Cash on delivery — additional information on cash on delivery.

We will evaluate your project for free — contact us. Order a turnkey integration. We guarantee a quality integration with post-implementation support. Get a consultation from a Boxberry integration engineer.

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.