Setting Up Age Verification (18+) on 1C-Bitrix
When launching an online store selling alcohol, tobacco, or medications, we faced strict requirements from 54-FZ and Article 14.17 of the Administrative Code — verifying the buyer's age. Missing verification can result in fines up to $4.5k–6.5k and site blocking. Bitrix doesn't provide a ready-made mechanism, so we design and implement it turnkey. Over the years, we have completed more than 50 such integrations — from a simple modal window to full identification via Gosuslugi. Our approach works 3 times faster than typical implementation thanks to ready-made modules and a polished scheme.
Federal Law № 171-FZ and Article 14.17 of the Code of Administrative Offenses of the Russian Federation directly require sellers of alcohol and tobacco to verify the buyer's age. Quoting: "Retail sale to minors entails imposition of an administrative fine." Hence, the verification system is not a luxury but a mandatory condition.
How to Choose the Verification Level?
The first question: which verification level to choose? There are three, and each requires a different approach.
| Level | Method | Reliability | Complexity | Timeline |
|---|---|---|---|---|
| 1 — Declaration | Modal window with "Yes" and "No" buttons | Low (cookie) | Minimal | 2–3 days |
| 2 — Date of Birth | Input date, mathematical check | Medium (session) | Low | 2–4 days |
| 3 — Documents | Integration with ESIA, IDEX, Kontur.Check | High (passport) | High | 1–3 weeks |
Level 1 is fastest. The buyer self-confirms age, result stored in cookie age_verified=1 with a 30-day lifetime. Legally weak protection, but sufficient for some goods (e.g., energy drinks).
Level 2 — user enters date of birth, system checks (today - birthdate) >= 18 years. Trivially bypassable but shifts legal responsibility to the buyer.
Level 3 is most reliable. We integrated with 171-FZ via ESIA REST API. Verification using passport data is our standard for alcohol and tobacco.
Why You Cannot Rely Solely on Cookies?
Cookies expire and can be cleared. Therefore we add checks on multiple fronts:
-
OnPageStart— check cookie and display modal. -
OnBeforePrologin thebitrix:catalogcomponent — restrict access to age-limited sections. -
OnSaleBasketItemAdd— block adding product to cart without confirmation.
Handler code in init.php:
AddEventHandler('main', 'OnPageStart', function() { global $APPLICATION; if (!isset($_COOKIE['age_verified'])) { $APPLICATION->AddHeadScript('/local/js/age-verify.js'); $APPLICATION->SetAdditionalCSS('/local/css/age-verify.css'); } }); // age-verify.js — set cookie on confirmation document.cookie = 'age_verified=1; max-age=' + (86400 * 30) + '; path=/; SameSite=Lax'; Restriction at Category Level
Verification may not be required for the whole site. In the section infoblock, a property UF_AGE_RESTRICTED (checkbox) is created. The handler checks not only the cookie presence but also whether the current page belongs to a restricted category.
// OnBeforeProlog in bitrix:catalog $sectionId = $arParams['SECTION_ID']; $section = CIBlockSection::GetByID($sectionId)->Fetch(); if ($section['UF_AGE_RESTRICTED'] && !isset($_COOKIE['age_verified'])) { LocalRedirect('/age-check/?back=' . urlencode($REQUEST_URI)); } Verification on Add to Cart
Even if the buyer passed verification on entry, the cookie may have expired. The OnSaleBasketItemAdd handler checks for an up-to-date confirmation:
AddEventHandler('sale', 'OnSaleBasketItemAdd', function(&$arFields) { $productId = $arFields['PRODUCT_ID']; if (isAgeRestrictedProduct($productId) && !isAgeVerified()) { return new CDBResult(false, 'Confirm your age to add this product'); } }); Storing Verification Status for Authorized Users
For authorized users, the verification result is stored in the profile — UF fields UF_AGE_VERIFIED (Yes/No) and UF_BIRTH_DATE (date). On next login, the cookie is set automatically without re-verification. This boosts conversion: according to our data, 40% of buyers do not return when forced to re-verify.
How to Set Up Verification for Authorized Users?
UF fields UF_AGE_VERIFIED and UF_BIRTH_DATE are added to the user profile. On successful verification, they are filled, and on subsequent login, the cookie is set automatically without repeating the process. We also configure automatic cookie renewal via agents if the user remains logged in.
Typical Mistakes and How to Avoid Them
Here's what we've encountered with clients: storing status only in a cookie (easily circumvented), lack of verification at the cart level (products go out without verification), improper handling of cookie expiry (users cannot complete checkout), ignoring authorized users (re-verification reduces conversion). We've learned to avoid these mistakes over 10+ years of working with Bitrix.
What Is Included in the Work
- Requirements analysis and verification level selection.
- Scheme design and prototyping.
- Development of modal windows, handlers, restrictions.
- Integration with ESIA or other services (if needed).
- Testing all scenarios: entry, cart, cookie expiry.
- Operational documentation and team training.
- Monitoring setup and post-launch support.
Process Timeline
| Stage | Duration | Result |
|---|---|---|
| Requirements analysis | 1 day | Level and integration scheme selection |
| Design | 1-2 days | Prototype and component selection |
| Development | 2-5 days | Modal window, handlers, restrictions |
| ESIA integration | 5-10 days | REST calls, passport verification |
| Testing | 1-2 days | All scenarios checked |
| Deployment | 1 day | Caching and monitoring setup |
We guarantee the system will pass any inspection by the Federal Service for Alcohol Regulation. Contact us — get a consultation and preliminary estimate in 1 day. Order verification setup and avoid the risk of fines.
Additionally, we connect Bitrix24 REST API for synchronization with CRM and external systems. The cost is calculated individually based on integration scope and complexity.

