Skip to main content

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
ProfileHostRequired permission
Managermanager-apiWrite
Consultantconsultant-apiGranted by the integration team
Assignorassignor-apiWrite

Base URL for each host: Environments (Hosts).

Request​

ENDPOINT
/trade_resolve/fund_class/FUND_CLASS_KEY/assignment/ASSIGNMENT_EXTERNAL_ID/asset
METHOD
POST

ASSIGNMENT_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​

FieldTypeDescriptionCharacters
external_idstringIdentifier of the asset, the same one under which it was added to the portfolio. Send this or contract_number.Up to 50
contract_numberstringContract 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_numberstringDebtor's document, to disambiguate the asset lookup11 to 18
sale_valuenumberAmount at which the asset will be written off. Send this or calculation_method.2 decimal places
calculation_methodstringCalculates 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_id and contract_number, and exactly one of sale_value and calculation_method.
  • In assignment_resolution batches, sale_value must equal the asset's acquisition value (TRR000053).

Response​

STATUS
201
Response Body
{
"asset_key": "0b6f6c55-5d1b-4b6e-8f3a-6c1f0f7f2b10",
"asset_resolve_key": "e4a1c9d2-7b3f-4e8a-a5c6-1d2e3f4a5b6c",
"asset_status": "pending_wallet_sale"
}
asset_statusWhen
pending_wallet_saleThe sale price diverges by up to 5% from the asset's fair book value. The asset proceeds in the flow.
pending_validationThe 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​

StatusCodeWhen it happens
400QIT000001Body outside the contract: unknown field or invalid format
400TRR000050Neither sale_value nor calculation_method was sent
400TRR000051sale_value and calculation_method sent together
400TRR000052calculation_method other than current_fair_value
400TRR000071Neither external_id nor contract_number was sent
400TRR000070external_id and contract_number sent together
400TRR000072The batch's asset type does not accept contract_number: use external_id
400TRR000021The batch is not in pending_assets_insertion (it has already been closed or discarded)
400TRR000029More than one asset found: provide borrower_document_number or use external_id
400TRR000053assignment_resolution batch with sale_value different from the acquisition value
403TRR000049The agent does not have access to this fund or this batch
404TRR000006There is no fund with this fund_class_key
404TRR000020Batch not found with this external_id
404TRR000028No active asset found in the fund's portfolio with this external_id
404TRR000073Asset not found with this contract_number
409TRR000042The asset is already in a batch that has not been discarded

Authentication, permission and host errors: see API errors.