validate_identity_document (Au10tix)
Business purpose: verify that a government ID uploaded to Payability is authentic, unexpired, of acceptable quality, and that its name matches the supplier owner on record.
|
Au10tix / Entrust coexistence. Entrust Identity Verification (Onfido) is the eventual
replacement for Au10tix identity-document validation. During the rollout both vendors run
under the same |
Step 1 — au10tix/request_identity_document_validation
InitialTask, runs in the Web API.
Input |
|
Allowed sources |
|
Input validator |
none |
Output |
|
Side effects, in order:
-
TaskExecutionTable.save—status=pending,process_name=validate_identity_document,input= the three fields, plussourceandrequested_by. -
ToolTable.update—AU10TIX→PENDINGwith thiscorrelation_id. -
B2BTaskManager.start_swf— workflow idAutomatic UW Tool - {supplier_key} - Validate identity document., carrying the handle task name and the full input (this is the only process that passes real fields rather than just the correlation id).
input_body={
'platform': 'automatic-uw',
'task_name': 'au10tix/handle_identity_document_validation_response',
'task_correlation_id': self.correlation_id,
'task_input': {
'document_id': input_.document_id,
'supplier_key': input_.supplier_key,
'person_id': input_.person_id
}
}
Because the workflow id is deterministic per supplier, a second concurrent request for the same
supplier surfaces CannotRunWorkflow ("Task already running") as a 400.
Step 2 — au10tix/handle_identity_document_validation_response
GenericTask, runs on the worker.
Flow
-
PYBDocuments.get_document(document_id)— download the uploaded image bytes (DocumentNotFoundon a 404). -
POST {AU10TIX_API_URL}/IdentityDocuments/BeginProcessingRequest— multipart upload ofrequestData(theprocess_identity_document.jsontemplate) anddocumentImage_Page0; returns aRequestId. -
Poll
POST /IdentityDocuments/CheckReadinessOfResultswith{"idList": [request_id]}until the first element istrue— 10 attempts, 5 s apart. -
GET /IdentityDocuments/Results/{request_id}— accepted only whenCompletionStatus == 'Ok'; anything else raises and is retried (10 attempts, 5 s, also forcing a retry onAttributeError). -
Archive the raw result JSON to S3.
-
Compare the document name against the supplier owner from the Payability internal API.
Verdict rules
Derived in __prepare_final_status_data from the Au10tix payload:
| Final-status field | VERIFIED when |
|---|---|
|
|
|
|
|
|
|
the document name fuzzy-matches the owner name |
Name matching: DocumentData2.FirstName/LastName are used when both are present, otherwise
FullName is split on spaces (first token, last token). The owner comes from
PayabilityInternalAPI.get_supplier_info(detailed=True) matched on loginKey == person_id;
their firstName is stripped of middle names. Comparison is
utils.string_utils.is_full_name_match — accent-folded thefuzz.token_set_ratio at 100.
A 400/404 from the internal API yields NOT_VERIFIED rather than a task failure; other
HTTP errors propagate.
The tool becomes VERIFIED only when no field is NOT_VERIFIED.
Side effects
-
S3:
au10tix/identity_document_validation/supplier_key=<sk>/person_id=<pid>/<timestamp>.json. -
TaskExecutionTable→processed,output = {raw_result_s3_path},additional_data.full_result_s3_path. -
FinalStatusTable.save— the four fields above. -
ToolTable.update—AU10TIX→VERIFIED/NOT_VERIFIED. -
EventBridge:
ProcessFinishedEventwithDetailType = VALIDATE_IDENTITY_DOCUMENT. -
Output:
{raw_result_s3_path}.