Integrating 1C-Bitrix with the 5Post Delivery Service
Pickup points are the main channel for customers to receive goods in the regions. 5Post, a subsidiary of X5 Retail, manages a network of over 15,000 pickup points in "Pyaterochka" and "Perekrestok" stores. However, integration with 1C-Bitrix often causes difficulties: incorrect token handling, unaccounted dimension restrictions, lost webhooks. We offer a ready-made solution — we connect 5Post via REST API from scratch or refine an existing integration. Our team's experience — 5+ years of Bitrix development, 100+ delivery integration projects — ensures you get a stable result and a performance guarantee.
Why Integrate 5Post into 1C-Bitrix?
5Post outperforms many alternatives: its pickup point network is the largest among Russian delivery services, and delivery costs are below market average. For an online store, this means more loyal customers and lower logistics costs. Integration via REST API provides full control — from cost calculation to real-time status tracking.
How to Configure OAuth 2.0 for 5Post?
5Post provides a REST API. Authorization is via OAuth 2.0 (client_credentials). Base production URL: https://api.5post.ru. A test environment is provided upon connection through your 5Post personal account. Getting a token:
$tokenResponse = $httpClient->post('https://api.5post.ru/api/v1/auth/token', [ 'grant_type' => 'client_credentials', 'client_id' => $clientId, 'client_secret' => $clientSecret, ]); $accessToken = $tokenResponse['access_token']; // token valid for 1 hour — cache in b_option The token is valid for 60 minutes, so we cache it in module options and refresh it 5 minutes before expiration. On a 401 error, we automatically request a new token and retry the request. 5Post API documentation details request parameters.
Main API methods:
-
POST /api/v1/orders— create a delivery request -
GET /api/v1/orders/{orderUUID}— get request status -
DELETE /api/v1/orders/{orderUUID}— cancel -
GET /api/v1/pvz— list pickup points with region/city filtering -
POST /api/v1/orders/calc— calculate delivery cost
What to Do When Webhooks Fail?
5Post sends webhooks on status changes. Register the URL in your personal account. Status mapping:
| 5Post Status | Bitrix Order Status |
|---|---|
CREATED |
Submitted for delivery |
IN_TRANSIT |
In transit |
ARRIVED_AT_PVZ |
Awaiting at pickup point |
ISSUED |
Delivered |
RETURNED |
Returned |
CANCELED |
Canceled |
On receiving a webhook, check the X-Signature header (HMAC signature) — 5Post signs requests with the partner's secret key. If the signature does not match, the webhook is ignored and an error is logged.
Example of HMAC signature verification
$signature = $_SERVER['HTTP_X_SIGNATURE']; $payload = file_get_contents('php://input'); $expectedSignature = hash_hmac('sha256', $payload, $secretKey); if (hash_equals($expectedSignature, $signature)) { // process webhook } else { // ignore and log } Module in Bitrix
The delivery class inherits from \Bitrix\Sale\Delivery\Services\Base. Parameters are stored in b_sale_delivery_service_params: CLIENT_ID, CLIENT_SECRET, PARTNER_CODE (5Post partner code).
Cost Calculation
$calcResult = $httpClient->post('/api/v1/orders/calc', [ 'partnerOrder' => [ 'partnerOrderId' => 'SHOP-' . $orderId, 'pvzCode' => $selectedPvzCode, 'dimensions' => [ 'length' => $lengthCm, 'width' => $widthCm, 'height' => $heightCm, 'weight' => $weightGram, ], 'assessedValue' => $assessedValue, ], ]); $deliveryCost = $calcResult['deliveryCost']; For a preliminary calculation (before selecting a specific pickup point), you can pass the locality code instead of the pickup point code — the API will return the base cost by zone.
Loading and Displaying Pickup Points
The list of pickup points is large: over 15,000 objects. Loading strategy:
- Once daily (Bitrix agent) request the current list via
GET /api/v1/pvz. - Save to an HL-block "5Post Pickup Points" with fields: code, name, address, coordinates, working hours, allowed dimensions.
- On the checkout page, filter pickup points by selected city and display on a map.
An important nuance: 5Post pickup points have dimension restrictions. maxDimensionCm and maxWeightGram must be considered during filtering to avoid showing pickup points where the parcel physically cannot fit.
Creating a Request
After selecting a pickup point and placing the order, create a request:
$orderPayload = [ 'partnerOrder' => [ 'partnerOrderId' => 'SHOP-' . $bitrixOrderId, 'pvzCode' => $pvzCode, 'recipientName' => $fullName, 'recipientPhone' => $phone, 'recipientEmail' => $email, 'assessedValue' => $assessedValue, 'cashOnDelivery' => $codAmount, 'dimensions' => $dimensions, 'places' => [ ['barcode' => 'SHOP-' . $bitrixOrderId . '-1', 'description' => 'Place 1'] ], ], ]; The response contains orderUUID — saved in b_sale_order_props. It also returns a label for printing (labelUrl): a PDF with a barcode for the parcel sticker.
Operational Features
5Post does not automatically refund money for unclaimed orders — return conditions must be set in the contract. Shelf life at pickup points is 7 days, after which the parcel is returned. On return, the status in b_sale_order is updated via the same webhook mechanism.
What's Included in the Integration
- OAuth 2.0 setup and token caching
- Development of a delivery class with cost calculation
- Loading and storing pickup points in an HL-block
- Filtering pickup points by city and dimensions
- Webhook processing with HMAC signature verification
- Creating requests and printing labels
- Testing in the 5Post sandbox
- Documentation and training for your manager
Timelines
| Scope | Composition | Duration |
|---|---|---|
| Calculation + request creation | Without pickup point map, only address delivery | 3–4 days |
| + Pickup point map | HL-block + selection widget + dimension filter | +3–4 days |
| + Status webhooks | Handler + mapping | +1–2 days |
Contact us — we will assess your project and provide accurate timelines. We guarantee stable integration: monitoring, error handling, and post-launch support. Get a consultation on integration — we will help configure 5Post for your business.

