Integrating 1C-Bitrix with Competera (Price Monitoring)
Competera is a dynamic pricing and competitor monitoring platform. Its core consists of machine learning algorithms that analyse competitor data and demand elasticity to generate price recommendations. The integration goal with 1C-Bitrix is to receive these recommendations and either apply them automatically or present them to the category manager for manual approval.
Competera API
Competera provides a REST API. Base URL: https://api.competera.io/v1/. Authentication via an API key in the X-Api-Key header. Key endpoints:
-
GET /products— product catalogue in Competera -
POST /products/upload— upload/update catalogue -
GET /repricing/recommendations— pricing recommendations -
POST /prices/upload— upload current store prices -
GET /competitors/prices— competitor prices for your products
Synchronizing the 1C-Bitrix Catalogue to Competera
Competera requires your product catalogue: SKU, name, EAN, current price, cost price (optional). Format — CSV or JSON.
An agent exports changes once per day (or on product update):
function SyncCatalogToCompetera(): string
{
$products = \CIBlockElement::GetList(
['ID' => 'ASC'],
['IBLOCK_ID' => CATALOG_IBLOCK_ID, 'ACTIVE' => 'Y'],
false,
['nPageSize' => 1000],
['ID', 'NAME', 'PROPERTY_ARTICLE', 'PROPERTY_BARCODE']
);
$rows = [['sku', 'name', 'ean', 'price', 'cost', 'category']];
while ($product = $products->GetNext()) {
$price = \CCatalogProduct::GetOptimalPrice($product['ID'])['PRICE']['PRICE'] ?? 0;
$cost = \CIBlockElement::GetProperty(CATALOG_IBLOCK_ID, $product['ID'], [], ['CODE' => 'COST_PRICE'])->Fetch()['VALUE'] ?? 0;
$rows[] = [
$product['PROPERTY_ARTICLE_VALUE'],
$product['NAME'],
$product['PROPERTY_BARCODE_VALUE'],
$price,
$cost,
$product['SECTION_NAME'],
];
}
$csv = implode("\n", array_map('str_getcsv', $rows));
$competera->post('/products/upload', ['file' => $csv, 'format' => 'csv']);
return __FUNCTION__ . '();';
}
Retrieving Recommendations and Applying Prices
GET /repricing/recommendations returns an array with recommended prices, reasons for change, and the algorithm's confidence score:
{
"recommendations": [
{
"sku": "ART-12345",
"current_price": 4990.00,
"recommended_price": 4750.00,
"reason": "competitor_undercut",
"confidence": 0.87,
"competitor_min": 4720.00
}
]
}
The application logic depends on settings:
foreach ($recommendations as $rec) {
$product = ProductRepository::findBySku($rec['sku']);
if (!$product) continue;
$autoApply = (bool)\Bitrix\Main\Config\Option::get('competera', 'auto_apply_' . $product['SECTION_ID'], false);
$minConfidence = (float)\Bitrix\Main\Config\Option::get('competera', 'min_confidence', 0.8);
if ($autoApply && $rec['confidence'] >= $minConfidence) {
// Apply automatically
\CCatalogProduct::Update($product['ID'], ['PRICE' => $rec['recommended_price']]);
\CCatalogProduct::SetPrice($product['ID'], BASE_PRICE_TYPE_ID, $rec['recommended_price']);
PriceChangeLog::write($product['ID'], $rec['current_price'], $rec['recommended_price'], 'competera_auto');
} else {
// Queue for manager approval
CompeteraPendingTable::add([
'PRODUCT_ID' => $product['ID'],
'CURRENT_PRICE' => $rec['current_price'],
'RECOMMENDED' => $rec['recommended_price'],
'CONFIDENCE' => $rec['confidence'],
'REASON' => $rec['reason'],
'STATUS' => 'pending',
]);
}
}
Recommendation Approval Interface
In the 1C-Bitrix admin panel — a "Competera Recommendations" page with a table:
| Product | SKU | Current price | Rec. price | Change | Competitor min | Confidence | Action |
|---|---|---|---|---|---|---|---|
| Philips BHD... hair dryer | ART-12345 | 4990 | 4750 | −4.8% | 4720 | 87% | [Apply] [Reject] |
Clicking "Apply" calls the price update API in 1C-Bitrix and updates the status in bl_competera_pending. Clicking "Reject" sets the status to rejected and the recommendation is not applied.
Timeline
| Phase | Duration |
|---|---|
| Competera API client + authentication | 1 day |
| Catalogue and price synchronization | 2 days |
| Recommendations retrieval + application logic | 2 days |
| Manager approval interface | 2 days |
| Logging and testing | 1 day |
| Total | 8–10 days |







