State Registration (Mongolia)
reference Facts, options, APIs
On this page
- Settings
- Vocabulary and Properties
- Request and response
- Properties added by the enricher
- How the script handles input and errors
- Testing the enricher
- Limitations
- Process script
This example looks up a Mongolian legal entity register number (регистрийн дугаар) in the open data API of the General Authority for State Registration (Улсын бүртгэлийн ерөнхий газар). The API is described by an OpenAPI specification, follows the Beneficial Ownership Data Standard (BODS) 0.4 and is licensed CC BY 4.0. For each golden record it stores the registered name, state registration number, legal form, status, founding and dissolution dates, registered address, registration office, profit and ownership type, number of founders, the current executive, and the codes of the registered activities. No API key is needed.
Enricher version: V2
API key: not needed (optional: an API key from the portal, for a higher quota)
To set up the enricher, see Add REST API enricher, then use the settings and script on this page.
Settings
-
Accepted Business Domain –
/Organization, or the business domain that holds your companies. -
Version – V2 (recommended).
-
API Key – leave empty, or enter an API key issued by the portal. When the field has a value, the script sends it in the
X-Api-Keyheader. -
Filters – we recommend a rule that only accepts golden records where
organization.mongoliaRegisterNumberhas a value. Otherwise, every record without a register number is listed on the enricher’s Logs tab as having returned no results.
Vocabulary and Properties
organization.mongoliaRegisterNumber
organization.mongoliaRegisterNumber holds the 7-digit legal entity register number, for example 2613247. The API’s record ID form, mn-le-2613247, is also accepted. If your data uses another vocabulary key, change this field and the REGISTER_NUMBER_KEY value at the top of the script.
Request and response
Base URL: https://opendata.burtgel.gov.mn/api/v1
Endpoint: GET /entity?id={registerNumber}
Authentication: none; optionally an API key in the X-Api-Key header
Rate limits: the portal limits requests per minute and per month for each plan, and answers HTTP 429 when a limit is reached. The limits for requests without a key aren’t published. Requests take about 0.5–2.5 seconds.
GET https://opendata.burtgel.gov.mn/api/v1/entity?id=2613247
Accept: application/json
The response has the entity and all its lists: identifiers, addresses, activities, branches, bans, reorganisations, closures, deregistrations, relationships (executives, founders, shareholders and beneficial owners, with their interests) and holdings. Shortened response, with one of its eight relationships:
{
"entity": {
"recordId": "mn-le-2613247",
"statementId": "75d55d2abd26d2e88ed3b9b5853ae5f8e57548d4ff443164ede461f0c24caee5",
"statementDate": "2026-12-02",
"recordStatus": "new",
"entityType": "registeredEntity",
"entityTypeDetails": "ТӨХК",
"name": "МИАТ",
"jurisdictionName": "Mongolia",
"jurisdictionCode": "MN",
"registerNumber": "2613247",
"stateRegNumber": "9012001007",
"foundingDate": "2005-11-03",
"registeredAddress": "Улаанбаатар, Хан-Уул, 21-р хороо, Буянт-Ухаа 45, өөрийн байр",
"status": "Хэвийн",
"registryUnit": "Улаанбаатар",
"profitType": "Ашгийн төлөө",
"companyTypeName": "ТӨХК",
"companyTypeFullName": "Төрийн өмчит хувьцаат компани",
"ownershipType": "Төрийн өмчийн",
"founderCount": 1
},
"identifiers": [
{
"id": "2613247",
"schemeName": "Хуулийн этгээдийн регистрийн дугаар (MN)"
},
{
"id": "9012001007",
"schemeName": "Улсын бүртгэлийн дугаар (MN)"
}
],
"addresses": [
{
"status": "Идэвхтэй",
"addressType": "Байр хороолол",
"city": "Улаанбаатар",
"district": "Хан-Уул",
"khoroo": "21-р хороо",
"door": "Буянт-Ухаа 45, өөрийн байр",
"fullAddress": "Улаанбаатар, Хан-Уул, 21-р хороо, Буянт-Ухаа 45, өөрийн байр",
"registeredDate": "2005-11-03"
}
],
"activities": [
{
"status": "Идэвхтэй",
"code": "5110",
"name": "Иргэний нисэхийн үйл ажиллагаа",
"licenseOrg": "Иргэний нисэхийн ерөнхий газар",
"licenseNumber": "АТ-003",
"startDate": "2004-11-01",
"registeredDate": "2005-11-03"
}
],
"branches": [],
"bans": [],
"reorganisations": [],
"closures": [],
"deregistrations": [],
"relationships": [
{
"recordId": "mn-rel-2a897086cb28d18f55bd5534d69dd109ba23bd07",
"recordStatus": "new",
"interestedParty": "mn-person-d25e63b51570884f025fd80f11abb9caa5979284991103a23416334b6ee26ef9",
"role": "executive",
"roleName": "Гүйцэтгэх удирдлага",
"category": "Иргэн",
"status": "Идэвхтэй",
"positionName": "Гүйцэтгэх захирал",
"partyName": "Тунсаг Тэлмэн",
"partyType": "person",
"interests": [
{
"idx": 1,
"type": "seniorManagingOfficial",
"beneficialOwnershipOrControl": false,
"details": "Гүйцэтгэх захирал",
"startDate": "2026-02-13"
}
]
}
],
"holdings": [],
"holdingsTotal": 0
}
The portal’s documentation lists these errors: HTTP 401 for a wrong key, 402 when a request needs a key with an active plan, and 429 when the rate limit or the monthly quota is reached. A register number that doesn’t exist returns HTTP 404 with {"error":"not_found"}.
Properties added by the enricher
| Property | Response field | Example |
|---|---|---|
mnregister.registerNumber | entity.registerNumber | 2613247 |
mnregister.stateRegistrationNumber | entity.stateRegNumber | 9012001007 |
mnregister.name | entity.name | МИАТ |
mnregister.legalForm | entity.companyTypeFullName | Төрийн өмчит хувьцаат компани |
mnregister.legalFormCode | entity.companyTypeName | ТӨХК |
mnregister.status | entity.status | Хэвийн |
mnregister.foundingDate | entity.foundingDate | 2005-11-03 |
mnregister.dissolutionDate | entity.dissolutionDate | 2021-11-03 |
mnregister.address | entity.registeredAddress | Улаанбаатар, Хан-Уул, 21-р хороо, Буянт-Ухаа 45, өөрийн байр |
mnregister.registryUnit | entity.registryUnit | Улаанбаатар |
mnregister.profitType | entity.profitType | Ашгийн төлөө |
mnregister.ownershipType | entity.ownershipType | Төрийн өмчийн |
mnregister.founderCount | entity.founderCount | 1 |
mnregister.executive | partyName of the first active (Идэвхтэй) relationship with role executive | Тунсаг Тэлмэн |
mnregister.executivePosition | positionName of that relationship | Гүйцэтгэх захирал |
mnregister.activityCodes | code of the active activities, without repeats, separated by ; | 5110 |
A property is added only when the register has a value for it.
If the enricher has a Preview tab, the results appear there first. To add them to golden records, go to the Map tab, select Map Data, and choose Auto Mapping. Select the business domain, enter a new vocabulary named Mongolia State Registration with the key prefix mnregister, and then create the mapping. Auto mapping also uses name as the golden record name, so remove that from the mapping if you want to keep your existing names. Then process the data on the Process tab. If the enricher has no Preview tab, the properties are added to the golden record as soon as it is enriched.
How the script handles input and errors
-
Spaces, dots, dashes, and a leading
mn-le-are removed, somn-le-2613247is looked up as2613247. Golden records without a 7-digit register number are skipped without calling the API. Register numbers have no published check digit. -
Large companies can have thousands of shareholders. To stay within the script engine’s limit of 10,000 statements, the script reads at most the first 100 relationships and activities (
MAX_LIST_ITEMS), and caches only the properties it stores, not the whole response. -
If the register number isn’t registered (HTTP 404), or the API returns another error, the script logs the reason and adds nothing.
-
If the API rejects the API key (HTTP 401 or 403), or says the request needs a key with an active plan (HTTP 402), the script throws an error, so the golden record is listed on the Logs tab with the reason.
-
If the API reports that it is too busy or the quota is used up (HTTP 429 or 503), the script throws an error that makes the enricher try the golden record again later.
-
Successful results are cached for 24 hours per register number. To change this, edit
CACHE_MILLISECONDSin the script.
Testing the enricher
-
Test connection checks only that the script runs. It doesn’t call the API.
-
To try the setup, create a golden record with
organization.mongoliaRegisterNumberset to2613247(MIAT Mongolian Airlines) or2702673(APU).3250911returns a dissolved entity, withmnregister.status=Татан буугдсанand a dissolution date.
Limitations
-
Names, legal forms, statuses and addresses are in Mongolian Cyrillic.
-
Shareholders, beneficial owners, capital and holdings aren’t added. For a company with more than 100 relationships, the executive may not be found.
-
Activities have no main-activity flag, so all active activity codes are stored.
-
The portal is a copy of the register that is imported regularly;
GET /api/v1/statsshows when it was last imported. The portal also offers the full register as free CSV downloads at/api/v1/downloads.
Process script
// REST API enricher (V2) - Mongolian legal entity lookup with the State Registration open data API
//
// Looks up a golden record's Mongolian legal entity register number (регистрийн дугаар) in the
// open data API of the General Authority for State Registration (Улсын бүртгэлийн ерөнхий газар,
// https://opendata.burtgel.gov.mn/, OpenAPI specification at /openapi/v1.json), and adds the
// result to the golden record as mnregister.* properties:
//
// mnregister.registerNumber 7-digit register number that was looked up
// mnregister.stateRegistrationNumber state registration number (улсын бүртгэлийн дугаар)
// mnregister.name registered name
// mnregister.legalForm legal form, for example Төрийн өмчит хувьцаат компани
// mnregister.legalFormCode legal form abbreviation, for example ТӨХК
// mnregister.status status, for example Хэвийн (normal)
// mnregister.foundingDate date of registration (YYYY-MM-DD)
// mnregister.dissolutionDate date the entity was dissolved or deregistered (YYYY-MM-DD)
// mnregister.address registered address
// mnregister.registryUnit registration office, for example Улаанбаатар
// mnregister.profitType for-profit or non-profit
// mnregister.ownershipType ownership, for example Хувийн (private)
// mnregister.founderCount number of founders
// mnregister.executive name of the current executive (chief executive or director)
// mnregister.executivePosition that person's position, for example Гүйцэтгэх захирал
// mnregister.activityCodes codes of the registered activities, separated by "; "
//
// No API key is needed. An API key from the portal (for a higher quota) can be entered in the
// enricher's API Key field; it is sent in the X-Api-Key header. See README.md next to this file
// for the enricher settings.
//
// The API returns the entity's full record, including every shareholder and beneficial owner.
// The script reads only the parts it needs, and stops after the first MAX_LIST_ITEMS items of
// a list, so that large companies stay within the script engine's statement limit.
//
// A record gets no result (nothing is stored) when it has no valid register number, when the
// number isn't registered, or when the API can't answer.
// ---- Settings -------------------------------------------------------------------------
// Vocabulary key to read. Add the same key to the Vocabulary and Properties field.
const REGISTER_NUMBER_KEY = "organization.mongoliaRegisterNumber";
const ENTITY_URL = "https://opendata.burtgel.gov.mn/api/v1/entity";
// The {APIKey} placeholder is replaced with the API Key field value. Optional.
const API_KEY = "{APIKey}";
// How many activities and relationships to read at most.
const MAX_LIST_ITEMS = 100;
// How long to reuse an answer for the same register number. 0 turns caching off.
const CACHE_MILLISECONDS = 24 * 60 * 60 * 1000;
// ---- Script ---------------------------------------------------------------------------
// Status the register uses for an active activity or relationship.
const ACTIVE = "Идэвхтэй";
function getValue(key) {
// A plain loop rather than vocabularies.find(...): vocabularies is a .NET list, and when
// .find is called from inside a function, later calls return the first call's match.
const items = vocabularies || [];
for (let i = 0; i < items.length; i++) {
if (items[i].Key === key) {
const value = items[i].Value;
return value === null || value === undefined ? "" : String(value).trim();
}
}
return "";
}
// Accepts "2613247", "261 3247" and the register's record id "mn-le-2613247". Returns the 7
// digits, or null when the value isn't a legal entity register number.
function parseRegisterNumber(raw) {
const text = raw.toLowerCase().replace(/^mn-le-/, "").replace(/[\s.\-]/g, "");
return /^\d{7}$/.test(text) ? text : null;
}
function clean(value) {
if (value === null || value === undefined) {
return null;
}
const text = String(value).replace(/\s+/g, " ").trim();
return text === "" ? null : text;
}
function parseJson(text) {
try {
return JSON.parse(text);
} catch (e) {
return null;
}
}
function dateOnly(value) {
const text = clean(value);
return text && /^\d{4}-\d{2}-\d{2}/.test(text) ? text.substring(0, 10) : null;
}
function list(value) {
return Array.isArray(value) ? value : [];
}
// Picks the properties to store from the API's answer.
function toData(body, registerNumber) {
const entity = body.entity || {};
let executive = null;
const relationships = list(body.relationships);
for (let i = 0; i < relationships.length && i < MAX_LIST_ITEMS; i++) {
const relationship = relationships[i];
if (relationship && relationship.role === "executive" && relationship.status === ACTIVE && relationship.partyName) {
executive = relationship;
break;
}
}
const activityCodes = [];
const activities = list(body.activities);
for (let i = 0; i < activities.length && i < MAX_LIST_ITEMS; i++) {
const code = activities[i] && activities[i].status === ACTIVE ? clean(activities[i].code) : null;
if (code && activityCodes.indexOf(code) < 0) {
activityCodes.push(code);
}
}
return {
"mnregister.registerNumber": clean(entity.registerNumber) || registerNumber,
"mnregister.stateRegistrationNumber": clean(entity.stateRegNumber),
"mnregister.name": clean(entity.name),
"mnregister.legalForm": clean(entity.companyTypeFullName),
"mnregister.legalFormCode": clean(entity.companyTypeName),
"mnregister.status": clean(entity.status),
"mnregister.foundingDate": dateOnly(entity.foundingDate),
"mnregister.dissolutionDate": dateOnly(entity.dissolutionDate),
"mnregister.address": clean(entity.registeredAddress),
"mnregister.registryUnit": clean(entity.registryUnit),
"mnregister.profitType": clean(entity.profitType),
"mnregister.ownershipType": clean(entity.ownershipType),
"mnregister.founderCount": typeof entity.founderCount === "number" ? String(entity.founderCount) : null,
"mnregister.executive": executive ? clean(executive.partyName) : null,
"mnregister.executivePosition": executive ? clean(executive.positionName) : null,
"mnregister.activityCodes": activityCodes.length > 0 ? activityCodes.join("; ") : null,
};
}
// Calls the API. Returns the properties to store, or null when there's no answer to store.
function lookUp(registerNumber) {
const headers = [{ Key: "Accept", Value: "application/json" }];
if (API_KEY) {
headers.push({ Key: "X-Api-Key", Value: API_KEY });
}
const apiResponse = http.send({
url: `${ENTITY_URL}?id=${registerNumber}`,
method: "GET",
headers: headers,
});
const status = String(apiResponse.HttpStatus || "");
const body = parseJson(apiResponse.Content);
if (status === "TooManyRequests" || status === "ServiceUnavailable") {
throw new Error(`TooManyRequests - the State Registration open data API is busy or the quota is used up (HTTP ${status}), the record will be retried`);
}
if (status === "Unauthorized" || status === "Forbidden") {
throw new Error(`The State Registration open data API rejected the API key (HTTP ${status}). Check the API Key field of the enricher, or leave it empty.`);
}
if (status === "PaymentRequired") {
throw new Error("The State Registration open data API needs an API key with an active plan for this request (HTTP 402). Enter one in the API Key field of the enricher.");
}
if (status === "OK" && body && body.entity) {
return toData(body, registerNumber);
}
if (status === "NotFound") {
log(`The State Registration register has no legal entity with register number ${registerNumber}.`);
} else {
log(`The State Registration open data API could not look up ${registerNumber}. HTTP ${status}. ${String(apiResponse.Content || "").substring(0, 200)}`);
}
return null;
}
function run() {
const registerNumber = parseRegisterNumber(getValue(REGISTER_NUMBER_KEY));
if (!registerNumber) {
// No valid register number on this record (this is also what Test connection hits,
// because it passes placeholder values instead of real ones).
return [];
}
// The cache holds only the properties, not the API's full (large) answer.
const cacheKey = `mnregister:${registerNumber}`;
const cached = CACHE_MILLISECONDS > 0 ? cache.get(cacheKey) : null;
let data = cached ? parseJson(String(cached)) : null;
if (!data) {
data = lookUp(registerNumber);
if (!data) {
return [];
}
if (CACHE_MILLISECONDS > 0) {
cache.set(cacheKey, JSON.stringify(data), CACHE_MILLISECONDS);
}
}
// Leave out values the register didn't return, so they don't overwrite existing data with blanks.
Object.keys(data).forEach((key) => {
if (data[key] === null) {
delete data[key];
}
});
return [{ Data: data, Score: 100 }];
}
response = JSON.stringify(run());