PaygateDeveloper documentation
422merchants.invalid_documentmerchantsRule R5

The document is not usable

A document names an uploaded file, and the file must be available, belong to this tenant, and carry the purpose its document type maps to: registration and address_proof to kyc.registration, id to kyc.id, bank_confirmation to bank.confirmation. A document of type id must also name a person.

Why the API refuses

WHEN AddDocument is executed, THE SYSTEM SHALL reject it naming the field file_id unless the referenced file is available, belongs to this tenant and carries the purpose the document type maps to — registration and address_proof to kyc.registration, id to kyc.id, bank_confirmation to bank.confirmation — and SHALL reject a document of type id that names no person.

What to do

Upload the file with the purpose that matches the document type — the purpose is chosen at upload and cannot be changed afterwards — and attach an id document to the person it identifies. errors[0].field is file_id when the file is the problem.