Asset creation — discounted contract
Endpoint to insert a Discounted Contract asset into an assignment batch. This asset type represents an installment of a credit contract whose credit right will be assigned to the fund.
| Profile | Host | Required permission |
|---|---|---|
| Manager | manager-api | Write |
| Consultant | consultant-api | Batches |
| Assignor | assignor-api | Write |
Base URL for each host: Environments (Hosts).
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.
Think of a 5-installment contract as a sheet with 5 coupons.
- Discounted contract (
discounted_contract): you assign loose coupons. Each installment is an asset and goes in its own request. - Installment contract (
contract): you assign the whole sheet. The contract is a single asset and goes in one request, with the installments inside.
| Discounted contract | Installment contract | |
|---|---|---|
| The asset is | one installment | the whole contract |
| Requests per contract | one per installment | one |
| What you need at assignment time | only the installment being assigned | amount and due date of every installment being assigned |
Price (total_purchase_value) | of each installment | of the contract; QI Tech splits it across the installments |
| How installments are assigned | one by one, each in the batch you want | together, in the same asset |
| Rejection in eligibility | only that installment leaves | the whole contract leaves |
| Bankslip | one per installment | one per installment |
| Payments you report | every credit-right type, including refund, gloss and interest | only settlement and amortization, of the contract or of one installment |
| Extend the due date | yes, installment by installment (asset_extension) | no |
| Repurchase | installment by installment | only the whole contract |
| Portfolio report | one row per installment; the contract-number column shows order_number | one row per installment, with the contract and installment numbers |
Which one fits your operation:
- You sell installments over time, choose which ones to sell, or need to extend, refund or repurchase single installments: discounted contract.
- You sell the contract as one unit, with a single price, and every installment is known at assignment time: installment contract.
The type is not chosen when sending: it comes from your assignment configuration, and the batch only accepts assets of that type (TRC000025). To check yours, see asset_type in the configuration listing. To change the type, contact the integration team.
Installment and contract
In this asset type, each installment is an asset. A 5-installment contract becomes 5 insertions, each with its own external_id, its own face_value (the value of that installment), its own maturity_date and its own installment_number. You do not send the values of the other installments.
The contract object identifies the source contract and repeats, unchanged, in every installment of the same contract:
numbergroups the installments. It is the filter for a contract's assets in the asset query, it appears in the Assignment Term attachment and it identifies the asset in a repurchase. Keep the same value in every installment.issue_dateis the contract issue date and becomes the asset issue date.total_face_valueandnumber_of_installmentsare informational. They describe the whole contract and do not affect the price, the eligibility or the bankslip. QI Tech does not check them against the installments received.
Installments can be assigned in different batches, in any order. You do not have to assign all of them, nor assign the first one before the others.
Request
{
"asset_type": "discounted_contract",
"total_purchase_value": 1231.21,
"discounted_credit_right": {
"external_id": "mdf27za1-ra5f-46c0-a32f-fb909884dbb2",
"originator_document_number": "22.333.444/0001-81",
"face_value": 1231.21,
"maturity_date": "2025-12-10",
"installment_number": 1,
"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": "CT958431587P01",
"contract": {
"number_of_installments": 5,
"total_face_value": 6156.05,
"number": "958431587",
"issue_date": "2023-10-10"
}
}
}
Body attributes
| Field | Type | Required | Description |
|---|---|---|---|
asset_type | string | required | Asset type. For a discounted contract, provide discounted_contract. |
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. |
face_value | number | required | Face value. Up to 8 decimal places. |
maturity_date | string | required | Installment maturity date in the YYYY-MM-DD format. |
installment_number | integer | required | Number of the contract installment this asset represents. Without it, the insertion returns TRC000077. |
participant_control_number | string | optional | Your control number for the asset. Maximum of 25 characters. In an assignment with bankslip, it becomes the bankslip participant control number and must always be sent, with a unique value. See From asset to bankslip. |
order_number | string | optional | Document number in your system. Maximum of 45 characters. In an assignment with bankslip, its last 10 characters become the bankslip document number. |
bankslip | object | optional | Bankslip data, when you issue the "nosso número". See the bankslip attributes on the Asset Creation — Duplicata page. |
delay | object | optional | Late fine and interest for the bankslip. See the delay attributes on the Asset Creation — CTE page. Without it, the charges in the fund's collection configuration apply. |
borrower | object | required | Drawee data. See the borrower attributes on the Asset Creation — CCB page. |
contract | object | required | Contract data. See contract attributes. Without it, the insertion returns TRC000075. Do not send the invoice object for this asset type (TRC000076). |
contract attributes
| Field | Type | Required | Description |
|---|---|---|---|
number_of_installments | integer | required | Total number of installments in the contract, assigned or not. Informational. |
total_face_value | number | required | Sum of the face value of all installments in the contract, assigned or not. Informational. Up to 2 decimal places. |
number | string | required | Contract number in your system. Maximum of 50 characters. Use the same value in every installment of the contract. |
issue_date | string | required | Contract issue date in the YYYY-MM-DD format. Use the same date in every installment. |
See Installment and contract for how each field is used.
Response
{
"asset_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
"external_id": "mdf27za1-ra5f-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 | TRC000077 | Missing installment_number. |
| 400 | TRC000075 | Missing contract object. |
| 400 | TRC000076 | invoice object sent in a discounted_contract asset. |
| 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.