> 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-v2/summary-endpoint/ocr/passports.md).

# Passports

{% hint style="info" %}
**Note:** The **Personal-ID-Number** and **Religion** fields in passports are **optional**, meaning they may or may not be present in the response.&#x20;

For Example:

* **Included:** Some countries, such as **Malaysia** and **South Korea**
* **Not Included:** Many other countries do not include these fields in their passport format
  {% endhint %}

{% hint style="info" %}
**Passport OCR Verification Update**

Passport OCR verification has been updated to use MRZ (Machine Readable Zone) as the primary source for several core identity fields instead of relying on VIZ (Visual Inspection Zone / optical image extraction). This change improves consistency and reliability for standardized passport fields that are officially encoded in the MRZ section.

**Field Source Changes**

**Fields now extracted from MRZ:**

* `id_number`
* `name`
* `dob`
* `gender`
* `exp_date`
* `issuer_country`
* `issuer_name`

**Fields still extracted from VIZ:**

* `personal_id_number`
* `citizenship`
* `pob`
* `religion`
* `issue_date`
* `issuing_authority`
* `portrait_image`

**Impact**

* No new error codes or warning codes are introduced as part of this change.
* The response structure remains unchanged.
* Only the internal OCR extraction source for the affected fields has been updated from VIZ to MRZ.
  {% endhint %}

### Request

<details>

<summary>Request</summary>

```json
{
    "operations": ["ocr"],
    "payload": {
        "partnerTrxId": "{{$guid}}",
        "groupId":"{{$guid}}",
        "country": "KOR",
        "idType": "PASSPORT",
        "idSubtype": "N/A",
        "idFrontSideImage":"Base64 encoded image of passport front side"
    },
    "userConsent": {
        "userIp": "226.80.211.232",
        "country": "IND",
        "obtained": true,
        "obtainedAt": "1680700959"
    }
}
```

</details>

### Success Response

HTTP Status Code: `200`&#x20;

<details>

<summary>Success JSON Response</summary>

<pre class="language-json"><code class="lang-json">{
    "transactionId": "unique transaction id generated to identify this transaction",
    "partnerTrxId": "partner transaction id submitted by customer in request",
<strong>    "groupId": "partner group id submitted by customer in request",
</strong>    "card": {
        "country": "Country",
        "type": "PASSPORT",
        "isoAlpha3CountryCode": "iso Alpha 3 Country Code of the country the card belongs to",
        "isoAlpha2CountryCode": "iso Alpha 2 Country Code of the country the card belongs to"
    },
    "ocrResult": {
        "front": {
            "idNumber": "Id-Number",
            "name": "Name from Passport",
            "dob": "YYYYMMDD",
            "gender": "Gender from Passport",
            "placeOfBirth": "Place of birth from passport",
            "dateOfExpiry": "Date of expiry",
            "dateOfIssue": "Date of Issuance",
            "citizenship": "citizenship from passport",
            "issuerName": "issuer name from passport",
            "issuerCountry": "issuer country from passport",
            "issuingAuthority": "issuing authority from passport"
        }
    }
}
</code></pre>

</details>

### Failure Response If the OCR is Unable to Extract a Mandatory field

HTTP Status Code: `500`

<details>

<summary>Error response in case if the OCR model unable to extract a critical field</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",
  "errors": [
    {
      "code": 5005,
      "operations": [
        "idVerification",
        "ocr"
      ],
      "message": "extraction_failed"
    }
  ]
}
```

</details>
