# Asia Business ID Validator: Taiwan, Japan, Korea, China +9 (`arched_axolotl/asia-business-id-validator`) Actor

Validate and normalise company registration and tax numbers from 13 Asia-Pacific countries: Taiwan 統一編號, Japan 法人番号, Korea BRN, China USCC, Singapore UEN, India GSTIN, ABN, NZBN and more. Offline checksum rules, results in about a second. Built for list cleaning, AI agents and n8n.

- **URL**: https://apify.com/arched_axolotl/asia-business-id-validator.md
- **Developed by:** [Ryan Lin](https://apify.com/arched_axolotl) (community)
- **Categories:** Lead generation, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Asia Business ID Validator: Taiwan 統一編號, Japan 法人番号, Korea BRN, China USCC, Singapore UEN, India GSTIN and more

Check company registration and tax numbers from 13 Asia-Pacific countries, and get each one back in a clean canonical form with the country and ID type detected.

It is rule-based and works offline: no website is visited, a run takes about a second, and the same input always gives the same answer. Use it to clean CRM and supplier lists, to check a number before an invoice or KYC step, or as a tool that stops an AI agent from guessing whether a number "looks right".

驗證並標準化亞太 13 國的公司統一編號／稅籍編號（台灣統一編號含 2023 年新檢查碼規則、日本法人番号、韓國事業者登錄番號、中國統一社會信用代碼、新加坡 UEN、印度 GSTIN 等），純規則運算、不連網、約一秒完成。

### What you can do with it

- **Clean a company list.** Find mistyped tax IDs before they reach your ERP, e-invoice system or CRM.
- **Normalise formats.** `統編 ２２０９－９１３１`, `2209 9131` and `22099131` all become `22099131`. Full-width digits, spaces, dashes and labels are handled.
- **Detect the country.** Mixed lists work: the country is recognised from the number's structure and check digit.
- **Repair spreadsheet damage.** A Taiwanese number stored as the number `4541302` gets its leading zero back (`04541302`) when the country is set.
- **Give an AI agent a reliable check.** Language models are bad at checksum arithmetic. This tool is exact.

### Supported countries and what is checked

| Country | ID | Local name | Length | Check digit verified | Rule source |
|---|---|---|---|---|---|
| Taiwan (TW) | Unified Business Number | 統一編號 | 8 digits | **Yes**, current rule (sum divisible by 5, in force since April 2023) | Ministry of Finance, 營利事業統一編號檢查碼邏輯修正說明 |
| Japan (JP) | Corporate Number | 法人番号 | 13 digits (also `T` + 13 digits invoice number) | **Yes** | National Tax Agency check-digit document |
| South Korea (KR) | Business Registration Number | 사업자등록번호 | 10 digits | **Yes** (see note 1) | Widely published rule, confirmed on real numbers |
| China (CN) | Unified Social Credit Code | 统一社会信用代码 | 18 characters | **Yes** | GB 32100-2015 (MOD 31-3) |
| Singapore (SG) | Unique Entity Number, all 3 formats | UEN | 9 or 10 characters | **Yes** (see note 1) | python-stdnum, confirmed on real numbers |
| India (IN) | GSTIN (regular taxpayers) | GSTIN | 15 characters | **Yes** | Luhn mod 36 |
| Australia (AU) | ABN and ACN | ABN, ACN | 11 and 9 digits | **Yes** | Australian Business Register; ASIC |
| New Zealand (NZ) | NZBN | NZBN | 13 digits | **Yes** | GS1 GLN check digit |
| Vietnam (VN) | Tax code, with optional branch | Mã số thuế | 10 or 13 digits | **Yes** | python-stdnum, confirmed on real numbers |
| Thailand (TH) | Juristic person tax ID | เลขทะเบียนนิติบุคคล | 13 digits starting with 0 | **Yes** | python-stdnum, confirmed on real numbers |
| Indonesia (ID) | NPWP | NPWP | 15 or 16 digits | **Yes** | Luhn over the first 9 digits |
| Hong Kong (HK) | Business Registration Number | 商業登記號碼 | 8 digits | **No, format only** (note 2) | Companies Registry UBI flyer |
| Malaysia (MY) | SSM registration number | No. Pendaftaran SSM | 12 digits, or old `1234567-A` | **No, format only** (note 2) | SSM announcement of 2019 |

Every check-digit rule was tested against the published numbers of well-known organisations (for example TSMC, Toyota, Samsung Electronics, Tencent, DBS Bank, Reliance Industries, Telstra, Air New Zealand, Vingroup, PTT and Telkom Indonesia), 50 real numbers in total, and against the worked examples in the official documents where they exist.

**Note 1.** The tax authorities of South Korea and Singapore do not publish their check-digit rules. The rules used here are the ones in general use and they pass every real number tested, but they are not backed by an official document.

**Note 2.** Hong Kong and Malaysia have no publicly documented check digit. For these two the tool checks length and structure only, the result says `"validationLevel": "format"` and `"checksumVerified": false`, and they are never auto-detected: you must set the country (or prefix the value with `HK:` or `MY:`).

Beyond the check digit, the tool also checks the parts of a number where rules exist: Korean tax-office codes, Indian state codes and the embedded PAN, the registration department and region in a Chinese code, the year in a Singapore UEN, the `9429` prefix of an NZBN.

### Input

Only `values` is needed.

| Field | Type | Default | What it does |
|---|---|---|---|
| `values` | array of strings | — | The numbers to check. Prefix one with `TW:`, `JP:`, `HK:` … to force its country. |
| `country` | string | `auto` | `auto`, or one of `TW JP KR CN SG HK IN AU NZ VN TH ID MY`. Country names such as `Taiwan` or `日本` are accepted too. |
| `records` | array of objects | — | Rows of a list, as an alternative to `values`. Other columns are passed through. |
| `valueField` | string | guessed | Field of each record that holds the number. |
| `countryField` | string | — | Field of each record that holds that row's country. |

#### Example: a mixed list

```json
{
    "values": ["22099131", "JP:1-1803-0101-8771", "124-81-00998", "91440300708461136T", "ABN 33 051 775 556"]
}
```

#### Example: clean a whole list, keeping the other columns

```json
{
    "records": [
        { "company": "Hon Hai", "taxId": 4541302, "cc": "TW" },
        { "company": "HK example", "taxId": "12345678-000-07-24-5", "cc": "HK" }
    ],
    "valueField": "taxId",
    "countryField": "cc"
}
```

### Output

One item per input value, in the same order. Nothing is dropped: empty and unreadable values come back as invalid with a reason.

A valid number (from a real run):

```json
{
    "index": 2,
    "input": "JP:1-1803-0101-8771",
    "isValid": true,
    "normalized": "1180301018771",
    "formatted": "1-1803-0101-8771",
    "country": "JP",
    "countryName": "Japan",
    "idType": "JP_CN",
    "idTypeName": "Corporate Number",
    "idTypeLocalName": "法人番号",
    "validationLevel": "checksum",
    "checksumVerified": true,
    "reason": null,
    "message": null,
    "warnings": [],
    "ambiguous": false,
    "alternatives": [],
    "details": {}
}
```

An invalid number (from the same run):

```json
{
    "index": 8,
    "input": "12345678",
    "isValid": false,
    "normalized": "12345678",
    "formatted": null,
    "country": "TW",
    "countryName": "Taiwan",
    "idType": "TW_UBN",
    "idTypeName": "Unified Business Number",
    "idTypeLocalName": "統一編號",
    "validationLevel": "checksum",
    "checksumVerified": false,
    "reason": "checksum_failed",
    "message": "The check digit does not match (Taiwan UBN rule, divisible by 5). It has the shape of HK (HK_BRN), which has no check digit: set the country to validate the format.",
    "warnings": [],
    "ambiguous": false,
    "alternatives": [],
    "details": {}
}
```

A record, with the leading zero restored and the original row passed through:

```json
{
    "index": 9,
    "input": 4541302,
    "isValid": true,
    "normalized": "04541302",
    "country": "TW",
    "idType": "TW_UBN",
    "checksumVerified": true,
    "warnings": ["leading_zeros_restored"],
    "details": { "validUnderLegacyRule": true },
    "record": { "company": "Hon Hai", "taxId": 4541302, "cc": "TW" }
}
```

#### Fields

| Field | Meaning |
|---|---|
| `input` | The value exactly as you sent it. |
| `isValid` | `true` when the number passes every check available for its type. |
| `normalized` | Canonical form for storage and matching: no spaces or dashes, upper case, half-width. |
| `formatted` | The usual printed form, for example `124-81-00998` or `33 051 775 556`. |
| `country`, `countryName` | Issuing country. For an invalid value this is the best guess, or `null`. |
| `idType`, `idTypeName`, `idTypeLocalName` | For example `TW_UBN`, `Unified Business Number`, `統一編號`. |
| `validationLevel` | `checksum` or `format`: the strongest check that exists for this ID type. |
| `checksumVerified` | `true` only when a check digit was calculated and matched. |
| `reason`, `message` | Machine-readable code and a short explanation when invalid, otherwise `null`. |
| `warnings` | Things that were repaired or deserve a look (see below). |
| `ambiguous`, `alternatives` | Set when the number is valid in more than one country (see FAQ). |
| `details` | Parts decoded from the number (see below). |
| `record` | The original row, when you used `records`. |

#### Reason codes

| `reason` | Meaning |
|---|---|
| `empty` | Nothing to check (empty, null, or not a string or number). |
| `invalid_characters` | Characters that cannot occur in this ID. |
| `invalid_length` | Wrong number of digits or characters. |
| `invalid_format` | Right length, wrong structure. |
| `invalid_component` | A part is out of range: unknown state code, impossible year, all zeros … |
| `checksum_failed` | The check digit does not match. Usually a typing error. |
| `unrecognized_format` | With `auto`: the value matches no supported ID. |
| `country_required` | With `auto`: the value could be a Hong Kong or Malaysian number, which needs an explicit country. |
| `personal_id_not_supported` | The value is a personal ID (Thai citizen ID, Indonesian NIK). Not checked on purpose. |

#### Warnings

| `warnings` entry | Meaning |
|---|---|
| `leading_zeros_restored` | The value arrived as a number and was padded back to full length (country must be set). |
| `letters_read_as_digits` | Letters `O`, `I`, `L` inside an all-digit ID were read as `0`, `1`, `1`, and the result passed the check digit. |
| `ambiguous_country` | Valid in more than one country; see `alternatives`. |
| `unusual_entity_category` | China: the category digit is not one listed for that registration department. |
| `unknown_entity_type` | Singapore: the two-letter entity type is not in the known list. |
| `unknown_country_hint` | The record's country field was not recognised; the default country was used. |

#### Decoded details

| ID type | `details` |
|---|---|
| Taiwan | `validUnderLegacyRule`: `false` means the number is valid only under the 2023 rule, so older software will reject it. |
| Japan | `invoiceRegistrationNumber` when the input was `T` + 13 digits. |
| Korea | `taxOfficeCode`, `businessTypeCode`. |
| China | `registrationDepartmentCode`, `registrationDepartment`, `entityCategoryCode`, `entityCategory`, `regionCode`, `organizationCode`. |
| Singapore | `uenFormat` (`business`, `local_company`, `other_entity`), `registrationYear`, `entityTypeCode`. |
| India | `stateCode`, `state`, `pan`, `holderType`, `entityNumber`. |
| Vietnam | `parentTaxCode`, `branchCode` for 13-digit branch codes. |
| Indonesia | `npwp15`, `npwp16`, `taxOfficeCode`, `branchCode`. |
| Hong Kong | `branchNumber` when a full certificate number was given; `dummyNumber` for letter-prefixed numbers. |
| Malaysia | `ssmFormat`, `registrationYear`, `entityTypeCode`, `entityType`, `oldNumber`. |

#### Summary

Every run also saves a summary to the `OUTPUT` record of its key-value store:

```json
{
    "total": 11,
    "valid": 10,
    "invalid": 1,
    "validPercent": 90.9,
    "validChecksumVerified": 9,
    "validFormatOnly": 1,
    "ambiguous": 0,
    "invalidByReason": { "checksum_failed": 1 },
    "validByCountry": { "TW": 3, "JP": 1, "KR": 1, "CN": 1, "SG": 1, "IN": 1, "AU": 1, "HK": 1 },
    "validByIdType": { "TW_UBN": 3, "JP_CN": 1, "KR_BRN": 1, "CN_USCC": 1, "SG_UEN": 1, "IN_GSTIN": 1, "AU_ABN": 1, "HK_BRN": 1 },
    "warnings": { "leading_zeros_restored": 1 },
    "stoppedAtItemLimit": false,
    "defaultCountry": "auto"
}
```

### Use with AI agents (MCP)

The Actor works as a tool for Claude, ChatGPT, Cursor and other MCP clients through the [Apify MCP server](https://mcp.apify.com). Add it with this server URL:

```
https://mcp.apify.com?tools=arched_axolotl/asia-business-id-validator
```

Then ask in plain language, for example: *"Check these supplier tax IDs and tell me which ones are mistyped: 22099131, 04541303, 1180301018771."*

Input that works well for agents:

```json
{
    "values": ["22099131", "04541303", "1180301018771"],
    "country": "auto"
}
```

Tips for agents: pass the values exactly as found, without cleaning them first. Read `isValid`, `normalized`, `reason` and `message`. When the country is known, set `country`, or prefix single values (`"HK:12345678"`).

### Use with n8n

In **n8n**, add the **Apify** node, choose **Run an Actor and get dataset**, pick this Actor and paste the input JSON. Each checked value arrives as one n8n item.

A typical list-cleaning workflow:

1. **Google Sheets / Airtable / CRM** — read the rows.
2. **Apify** — run this Actor with `records` set to the rows, `valueField` set to the tax ID column and, if you have one, `countryField`.
3. **IF** — `isValid` is false.
4. **Update row / Slack / Email** — write back `normalized` for valid rows, and send `record`, `reason` and `message` for the invalid ones to whoever fixes the data.

Because the original row comes back in `record`, you do not need a merge step.

From any tool that can call a URL:

```bash
curl -X POST "https://api.apify.com/v2/acts/arched_axolotl~asia-business-id-validator/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"values": ["22099131", "JP:1180301018771"], "country": "auto"}'
```

This call waits for the run and returns the results as JSON in one response.

### Limits to know about

- **A valid check digit does not prove the company exists.** It shows that the number is well formed and not mistyped. Whether it was ever issued, to whom, and whether the business is still active can only be confirmed in the official registry of each country. This Actor does not query registries.
- **A check digit cannot catch every error.** With a single check digit roughly one in ten random numbers passes (one in five for Taiwan since the 2023 rule change, one in nine for Japan). Single mistyped digits are caught far more reliably than that, but not always.
- **Hong Kong and Malaysia are format checks only**, as explained above.
- **Auto-detection relies on check digits.** A short all-digit number can be valid in two countries at once (for example 10 digits: Korea and Vietnam). The result is then flagged `ambiguous` with the other candidates in `alternatives`. Set `country` when you know it.
- **A 9-digit number passes the Australian ACN check one time in ten** by chance. With `auto`, do not read "valid ACN" as proof that a number is Australian.
- **India: regular GSTINs only.** Special registrations with a different structure (UN bodies, non-resident online service providers, TDS/TCS deductors) are reported as invalid.
- **Not covered:** Korean corporate registration numbers (법인등록번호), Japanese invoice numbers of sole proprietors, Indian PAN and CIN on their own, China's pre-2015 15-digit registration numbers, Philippine TINs, and every personal ID number.
- **No personal IDs.** National ID numbers of individuals are out of scope and are not validated.
- Up to 200,000 values per run.

### FAQ

**How fast is it?** The checks take milliseconds; a run is mostly container start-up, about a second or two in total.

**Does it go online?** No. There are no network calls, so it also cannot tell you the company name behind a number.

**Which Taiwan rule is used?** The current one. Since April 2023 a 統一編號 is valid when the weighted digit sum is divisible by 5 (before: by 10). Numbers issued under the new rule fail in software that still uses the old one; `details.validUnderLegacyRule` tells you which case you have.

**What happens to leading zeros?** Keep IDs as text whenever you can. If a number such as `04541302` reached you as the number `4541302`, set the country and the Actor pads it back and adds the `leading_zeros_restored` warning. Without a country it will not guess.

**Why is `country` filled in for an invalid value?** It is the best guess from the shape of the value, so the message can say which rule failed. It is `null` when several countries fit.

**Can I check numbers from Europe or the Americas?** No, this Actor covers Asia-Pacific only.

**Is the data stored?** Your input and the results live in your own Apify run storage, under your account's retention settings. The Actor sends nothing anywhere else.

# Actor input Schema

## `values` (type: `array`):

Business registration or tax numbers, one per item. Spaces, dashes, full-width digits and labels such as '統編' or 'ABN' are ignored. With country 'auto' the country is detected from the number; to force a country for one value, prefix it with the two-letter code and a colon, for example 'TW:22099131', 'JP:1180301018771' or 'HK:12345678'. Never put personal ID numbers here.

## `country` (type: `string`):

Country that issued the numbers. Use 'auto' (default) to detect it from each number; this works for every country that has a check digit. Set a country when the whole list comes from one country (more precise error messages, and it restores leading zeros lost in spreadsheets), and always for Hong Kong (HK) and Malaysia (MY), whose numbers have no check digit and are therefore never auto-detected. Values: auto, TW, JP, KR, CN, SG, HK, IN, AU, NZ, VN, TH, ID, MY.

## `records` (type: `array`):

Alternative to 'values' for cleaning a whole list: an array of JSON objects, one per row, for example \[{"company": "TSMC", "taxId": "22099131"}]. The number is read from the field named in 'valueField'. Every row comes back in the same order with the validation result, and the original row is returned unchanged in the 'record' field.

## `valueField` (type: `string`):

Name of the field in each record that contains the business ID, for example 'taxId' or '統一編號'. Required with 'records' unless the field is called value, id, taxId, businessId, registrationNumber, companyNumber, number, 統一編號 or 統編.

## `countryField` (type: `string`):

Optional. Name of a field in each record that contains the country of that row as a two-letter code (TW, JP, ...) or a name (Taiwan, 日本, Korea). Rows where it is empty or unknown fall back to 'country'.

## Actor input object example

```json
{
  "values": [
    "22099131",
    "統一編號：２２０９－９１３１",
    "JP:1-1803-0101-8771",
    "124-81-00998",
    "91440300708461136T",
    "196800306E",
    "27AAACR5055K1Z7",
    "ABN 33 051 775 556",
    "12345678"
  ],
  "country": "auto"
}
```

# Actor output Schema

## `results` (type: `string`):

One item per input value, in input order, with validity, normalised form, country and reason.

## `summary` (type: `string`):

Run summary: counts of valid and invalid values by country and by reason.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "values": [
        "22099131",
        "統一編號：２２０９－９１３１",
        "JP:1-1803-0101-8771",
        "124-81-00998",
        "91440300708461136T",
        "196800306E",
        "27AAACR5055K1Z7",
        "ABN 33 051 775 556",
        "12345678"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("arched_axolotl/asia-business-id-validator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "values": [
        "22099131",
        "統一編號：２２０９－９１３１",
        "JP:1-1803-0101-8771",
        "124-81-00998",
        "91440300708461136T",
        "196800306E",
        "27AAACR5055K1Z7",
        "ABN 33 051 775 556",
        "12345678",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("arched_axolotl/asia-business-id-validator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "values": [
    "22099131",
    "統一編號：２２０９－９１３１",
    "JP:1-1803-0101-8771",
    "124-81-00998",
    "91440300708461136T",
    "196800306E",
    "27AAACR5055K1Z7",
    "ABN 33 051 775 556",
    "12345678"
  ]
}' |
apify call arched_axolotl/asia-business-id-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,arched_axolotl/asia-business-id-validator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/2DpA5X3h5VyX6yTv5/builds/XMrPwPeIEVHytFGf6/openapi.json
