Creating an asset to be repurchased/sold
Inserts an asset from the fund's portfolio into a batch in pending_assets_insertion. Send one request per asset.
Available on
| Profile | Host | Required permission |
|---|---|---|
| Manager | manager-api | Write |
| Consultant | consultant-api | Granted by the integration team |
| Assignor | assignor-api | Write |
Base URL for each host: Environments (Hosts).
Request
ENDPOINT
/trade_resolve/fund_class/FUND_CLASS_KEY/assignment/ASSIGNMENT_EXTERNAL_ID/assetMETHOD
POSTASSIGNMENT_EXTERNAL_ID is the external_id of the batch, provided in the batch creation. The external_id in the body is the asset's.
Request Body
{
"external_id": "7c2d5a10-3f4e-4b8a-9d61-0e2f4a6b8c90",
"sale_value": 1234.56
}
Body Params
| Field | Type | Description | Characters |
|---|---|---|---|
external_id | string | Identifier of the asset, the same one under which it was added to the portfolio. Send this or contract_number. | Up to 50 |
contract_number | string | Contract number of the asset, an alternative to external_id. Accepted for ccb, structured_cci, duplicata_servicos, duplicata_mercantil and cte. | Up to 50 |
borrower_document_number | string | Debtor's document, to disambiguate the asset lookup | 11 to 18 |
sale_value | number | Amount at which the asset will be written off. Send this or calculation_method. | 2 decimal places |
calculation_method | string | Calculates the sale value instead of providing it. Only accepted value: current_fair_value (the asset's current fair book value). | Up to 255 |
Rules
- The asset must be active in the fund's portfolio and be of the same asset type as the batch configuration.
- Send exactly one of
external_idandcontract_number, and exactly one ofsale_valueandcalculation_method. - In
assignment_resolutionbatches,sale_valuemust equal the asset's acquisition value (TRR000053).
Response
STATUS
201Response Body
{
"asset_key": "0b6f6c55-5d1b-4b6e-8f3a-6c1f0f7f2b10",
"asset_resolve_key": "e4a1c9d2-7b3f-4e8a-a5c6-1d2e3f4a5b6c",
"asset_status": "pending_wallet_sale"
}
asset_status | When |
|---|---|
pending_wallet_sale | The sale price diverges by up to 5% from the asset's fair book value. The asset proceeds in the flow. |
pending_validation | The sale price diverges by more than 5% from the fair book value. The asset is held until a confirmation, which is not available in the API: align with integracao.dtvm@qitech.com.br. |
Retry and duplicates
In case of error, resend the request. A duplicate (TRR000042) means the asset is already in a non-discarded batch: do not insert it again. See Retry and duplicates.
Errors
| Status | Code | When it happens |
|---|---|---|
| 400 | QIT000001 | Body outside the contract: unknown field or invalid format |
| 400 | TRR000050 | Neither sale_value nor calculation_method was sent |
| 400 | TRR000051 | sale_value and calculation_method sent together |
| 400 | TRR000052 | calculation_method other than current_fair_value |
| 400 | TRR000071 | Neither external_id nor contract_number was sent |
| 400 | TRR000070 | external_id and contract_number sent together |
| 400 | TRR000072 | The batch's asset type does not accept contract_number: use external_id |
| 400 | TRR000021 | The batch is not in pending_assets_insertion (it has already been closed or discarded) |
| 400 | TRR000029 | More than one asset found: provide borrower_document_number or use external_id |
| 400 | TRR000053 | assignment_resolution batch with sale_value different from the acquisition value |
| 403 | TRR000049 | The agent does not have access to this fund or this batch |
| 404 | TRR000006 | There is no fund with this fund_class_key |
| 404 | TRR000020 | Batch not found with this external_id |
| 404 | TRR000028 | No active asset found in the fund's portfolio with this external_id |
| 404 | TRR000073 | Asset not found with this contract_number |
| 409 | TRR000042 | The asset is already in a batch that has not been discarded |
Authentication, permission and host errors: see API errors.