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 bizId for the business transaction
  • Prepare a unique userId for the user being verified
  • Set region, numberType, and numberValue
  • Provide data.firstName + data.lastName + data.birthday (all required); data.address is 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

ParameterDescription
X-ACCESS-TOKENstring Please use Token Authentication API to get your access token.

Request Parameters

ParameterDescription
bizIdstring 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.
userIdstring The unique user ID for the user performing the verification. Must be non-empty and no longer than 200 characters.
regionstring The supported service region. Refer to ISO ALPHA-3 Country Code. For Thailand National ID verification, must be THA.
numberTypestring 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.
numberValuestring 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.
dataobject Extended data object for additional verification parameters.
data.firstNamestring Required. Given name.
data.lastNamestring Required. Family name or surname.
data.birthdaystring Required. Date of birth in yyyy/MM/dd format. Must be a valid calendar date and earlier than today.
data.addressobject (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).

numberTyperegionnumberValue formatDescription
NATIONALIDTHA13-digit numeric stringThailand 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

ParameterDescription
codeResponse Code.
transactionIdThe request ID of this API call. The max length is 64.
pricingStrategyDeprecated, always returns FREE.
messageStatus Code Explanation.
dataobject The business result of the verification.

Response.data

FieldDescription
signatureIdThe business ID of this verification.
overallResultOverall verification result. One of PASS or FAIL.
errorCodeBusiness-level error code when overallResult is not PASS. Returns an empty string when overallResult is PASS. Possible values: INFO_MISMATCH.
docDatabaseDetailobject 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.

FieldDescription
numberValueboolean Whether the submitted national ID matched the database.
fullNameboolean Whether the submitted first name and last name matched.
birthdayboolean Whether the submitted date of birth matched.
addressboolean 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

Status CodeMessage
SUCCESSOK. The request reached business processing. The actual verification result is returned in data.overallResult and data.errorCode.
PARAMETER_ERRORBizId 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_FAILEDAccess denied due to identity or access management certification failed
ERRORServer error

data.errorCode

This section applies only when the top-level code is SUCCESS.

errorCodeoverallResultDescription
""PASSDatabase lookup succeeded and all submitted attributes matched.
INFO_MISMATCHFAILSubmitted 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"
}

Did this page help you?