> 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.  **Validation** determines the authenticity of the identity document, and  **OCR** extracts its data. Non-identity printed documents (invoices and generic PDFs) are processed by a dedicated service.

#### Available services

* [**Document Validation**](https://docs.facephi.com/docs.facephi-en/rest-api/midapi-v2/document-services/document-validation.md): validates the authenticity of the identity document using its front and, optionally, its back 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**](https://docs.facephi.com/docs.facephi-en/rest-api/midapi-v2/document-services/document-ocr.md): extracts identity document fields.
* [**Form OCR**](https://docs.facephi.com/docs.facephi-en/rest-api/midapi-v2/document-services/form-ocr.md): extracts fields from non-identity printed documents: invoices and generic PDFs.

#### How the document is named

**Document OCR** names the document using the pair of fields `documentType` and `countryCode`, in the format `UPPER_SNAKE`. `countryCode` is the issuing country as an **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` with an indication of the values it accepts.

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