Addition of Assets to be Repurchased
Endpoint to insert, into a substitution batch, an asset from the fund's portfolio that will be repurchased by the assignor. The value of the repurchased assets is deducted from the assignment payment for the new assets in the same batch.
| Profile | Host | Required permission |
|---|---|---|
| Manager | manager-api | Write |
| Consultant | consultant-api | Batches |
Base URL for each host: Environments (Hosts).
This endpoint only accepts batches created in a repurchase assignment configuration (assignment_configuration_type = repurchase_configuration). The batch must be in pending_assets_insertion. Repurchase assets and new assets can be inserted in any order while the batch is open.
To close the insertion, the batch must have at least one repurchase asset, and the value of the new assets cannot be lower than that of the repurchased assets — see Close Asset Insertion.
Before this, you must have created the batch. Also insert the new assets that will replace the repurchased ones.
Request
{
"asset_type": "duplicata_mercantil",
"external_id": "88c2304e-8eb3-44e0-acb4-25811ae20cf1",
"assignor_document_number": "11.222.333/0001-81",
"repurchase_value": 1000.00,
"settlement_type": "asset_settlement"
}
Body attributes
| Field | Type | Required | Description |
|---|---|---|---|
asset_type | string | required | Type of the asset to be repurchased (e.g., ccb, duplicata_mercantil, discounted_contract). |
external_id | string | required | The external_id under which the asset was originally assigned to the fund. From 1 to 50 characters. |
assignor_document_number | string | required | CPF or CNPJ, with punctuation, of the assignor that assigned the asset to the fund. |
settlement_type | string | required | Repurchase modality. See the table below. |
repurchase_value | number | optional | Repurchase value, in reais. Minimum 0.01. If omitted, the asset's current fair value in the fund's portfolio applies. |
settlement_type values:
| Value | Description |
|---|---|
asset_settlement | Full repurchase of the asset. |
asset_amortization | Partial repurchase (amortization) of the asset. |
Response
{
"repurchased_asset_key": "a6115a17-8b4d-49a3-aed6-47c9574eab88",
"asset_type": "duplicata_mercantil",
"asset_key": "65bbce6d-e0b4-4471-a702-e0ced4542e5b",
"external_id": "88c2304e-8eb3-44e0-acb4-25811ae20cf1",
"assignor": {
"assignor_key": "c1d2e3f4-a5b6-4890-abcd-ef1234567890",
"document_number": "11.222.333/0001-81",
"name": "Cedente Exemplo Ltda"
},
"status": "pending_assignment_validation",
"assignment": {
"assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
"external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
"name": "CESSÃO #12345",
"assignment_number": "12345",
"assignment_date": "2024-04-01",
"status": "pending_assets_insertion",
"origin_type": "client"
},
"repurchase_value": 1000.00,
"contract_number": "000123",
"maturity_date": "2024-09-30"
}
Response attributes
| Field | Type | Description |
|---|---|---|
repurchased_asset_key | string | Unique identifier of the repurchase generated by QI Tech (UUID). |
asset_type | string | Type of the repurchased asset. |
asset_key | string | Identifier of the asset in the fund's portfolio (UUID). |
external_id | string | The asset external_id, as provided in the request. |
assignor | object | Assignor that assigned the asset: assignor_key, document_number and name. |
status | string | Repurchase status. See the table below. |
assignment | object | Substitution batch, with the same structure as the Assignment Batch Retrieval, without status_events. |
repurchase_value | number | Repurchase value, in reais. |
contract_number | string | Contract number of the repurchased asset, when available. |
maturity_date | string | Maturity of the repurchased asset, in the YYYY-MM-DD format. |
Repurchase status:
| Status | Description |
|---|---|
pending_assignment_validation | Repurchase registered, waiting for the batch to move through the flow. |
sending_to_wallet | Repurchase being settled in the fund's portfolio. |
completed | Repurchase completed. |
discarded | Repurchase discarded together with the batch. |
Errors
| Status | Code | When it happens |
|---|---|---|
| 400 | TRC000088 | The batch's assignment configuration is not a repurchase configuration. |
| 400 | TRC000089 | The batch is not in pending_assets_insertion. |
| 400 | TRC000090 | The asset was not found in the fund's portfolio for that assignor, type and external_id, or it cannot be repurchased. |
| 404 | TRC000005 | No assignor with that assignor_document_number. |
| 404 | TRC000012 | Nonexistent asset_type. |
| 404 | TRC000018 | No batch with that external_id in this assignment configuration. |
Authentication, permission and host errors: see API Errors.
Next steps
- Insertion of the new assets — add the assets that will replace the repurchased ones.
- Document submission — submit the required documentation for each new asset.
- Close asset insertion — signal that all assets have been inserted so the batch proceeds to the eligibility analysis.