In case there's some issue when calling the endpoint due to classification failed, an issue such as bad quality,
or any of the fail reasons the response will always have the field:
- classification
- failReason
- sharpness
- glare
- horizontalResolution
We recommend considering the call as failed if there's a failReason in the response or if the classification is false.
Possible values for fail reason:
- UNKNOWN_DOCUMENT_TYPE: document classification failed
- WRONG_DOCUMENT_SIDE: can happen when uploading back side of id when front id is required or the other way around
- WRONG_ONE_SIDED_DOCUMENT: uploading wrong document with only one side
- WRONG_UNFOLDED_DOCUMENT: uploading unfolded document with unrecognizable sides
- UNFOLDED_DOCUMENT_PAGE_MISMATCH: uploading unfolded document with mismatching sides
- DOCUMENT_NOT_READABLE: document couldn't be read, probably due to image quality
- UNABLE_TO_ALIGN_DOCUMENT: alignment failed
- ID_TYPE_UNACCEPTABLE: invalid type of id
- UNEXPECTED_ERROR_OCCURRED: unexpected error
Whenever the classification is done successfully the fields that will always be present are:
- classification
- sharpness
- glare
- horizontalResolution
- readability
- typeOfId
- sessionStatus
The remaining fields could be optional depending on the specific type of id and country of origin.