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

# KTP

### Request

<details>

<summary>Request</summary>

```json
{
  "operations": ["idVerification"],
  "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`

<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": "INDONESIA",
        "type": "KTP",
        "isoAlpha3CountryCode": "IDN",
        "isoAlpha2CountryCode": "ID"
    },
    "imageQualityResult": {
        "front": {
            "blurriness": {
                "score": 0.000002,
                "threshold": 0.95
            },
            "lowLight": {
                "score": 0.418286,
                "threshold": 0.95
            },
            "overExposure": {
                "score": 0.709778,
                "threshold": 0.95
            },
            "cardDimension": {
                "card_coordinates": {
                    "x1": 55,
                    "x2": 987,
                    "y1": 84,
                    "y2": 662
                },
                "card_width": 932,
                "card_height": 578
            }
        }
    },
    "idVerificationResult": {
        "front": {
            "spoofingResult": {
                "message": "Success",
                "code": 5000,
                "recapScore": {
                    "score": 0.140889,
                    "threshold": 0.95
                },
                "blackWhite": {
                    "score": 0.024357,
                    "threshold": 0.95
                },
               -----[TRUNCATED]------
            },
            "landmarkResult": {
                "code": 5000,
                "message": "Success",
                "threshold": 0.95,
                "containerResult": [
                    {
                        "position": {
                            "x": 346,
                            "y": 23,
                            "width": 143,
                            "height": 23
                        },
                        "name": "provinsi",
                        "score": 0.9922
                    },
                    {
                        "position": {
                            "x": 36,
                            "y": 101,
                            "width": 55,
                            "height": 28
                        },
                        "name": "nik",
                        "score": 0.9924
                    },
                    {
                        "position": {
                            "x": 32,
                            "y": 154,
                            "width": 55,
                            "height": 16
                        },
                        "name": "nama",
                        "score": 0.992
                    },
                 -----[TRUNCATED]------
                ],
                "landmarkTags": [
                    {
                        "name": "portrait_background_color",
                        "value": "blue"
                    }
                ],
                "landmarkVerification": [
                    {
                        "name": "heuristic_check",
                        "status": "pass"
                    }
                ]
            },
            "forgeryResult": {
                "code": 5000,
                "message": "Success",
                "summary": {
                    "score": 0.000574,
                    "threshold": 0.95
                }
            }
        }
    }
}
```

</details>

### Forged Card Response

HTTP Status Code: `400`

<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": {
        "front": {
            "blurriness": {
                "score": 0,
                "threshold": 0.95
            },
            "lowLight": {
                "score": 0.313142,
                "threshold": 0.95
            },
            "overExposure": {
                "score": 0.798441,
                "threshold": 0.95
            },
            "cardDimension": {
                "card_coordinates": {
                    "x1": 0,
                    "x2": 1004,
                    "y1": 0,
                    "y2": 636
                },
                "card_width": 1004,
                "card_height": 636
            }
        }
    }
}
```

</details>

### Landmark Warning Response

HTTP Status Code: `200`

<details>

<summary>Landmark 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",
    "warnings": [
        {
            "message": "Image has Occlusion, please check [nik] from landmarkResult for more details",
            "code": 10412,
            "operations": [
                "idVerification"
            ]
        }
    ],
    "card": {
        "country": "INDONESIA",
        "type": "KTP",
        "isoAlpha3CountryCode": "IDN",
        "isoAlpha2CountryCode": "ID"
    },
    "imageQualityResult": {
        "front": {
            "blurriness": {
                "score": 0.002078,
                "threshold": 0.95
            },
            "lowLight": {
                "score": 0.377055,
                "threshold": 0.95
            },
            "overExposure": {
                "score": 0.744546,
                "threshold": 0.95
            },
            "cardDimension": {
                "card_coordinates": {
                    "x1": 263,
                    "x2": 1281,
                    "y1": 403,
                    "y2": 1111
                },
                "card_width": 1018,
                "card_height": 708
            }
        }
    },
    "idVerificationResult": {
        "front": {
            "spoofingResult": {
                "message": "Success",
                "code": 5000,
                "recapScore": {
                    "score": 0.274882,
                    "threshold": 0.95
                },
                "blackWhite": {
                    "score": 0.028911,
                    "threshold": 0.95
                },
                "colorPrint": {
                    "score": 0.447861,
                    "threshold": 0.95
                },
                "screenshot": {
                    "score": 0.117069,
                    "threshold": 0.95
                }
            },
            "landmarkResult": {
                "code": 5000,
                "message": "Success",
                "threshold": 0.95,
                "containerResult": [
                    {
                        "position": {
                            "x": 318,
                            "y": 45,
                            "width": 153,
                            "height": 33
                        },
                        "name": "provinsi",
                        "score": 0.992
                    },
                    {
                        "position": {
                            "x": 0,
                            "y": 0,
                            "width": 0,
                            "height": 0
                        },
                        "name": "nik",
                        "score": 0
                    -----TRUNCATED-----
                ],
                "landmarkTags": [
                    {
                        "name": "portrait_background_color",
                        "value": "red"
                    }
                ],
                "landmarkVerification": [
                    {
                        "name": "heuristic_check",
                        "status": "fail"
                    }
                ]
            },
            "forgeryResult": {
                "code": 5000,
                "message": "Success",
                "summary": {
                    "score": 0.000561,
                    "threshold": 0.95
                }
            }
        }
    }
}
```

</details>

### Spoof Error Response

HTTP Status Code: `400`

<details>

<summary>Spoof 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": "Spoof check failed. Image submitted is screenshot",
            "code": 5604,
            "operations": [
                "idVerification"
            ]
        }
    ],
            -----TRUNCATED-----
```

</details>
