> For the complete documentation index, see [llms.txt](https://docs.vida.id/identity-stack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vida.id/identity-stack/verify/document-ai/ocr-and-document-verification/ocr-and-document-verification-v1/full-details-endpoint/ocr/malaysian-cards.md).

# Malaysian Cards

Currently Supported Malaysian Cards include:

1. [MyKad](#mykad)
2. [MyTentera](#mytentera)
3. [MyKas](#mykas)
4. [MyPR](#mypr)

{% hint style="info" %}
Note: The RELIGION field is optional on Malaysian ID cards, meaning it may or may not be printed on the card. As a result, this field may also be present or absent in the response.
{% endhint %}

## MyKad

<details>

<summary>Request</summary>

```json
{
  "operations": ["ocr"],
  "payload": {
    "partnerTrxId": "random-uuid",
    "groupId": "random-uuid",
    "idType": "ID_CARD",
    "country": "MYS",
    "idSubtype": "MyKad",
    "idFrontSideImage": "Base64 encoded image of ID front side"
  },
  "userConsent": {
    "userIP": "0.0.0.0",
    "country": "MYS",
    "obtained": true,
    "obtainedAt": "1680700959"
  }
}
```

</details>

### Success Response

HTTP Status Code: `200`

<details>

<summary>Success <strong>JSON Response</strong></summary>

```json
{
  "transactionId": "unique transaction id generated to identify this transaction",
  "partnerTrxId": "partner transaction id submitted by customer in request",
  "groupId": "partner group id submitted by customer in request",
  "imageQualityResult": {
      "glare": {
          "score": 0,
          "threshold": 0.95
      },
      "blurriness": {
          "score": 0.000001,
          "threshold": 0.95
      },
      "lowLight": {
          "score": 0.045506,
          "threshold": 0.95
      }
  },
  "card":{
     "country": "MALAYSIA",
     "type": "MyKad",
     "isoAlpha3CountryCode": "MYS",
     "isoAlpha2CountryCode": "MY"
  },
  "ocrResult": {
    "data":{
      "idNumber":{
        "value":"Id Number from the card",
        "score":0.802543,
        "threshold": 0.95
      },
      "name":{
        "value":"Name from id card",
        "score":0.841026,
        "threshold": 0.95
      },
      "address":{
        "value":"Address from id card",
        "score":0.789136,
        "threshold": 0.95
      },
      "dob":{
        "value":"Date of birth in YYYYMMDD format",
        "score":0.802543,
        "threshold": 0.95
      },
      "citizenship":{
        "value":"Citizenship from id card",
        "score":0.829340,
         "threshold": 0.95
      },
      "gender":{
        "value":"Gender from id card (M/F/O)",
        "score":0.872438,
        "threshold": 0.95
      },
      "religion":{
        "value":"Religion from id card",
        "score":0.495276,
        "threshold": 0.95
      },
      "address1": {
        "value": "address 1",
        "score": 1,
        "threshold": 0.95
      },
      "address2": {
        "value": "address 2",
        "score": 1,
        "threshold": 0.95
      },
      "zipCode": {
        "value": "Zip Code",
        "score": 1,
        "threshold": 0.95
      },
      "city": {
        "value": "City",
        "score": 1,
        "threshold": 0.95
      },
      "state": {
        "value": "State",
        "score": 1,
        "threshold": 0.95
      },
      "portraitImage" : "Base64 encoded cropped face image from id card"
    }
  }
}
```

</details>

### Error 5023 - IdNumber Doesn't contain a valid DOB

{% hint style="info" %}
**Note:** In some cases, glare or other obstructions on MyKad cards may prevent proper extraction of the ID number, which in turn affects the extraction of the date of birth. If the ID number is occluded or not extracted correctly, the following error message will be returned.
{% endhint %}

HTTP Status Code: `400`

<details>

<summary>Error 5023 - <strong>JSON Response</strong></summary>

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "transactionId": "b0499f89-14e5-414a-bcda-011bf58690bd",
    "partnerTrxId": "7a3734a7-6a9c-45f3-8e7b-4d06c57905c8",
    "groupId": "1634dc4d-a2f2-4a4f-9a29-8b0ea480fa8f",
    "errors": [
        {
            "message": "Bad Quality Image , Id Number Extraction Failed",
            "code": 5023,
            "operations": [
                "ocr"
            ]
        }
    ],
    "imageQualityResult": {
        -----[TRUNCATED]------
    },
    "ocrResult": {
      "data":{
      // NOTE: DOB is not present in the response.
        "idNumber":{
          -----[TRUNCATED]------
        },
        "name":{
          -----[TRUNCATED]------
        },
        "address":{
          -----[TRUNCATED]------
        },
        "citizenship":{
          -----[TRUNCATED]------
        },
        "gender":{
          -----[TRUNCATED]------
        },
        "religion":{
          -----[TRUNCATED]------
        },
        "portraitImage" : "Base64 encoded cropped face image from id card"
      }
  }
}
</code></pre>

</details>

### IdNumber with '\*' at the end

{% hint style="info" %}
**Note:** Some MyKad cards have an `*` at the end of the ID number. This asterisk indicates that the **ID number does not match the cardholder’s date of birth**. Instead, the **first six digits**, which typically represent the date of birth, correspond to the **date of application** for the MyKad.
{% endhint %}

HTTP Status Code: `200`&#x20;

<details>

<summary>IdNumber with '*' <strong>JSON Response</strong></summary>

```json
{
    "transactionId": "eee3452d-22de-4fd9-bcd6-fe4dbe1d2161",
    "partnerTrxId": "45a247eb-9071-4ae0-a2e8-fd91c9a9d737",
    "groupId": "9c0afec4-3951-4dd3-bd40-16703f45c82a",
    "imageQualityResult": {
        -----[TRUNCATED]------
    },
    "card": {
        -----[TRUNCATED]------
    },
    "ocrResult": {
        "data": {
            "idNumber": {
                "value": "80xxxx-xx-xx52*",
                "score": 0.9916,
                "threshold": 0.95
            },
            -----[TRUNCATED]------
            "portraitImage": "base 64"
        }
    }
}
```

</details>

### OCR Warning for low scores

{% hint style="info" %}
**Note:** Any field if has a score lower than threshold value of 0.95, we raise a low score warning for the field.
{% endhint %}

HTTP Status Code: `200`&#x20;

<details>

<summary>OCR Warning <strong>JSON Response</strong></summary>

```json
{
    "transactionId": "eee3452d-22de-4fd9-bcd6-fe4dbe1d2161",
    "partnerTrxId": "45a247eb-9071-4ae0-a2e8-fd91c9a9d737",
    "groupId": "9c0afec4-3951-4dd3-bd40-16703f45c82a",
    "warnings": [
       {
           "message": "Low confidence score for ocr, please check [name] from ocrResult for more details",
           "code": 10028,
           "operations": [
               "ocr"
           ]
       },
       {
           "message": "Low confidence score for ocr, please check [address] from ocrResult for more details",
           "code": 10029,
           "operations": [
               "ocr"
           ]
       }
    ],
    "imageQualityResult": {
        -----[TRUNCATED]------
    },
    "card": {
        -----[TRUNCATED]------
    },
    "ocrResult": {
        "data": {
            "idNumber": {
                "value": "xxxxx",
                "score": 0.9916,
                "threshold": 0.95
            },
            "name": {
               "value": "abc",
               "score": 0.11, // score below the threshold.
               "threshold": 0.95
            },
            "address": {
               "value": "xyz",
               "score": 0, // score below the threshold.
               "threshold": 0.95
            },
            -----[TRUNCATED]------
            "portraitImage": "base 64"
        }
    }
}
```

</details>

### Image Color Reprint

HTTP Status Code: `200`&#x20;

<details>

<summary>Image Color Reprint <strong>JSON Response</strong></summary>

```json
{
    "transactionId": "2b434684-b574-4b45-ad70-c22d1a4abd1a",
    "partnerTrxId": "eb385bd8-ffd6-4066-bc33-2846a7c74a93",
    "groupId": "acde070d-8c4c-4f0d-9d8a-162843c10333",
    "warnings": [
        {
            "message": "Image submitted is color reprint",
            "code": 10207,
            "operations": [
                "ocr"
            ]
        }
    ],
    "imageQualityResult": {
        "glare": {
            "score": 0,
            "threshold": 0.95
        },
        "blurriness": {
            "score": 0.013282,
            "threshold": 0.95
        },
        "lowLight": {
            "score": 0.012254,
            "threshold": 0.95
        }
    },
    "card": {
        "country": "MALAYSIA",
        "type": "MyKad",
        "isoAlpha3CountryCode": "MYS",
        "isoAlpha2CountryCode": "MY"
    },
    "idVerificationResult": {
        "spoofingResult": {
            "message": "Image submitted is color reprint",
            "code": 5012,
            "recapScore": {
                "score": 0.732143,
                "threshold": 0.95
            },
            "blackWhite": {
                "score": 0.695928,
                "threshold": 0.95
            },
            "colorPrint": {
                "score": 0.950843,
                "threshold": 0.95
            }
        },
        "landmarkResult": {
            "code": 5000,
            "message": "Success",
            "threshold": 0.95,
            "containerResult": [
                {
                    "name": "chip",
                    "score": 0.9747
                },
                {
                    "name": "portrait",
                    "score": 0.9717
                },
                {
                    "name": "card_logo",
                    "score": 0.9796
                },
                {
                    "name": "ghost",
                    "score": 0.9868
                },
                {
                    "name": "hibiscus_logo",
                    "score": 0.9763
                },
                {
                    "name": "id_number",
                    "score": 0.9944
                },
                {
                    "name": "malaysia_flag",
                    "score": 0.9782
                },
                {
                    "name": "kad_pengenalan_header",
                    "score": 0.9818
                },
                {
                    "name": "msc_logo",
                    "score": 0.9689
                },
                {
                    "name": "name",
                    "score": 0.9893
                }
            ]
        },
        "forgeryResult": {
            "code": 5000,
            "message": "Success",
            "summary": {
                "score": 0.020989,
                "threshold": 0.95
            }
        }
    },
    "ocrResult": {
        "data": {
            "idNumber": {
                "value": "ID Number",
                "score": 0.974472,
                "threshold": 0.95
            },
            "name": {
                "value": "NAME",
                "score": 0.999658,
                "threshold": 0.95
            },
            "address": {
                "value": "ADDRESS",
                "score": 0.998371,
                "threshold": 0.95
            },
            "dob": {
                "value": "YYYYMMDD",
                "score": 0.974472,
                "threshold": 0.95
            },
            "citizenship": {
                "value": "WARGANEGARA",
                "score": 1,
                "threshold": 0.95
            },
            "gender": {
                "value": "Gender from id card (M/F/O)",
                "score": 1,
                "threshold": 0.95
            },
            "portraitImage": "Base 64....",
        }
    }
}
```

</details>

## MyTentera

<details>

<summary>Request</summary>

```json
{
  "operations": ["ocr"],
  "payload": {
    "partnerTrxId": "random-uuid",
    "groupId": "random-uuid",
    "idType": "ID_CARD",
    "country": "MYS",
    "idSubtype": "MyTentera",
    "idFrontSideImage": "Base64 encoded image of ID front side"
  },
  "userConsent": {
    "userIP": "0.0.0.0",
    "country": "MYS",
    "obtained": true,
    "obtainedAt": "1680700959"
  }
}
```

</details>

### Success Response

HTTP Status Code: `200`

<details>

<summary>Success <strong>JSON Response</strong></summary>

```json
{
  "transactionId": "unique transaction id generated to identify this transaction",
  "partnerTrxId": "partner transaction id submitted by customer in request",
  "groupId": "partner group id submitted by customer in request",
  "imageQualityResult": {
    "blurriness": {
        "score": 0.000006,
        "threshold": 0.95
    },
    "lowLight": {
        "score": 0.088379,
        "threshold": 0.95
    }
  },
  "card":{
     "country": "MALAYSIA",
     "type": "MyTentera",
     "isoAlpha3CountryCode": "MYS",
     "isoAlpha2CountryCode": "MY"
  },
  "ocrResult": {
    "data":{
      "idNumber": {
            "value": "Id-Number",
            "score": 0.999809,
            "threshold": 0.95
        },
        "name": {
            "value": "NAME",
            "score": 0.993254,
            "threshold": 0.95
        },
        "address": {
            "value": "ADDRESS",
            "score": 0.996768,
            "threshold": 0.95
        },
        "dob": {
            "value": "YYYYMMDD",
            "score": 0.999809,
            "threshold": 0.95
        },
        "gender": {
            "value": "Gender from id card (M/F/O)",
            "score": 1,
            "threshold": 0.95
        },
        "religion": {
            "value": "Religion",
            "score": 1,
            "threshold": 0.95
        },
        "militaryId": {
            "value": "Military-ID",
            "score": 0.999698,
            "threshold": 0.95
        },
        "militaryRank": {
            "value": "Military-RANK",
            "score": 1,
            "threshold": 0.95
        },
        "militaryDivision": {
            "value": "Military-DIVISION",
            "score": 1,
            "threshold": 0.95
        },
        "portraitImage" : "Base64 encoded cropped face image from id card"
    }
  }
}
```

</details>

### Error 5023 - IdNumber Doesn't contain a valid DOB

{% hint style="info" %}
**Note:** In some cases, glare or other obstructions on MyTentera cards may prevent proper extraction of the ID number, which in turn affects the extraction of the date of birth. If the ID number is occluded or not extracted correctly, the following error message will be returned.
{% endhint %}

HTTP Status Code: `400`

<details>

<summary>Error 5023 - <strong>JSON Response</strong></summary>

```json
{
    "transactionId": "b0499f89-14e5-414a-bcda-011bf58690bd",
    "partnerTrxId": "7a3734a7-6a9c-45f3-8e7b-4d06c57905c8",
    "groupId": "1634dc4d-a2f2-4a4f-9a29-8b0ea480fa8f",
    "errors": [
        {
            "message": "Bad Quality Image , Id Number Extraction Failed",
            "code": 5023,
            "operations": [
                "ocr"
            ]
        }
    ],
    "imageQualityResult": {
        -----[TRUNCATED]------
    },
    "ocrResult": {
      "data":{
      // NOTE: DOB is not present in the response.
        "idNumber": {
            -----[TRUNCATED]------
        },
        "name": {
            -----[TRUNCATED]------
        },
        "address": {
            -----[TRUNCATED]------
        },
        "gender": {
            -----[TRUNCATED]------
        },
        "religion": {
            -----[TRUNCATED]------
        },
        "militaryId": {
            -----[TRUNCATED]------
        },
        "militaryRank": {
            -----[TRUNCATED]------
        },
        "militaryDivision": {
            -----[TRUNCATED]------
        },
        "portraitImage" : "Base64 encoded cropped face image from id card"
      }
    }
}
```

</details>

### OCR Warning's for low score

{% hint style="info" %}
**Note:** Any field if has a score lower than threshold value of 0.95, we raise a low score warning for the field.
{% endhint %}

HTTP Status Code: `200`

<details>

<summary>OCR Warning <strong>JSON Response</strong></summary>

```json
{
    "transactionId": "b0499f89-14e5-414a-bcda-011bf58690bd",
    "partnerTrxId": "7a3734a7-6a9c-45f3-8e7b-4d06c57905c8",
    "groupId": "1634dc4d-a2f2-4a4f-9a29-8b0ea480fa8f",
    "warnings": [
       {
           "message": "Low confidence score for ocr, please check [name] from ocrResult for more details",
           "code": 10028,
           "operations": [
               "ocr"
           ]
       },
       {
           "message": "Low confidence score for ocr, please check [address] from ocrResult for more details",
           "code": 10029,
           "operations": [
               "ocr"
           ]
       },
    ]
    "imageQualityResult": {
        -----[TRUNCATED]------
    },
    "card":{
        -----[TRUNCATED]------
    },
    "ocrResult": {
      "data":{
          -----[TRUNCATED]------
          "name": {
               "value": "",
               "score": 0, // Low confidence score
               "threshold": 0.95
           },
           "address": {
               "value": "",
               "score": 0, // Low confidence score
               "threshold": 0.95
           },
          -----[TRUNCATED]------
      }
    }
}
```

</details>

### Image Color Reprint

HTTP Status Code: `200`&#x20;

<details>

<summary>Image Color Reprint <strong>JSON Response</strong></summary>

```json
{
    "transactionId": "33ab7e6b-4359-40ba-b33c-0e4f10c0bc98",
    "partnerTrxId": "14a93a03-7b4c-459f-8f13-c0b2e6d714be",
    "groupId": "acde070d-8c4c-4f0d-9d8a-162843c10333",
    "imageQualityResult": {
        "blurriness": {
            "score": 0.003044,
            "threshold": 0.95
        },
        "lowLight": {
            "score": 0.090518,
            "threshold": 0.95
        }
    },
    "card": {
        "country": "MALAYSIA",
        "type": "MyTentera",
        "isoAlpha3CountryCode": "MYS",
        "isoAlpha2CountryCode": "MY"
    },
    "idVerificationResult": {
        "spoofingResult": {
            "message": "Success",
            "code": 5000,
            "recapScore": {
                "score": 0.363005,
                "threshold": 0.95
            },
            "blackWhite": {
                "score": 0.063191,
                "threshold": 0.95
            },
            "colorPrint": {
                "score": 0.709552,
                "threshold": 0.95
            }
        },
        "landmarkResult": {
            "code": 5000,
            "message": "Success",
            "threshold": 0.95,
            "containerResult": [
                {
                    "name": "chip",
                    "score": 0.9968
                },
                {
                    "name": "portrait",
                    "score": 0.9967
                },
                {
                    "name": "kad_pengenalan_header",
                    "score": 0.9955
                },
                {
                    "name": "malaysia_flag",
                    "score": 0.995
                },
                {
                    "name": "card_logo",
                    "score": 0.9948
                },
                {
                    "name": "name",
                    "score": 0.9928
                },
                {
                    "name": "id_number",
                    "score": 0.9927
                }
            ]
        }
    },
    "ocrResult": {
        "data": {
            "idNumber": {
                "value": "ID Number",
                "score": 0.998588,
                "threshold": 0.95
            },
            "name": {
                "value": "NAME",
                "score": 0.99999,
                "threshold": 0.95
            },
            "address": {
                "value": "Address",
                "score": 0.997343,
                "threshold": 0.95
            },
            "dob": {
                "value": "DOB",
                "score": 0.998588,
                "threshold": 0.95
            },
            "citizenship": {
                "value": "CITIZENSHIP",
                "score": 1,
                "threshold": 0.95
            },
            "gender": {
                "value": "Gender from ID Card (M/F/O)",
                "score": 1,
                "threshold": 0.95
            },
            "religion": {
                "value": "Religion",
                "score": 1,
                "threshold": 0.95
            },
            "portraitImage": "Base 64...",
        }
    }
}
```

</details>

## MyKas

<details>

<summary>Request</summary>

```json
{
  "operations": ["ocr"],
  "payload": {
    "partnerTrxId": "random-uuid",
    "groupId": "random-uuid",
    "idType": "ID_CARD",
    "country": "MYS",
    "idSubtype": "MyKas",
    "idFrontSideImage": "Base64 encoded image of ID front side"
  },
  "userConsent": {
    "userIP": "0.0.0.0",
    "country": "MYS",
    "obtained": true,
    "obtainedAt": "1680700959"
  }
}
```

</details>

### Success Response

HTTP Status Code: `200`&#x20;

<details>

<summary>Success JSON Response</summary>

```json
{
  "transactionId": "unique transaction id generated to identify this transaction",
  "partnerTrxId": "partner transaction id submitted by customer in request",
  "groupId": "partner group id submitted by customer in request",
  "imageQualityResult": {
    "blurriness": {
        "score": 0.000006,
        "threshold": 0.95
    },
    "lowLight": {
        "score": 0.088379,
        "threshold": 0.95
    }
  },
  "card":{
     "country": "MALAYSIA",
     "type": "MyKas",
     "isoAlpha3CountryCode": "MYS",
     "isoAlpha2CountryCode": "MY"
  },
  "ocrResult": {
    "data":{
        "idNumber": {
            "value": "Id-Number",
            "score": 0.999809,
            "threshold": 0.95
        },
        "name": {
            "value": "NAME",
            "score": 0.993254,
            "threshold": 0.95
        },
        "address": {
            "value": "ADDRESS",
            "score": 0.996768,
            "threshold": 0.95
        },
        "dob": {
            "value": "YYYYMMDD",
            "score": 0.999809,
            "threshold": 0.95
        },
        "dateOfExpiry": {
            "value": "DateOfExpiry",
            "score": 0,
            "threshold": 0.95
        },
        "citizenship": {
            "value": "Citizenship",
            "score": 1,
            "threshold": 0.95
        },
        "gender": {
            "value": "Gender from id card (M/F/O)",
            "score": 1,
            "threshold": 0.95
        },
        "religion": {
            "value": "Religion",
            "score": 1,
            "threshold": 0.95
        },
        "portraitImage" : "Base64 encoded cropped face image from id card"
    }
  }
}
```

</details>

### Error 5023 - IdNumber Doesn't contain a valid DOB

{% hint style="info" %}
**Note:** In some cases, glare or other obstructions on MyKas cards may prevent proper extraction of the ID number, which in turn affects the extraction of the date of birth. If the ID number is occluded or not extracted correctly, the following error message will be returned.
{% endhint %}

HTTP Status Code: `400`

<details>

<summary>Error 5023 - JSON Response</summary>

```json
{
    "transactionId": "b0499f89-14e5-414a-bcda-011bf58690bd",
    "partnerTrxId": "7a3734a7-6a9c-45f3-8e7b-4d06c57905c8",
    "groupId": "1634dc4d-a2f2-4a4f-9a29-8b0ea480fa8f",
    "errors": [
        {
            "message": "Bad Quality Image , Id Number Extraction Failed",
            "code": 5023,
            "operations": [
                "ocr"
            ]
        }
    ],
    "imageQualityResult": {
        -----[TRUNCATED]------
    },
    "ocrResult": {
      "data":{
      // NOTE: DOB is not present in the response.
      "idNumber": {
            -----[TRUNCATED]------
        },
        "name": {
            -----[TRUNCATED]------
        },
        "address": {
            -----[TRUNCATED]------
        },
        "dateOfExpiry": {
            -----[TRUNCATED]------
        },
        "citizenship": {
            -----[TRUNCATED]------
        },
        "gender": {
            -----[TRUNCATED]------
        },
        "religion": {
            -----[TRUNCATED]------
        },
        "portraitImage" : "Base64 encoded cropped face image from id card"
      }
  }
}
```

</details>

### OCR Warning's for low score

{% hint style="info" %}
**Note:** Any field if has a score lower than threshold value of 0.95, we raise a low score warning for the field.
{% endhint %}

HTTP Status Code: `200`

<details>

<summary>OCR Warning <strong>JSON Response</strong></summary>

```json
{
    "transactionId": "b0499f89-14e5-414a-bcda-011bf58690bd",
    "partnerTrxId": "7a3734a7-6a9c-45f3-8e7b-4d06c57905c8",
    "groupId": "1634dc4d-a2f2-4a4f-9a29-8b0ea480fa8f",
    "warnings": [
       {
           "message": "Low confidence score for ocr, please check [citizenship] from ocrResult for more details",
           "code": 10030,
           "operations": [
               "ocr"
           ]
       },
       {
           "message": "Low confidence score for ocr, please check [gender] from ocrResult for more details",
           "code": 10032,
           "operations": [
               "ocr"
           ]
       }
    ]
    "imageQualityResult": {
        -----[TRUNCATED]------
    },
    "card":{
        -----[TRUNCATED]------
    },
    "ocrResult": {
      "data":{
          -----[TRUNCATED]------
           "citizenship": {
               "value": "abc",
               "score": 0, // Low confidence Score
               "threshold": 0.95
           },
           "gender": {
               "value": "O",
               "score": 0, // Low confidence Score
               "threshold": 0.95
           },
          -----[TRUNCATED]------
      }
    }
}
```

</details>

### Image Color Reprint

HTTP Status Code: `200`&#x20;

<details>

<summary>Image Color Reprint <strong>JSON Response</strong></summary>

```json
{
    "transactionId": "d5104bbd-8688-4d06-b55b-2015aae9928b",
    "partnerTrxId": "61fd0482-6e76-49d9-86f0-f7acc3df4395",
    "groupId": "acde070d-8c4c-4f0d-9d8a-162843c10333",
    "imageQualityResult": {
        "blurriness": {
            "score": 0.002738,
            "threshold": 0.95
        },
        "lowLight": {
            "score": 0.016455,
            "threshold": 0.95
        }
    },
    "card": {
        "country": "MALAYSIA",
        "type": "MyKas",
        "isoAlpha3CountryCode": "MYS",
        "isoAlpha2CountryCode": "MY"
    },
    "idVerificationResult": {
        "spoofingResult": {
            "message": "Success",
            "code": 5000,
            "recapScore": {
                "score": 0.301117,
                "threshold": 0.95
            },
            "blackWhite": {
                "score": 0.795503,
                "threshold": 0.95
            },
            "colorPrint": {
                "score": 0.434641,
                "threshold": 0.95
            }
        },
        "landmarkResult": {
            "code": 5000,
            "message": "Success",
            "threshold": 0.95,
            "containerResult": [
                {
                    "name": "chip",
                    "score": 0.9973
                },
                {
                    "name": "malaysia_flag",
                    "score": 0.9951
                },
                {
                    "name": "portrait",
                    "score": 0.9925
                },
                {
                    "name": "card_logo",
                    "score": 0.9832
                },
                {
                    "name": "id_number",
                    "score": 0.9756
                },
                {
                    "name": "kad_pengenalan_header",
                    "score": 0.971
                },
                {
                    "name": "name",
                    "score": 0.9653
                }
            ]
        }
    },
    "ocrResult": {
        "data": {
            "idNumber": {
                "value": "ID Number",
                "score": 0.996263,
                "threshold": 0.95
            },
            "name": {
                "value": "NAME",
                "score": 0.99995,
                "threshold": 0.95
            },
            "address": {
                "value": "ADDRESS",
                "score": 0.991744,
                "threshold": 0.95
            },
            "dob": {
                "value": "YYYYMMDD",
                "score": 0.996263,
                "threshold": 0.95
            },
            "dateOfExpiry": {
                "value": "Date of Expiry",
                "score": 0.97156,
                "threshold": 0.95
            },
            "citizenship": {
                "value": "WARGANEGARA",
                "score": 1,
                "threshold": 0.95
            },
            "gender": {
                "value": "Gender from id card (M/F/O)",
                "score": 1,
                "threshold": 0.95
            },
            "religion": {
                "value": "Religion",
                "score": 1,
                "threshold": 0.95
            },
            "portraitImage": "Base64...."
        }
    }
}
```

</details>

## MyPR

<details>

<summary>Request</summary>

```json
{
  "operations": ["ocr"],
  "payload": {
    "partnerTrxId": "random-uuid",
    "groupId": "random-uuid",
    "idType": "ID_CARD",
    "country": "MYS",
    "idSubtype": "MyPR",
    "idFrontSideImage": "Base64 encoded image of ID front side"
  },
  "userConsent": {
    "userIP": "0.0.0.0",
    "country": "MYS",
    "obtained": true,
    "obtainedAt": "1680700959"
  }
}
```

</details>

### Success Response

HTTP Status Code: `200`

<details>

<summary>Success JSON Response</summary>

```json
{
  "transactionId": "unique transaction id generated to identify this transaction",
  "partnerTrxId": "partner transaction id submitted by customer in request",
  "groupId": "partner group id submitted by customer in request",
  "imageQualityResult": {
    "blurriness": {
        "score": 0.000006,
        "threshold": 0.95
    },
    "lowLight": {
        "score": 0.088379,
        "threshold": 0.95
    }
  },
  "card":{
     "country": "MALAYSIA",
     "type": "MyPR",
     "isoAlpha3CountryCode": "MYS",
     "isoAlpha2CountryCode": "MY"
  },
  "ocrResult": {
    "data":{
        "idNumber": {
            "value": "Id-Number",
            "score": 0.999809,
            "threshold": 0.95
        },
        "name": {
            "value": "NAME",
            "score": 0.993254,
            "threshold": 0.95
        },
        "address": {
            "value": "ADDRESS",
            "score": 0.996768,
            "threshold": 0.95
        },
        "dob": {
            "value": "YYYYMMDD",
            "score": 0.999809,
            "threshold": 0.95
        },
        "citizenship": {
            "value": "Citizenship",
            "score": 1,
            "threshold": 0.95
        },
        "gender": {
            "value": "Gender from id card (M/F/O)",
            "score": 1,
            "threshold": 0.95
        },
        "religion": {
            "value": "Religion",
            "score": 1,
            "threshold": 0.95
        },
        "portraitImage" : "Base64 encoded cropped face image from id card"
    }
  }
}
```

</details>

### Error 5023 - IdNumber Doesn't contain a valid DOB

{% hint style="info" %}
**Note:** In some cases, glare or other obstructions on MyPR cards may prevent proper extraction of the ID number, which in turn affects the extraction of the date of birth. If the ID number is occluded or not extracted correctly, the following error message will be returned.
{% endhint %}

HTTP Status Code: `400`

<details>

<summary>Error 5023 - <strong>JSON Response</strong></summary>

```json
{
    "transactionId": "b0499f89-14e5-414a-bcda-011bf58690bd",
    "partnerTrxId": "7a3734a7-6a9c-45f3-8e7b-4d06c57905c8",
    "groupId": "1634dc4d-a2f2-4a4f-9a29-8b0ea480fa8f",
    "errors": [
        {
            "message": "Bad Quality Image , Id Number Extraction Failed",
            "code": 5023,
            "operations": [
                "ocr"
            ]
        }
    ],
    "imageQualityResult": {
        -----[TRUNCATED]------
    },
    "ocrResult": {
      "data":{
      // NOTE: DOB is not present in the response.
      "idNumber": {
            -----[TRUNCATED]------
        },
        "name": {
            -----[TRUNCATED]------
        },
        "address": {
            -----[TRUNCATED]------
        },
        "citizenship": {
            -----[TRUNCATED]------
        },
        "gender": {
            -----[TRUNCATED]------
        },
        "religion": {
            -----[TRUNCATED]------
        },
        "portraitImage" : "Base64 encoded cropped face image from id card"
      }
  }
}
```

</details>

### OCR Warning's for low score

{% hint style="info" %}
**Note:** Any field if has a score lower than threshold value of 0.95, we raise a low score warning for the field.
{% endhint %}

HTTP Status Code: `200`

<details>

<summary>OCR Warning <strong>JSON Response</strong></summary>

```json
{
    "transactionId": "b0499f89-14e5-414a-bcda-011bf58690bd",
    "partnerTrxId": "7a3734a7-6a9c-45f3-8e7b-4d06c57905c8",
    "groupId": "1634dc4d-a2f2-4a4f-9a29-8b0ea480fa8f",
    "warnings": [
       {
           "message": "Low confidence score for ocr, please check [citizenship] from ocrResult for more details",
           "code": 10030,
           "operations": [
               "ocr"
           ]
       },
       {
           "message": "Low confidence score for ocr, please check [gender] from ocrResult for more details",
           "code": 10032,
           "operations": [
               "ocr"
           ]
       }
    ]
    "warnings": [
       {
           "message": "Low confidence score for ocr, please check [dateOfExpiry] from ocrResult for more details",
           "code": 10120,
           "operations": [
               "ocr"
           ]
       }
    ]
    "imageQualityResult": {
        -----[TRUNCATED]------
    },
    "card":{
        -----[TRUNCATED]------
    },
    "ocrResult": {
      "data":{
          -----[TRUNCATED]------
           "citizenship": {
               "value": "abc",
               "score": 0, // Low confidence Score
               "threshold": 0.95
           },
           "gender": {
               "value": "O",
               "score": 0, // Low confidence Score
               "threshold": 0.95
           },
          -----[TRUNCATED]------
      }
    }
}
```

</details>

### Image Color Reprint

HTTP Status Code: `200`&#x20;

<details>

<summary>Image Color Reprint <strong>JSON Response</strong></summary>

```json
{
    "transactionId": "af57730c-eaeb-41dc-bbf1-70c48329710a",
    "partnerTrxId": "ebf32134-24db-4f7b-aa99-5417b396b4d4",
    "groupId": "acde070d-8c4c-4f0d-9d8a-162843c10333",
    "imageQualityResult": {
        "blurriness": {
            "score": 0.003044,
            "threshold": 0.95
        },
        "lowLight": {
            "score": 0.090518,
            "threshold": 0.95
        }
    },
    "card": {
        "country": "MALAYSIA",
        "type": "MyPR",
        "isoAlpha3CountryCode": "MYS",
        "isoAlpha2CountryCode": "MY"
    },
    "idVerificationResult": {
        "spoofingResult": {
            "message": "Success",
            "code": 5000,
            "recapScore": {
                "score": 0.363005,
                "threshold": 0.95
            },
            "blackWhite": {
                "score": 0.063191,
                "threshold": 0.95
            },
            "colorPrint": {
                "score": 0.709552,
                "threshold": 0.95
            }
        },
        "landmarkResult": {
            "code": 5000,
            "message": "Success",
            "threshold": 0.95,
            "containerResult": [
                {
                    "name": "chip",
                    "score": 0.9968
                },
                {
                    "name": "portrait",
                    "score": 0.9967
                },
                {
                    "name": "kad_pengenalan_header",
                    "score": 0.9955
                },
                {
                    "name": "malaysia_flag",
                    "score": 0.995
                },
                {
                    "name": "card_logo",
                    "score": 0.9948
                },
                {
                    "name": "name",
                    "score": 0.9928
                },
                {
                    "name": "id_number",
                    "score": 0.9927
                }
            ]
        }
    },
    "ocrResult": {
        "data": {
            "idNumber": {
                "value": "ID NUMBER",
                "score": 0.998588,
                "threshold": 0.95
            },
            "name": {
                "value": "NAME",
                "score": 0.99999,
                "threshold": 0.95
            },
            "address": {
                "value": "ADDRESS",
                "score": 0.997343,
                "threshold": 0.95
            },
            "dob": {
                "value": "YYYYMMDD",
                "score": 0.998588,
                "threshold": 0.95
            },
            "citizenship": {
                "value": "CITIZENSHIP",
                "score": 1,
                "threshold": 0.95
            },
            "gender": {
                "value": "Gender from id card (M/F/O)",
                "score": 1,
                "threshold": 0.95
            },
            "religion": {
                "value": "RELIGION",
                "score": 1,
                "threshold": 0.95
            },
            "portraitImage": "Base64...."
        }
    }
}
```

</details>
