Skip to content

E-Document#

E-Document Files Generation#

Important

This function is intended for cases when document_pdf or document_image files were not generated during the initial receipt of the electronic document.

In some cases, when receiving an electronic document, PDF or image files may not be generated. For such situations, a special endpoint is provided that allows you to generate missing files.

Request URL:

https://kyc.biometric.kz/api/v1/e-document/generate-files/

Request Format Request Method
JSON POST
Field name Type Required Description
session_id String Yes UUID of the Flow session for which files need to be generated
api_key String Yes API KEY of the organization in the personal cabinet

Request examples:

curl -X 'POST' \
  'https://kyc.biometric.kz/api/v1/e-document/generate-files/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "session_id": "123e4567-e89b-12d3-a456-426614174000",
  "api_key": "<organization_api_key>"
}'
import requests

url = 'https://kyc.biometric.kz/api/v1/e-document/generate-files/'

headers = {
    'accept': 'application/json',
    'Content-Type': 'application/json',
}

data = {
    'session_id': '123e4567-e89b-12d3-a456-426614174000',
    'api_key': '<organization_api_key>',
}

response = requests.post(url, headers=headers, json=data)

print(response.status_code)
const url = 'https://kyc.biometric.kz/api/v1/e-document/generate-files/';

const headers = {
    'accept': 'application/json',
    'Content-Type': 'application/json',
};

const data = {
    'session_id': '123e4567-e89b-12d3-a456-426614174000',
    'api_key': '<organization_api_key>',
};

fetch(url, {
    method: 'POST',
    headers: headers,
    body: JSON.stringify(data)
})
.then(response => {
    console.log(response.status);
})
.catch(error => console.error(error));

Response:

On successful file generation, status code 200 is returned.

Note

  • If both files (document_pdf and document_image) already exist, an error will be returned
  • If files cannot be generated due to missing data in result_json, an error will be returned
  • In case of connection problems with the government service, a corresponding error will be returned

Possible errors:

Status code Response Description
404 No E-Document results found for the given session No E-Document results found for the specified session
404 No E-Document data found E-Document results are missing data (result_json)
400 Files already exist for given E-Document Files already exist for the given E-Document
503 Can`t connect to E-Document service Unable to connect to the Egov government service
503 E-Document service is not available now The Egov government service is not currently available
504 Could not send request to E-Document service Timeout of request to the Egov government service