1С-Bitrix Partner Cabinet Module: Attribution and Commissions

Imagine: an online store with 5000 orders per month, 30% of sales from partners. Each manager spends 10 hours per week manually calculating commissions and reconciling data. Attribution errors cause disputes and partner churn. Our module for 1С-Bitrix automates attribution and commissions. Partners

Our competencies:

Frequently Asked Questions

Imagine: an online store with 5000 orders per month, 30% of sales from partners. Each manager spends 10 hours per week manually calculating commissions and reconciling data. Attribution errors cause disputes and partner churn. Our module for 1С-Bitrix automates attribution and commissions. Partners log into their personal account, see statistics, generate links, and track payouts—with no manager involvement. In 4–5 weeks, you get a module that pays for itself in the first month. Attribution accuracy is 98%, commission accrual is automatic. We have 5+ years of experience developing partner modules for Bitrix, with 30+ projects completed. Manager time savings: up to 40 hours per month.

How Attribution Works

The main challenge is attribution. You need to accurately determine which order came from which partner, even if the user clicked a link a week ago, closed the browser, reopened it, and only then purchased. The module solves attribution at two levels.

Cookie Attribution

When a user clicks a referral link (?ref=PARTNER_CODE), a cookie partner_ref is written to the browser with a TTL of 30–90 days (configurable). The cookie is HttpOnly so JavaScript cannot modify it.

UTM Attribution

Simultaneously, the partner code is stored in the session. When an order is placed, the OnSaleOrderAdd event reads both sources, determines attribution, and writes a custom field PARTNER_CODE into b_sale_order_props. Additionally, UTM parameters are used for tracking marketing campaigns.

// Пример обработчика атрибуции \Bitrix\Main\EventManager::getInstance()->addEventHandler('sale', 'OnSaleOrderAdd', function(\Bitrix\Main\Event $event) { $order = $event->getParameter('ENTITY'); $partnerCode = $_COOKIE['partner_ref'] ?? $_SESSION['partner_ref']; if ($partnerCode) { $order->setField('PARTNER_CODE', $partnerCode); } }); 

All partner codes, commissions, and payout statuses are stored in the module's tables:

  • myvendor_partner – partner profiles
  • myvendor_partner_order – order-partner link, commission amount
  • myvendor_partner_payout – payout history

Why Flexible Commission Calculation Is Critical

This is the business logic with the most variations, and it must be flexible from the start. Commission can depend on:

  • product categories in the order (different percentages for different catalog sections)
  • order amount (progressive scale)
  • partner level (Silver / Gold / Platinum)
  • first-time or repeat customer order

Our automatic commission calculation is 5x faster than manual reconciliation—without errors. For example, for a client with 1000 orders per month, the module processes payouts in one hour, whereas previously it took 3 days.

class CommissionCalculator { public function calculate(\Bitrix\Sale\Order $order, Partner $partner): float { $rules = CommissionRuleTable::getActiveRules($partner->getLevel()); $commission = 0.0; foreach ($order->getBasket() as $item) { $rule = $this->matchRule($rules, $item->getProductId()); $commission += $item->getPrice() * $rule->getRate() / 100; } return round($commission, 2); } } 

The calculation is triggered in the OnSaleOrderPaid handler—commission accrues only on paid orders. On return (OnSaleOrderStatusChange), commission is automatically reversed. This approach eliminates errors and manual reconciliation. Commission rates can range from 5% to 30% depending on rules.

Partner Personal Account

The cabinet is built on standard Bitrix components with custom templates. Authorization uses the standard user mechanism (b_user) but with an additional check: the user must belong to the "Partners" group (b_user_group).

Statistics section. Shows for a selected period: number of clicks, number of completed orders, total commission amount. Data is aggregated by an agent once per hour—not queried in real time. This is a key performance decision for a large number of partners (up to 5000).

Referral links. The partner enters any site URL, the module appends ?ref=CODE and displays the ready link. Additionally, UTM link generation with pre-filled parameters is available.

Promotional materials. An infoblock with banners of various sizes. The partner selects a banner, gets the HTML code to embed—the link in the banner already contains their referral code.

Admin Module

The administrator sees: a list of all partners with cumulative statistics, a payout queue (partners with accumulated commission above a threshold), and payout history. Payout is recorded manually—the admin clicks "Paid", specifies the method and date, the system changes the status and sends an email to the partner.

Development Process

  1. Analysis – clarify requirements, attribution and commission schemes, cabinet prototype.
  2. Design – database architecture, API interfaces, integration with current site.
  3. Implementation – module development, caching configuration, tagging.
  4. Testing – unit tests for commissions, load testing for attribution.
  5. Deployment – install on server, configure agents, hand over documentation.
  6. Documentation and training – hand over docs, train managers.
Stage Content
Analysis Clarify requirements, attribution/commission schemes, cabinet prototype
Design DB architecture, API interfaces, integration with current site
Implementation Module development, caching configuration, tagging
Testing Unit tests for commissions, load testing for attribution
Deployment Install on server, configure agents, hand over documentation

What's Included

After completion, we deliver:

  • API and architecture documentation
  • Server and admin panel access
  • Manager training
  • 1 month of warranty support

Our Experience and Guarantees

We have 5+ years of 1С-Bitrix development, with 30+ partner modules implemented across various niches—from online stores to B2B platforms. We guarantee the module works stably under load, correctly handles attribution, and does not slow down the site. All code undergoes code review and meets Bitrix standards. Example: for a client with 1000 orders per month, the module processes payouts in one hour, saving 40 manager hours monthly.

Development Timelines

Scope Composition Timeline
Basic Cabinet + attribution + fixed commission 4–5 weeks
Medium + multi-level rules + promotional materials + payouts 7–9 weeks
Extended + multi-level marketing (2nd tier) + API for integrations 10–14 weeks

The key question before starting: is a multi-level structure needed (partner recruits sub-partners)? If yes, the data schema changes radically.

Official OnSaleOrderPaid documentation

Contact us for a project evaluation. We'll assess it in 1 day and propose the optimal solution. Order the module development today and get a consultation on commission structure and attribution without prepayment. If you already have requirements—send them over, and we'll prepare a commercial proposal.