Developing Bonus System in 1C-Bitrix
There's no ready-made bonus system in standard Bitrix. The loyalty program module (loyalty) exists but is limited. For full bonus accumulation and spending system, development is needed: either standard module enhancement, custom module, or integration with specialized service.
What standard loyalty module can do
The loyalty module in Bitrix supports:
- Bonus earning for orders (% of amount)
- Loyalty program levels with different earning percentages
- Bonus spending on order placement (partial payment with points)
Tables: b_loyalty_account (customer account), b_loyalty_account_operation (operation history), b_loyalty_level (program levels).
Standard module limitations: no bonus expiration date, no earning for actions except orders, no flexible earning category management.
Custom bonus system architecture
Custom implementation is built on several components:
Balance and operation storage:
- Table
custom_bonus_account— current user balance - Table
custom_bonus_transaction— history: earning, spending, expiration, operation type, date, order
Bonus earning:
Handler for OnSaleOrderPaid event (main module) — awards bonuses after payment confirmation:
AddEventHandler('sale', 'OnSaleOrderPaid', function($order) {
$userId = $order->getUserId();
$sumOrder = $order->getPrice();
$bonusRate = getBonusRateForUser($userId); // earning %
$bonusAmount = round($sumOrder * $bonusRate / 100);
addBonusTransaction($userId, $bonusAmount, 'EARN', $order->getId());
});
Bonus spending:
Additional payment method (b_sale_pay_system) with handler decreasing balance and recording SPEND type transaction.
Bonus expiration:
Agent running daily, checking transactions with EXPIRE_DATE field and canceling expired bonuses via EXPIRE type transaction.
Loyalty program levels
| Level | Accumulated amount | Earning percentage |
|---|---|---|
| Standard | 0–10,000 rubles | 3% |
| Silver | 10,000–50,000 rubles | 5% |
| Gold | from 50,000 rubles | 7% |
Level is recalculated on each completed order — agent or event handler checks total user purchases for period and updates their level in b_user via UF_BONUS_LEVEL field.
Personal account: bonus history
Component in personal account shows:
- Current balance
- Transaction history with operation types
- Expiration date of nearest bonuses
Data is read from custom_bonus_transaction filtered by USER_ID.
Integration with external loyalty platforms
Alternative to own development — integration with ready-made platforms: Mindbox, Passteam, UDS Game. Bitrix sends events (purchase, registration) via webhooks or REST API to platform, it manages balance and returns bonus information for display in personal account. Plus — ready analytics. Minus — third-party service dependency and monthly payment.
Estimated timeframes
| Scope | Timeframe |
|---|---|
| Basic system: earning + spending + personal account | 2–3 weeks |
| With levels, expiration date, analytics | 4–6 weeks |
| Integration with external loyalty platform | 1–2 weeks |







