Database Validation (THA)
Call this API to verify a Thailand National ID against the authoritative database with a pure API integration. The verification compares the submitted identity attributes against the database record.
- Get an access token: Token Authentication API
- Prepare a unique
bizIdfor the business transaction - Prepare a unique
userIdfor the user being verified - Set
region,numberType, andnumberValue - Provide
data.firstName+data.lastName+data.birthday(all required);data.addressis optional
Request Example:
curl -X POST \
https://sg-api.advance.ai/intl/openapi/identity-risk/idvs-h5/ekyc/v1/api/database-id-verification \
-H 'Content-Type: application/json' \
-H 'X-ACCESS-TOKEN:{Your Access Token}' \
-d '{
"bizId": "biz_tha_001",
"userId": "user_tha_001",
"region": "THA",
"numberType": "NATIONALID",
"numberValue": "1101700123456",
"data": {
"firstName": "สมชาย",
"lastName": "ใจดี",
"birthday": "1990/01/15",
"address": {
"street1": "6/1",
"city": "อ. สอง",
"postalCode": "54120"
}
}
}'Request Url
https://sg-api.advance.ai/intl/openapi/identity-risk/idvs-h5/ekyc/v1/api/database-id-verification
POST (application/json)Request Header Parameters
| Parameter | Description |
|---|---|
| X-ACCESS-TOKEN | string Please use Token Authentication API to get your access token. |
Request Parameters
| Parameter | Description |
|---|---|
| bizId | string The unique business ID for the transaction that triggered this verification, such as an order ID. Must be non-empty and no longer than 99 characters. |
| userId | string The unique user ID for the user performing the verification. Must be non-empty and no longer than 200 characters. |
| region | string The supported service region. Refer to ISO ALPHA-3 Country Code. For Thailand National ID verification, must be THA. |
| numberType | string The identity number type. Case-sensitive — must be uppercase. See Supported numberType for the full list. Any value not in the supported set (or lowercase such as nationalid) will be rejected with PARAMETER_ERROR / Number type and country are not match. |
| numberValue | string Required. Thailand National ID. After leading and trailing whitespace is trimmed, must be exactly 13 digits. Separators and internal whitespace are not accepted, and will be rejected with PARAMETER_ERROR / Invalid ID number, please check the format. |
| data | object Extended data object for additional verification parameters. |
| data.firstName | string Required. Given name. |
| data.lastName | string Required. Family name or surname. |
| data.birthday | string Required. Date of birth in yyyy/MM/dd format. Must be a valid calendar date and earlier than today. |
| data.address | object (optional) Address. An object may include: street1, street2, city, region, postalCode. All sub-fields are optional; when every sub-field is blank or absent, the address is treated as not supplied. |
Supported numberType
New identity number types are appended to this table. numberType must match the region column exactly (uppercase).
| numberType | region | numberValue format | Description |
|---|---|---|---|
| NATIONALID | THA | 13-digit numeric string | Thailand National ID |
NATIONALID is the only type supported for region=THA on this endpoint. THAIEID (ThaID app authorization) is a different product, and is rejected with PARAMETER_ERROR / Number type and country are not match. The 13th digit is a mod-11 check digit; it is not validated locally, so the outcome is decided by the database.
Response Description
| Parameter | Description |
|---|---|
| code | Response Code. |
| transactionId | The request ID of this API call. The max length is 64. |
| pricingStrategy | Deprecated, always returns FREE. |
| message | Status Code Explanation. |
| data | object The business result of the verification. |
Response.data
| Field | Description |
|---|---|
| signatureId | The business ID of this verification. |
| overallResult | Overall verification result. One of PASS or FAIL. |
| errorCode | Business-level error code when overallResult is not PASS. Returns an empty string when overallResult is PASS. Possible values: INFO_MISMATCH. |
| docDatabaseDetail | object Per-field comparison result returned by the database. Returns null when the database returns no comparison detail. Does not contain PII — no name, ID number, date of birth, or address is echoed. |
Response.data.docDatabaseDetail
Each field is a boolean: true means full match, false means the field was compared and did not match, and null means the field was not returned by the database — typically because it was not supplied in the request.
| Field | Description |
|---|---|
| numberValue | boolean Whether the submitted national ID matched the database. |
| fullName | boolean Whether the submitted first name and last name matched. |
| birthday | boolean Whether the submitted date of birth matched. |
| address | boolean Whether the submitted address matched. |
Response.code
This API returns two layers of status codes. The top-level code only reflects infrastructure-level or request-level failures. Business verification results are returned in data.overallResult and data.errorCode when the top-level code is SUCCESS.
For Thailand National ID verification, parameter failures and database failures are surfaced as top-level PARAMETER_ERROR / ERROR rather than SUCCESS + data.overallResult = INCOMPLETE.
Top-level code
code| Status Code | Message |
|---|---|
| SUCCESS | OK. The request reached business processing. The actual verification result is returned in data.overallResult and data.errorCode. |
| PARAMETER_ERROR | BizId is wrong (bizId is missing) |
| BizId is too long (bizId length exceeds 99) | |
| UserId is invalid (userId is missing) | |
| UserId is too long (userId length exceeds 200) | |
| Region is wrong (missing or not a supported ISO ALPHA-3 code) | |
| numberType is empty | |
| numberType is wrong (length > 30) | |
| Number type and country are not match (numberType not in supported set for the region, or not uppercase) | |
| Invalid ID number, please check the format (numberValue is empty, or fails format validation for the given numberType — e.g. the Thai national ID must be a 13-digit numeric string, or the database rejects the number format) | |
Invalid input, please check the format (data.firstName / data.lastName missing or blank, or data.birthday missing / not yyyy/MM/dd / not a valid calendar date / not earlier than today) | |
| IAM_FAILED | Access denied due to identity or access management certification failed |
| ERROR | Server error |
data.errorCode
This section applies only when the top-level code is SUCCESS.
| errorCode | overallResult | Description |
|---|---|---|
| "" | PASS | Database lookup succeeded and all submitted attributes matched. |
| INFO_MISMATCH | FAIL | Submitted identity attributes do not match the database record, or the database could not confirm the identity. |
Response Examples
SUCCESS
{
"code": "SUCCESS",
"message": "OK",
"data": {
"signatureId": "a1b2c3d4e5f6g7h8",
"overallResult": "PASS",
"errorCode": "",
"docDatabaseDetail": {
"numberValue": true,
"fullName": true,
"birthday": true,
"address": true
}
},
"extra": null,
"transactionId": "a1b2c3d4e5f6g7h8",
"pricingStrategy": "FREE"
}{
"code": "SUCCESS",
"message": "OK",
"data": {
"signatureId": "a1b2c3d4e5f6g7h8",
"overallResult": "FAIL",
"errorCode": "INFO_MISMATCH",
"docDatabaseDetail": {
"numberValue": true,
"fullName": false,
"birthday": true,
"address": null
}
},
"extra": null,
"transactionId": "a1b2c3d4e5f6g7h8",
"pricingStrategy": "FREE"
}address is null in this example because no address was supplied in the request.
PARAMETER_ERROR
{
"code": "PARAMETER_ERROR",
"message": "Invalid ID number, please check the format",
"data": null,
"extra": null,
"transactionId": "a1b2c3d4e5f6g7h8",
"pricingStrategy": "FREE"
}{
"code": "PARAMETER_ERROR",
"message": "Invalid input, please check the format",
"data": null,
"extra": null,
"transactionId": "a1b2c3d4e5f6g7h8",
"pricingStrategy": "FREE"
}{
"code": "PARAMETER_ERROR",
"message": "Number type and country are not match",
"data": null,
"extra": null,
"transactionId": "a1b2c3d4e5f6g7h8",
"pricingStrategy": "FREE"
}{
"code": "PARAMETER_ERROR",
"message": "Region is wrong",
"data": null,
"extra": null,
"transactionId": "a1b2c3d4e5f6g7h8",
"pricingStrategy": "FREE"
}IAM_FAILED
{
"code": "IAM_FAILED",
"message": "Access denied due to identity or access management certification failed",
"data": null,
"extra": null,
"transactionId": "a1b2c3d4e5f6g7h8",
"pricingStrategy": "FREE"
}ERROR
{
"code": "ERROR",
"message": "Server error",
"data": null,
"extra": null,
"transactionId": "a1b2c3d4e5f6g7h8",
"pricingStrategy": "FREE"
}Updated about 4 hours ago
