# Validation and test data

> Documentation index for AI agents: [/llms.txt](https://docs.apiindonesia.id/llms.txt). Every page is also available as markdown: add `.md` to the URL.

NIK, NPWP and bank account format validation, plus dummy NIK/NPWP/phone generators for testing.

Validation checks structure and format only. It does not confirm with Dukcapil or a bank that a person or account exists. The dummy generators return synthetic values for test environments.

All endpoints need the `x-api-key` header (see [Authentication](https://docs.apiindonesia.id/authentication.md)) and return the standard [envelope](https://docs.apiindonesia.id/errors.md). A successful request costs 2 credits.

## Endpoints on this page

- [`GET /api/v1/validasi/bank`](#get-api-v1-validasi-bank): List banks
- [`POST /api/v1/validasi/nik`](#post-api-v1-validasi-nik): Validate NIK
- [`POST /api/v1/validasi/npwp`](#post-api-v1-validasi-npwp): Validate NPWP
- [`POST /api/v1/util/dummy/nik`](#post-api-v1-util-dummy-nik): Generate dummy NIK
- [`POST /api/v1/util/dummy/npwp`](#post-api-v1-util-dummy-npwp): Generate dummy NPWP
- [`POST /api/v1/util/dummy/telepon`](#post-api-v1-util-dummy-telepon): Generate dummy TELEPON

## Format Validation

### GET /api/v1/validasi/bank

**List banks.** Returns bank codes with valid account number lengths.

```bash
curl "https://use.apiindonesia.id/api/v1/validasi/bank" \
  -H "x-api-key: YOUR_API_KEY"
```

Example response (shortened):

```json
{
  "data": [
    {
      "code": "014",
      "name": "Bank BCA",
      "short_name": "BCA",
      "min_account_length": 10,
      "max_account_length": 10
    }
  ]
}
```

### POST /api/v1/validasi/nik

**Validate NIK.** Checks 16-digit NIK format and extracts region/birth date codes. Not Dukcapil verification.

| Body field | Required | Type | Description |
| --- | --- | --- | --- |
| `nik` | yes | string | 16-digit NIK |

```bash
curl -X POST "https://use.apiindonesia.id/api/v1/validasi/nik" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{"nik":"3201010101900001"}'
```

Example response (shortened):

```json
{
  "data": {
    "valid": true,
    "province_code": "32",
    "birth_date": "1990-01-01"
  },
  "meta": {
    "disclaimer": "Validasi struktural saja..."
  }
}
```

### POST /api/v1/validasi/npwp

**Validate NPWP.** Checks 15-digit NPWP format. Not DJP verification.

| Body field | Required | Type | Description |
| --- | --- | --- | --- |
| `npwp` | yes | string | NPWP number |

```bash
curl -X POST "https://use.apiindonesia.id/api/v1/validasi/npwp" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{"npwp":"01.234.567.8-901.000"}'
```

Example response (shortened):

```json
{
  "data": {
    "valid": true,
    "formatted": "01.234.567.8-901.000"
  }
}
```

## Developer Utilities

### POST /api/v1/util/dummy/nik

**Generate dummy NIK.** Synthetic test data, not official verification.

```bash
curl -X POST "https://use.apiindonesia.id/api/v1/util/dummy/nik" \
  -H "x-api-key: YOUR_API_KEY"
```

Example response (shortened):

```json
{
  "data": {},
  "meta": {
    "disclaimer": "Data sintetis untuk testing. Bukan data Dukcapil/DJP."
  }
}
```

### POST /api/v1/util/dummy/npwp

**Generate dummy NPWP.** Synthetic test data, not official verification.

```bash
curl -X POST "https://use.apiindonesia.id/api/v1/util/dummy/npwp" \
  -H "x-api-key: YOUR_API_KEY"
```

Example response (shortened):

```json
{
  "data": {},
  "meta": {
    "disclaimer": "Data sintetis untuk testing. Bukan data Dukcapil/DJP."
  }
}
```

### POST /api/v1/util/dummy/telepon

**Generate dummy TELEPON.** Synthetic test data, not official verification.

```bash
curl -X POST "https://use.apiindonesia.id/api/v1/util/dummy/telepon" \
  -H "x-api-key: YOUR_API_KEY"
```

Example response (shortened):

```json
{
  "data": {},
  "meta": {
    "disclaimer": "Data sintetis untuk testing. Bukan data Dukcapil/DJP."
  }
}
```
