Asset Creation — Invoice (Duplicata)
Endpoint to insert a Duplicata asset into an assignment batch. Two subtypes are accepted: Duplicata Mercantil (duplicata_mercantil) — linked to an invoice for the sale of goods — and Service Duplicata (duplicata_servicos) — linked to an invoice for the provision of services.
| Profile | Host | Required permission |
|---|---|---|
| Manager | manager-api | Write |
| Consultant | consultant-api | Batches |
| Assignor | assignor-api | Write |
Base URL for each host: Environments (Hosts).
Both types use the same request body structure. The differences: for a duplicata mercantil, the NF-e access key is required and, after eligibility, the duplicata document is generated by QI Tech from that data; for a service duplicata, the key is optional and the required documents are those defined in the assignment configuration. See the Document Insertion page for more details.
This is step 2 of the assignment flow. Before this, you must have created the batch. After inserting the assets, submit the required documents and close the insertion.
The external_id field of the credit right identifies the asset within the batch and must not be confused with the batch external_id.
Request
{
"asset_type": "duplicata_mercantil",
"total_purchase_value": 1231.21,
"discounted_credit_right": {
"external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
"originator_document_number": "22.333.444/0001-81",
"maturity_date": "2023-12-10",
"order_number": "18923619954796912",
"face_value": 1023.01,
"person_type": "natural_person",
"borrower": {
"name": "Natália Nascimento",
"document_number": "969.698.790-03",
"person_type": "natural_person",
"email": "natalia.nascimento@yopmail.com",
"address": {
"street": "Gilberto Sabino",
"number": "215",
"neighborhood": "Pinheiros",
"city": "São Paulo",
"postal_code": "05425-020",
"uf": "SP",
"country": "BRA"
},
"phone": {
"area_code": "11",
"number": "36360268"
},
"natural_person": {
"mother_name": "Lívia Santos",
"birthdate": "2001-01-05"
}
},
"participant_control_number": "ICX841HWCPUGU4U101XPLDW8D",
"bankslip": {
"our_number": {
"number": 2,
"digit": "P"
}
},
"delay": {
"fine": {
"fine_type": "percentage",
"percentage_value": 0.0
},
"interest": {
"method": "pre_fixed",
"pre_fixed": {
"daily_rate": 0.0,
"calendar_base": "calendar_360"
}
}
},
"invoice": {
"access_key": "35231011222333000181551239584315871861703272",
"total_value": 1231.21,
"serie": "123",
"number": "958431587",
"issue_date": "2023-10-10"
}
}
}
Body attributes
| Field | Type | Required | Description |
|---|---|---|---|
asset_type | string | required | Asset type. Accepted values: duplicata_mercantil or duplicata_servicos. |
total_purchase_value | number | required | Total purchase value of the asset — effectively how much the assignee will pay. Up to 2 decimal places. |
discounted_credit_right | object | required | Credit right data. See discounted_credit_right attributes. |
discounted_credit_right attributes
| Field | Type | Required | Description |
|---|---|---|---|
external_id | string | required | Unique identification key of this asset in the partner's system. Maximum of 50 characters. |
originator_document_number | string | required | Formatted CPF or CNPJ (000.000.000-00 or 00.000.000/0000-00) of the originator that enabled the operation. It must be registered with QI Tech; otherwise, it returns TRC000019. |
maturity_date | string | required | Maturity date in the YYYY-MM-DD format. |
order_number | string | required | Order number. Maximum of 45 characters. Without it, the insertion returns TRC000078. |
face_value | number | required | Face value. Up to 8 decimal places. |
person_type | string | optional | Drawee person type (natural_person or legal_person). |
borrower | object | required | Drawee data. See the borrower attributes on the Asset Creation — CCB page. |
participant_control_number | string | optional | Participant control number in the partner's system. Maximum of 25 alphanumeric characters. |
bankslip | object | optional | Bankslip data. See bankslip attributes. |
delay | object | optional | Late fine and interest data. See the delay attributes on the Asset Creation — CTE page. |
invoice | object | required | Invoice data. See invoice attributes. Without it, the insertion returns TRC000075. Do not send the contract object for this asset type (TRC000076). |
bankslip attributes
| Field | Type | Required | Description |
|---|---|---|---|
our_number | object | optional | Our number data. Applicable only when the our number is issued by the client. See our_number attributes. |
our_number attributes
| Field | Type | Required | Description |
|---|---|---|---|
number | number | required | Our number. Bank number for registered collection. 1 to 11 numeric characters. |
digit | string | required | Self-verification check digit of the our number. 1 alphanumeric character. |
invoice attributes
| Field | Type | Required | Description |
|---|---|---|---|
access_key | string | conditional | NF-e access key, 44 characters. Required for duplicata_mercantil (TRC000134), and positions 21 and 22 of the key must be model 55 (NF-e); another model returns TRC000135. Optional for duplicata_servicos. |
total_value | number | optional | Total invoice value. Up to 2 decimal places. |
serie | string | required | Invoice series number. Maximum of 3 characters. |
number | string | required | Invoice number. Maximum of 9 characters. |
issue_date | string | required | Issue date in the YYYY-MM-DD format. |
Response
{
"asset_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
"external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
"status": "pending_eligibility"
}
Response attributes
| Field | Type | Description |
|---|---|---|
asset_key | string | Unique asset identifier generated by QI Tech (UUID). |
external_id | string | The same external key provided in the external_id field of discounted_credit_right. |
status | string | Initial asset status. It always returns pending_eligibility, indicating that the asset was inserted and is awaiting eligibility analysis. |
Errors
| Status | Code | When it happens |
|---|---|---|
| 400 | QIT000001 | The request body does not follow the expected format: missing required field, invalid type or format. The description points to the field. |
| 404 | TRC000018 | There is no batch with that assignment_external_id in this assignment configuration. |
| 400 | TRC000025 | The asset_type differs from the asset type of the assignment configuration. |
| 400 | TRC000022 | The batch no longer accepts assets: the insertion has already been closed. To add more, reopen the batch. |
| 400 | TRC000009 | Invalid CPF or CNPJ in originator_document_number or in the document_number of a natural person drawee. |
| 404 | TRC000019 | There is no originator registered with the originator_document_number provided. Despite the title (Originator bond not found), the error does not refer to the link with the configuration. |
| 400 | TRC000078 | Missing order_number. |
| 400 | TRC000075 | Missing invoice object. |
| 400 | TRC000076 | contract object sent in a duplicata. |
| 400 | TRC000134 | Missing invoice.access_key in a duplicata_mercantil. |
| 400 | TRC000135 | invoice.access_key is not from an NF-e (model 55 in positions 21 and 22). |
| 409 | TRC000054 | An asset with that external_id already exists in this batch. |
| 409 | TRC100026 | A credit right with that external_id already exists for the same assignor in the fund's portfolio. |
| 400 | TRC1000xx | The asset's financial validation refused the request body. Example: TRC100017 (409), the fund does not buy overdue assets. |
The error body follows the format below:
{
"title": "Already Exist This External Id",
"description": "Already exist an asset with this External Id and asset_key->41d6ff41-1dac-4df7-9e50-d15210ec57f3",
"translation": "Ja existe um ativo com esse External Id e asset_key->41d6ff41-1dac-4df7-9e50-d15210ec57f3",
"code": "TRC000054"
}
In case of error, resend the request. A duplicate (TRC000054) means the resource already exists: query it instead of recreating it, through the asset query endpoint. More in Retry and duplicates.
Authentication, permission and host errors: see API Errors.
Next steps
After inserting the asset, the flow continues with:
- Document submission — submit the required documentation for each asset approved in eligibility.
- Close asset insertion — signal that all assets have been inserted so the batch proceeds to the eligibility analysis.