Integration of 1C-Bitrix with KLADR

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.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1175
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • 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
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

1C-Bitrix Integration with KLADR

KLADR (Classifier of Addresses of the Russian Federation) is the predecessor to FIAS, maintained by the Federal Tax Service. Until 2014 it was the primary addressing standard. KLADR remains relevant in legacy systems, for interactions with the FTS, and when integrating with older 1C accounting systems that operate on KLADR codes.

KLADR vs FIAS: when KLADR is specifically needed

  • Integration with a 1C:Enterprise accounting system that uses KLADR codes.
  • Submitting data to the FTS in formats that require a KLADR code.
  • Working with shipping carriers that have not yet migrated to FIAS.
  • Importing data from a database where addresses are stored with KLADR codes.

If the choice is not constrained by legacy systems, FIAS is preferable — it is more current and more detailed.

KLADR structure

A KLADR code is an 11-digit or 13-digit number (with actuality flag). Structure:

RR RRRRR CCC DDD SSSSS
2  5     3   3   4       = 17 characters (with padding)
  • RR — subject of the Russian Federation code (region).
  • RRRRR — district code.
  • CCC — city code.
  • DDD — locality code.
  • SSSSS — street code.

KLADR database files are downloaded from the FTS website (fias.nalog.ru — same location, KLADR section). Format: DBF files.

Importing KLADR into MySQL/PostgreSQL

# Convert DBF → SQL using the dbf2sql utility or Python
python3 -c "
import dbf, csv
table = dbf.Table('KLADR.DBF')
table.open()
for record in table:
    print(','.join([str(f) for f in record]))
table.close()
" > kladr.csv

After importing into the kladr_objects table, create indexes on the code and parent code columns for fast lookups.

KLADR search in Bitrix

function searchKladrCities(string $regionCode, string $cityName): array {
    $connection = \Bitrix\Main\Application::getConnection();
    $name = $connection->getSqlHelper()->forSql(mb_strtolower($cityName));

    $sql = "
        SELECT CODE, NAME, SOCR
        FROM kladr_objects
        WHERE CODE LIKE '{$regionCode}%'
          AND LENGTH(CODE) = 13  -- city level
          AND LOWER(NAME) LIKE '%{$name}%'
          AND STATUS = '1'       -- active records
        LIMIT 20
    ";
    // ...
}

KLADR ↔ FIAS mapping

Since modern systems use FIAS and legacy systems use KLADR, a correspondence table is often needed. The FIAS database contains a CODE field — this is the KLADR code. The ADDROBJ table holds both identifiers: AOGUID (FIAS) and CODE (KLADR).

// Get the KLADR code from a FIAS GUID
$sql = "SELECT CODE FROM fias_ADDROBJ WHERE AOGUID = '" . $fiasGuid . "'";

Address autocomplete via DaData with KLADR code

DaData returns both kladr_id and fias_id in a suggestion response. If KLADR is specifically required:

$("#address").suggestions({
    token: dadataToken,
    type: "ADDRESS",
    onSelect: function(suggestion) {
        const d = suggestion.data;
        $("#kladr-id").val(d.kladr_id);
        $("#fias-id").val(d.fias_id);
        // Store both — for different downstream systems
    }
});

Storing both identifiers is the correct practice when migrating from KLADR to FIAS.

Passing data to 1C:Enterprise

When synchronizing orders with 1C:Enterprise via CommerceML or a direct REST exchange — the address is passed in a format that 1C recognizes. If the 1C version is old (prior to 8.3.14) — it accepts KLADR codes. Pass kladr_id from the order field together with the string address.

Task Effort
Importing the KLADR database 4–6 h
API endpoints for hierarchical search 6–8 h
KLADR ↔ FIAS mapping 3–4 h
1C integration via KLADR codes 4–8 h