Dostavista API Integration: Cost Calculation, Ordering, Courier Tracking
Losing orders due to missing delivery cost calculations is a reality for 30% of online stores. Customers leave if they don't see an exact price. Integrating Dostavista solves this: the API allows calculating costs, creating orders, and tracking couriers in real time. Our accumulated experience (15+ projects) ensures stable operation without surprises. Average delivery cost savings compared to traditional services are 25%. Contact us for a project assessment — we'll propose the optimal solution.
Why Integrate Dostavista?
Dostavista is a crowdsourcing platform that delivers 2x faster than traditional courier services. A flexible transport type system lets you transport anything from documents to large furniture. The API provides all necessary methods: cost calculation, order creation, status tracking. We use our 10+ years of web development experience for reliable integration. According to our data, cart conversion increases by 15% on average after integration.
Dostavista API Methods
Dostavista provides a REST API with authorization via X-User-Email and X-User-Token. A sandbox environment is available at robotapitest.dostavista.ru. Before using, create an account and get an API token from your personal cabinet. The API has a limit of 10 requests per second per account. Exceeding it returns 429 Too Many Requests, so use caching for calculations. For more details, see the Dostavista API Documentation.
How to Calculate Delivery Cost
POST /api/business/v1/calculate-order
{
"matter": "Документы",
"insurance_amount": "0",
"vehicle_type_id": 1, // 1=пешеход, 2=велосипед, 3=мотоцикл, 8=авто
"points": [
{
"address": "Москва, Тверская, 1",
"client_order_id": "pickup"
},
{
"address": "Москва, Арбат, 10",
"client_order_id": "delivery"
}
]
}
The response includes delivery_fee_amount in kopecks — the delivery cost. We recommend adding a small buffer (+5–10%) to the displayed cost, as the final price may slightly differ due to dynamic pricing. Cache results for 1 minute to reduce requests.
How to Create an Order
POST /api/business/v1/create-order
{
"matter": "Одежда",
"vehicle_type_id": 3,
"backpay_amount": "0", // наложенный платёж
"points": [
{
"address": "Москва, Складской переулок, 5",
"contact_person": {"phone": "+79001234567", "name": "Склад"},
"taking_amount": "0",
"note": "Позвонить за 15 минут"
},
{
"address": "Москва, Ленина, 20, кв 5",
"contact_person": {"phone": "+79007654321", "name": "Покупатель"},
"is_door_to_door": true,
"note": "Код домофона: 456"
}
]
}
If vehicle_type_id is invalid, the API returns a 400 error. Use a unique client_order_id for idempotency — this prevents duplicate orders on retries.
Configuring Webhooks for Notifications
- In your Dostavista personal cabinet, specify the URL of your endpoint to receive POST requests.
- Implement event handling:
order.created, order.status_changed, order.finished.
- The webhook sends JSON with fields:
order_id, status, courier_latitude, courier_longitude.
- Ensure your server responds with 200 OK within 5 seconds — on timeout, the context is retried up to 3 times.
- Test in the sandbox environment by imitating different statuses. For local debugging, use services like webhook.site or ngrok.
Real-Time Courier Tracking
Order statuses can be tracked via polling (GET /api/business/v1/orders/{id}) or webhooks. Current statuses:
| Status |
Description |
| new |
Order created, awaiting courier assignment |
| available_for_couriers |
Available for couriers to take |
| active |
Courier assigned, delivering |
| finished |
Delivery completed |
| delayed |
Execution delayed |
| courier_not_found |
Failed to assign courier |
| canceled |
Canceled |
The response includes courier_latitude and courier_longitude — courier coordinates. Use JavaScript libraries like Leaflet to display on a map.
Choosing a Transport Type
Dostavista allows selecting transport based on cargo:
| Type |
What it transports |
Example |
| Pedestrian |
Small documents, envelopes |
Contracts, letters |
| Bicycle |
Small parcels, food |
Lunches, flowers |
| Motorcycle |
Urgent cargo up to 5 kg |
Spare parts, documents |
| Car |
Large items, multiple boxes |
Furniture, electronics |
On the frontend, implement this as an extra step during delivery selection or automatically based on product dimensions.
Error Handling
| HTTP Status |
Error Code |
Cause |
Solution |
| 400 |
INVALID_PARAMETER |
Invalid vehicle_type_id or empty address |
Validate on the frontend |
| 401 |
UNAUTHORIZED |
Invalid token |
Check X-User-Token in your cabinet |
| 409 |
ORDER_EXISTS |
Order with that client_order_id already exists |
Use unique identifiers |
| 429 |
TOO_MANY_REQUESTS |
Request limit exceeded |
Implement caching or reduce frequency |
| 500 |
INTERNAL_ERROR |
Temporary server failure |
Retry after 3 seconds |
Turnkey Integration Includes
- Requirements analysis and API key setup
- Delivery cost calculation on the website
- Order form with transport type selection
- Courier tracking on a map
- Webhook notifications for status changes
- Testing and debugging in sandbox environment
- Documentation and handover of access
Work Stages
-
Analysis and design — 1 day. Gather requirements, connect sandbox.
-
Integration development — 2–3 days. Implement calculation, order creation, tracking.
-
Testing and deployment — 1 day. Check all scenarios, including API errors.
Integration Timeline
Basic integration with calculation and order creation takes 2 to 3 business days. With map tracking and webhook handling, it takes 4 to 5 days. Exact timelines depend on your project's complexity. For example, for a coffee shop chain we integrated in 3 days, reducing delivery time by 30%.
Our experience (10+ years in web development, 15+ courier service integrations) guarantees reliability and on-time delivery. Get your project evaluated — we will suggest the best solution. Contact us to assess your project — we'll propose the optimal solution.
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.