Au10tix

Thin HTTP client for the Au10tix BOS4 identity-document verification API, used only by the Au10tix handle task (validate_identity_document (Au10tix)).

components/au10tix/client.py

Base URL

AU10TIX_API_URL — https://payability.au10tixservices.com/Au10tixBos4 in release, https://payability.au10tixservicesstaging.com/Au10tixBos4 in dev

Auth

Authorization: JWT {AU10TIX_TOKEN} (token from Secrets Manager: prod/au10tix/token or test/au10tix/token)

class Au10tixClient:

    def __init__(self):
        self.__token = settings.AU10TIX_TOKEN

    def send_request(
            self,
            http_method: str,
            url: str,
            additional_headers: Optional[dict] = (),
            payload: Optional[str] = None,
            files: Optional[dict] = None,
            query_params: Optional[dict] = None
    ):
        headers = {'Authorization': f'JWT {self.__token}'}
        headers.update(additional_headers)

        response = requests.request(
            method=http_method,
            url=url,
            params=query_params,
            data=payload,
            files=files,
            headers=headers,
        )

        response.raise_for_status()

        return response.json()

The caller passes the full URL (built from settings.AU10TIX_API_URL), so the client itself holds no path knowledge. Non-2xx raises HTTPError.

This client uses module-level requests.request with no session reuse and no timeout — a slow socket blocks the worker thread until the OS gives up. New clients must not copy that pattern; see Python standards.

Call sequence

Step Call

Submit

POST {AU10TIX_API_URL}/IdentityDocuments/BeginProcessingRequest — multipart with requestData (the JSON template) and documentImage_Page0 (the image bytes). Returns {"RequestId": …}.

Poll

POST {AU10TIX_API_URL}/IdentityDocuments/CheckReadinessOfResults with Content-Type: application/json and {"idList": [request_id]}. Returns an array; element 0 is true when ready.

Fetch

GET {AU10TIX_API_URL}/IdentityDocuments/Results/{request_id} — accepted only when CompletionStatus == 'Ok'.

Both polling loops use the injected Retry client (10 attempts, 5 s apart) from the handle task.

components/au10tix/request_template/

File Purpose

process_identity_document.json

The BeginProcessingRequest body, referencing the uploaded documentImage_Page0 part.

utils.py

read_request_template(name) — reads the template bytes from this package.

Fields consumed from the response

The handle task reads:

  • DocumentAuthenticity (top level) — Authentic means authentic.

  • ProcessingResult.IsDocumentExpired — boolean.

  • ProcessingResult.OverallQuality — Acceptable.

  • ProcessingResult.DocumentData2.FirstName.Value / .LastName.Value, falling back to FullName.Value split on spaces.

See validate_identity_document (Au10tix) for how those become verdicts.

A mocked result for tests lives at task/au10tix/handle_identity_document_validation_response/result.mock.json.