> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/rest-api/midapi-v2/document-services.md).

# Document Services

Document services. The **validation** determines the authenticity of the Identity document and the **OCR** extracts its data. Non-identity forms (invoices and generic PDFs) are processed in a dedicated service.

#### Available services

* [**Document Validation**](/docs.facephi-en/rest-api/midapi-v2/document-services/document-validation.md): validates the authenticity of the Identity document from its front side and, optionally, its back side and a selfie. It is an asynchronous, reference-only service: it returns a `transactionId` and the final diagnosis (`APPROVED`, `DECLINED` or `DOUBTFUL`) is obtained by polling.
* [**Document OCR**](/docs.facephi-en/rest-api/midapi-v2/document-services/document-ocr.md): extracts the fields from the Identity document.
* [**Form OCR**](/docs.facephi-en/rest-api/midapi-v2/document-services/form-ocr.md): extracts the fields from non-identity forms: invoices and generic PDFs.

#### How the document is named

**Document OCR** names the document with the pair of fields `documentType` and `countryCode`, in format `UPPER_SNAKE`. `countryCode` is the issuing country as ISO 3166-1 alpha-3 code **ISO 3166-1 alpha-3**.

| `documentType`    | Document OCR |
| ----------------- | ------------ |
| `ID_CARD`         | Yes          |
| `PASSPORT`        | Yes          |
| `DRIVING_LICENSE` | Yes          |
| `FOREIGN_CARD`    | Yes          |

A value that the service does not process is returned `400` indicating which ones it supports.

**Document Validation** does not have those fields: it recognizes the document from the capture itself. It validates Identity document and passports, and the specific set of supported types and countries is established when the service is set up (see [Document Validation](/docs.facephi-en/rest-api/midapi-v2/document-services/document-validation.md)).
