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.
| Profile | Host | Required permission |
|---|---|---|
| Manager | manager-api | Write |
| Consultant | consultant-api | Batches |
| Assignor | assignor-api | Write |
Base URL for each host: Environments (Hosts).
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.
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 adocument_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.
File in PDF, P7S or XML, Base64-encoded, up to 10 MB. Other formats are refused with TRC000166.
Request
Path params
| Parameter | Type | Description |
|---|---|---|
fund_class_key | string | Unique fund key (UUID). |
assignment_configuration_key | string | Assignment configuration key (UUID). |
assignment_external_id | string | External identifier of the batch, provided at batch creation. |
asset_external_id | string | The external_id provided at asset creation. |
{
"document_type": "ccb",
"document_b64": "aGVsbG8gd29ybGQgaWYgeW91IGRlY29kZWQgbWUsIGJlIGNhcmVmdWwuIEl0IG11c3QgYmUgYSBQREYgRmlsZSBvdGhlcndpc2UgSSB3aWxsIHJhaXNlIGFuIEVycm9yLg=="
}
Body attributes
| Field | Type | Required | Description |
|---|---|---|---|
document_type | string | required | Type of the document being submitted. The accepted values are those set in the assignment configuration used — see the enumerators below. |
document_b64 | string | required | File content Base64-encoded (PDF, P7S or XML; up to 10 MB). |
document_type values (accepted only when listed in the assignment configuration):
| Value | Description |
|---|---|
ccb | Bank Credit Note (Cédula de Crédito Bancário) — CCB-type assets. |
duplicata_servicos | Service duplicata. |
invoice | Invoice. |
cte | Electronic Bill of Lading (Conhecimento de Transporte Eletrônico). |
discounted_contract | Discounted contract. |
contract | The assigned installment contract itself (the asset), not the assignment contract. |
legal_fees_contract | Legal fees contract. |
check | Check. |
promissory_note | Promissory note. |
disbursement_receipt | Disbursement receipt. |
vehicle_reservation_receipt | Vehicle 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.
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_documentationafter being approved in individual eligibility and awaits the documents set as required for the product. Once all are submitted, it advances topre_approved. - After the assignment. If the assignment configuration requires post-assignment documents, the asset enters
pending_after_assignment_documentationafter 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 tocompletedand the assetcompletedwebhook 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
{
"document_key": "8e515a17-8b4d-49a3-aed6-47c9574e426a"
}
Response attributes
| Field | Type | Description |
|---|---|---|
document_key | string | Unique identifier of the document generated by QI Tech (UUID). |
Errors
| Status | Code | When it happens |
|---|---|---|
| 400 | TRC000032 | document_type is not in the assignment configuration's required_documents or after_assignment_required_documents (includes values that do not exist). |
| 400 | TRC000034 | document_b64 is not valid Base64. |
| 400 | TRC000155 | File larger than 10 MB. |
| 400 | TRC000166 | Format not accepted. Accepted formats: PDF, P7S and XML. |
| 404 | TRC000020 | No asset with that asset_external_id in the batch. |
| 409 | TRC000026 | The asset is not in a status that accepts documents (pending_eligibility, pending_documentation, denied because of a document, or pending_after_assignment_documentation). |
| 409 | TRC000035 | The asset already has a document of this type that was not denied. |
| 409 | TRC000162 | The batch is denied or discarded. |
Authentication, permission and host errors: see API Errors.
Next steps
After submitting all required documents, the flow continues with:
- Close asset insertion — signal that all assets have been inserted so the batch proceeds to the eligibility analysis.