> 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/full-details-endpoint/ocr/passports.md).

# Passports

{% hint style="info" %}
**Note:** The **Personal-ID-Number** and **Religion** fields in **passport documents** are **optional** — they may or may not appear in the OCR response.<br>

For example:

* **Included**: Passports from countries like **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 %}

### Sample 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`

<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",
    "card": {
        "country": "South Korea",
        "type": "PASSPORT",
        "isoAlpha3CountryCode": "KOR",
        "isoAlpha2CountryCode": "KR"
    },
    "ocrResult": {
      "front": {
        "data": {
            "idNumber": {
                "value": "Id-Number"
            },
            "personalIdNumber": {
                "value": "Personal Id Number"
            },
            "name": {
                "value": "Name from passport"
            },
            "dob": {
                "value": "Date of birth in YYYYMMDD format"
            },
            "gender": {
                "value": "Gender from passport (M/F/O)"
            },
            "placeOfBirth": {
                "value": "Place of birth from passport"
            },
            "dateOfExpiry": {
                "value": "Date of expiry"
            },
            "dateOfIssue": {
                "value": "Date of Issuance"
            },
            "citizenship": {
                "value": "citizenship from passport"
            },
            "religion": {
                "value": "religion from passport"
            },
            "issuerName": {
                "value": "issuer name from passport"
            },
            "issuerCountry": {
                "value": "issuer country from passport"
            },
            "issuingAuthority": {
                "value": "issuing authority from passport"
            },
            "portraitImage":"Base64 encoded cropped face image from passport"
            }
        }
    }
}
```

</details>

### Failure Response If the OCR is Unable to extract a critical field

HTTP Status code: `500`

<details>

<summary>Error response in case if the OCR model is 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>
