> 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/summary-endpoint/id-verification/ktp.md).

# KTP

### Request

<details>

<summary>Request</summary>

```json
{
  "operations": ["ocr"],
  "payload": {
    "partnerTrxId": "random-uuid",
    "groupId": "random-uuid",
    "idType": "ID_CARD",
    "country": "IDN",
    "idSubtype": "KTP",
    "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": {
    "statusCode": 5000
  },
  "card": {
    "country": "INDONESIA",
    "type": "KTP",
    "isoAlpha3CountryCode": "IDN",
    "isoAlpha2CountryCode": "ID"
  },
  "idVerificationResult": {
    "statusCode": 5000
  }
}
```

</details>

### Forged Card Response

HTTP Status Code: `400`&#x20;

<details>

<summary>Forged Card 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",
  "errors": [
    {
        "message": "The card appears to be forged.",
        "code": 5024,
        "operations": [
            "idVerification"
        ]
    }
  ],
  "imageQualityResult": {
    "statusCode": 5000
  }
}
```

</details>

### IDV Failure On Spoof or Landmark Response

HTTP Status Code: `400`&#x20;

<details>

<summary>IDV Failure On Spoof or Landmark 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",
  "errors": [
      {
        "message": "The card failed the idVerification",
        "code": 5025,
        "operations": [
            "idVerification"
        ]
      }
  ],
  "imageQualityResult": {
      "statusCode": 5000
  }
}
```

</details>
