Skip to main content

Asset Document Insertion

Endpoint to submit the documents required for an asset in the assignment batch. The file is sent Base64-encoded, one document per request.

Available on
ProfileHostRequired permission
Managermanager-apiWrite
Consultantconsultant-apiBatches
Assignorassignor-apiWrite

Base URL for each host: Environments (Hosts).

Where am I in the flow?

You can submit the documents right after inserting the asset (status pending_eligibility) or after the pending_documentation webhook, which indicates that the asset was approved in eligibility and is awaiting documentation. An asset denied because of a document (denied with denied_by = document) returns to pending_documentation when it receives a new document.

Which documents to submit?

The required types are defined per product and come in the assignment configuration, in the required_documents (before the assignment) and after_assignment_required_documents (after the assignment) fields. Only these types are accepted.

  • Duplicata mercantil (duplicata_mercantil): you do not need to submit a document — QI Tech generates the duplicata document from the invoice data. The call is accepted and returns a document_key, but nothing is stored.
  • Installment contract (contract): see Which document to submit for an installment contract.

The asset only advances to pre_approved after all required documents have been submitted and validated.

Document format

File in PDF, P7S or XML, Base64-encoded, up to 10 MB. Other formats are refused with TRC000166.

Request​

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

Path params​

ParameterTypeDescription
fund_class_keystringUnique fund key (UUID).
assignment_configuration_keystringAssignment configuration key (UUID).
assignment_external_idstringExternal identifier of the batch, provided at batch creation.
asset_external_idstringThe external_id provided at asset creation.
Request Body
{
"document_type": "ccb",
"document_b64": "aGVsbG8gd29ybGQgaWYgeW91IGRlY29kZWQgbWUsIGJlIGNhcmVmdWwuIEl0IG11c3QgYmUgYSBQREYgRmlsZSBvdGhlcndpc2UgSSB3aWxsIHJhaXNlIGFuIEVycm9yLg=="
}

Body attributes​

FieldTypeRequiredDescription
document_typestringrequiredType of the document being submitted. The accepted values are those set in the assignment configuration used — see the enumerators below.
document_b64stringrequiredFile content Base64-encoded (PDF, P7S or XML; up to 10 MB).

document_type values (accepted only when listed in the assignment configuration):

ValueDescription
ccbBank Credit Note (Cédula de Crédito Bancário) — CCB-type assets.
duplicata_servicosService duplicata.
invoiceInvoice.
cteElectronic Bill of Lading (Conhecimento de Transporte Eletrônico).
discounted_contractDiscounted contract.
contractThe assigned installment contract itself (the asset), not the assignment contract.
legal_fees_contractLegal fees contract.
checkCheck.
promissory_notePromissory note.
disbursement_receiptDisbursement receipt.
vehicle_reservation_receiptVehicle reservation receipt — operations with vehicle collateral. Post-assignment document.

Which document to submit for an installment contract​

For document_type contract, submit the contract being assigned: the instrument signed between the originator and the debtor, with the installments provided at asset creation. It is the asset's collateral.

Do not submit the assignment contract or the assignment term here. Those documents formalize the transfer of the assets to the fund and have their own flow in the assignment document.

Each asset receives one PDF with its own contract. In a batch with three contracts (A, B and C), submit three files: contract A on asset A, B on asset B and C on asset C. Do not merge several contracts into the same PDF. An asset accepts a single document of each type; submitting another contract for the same asset returns TRC000035, unless the previous one was denied.

Two moments for document submission

This endpoint serves two distinct moments of the flow, and the only thing that changes between them is the asset status:

  • Before the assignment. The asset enters pending_documentation after being approved in individual eligibility and awaits the documents set as required for the product. Once all are submitted, it advances to pre_approved.
  • After the assignment. If the assignment configuration requires post-assignment documents, the asset enters pending_after_assignment_documentation after the batch settlement. This is where the vehicle reservation receipt (vehicle_reservation_receipt) of operations with vehicle collateral comes in. Once all are submitted, the asset advances to completed and the asset completed webhook is sent, if you subscribe to that status. You can also track it through the asset query.

The list of documents required at each moment is defined per product and comes in the assignment configuration response, in the required_documents (before the assignment) and after_assignment_required_documents (after the assignment) fields. Submitting a document_type that is not configured for that assignment, including a value that does not exist, returns TRC000032.

Response​

STATUS
201
Response Body
{
"document_key": "8e515a17-8b4d-49a3-aed6-47c9574e426a"
}

Response attributes​

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

Errors​

StatusCodeWhen it happens
400TRC000032document_type is not in the assignment configuration's required_documents or after_assignment_required_documents (includes values that do not exist).
400TRC000034document_b64 is not valid Base64.
400TRC000155File larger than 10 MB.
400TRC000166Format not accepted. Accepted formats: PDF, P7S and XML.
404TRC000020No asset with that asset_external_id in the batch.
409TRC000026The asset is not in a status that accepts documents (pending_eligibility, pending_documentation, denied because of a document, or pending_after_assignment_documentation).
409TRC000035The asset already has a document of this type that was not denied.
409TRC000162The batch is denied or discarded.

Authentication, permission and host errors: see API Errors.

Next steps​

After submitting all required documents, the flow continues with:

  1. Close asset insertion — signal that all assets have been inserted so the batch proceeds to the eligibility analysis.