Skip to main content

Document Insertion

Endpoint to submit documentation required for an asset that has been approved in the eligibility step. Each document must be submitted in a separate request as a Base64-encoded PDF.

Which assets require documents?
  • CCB (ccb): document submission is always required.
  • Service Invoice (duplicata_servicos): document submission is required.
  • Commercial Invoice (duplicata_mercantil): document submission is not required.
  • Discounted Contract (discounted_contract): check the product configuration in the Assignment Contract.

The asset will only advance to pre_approved status once all required documents have been submitted.

Where am I in the flow?

This step occurs after receiving an Asset Eligibility Webhook with status pending_documentation. Submit all required documents for each approved asset, then close the insertion when all assets are ready.

Request

ENDPOINT
/trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}/asset/{asset_key}/document
METHOD
POST

Path params

ParameterTypeDescription
fund_class_keystringUnique fund identifier (UUID).
assignment_configuration_keystringUnique assignment configuration identifier (UUID).
assignment_external_idstringExternal identifier of the batch, provided at batch creation.
asset_keystringUnique asset identifier returned at asset creation (UUID).
Request Body
{
"document_type": "ccb",
"document_b64": "JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0ZpbHRlci9GbGF0ZURlY29kZT4+..."
}

Body attributes

FieldTypeRequiredDescription
document_typestringrequiredType of document being submitted. Accepted values: ccb or duplicata_servicos.
document_b64stringrequiredPDF file content encoded in Base64.

document_type enumerators:

ValueDescription
ccbCredit Certificate (Cédula de Crédito Bancário) — used for CCB assets.
duplicata_servicosService Invoice — used for service invoice assets.

Response

STATUS
201
Response Body
{
"document_key": "9b4d1a7c-2e3f-4a5b-8c9d-0e1f2a3b4c5d"
}

Response attributes

FieldTypeDescription
document_keystringUnique document identifier generated by QI Tech (UUID).

Possible errors

STATUS
404
Asset not found
{
"title": "Asset not found",
"description": "Asset not found",
"translation": "Ativo não encontrado",
"code": "TRC000017"
}
STATUS
400
Invalid asset status for document submission

The asset is not in a status that allows document submission. This typically means the asset has not yet been approved in eligibility or has already been discarded.

{
"title": "Invalid operation",
"description": "Asset is not in a valid status to receive documents",
"translation": "Ativo não está em status válido para receber documentos",
"code": "TRC000024"
}
STATUS
400
Invalid document type for asset

The document_type provided does not match the asset type. For example, submitting a duplicata_servicos document for a CCB asset.

{
"title": "Invalid document type",
"description": "Document type is not valid for this asset type",
"translation": "Tipo de documento inválido para esse tipo de ativo",
"code": "TRC000026"
}
STATUS
400
Document already submitted

A document of this type has already been submitted for this asset.

{
"title": "Document already exists",
"description": "A document of this type already exists for this asset",
"translation": "Já existe um documento desse tipo para esse ativo",
"code": "TRC000055"
}

Next steps

After submitting all required documents for an asset, the asset moves to pre_approved status. Once all assets in the batch are either pre_approved or discarded:

  1. Close insertion — signal that no more assets will be inserted, triggering the batch eligibility analysis.