Setting Up the Product Storefront on VKontakte for 1C-Bitrix
VKontakte allows connecting a shop directly to a community via the "Products" section. Buyers see product cards with prices without leaving the social network. Bitrix can synchronise the catalogue with VK via API, but this works out of the box only with the correct configuration of the catalog module and properly filled product data.
How the Integration Works
VKontakte accepts products via the VK API: the market.add method adds a product, market.edit updates it, and market.delete removes it. Each product is linked to an owner_id — the negative identifier of the community. Photos are sent separately via photos.saveMarketPhoto and photos.getMarketUploadServer.
On the Bitrix side there is a ready-made module socialservices containing the class CSocServVkontakte. However, a full-featured product storefront works through the sale module together with the bitrix:sale.export.vk component. This component generates a YML feed for VK — the format is similar to Yandex.Market but with a number of differences in the <offer> structure.
What to Prepare in the Catalogue
Before setting up the storefront, the required product fields are checked:
- Name — up to 100 characters, no special symbols
- Description — up to 4,096 characters
- Price — numeric value without formatting, currency RUB
- Photo — at least one, resolution from 400×400 px, JPG/PNG formats
- Category — a link to an info block section is mandatory
The b_iblock_element table stores catalogue elements, and b_catalog_price stores prices linked to CATALOG_GROUP_ID. The base price group (usually ID=1) is used for the VK storefront.
Configuring the Export
The bitrix:sale.export.vk component is placed on a separate site page (e.g. /vk-export/). The component parameters include:
-
IBLOCK_ID— catalogue info block ID -
PRICE_ID— price type ID for export -
SECTION_ID— root section (if partial export is needed) -
USE_CML2_QUANTITY— use stock fromb_catalog_store_product
For automatic synchronisation, an agent is configured via CAgent::Add() or a cron job — typically once every 1–4 hours. The agent triggers an update via the VK API, comparing product data hashes with the last saved state.
Authorisation via VK API
In the VKontakte application settings (vk.com/editapp) a Standalone application is created. The token with market, photos, groups permissions is saved in the module settings:
Settings → Product Settings → VK Market → Access Key
The token is stored in b_option under the socialservices module. The token lifetime is 1 year for server applications, so a renewal mechanism must be planned.
Common Issues
Photos fail to upload — most often because the image URL is not accessible externally (local development, closed server). The VK API fetches photos via HTTP, so images must be on a public URL.
Products duplicate on every synchronisation if the element_id → vk_item_id mapping is not saved. A UF field UF_VK_ITEM_ID in the info block or a separate mapping table is set up for this.
| Catalogue size | Initial upload | Regular synchronisation |
|---|---|---|
| Up to 500 products | 1 day | Configured immediately |
| 500–5,000 products | 2–3 days | From 1 hour |
| More than 5,000 products | From 5 days | Requires a task queue |
What Is Included in the Setup
- Creating and configuring the VKontakte application, obtaining the token
- Placing and configuring the
bitrix:sale.export.vkcomponent - Configuring the Bitrix → VK category mapping
- Initial product upload with per-card verification
- Configuring the agent for automatic synchronisation
- Creating the UF field for storing the VK product ID







