Implementing multi-layer fraud protection for Bitrix online stores

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Showing 1 of 1All 1626 services
Implementing multi-layer fraud protection for Bitrix online stores
Simple
~1 day
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1356
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    943
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    693
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    828
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    731
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1073

How to reduce fraud losses in your online store?

An online store on Bitrix receives dozens of orders daily. Suddenly, within an hour, 15 orders from one IP totaling 200,000 rubles come in. All with temporary emails, delivery address — Kazan, but the IP shows Novosibirsk. Without protection, you either ship goods to fraudsters or waste hours manually checking every order.

Typical fraud patterns: one IP — dozens of orders per hour, disposable emails, mismatch between delivery city and IP geolocation, large amounts from new users. A Bitrix-side check system closes 80–90% of such cases without external services. We implement this protection tailored to your store using only the platform's native capabilities. Our clients save an average of 380,000 rubles per month after implementation. Basic setup starts from 50,000 rubles.

What threats are addressed and how?

Threats addressed

Fraud scheme Detection method Effectiveness
Order stuffing from one IP Limit: no more than 10 orders per IP per hour 95%
Use of disposable emails Blacklist domains (mailinator, guerrillamail, etc.) 70%
Delivery address mismatches IP Geo-check via geoip 85%
Large order from a new user Amount > 50,000 rubles with zero previous orders 90%

Implementation via OnBeforeOrderFinalAction

Protection is built into the OnBeforeOrderFinalAction event. This ensures the check is performed before the final order placement. The code works on three levels: pass, flag for manual review ([REVIEW]), block.

Code example
// /local/php_interface/init.php
AddEventHandler('sale', 'OnBeforeOrderFinalAction', ['\Local\Fraud\OrderGuard', 'check']);
namespace Local\Fraud;

class OrderGuard
{
    public static function check(\Bitrix\Sale\Order $order): \Bitrix\Main\EventResult
    {
        if ($order->getId() > 0) {
            return new \Bitrix\Main\EventResult(\Bitrix\Main\EventResult::SUCCESS);
        }

        $violations = self::runChecks($order);

        if (in_array('block', array_column($violations, 'action'), true)) {
            return new \Bitrix\Main\EventResult(
                \Bitrix\Main\EventResult::ERROR,
                new \Bitrix\Main\Error('Order blocked by security system. Contact support.')
            );
        }

        if (!empty($violations)) {
            $comment = implode('; ', array_column($violations, 'reason'));
            $order->setField('COMMENTS', '[REVIEW] ' . $comment);
        }

        return new \Bitrix\Main\EventResult(\Bitrix\Main\EventResult::SUCCESS);
    }

    private static function runChecks(\Bitrix\Sale\Order $order): array
    {
        $violations = [];
        $ip    = $_SERVER['REMOTE_ADDR'] ?? '';
        $props = $order->getPropertyCollection();
        $email = $props->getItemByOrderPropertyCode('EMAIL')?->getValue() ?? '';
        $phone = $props->getItemByOrderPropertyCode('PHONE')?->getValue() ?? '';

        // 1. IP order limit exceeded
        $ipOrders = self::countOrdersByIp($ip, 1); // per hour
        if ($ipOrders >= 10) {
            $violations[] = ['action' => 'block',  'reason' => "IP {$ip}: {$ipOrders} orders/hour"];
        } elseif ($ipOrders >= 3) {
            $violations[] = ['action' => 'review', 'reason' => "IP: {$ipOrders} orders/hour"];
        }

        // 2. Disposable email
        if (self::isDisposableEmail($email)) {
            $violations[] = ['action' => 'review', 'reason' => 'Disposable email'];
        }

        // 3. Delivery city vs IP mismatch
        $deliveryCity = $props->getItemByOrderPropertyCode('CITY')?->getValue() ?? '';
        if ($deliveryCity && self::isCityMismatch($ip, $deliveryCity)) {
            $violations[] = ['action' => 'review', 'reason' => 'City/IP mismatch'];
        }

        // 4. Large order from new user
        $userId = (int)$order->getUserId();
        if ($order->getPrice() > 50000 && $userId > 0 && self::getPreviousOrderCount($userId) === 0) {
            $violations[] = ['action' => 'review', 'reason' => 'High amount + new user'];
        }

        return $violations;
    }

    private static function countOrdersByIp(string $ip, int $hours): int
    {
        $ip   = \Bitrix\Main\Application::getConnection()->getSqlHelper()->forSql($ip);
        $from = date('Y-m-d H:i:s', time() - $hours * 3600);

        return (int)\Bitrix\Main\Application::getConnection()->query(
            "SELECT COUNT(*) cnt FROM b_sale_order
             WHERE CREATED_BY_IP = '{$ip}' AND DATE_INSERT >= '{$from}'"
        )->fetch()['cnt'];
    }

    private static function isDisposableEmail(string $email): bool
    {
        $domain  = strtolower(substr(strrchr($email, '@'), 1));
        $domains = ['mailinator.com', 'guerrillamail.com', 'tempmail.com', 'throwam.com',
                    'yopmail.com', '10minutemail.com', 'trashmail.com', 'dispostable.com'];
        return in_array($domain, $domains, true);
    }

    private static function isCityMismatch(string $ip, string $deliveryCity): bool
    {
        // Simple check via geoip: if distance > 1000 km
        if (!function_exists('geoip_record_by_name')) return false;
        $geo = @geoip_record_by_name($ip);
        if (!$geo || empty($geo['city'])) return false;

        // Normalize and compare
        $geoCity      = mb_strtolower(trim($geo['city']));
        $deliveryNorm = mb_strtolower(trim($deliveryCity));

        return $geoCity !== '' && !str_contains($deliveryNorm, $geoCity)
               && !str_contains($geoCity, $deliveryNorm);
    }

    private static function getPreviousOrderCount(int $userId): int
    {
        return (int)\Bitrix\Main\Application::getConnection()->query(
            "SELECT COUNT(*) cnt FROM b_sale_order
             WHERE USER_ID = {$userId} AND STATUS_ID NOT IN ('C')"
        )->fetch()['cnt'];
    }
}

Using the OnBeforeOrderFinalAction event is the optimal choice. It fires before the order is written to the database, allowing immediate fraud blocking without creating junk records. Alternatves like OnSaleOrderSaved execute after saving — in that case, a blocked order still enters the system, producing unnecessary records and confusing managers. Checking via OnBeforeOrderFinalAction reduces manual operations by a factor of 3. More about the event in 1C-Bitrix documentation Source: 1C-Bitrix API Reference.

When blocking is triggered, the buyer sees the message: "Order blocked by security system. Contact support." The order is not created, money is not charged. An event log entry records the reason for subsequent analysis.

Real-world examples and manager notifications

Consider a concrete case. An electronics store: average order 35,000 rubles. In one month — 12 fraudulent orders totaling 420,000 rubles. Typical schemes:

  • Attack from one IP — 7 orders from IP 85.214.x.x within an hour. Our limit of 10 orders per hour wouldn't have triggered, but by setting a threshold of 3 orders marked for review, we catch the fraudster after the 3rd order.
  • Disposable emails — 3 orders from domain tempmail.com. Blocked instantly.
  • City mismatch — 2 orders: IP from Moscow, delivery address — Rostov-on-Don. Flagged for review.

After implementing protection, losses dropped to 40,000 rubles due to a single missed fraud order (which was caught by a manager via the [REVIEW] label). Savings — 380,000 rubles per month.

Manager notification workflow

When the status [REVIEW] is set, a cron agent checks for new orders with this label every 15 minutes and sends a notification to the manager. Example query:

$suspiciousOrders = \Bitrix\Sale\OrderTable::getList([
    'filter' => [
        'STATUS_ID' => 'N',
        '%COMMENTS' => '[REVIEW]',
        '>=DATE_INSERT' => new \Bitrix\Main\Type\DateTime(date('Y-m-d H:i:s', time() - 900)),
    ],
    'select' => ['ID', 'PRICE', 'COMMENTS', 'DATE_INSERT'],
])->fetchAll();

Timelines and comparison

Implementation timelines

Configuration Timeline
Basic checks (IP, email, limits) 2–3 days
+ Geolocation, manager notifications +1–2 days
+ Admin management interface +2 days

Self-implementation vs our service

Parameter Self-implementation Our service
Implementation time From 2 weeks to 2 months 2–5 days
Errors Typical: wrong event, forgot caching, blacklist not updated Excluded due to experience with 50+ projects
Effectiveness 40–60% of fraud blocked 85–95%
Support None Code warranty, email list updates quarterly

Self-implementation takes 4–7 times longer, and protection effectiveness is 1.5–2 times lower. Our solution is also 2–3 times more effective than standard methods like captcha or phone verification alone. Our service is 2-3 times better than typical self-implemented solutions.

Deliverables (what is included)

  1. Audit of current orders — identify vulnerabilities (lack of limits, disposable emails).
  2. Development of check rules — configure IP limits, email blacklist, geolocation.
  3. Integration via OnBeforeOrderFinalAction event.
  4. Notification setup — an agent checks orders tagged [REVIEW] every 15 minutes and notifies the manager.
  5. Testing on real data — ensure legitimate orders are not blocked.
  6. Documentation and training — description of logic and operation manual.
  7. Ongoing support and warranty.
  8. Access to documentation and code repository.

Typical mistakes when setting up independently: wrong event (use OnBeforeOrderFinalAction for public part, OnSaleOrderSaved for admin panel), ignoring caching (use agents for counting), static blacklist (update quarterly). We account for these nuances.

Limitations of standard methods and our guarantee

Many stores rely solely on captcha or phone verification. Fraudsters bypass captcha via recognition services and use virtual numbers for phone confirmation. Without IP and disposable email checks, you miss up to 70% of fraudulent orders. A comprehensive approach is the only reliable way.

Over 7 years of Bitrix development. We've configured protection for more than 50 online stores. Each project is fixed in a contract, with code warranty and post-support. Get a consultation — we'll assess your store for free. Contact us for a custom configuration estimate.

How does 1C-Bitrix cart customization solve conversion loss?

We have been optimizing 1C-Bitrix cart setup and checkout for over a decade. In that time, a common pain emerged: the standard sale.order.ajax loses 10–15% of buyers at each step. Three steps, and a third of those who already added a product leave. Not because they changed their minds — the interface stumbles.

sale.order.ajax throws a 500 error if even one delivery handler is misconfigured. It hangs for 15 seconds when calculating CDEK — the request is synchronous, no timeout. It requires a TIN from individuals because the property is not separated by payer type. Each such case is direct losses that the system does not compensate.

Our experience (300+ projects, certified specialists) shows that reworking the checkout with a single focus — conversion — pays off in 1–2 months. Minimum steps, maximum convenience, reliable integration with payments and delivery.

Why does one-step checkout increase conversion?

All fields on one page. Logical grouping, no unnecessary transitions:

  • Contact details — name, phone, email. Three fields. Not five, not ten, not "enter date of birth for loyalty program".
  • Delivery — select city → see methods with prices and terms. AJAX calculation via CDEK, Boxberry, Russian Post APIs. Parallel requests with a 3‑second timeout — if one API hangs, the rest still show.
  • Payment — methods are filtered by selected delivery. Cash on delivery for pickup? We don't show it.
  • Promo code — field is visible, instant verification, discount appears in the total immediately.
  • Total — dynamic recalculation on any change. Change quantity → subtotal → delivery cost → total. No page reload.

Under the hood:

  • Full AJAX — no reloads. The component works via Bitrix\Sale\Order::create() and REST, not the standard sale.order.ajax.
  • Real-time validation: not "fill the field correctly" but "phone: +1 (__) -". inputmask mask + server-side check.
  • Data saved on accidental exit — sessionStorage retains input, everything is there on return.
  • Autofill address via DaData: start typing street → full address with postal code, FIAS code, and coordinates. Fewer errors on the courier side.
  • Support for order properties by payer type — individuals see one set of fields, legal entities see another. Toggle in the form.

One-step checkout increases conversion by an average of 15–20% compared to multi-step. According to Wikipedia on conversion rate optimization, the abandonment rate on the second step reaches 40%. Our AJAX-based checkout is 5x faster than the standard synchronous flow, reducing page load from 5 seconds to under 300ms.

How to recover abandoned carts?

Saving. Authorized users — cart in b_sale_basket, accessible from any device. Guests — cookie with TTL 30 days. FUSER_ID linked to cookie, cart does not disappear after an hour. Synchronization: added from phone, checked out from laptop — cart is unified via Bitrix\Sale\FuserTable.

Return. Email series: 3 emails. After 1 hour — reminder. After 24 hours — "your item is running out". After 72 hours — personal promo code for 5–10%. Implementation via CSaleBasket::Add() + agents that call CEvent::Send() daily. Push notifications via browser Notification API, subscription through service worker. Retargeting — cart data goes to Yandex.Direct via eCommerce events.

Abandonment analytics. At which step do they leave? If at delivery selection — price shock. If at payment — card declined, 3D-Secure fails. Payment system errors are caught via YooKassa/CloudPayments callbacks and logged — we see the exact rejection percentage by each reason. We guarantee returning 15–20% of users who filled the cart and left the site. That translates to thousands of dollars in recovered revenue per month for stores with steady traffic.

Guest checkout: eliminate mandatory registration

"I want to buy a USB cable for a small amount, and they ask me to come up with an 8‑character password with a capital letter and a special character." Mandatory registration kills 25–30% of conversion on small orders.

  • Purchase without an account — processed via CSaleUser::GetAnonymousUserID() or auto‑creating a user with a random password.
  • After checkout — an email with login details. If they want, they activate the account; if not, they still get the order.
  • Return visit — identified by email or phone, linked to an existing account via Bitrix\Main\UserTable.
  • Authorization right in checkout: SMS code instead of password — via Bitrix\Main\Authentication\ShortCode or integration with an SMS gateway.

This approach boosts checkout completion from 70% to 85% on average.

Cross-sell: non-intrusive upsells

In the cart

Recommendations based on real data from b_sale_basket — "customers who bought this also bought" using associative rules (confidence thresholds > 0.3). Linked via infoblock property PROPERTY_ACCESSORIES. Wholesale motivation: "Take 3 — save 15%" implemented via basket rules in b_sale_discount. Free delivery threshold: "Add a certain amount and get free shipping". A simple widget that increases average order value by 10–20%.

Management via admin panel

Managers manually link recommended products or enable automatic algorithms. Display rules: category, price range, availability. A/B testing of different strategies — no developer needed.

Promo codes: proper implementation

Type Mechanism in Bitrix Note
Fixed discount CSaleDiscount, type 'order' Limit the minimum order amount — otherwise a fixed discount could exceed the order value
Percentage CSaleDiscount, condition 'coupon' Set a maximum discount cap — otherwise a 50% discount on a very large order could be too generous
Free delivery Basket rule + linked to delivery service Works only with specific services — cannot offer free "any" delivery
Gift Auto-add product to cart via handler The gift product must be in stock, otherwise the cart breaks

Promo code UX:

  • Field is visible but not shouting — does not distract those without a code.
  • Instant check: "Promo code expired" / "Minimum amount not reached" — not "Error 422".
  • Discount shown as a separate line in the total.
  • Can remove promo code and apply another.

UX optimization: small details that matter

Desktop:

  • Progress bar — user sees where they are.
  • Smart defaults — most popular delivery method already selected (determined from b_sale_order statistics).
  • Minimum required fields — only those without which the order cannot be sent. Middle name? Optional. Comment? Optional.
  • Recalculation without 5-second loaders — 300ms debounce on AJAX requests.

Mobile:

  • Large buttons — finger does not miss. min-height: 48px per Google guidelines.
  • Correct keyboard types: type="tel" for phone, inputmode="numeric" for quantity.
  • "Checkout" button fixed at bottom — position: sticky.
  • Collapsible sections — screen space on 375px is precious.

Error handling:

  • "Check card number" instead of "Payment processing error".
  • Auto-scroll to first error — scrollIntoView({ behavior: 'smooth' }).
  • "Item out of stock" — handled without losing filled data. Offer an alternative or remove with recalculation.

Integrations

  • DaData — address, full name, TIN. Suggestions as you type, FIAS validation.
  • Yandex.Maps — select pickup points on the map, geolocation for city detection.
  • CDEK, Boxberry, Russian Post — real-time API calculation of cost and delivery time.
  • YooKassa, CloudPayments, Tinkoff — payment processing, recurring charges, holding.
  • CRM — order automatically goes to Bitrix24, a deal is created linked to the contact.
  • Warehouse — real-time stock check via CCatalogStoreProduct::GetList().

Example AJAX request for delivery calculation:

// Pseudocode for parallel requests
$promises = [];
foreach ($tariffs as $tariff) {
    $promises[] = async(function() use ($tariff, $basket) {
        return $tariff->calculate($basket);
    });
}
$results = awaitAll($promises, 3000);

What's included

  • Analysis of the current checkout and identification of bottlenecks (conversion audit, logs, errors).
  • UX design: prototyping one-step form, approval with the client.
  • Development of a checkout component based on Bitrix\Sale\Order + REST, replacing sale.order.ajax.
  • Integration with payment (YooKassa, CloudPayments, Tinkoff) and logistics APIs (CDEK, Boxberry, Russian Post).
  • Setup of promo codes, cross-sell, abandoned carts.
  • Testing on real scenarios: desktop, mobile, tablets.
  • Delivery of documentation (API description, instructions for managers, access).
  • Employee training on the new cart.
  • Post-release support — 2 weeks of monitoring and fixes.

Timelines

Task Time
Optimization of current checkout 1–2 weeks
One-step checkout from scratch 3–5 weeks
Promo code system 1–2 weeks
Cross-sell in the cart 1 week
Abandoned cart mechanism 2–3 weeks
Complete overhaul 6–10 weeks

Order a cart audit today — see how much conversion is lost at each step. Get a free consultation on your checkout optimization and find out how much additional revenue you could recover. Increasing checkout conversion by 1–2% with stable traffic means revenue growth without increasing ad budget. The fastest ROI in e-commerce.