Skip to main content

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.

Available on
ProfileHostRequired permission
Managermanager-apiWrite
Consultantconsultant-apiBatches

Base URL for each host: Environments (Hosts).

Substitution batches

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.

Where am I in the flow?

Before this, you must have created the batch. Also insert the new assets that will replace the repurchased ones.

Request​

ENDPOINT
/trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}/repurchased_asset
METHOD
POST
Request Body
{
"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​

FieldTypeRequiredDescription
asset_typestringrequiredType of the asset to be repurchased (e.g., ccb, duplicata_mercantil, discounted_contract).
external_idstringrequiredThe external_id under which the asset was originally assigned to the fund. From 1 to 50 characters.
assignor_document_numberstringrequiredCPF or CNPJ, with punctuation, of the assignor that assigned the asset to the fund.
settlement_typestringrequiredRepurchase modality. See the table below.
repurchase_valuenumberoptionalRepurchase value, in reais. Minimum 0.01. If omitted, the asset's current fair value in the fund's portfolio applies.

settlement_type values:

ValueDescription
asset_settlementFull repurchase of the asset.
asset_amortizationPartial repurchase (amortization) of the asset.

Response​

STATUS
201
Response Body (summarized assignment)
{
"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​

FieldTypeDescription
repurchased_asset_keystringUnique identifier of the repurchase generated by QI Tech (UUID).
asset_typestringType of the repurchased asset.
asset_keystringIdentifier of the asset in the fund's portfolio (UUID).
external_idstringThe asset external_id, as provided in the request.
assignorobjectAssignor that assigned the asset: assignor_key, document_number and name.
statusstringRepurchase status. See the table below.
assignmentobjectSubstitution batch, with the same structure as the Assignment Batch Retrieval, without status_events.
repurchase_valuenumberRepurchase value, in reais.
contract_numberstringContract number of the repurchased asset, when available.
maturity_datestringMaturity of the repurchased asset, in the YYYY-MM-DD format.

Repurchase status:

StatusDescription
pending_assignment_validationRepurchase registered, waiting for the batch to move through the flow.
sending_to_walletRepurchase being settled in the fund's portfolio.
completedRepurchase completed.
discardedRepurchase discarded together with the batch.

Errors​

StatusCodeWhen it happens
400TRC000088The batch's assignment configuration is not a repurchase configuration.
400TRC000089The batch is not in pending_assets_insertion.
400TRC000090The asset was not found in the fund's portfolio for that assignor, type and external_id, or it cannot be repurchased.
404TRC000005No assignor with that assignor_document_number.
404TRC000012Nonexistent asset_type.
404TRC000018No batch with that external_id in this assignment configuration.

Authentication, permission and host errors: see API Errors.

Next steps​

  1. Insertion of the new assets — add the assets that will replace the repurchased ones.
  2. Document submission — submit the required documentation for each new asset.
  3. Close asset insertion — signal that all assets have been inserted so the batch proceeds to the eligibility analysis.