Skip to main content

Asset Removal from Batch

Process to remove assets from a batch that is awaiting manager approval. Removal involves 3 sequential steps: reopen the batch, remove the desired assets, and close the batch again.

Prerequisite

Asset removal is only possible when the batch is in pending_manager_approval status. With the batch in this status, it must be reopened before any asset changes can be made.

Step 1 — Reopen the batch

Change the batch status to pending_assets_insertion to allow asset removal.

Request

ENDPOINT
/trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}
METHOD
PUT
Request Body
{
"assignment_status": "pending_assets_insertion"
}

Body attributes

FieldTypeRequiredDescription
assignment_statusstringrequiredStatus to update the batch to. To reopen, send pending_assets_insertion.

Response

STATUS
200
Response Body
{
"assignment_key": "8e515a17-8b4d-49a3-aed6-47c9574e426a",
"external_id": "9eec85be-97c9-41e0-88b3-b17a39869b36",
"status": "pending_assets_insertion",
"number_of_approved_assets": 10,
"assignment_total_value": 1234.99
}

Response attributes

FieldTypeDescription
assignment_keystringUnique batch identifier (UUID).
external_idstringExternal batch key provided by the partner.
statusstringNew batch status: pending_assets_insertion.
number_of_approved_assetsintegerNumber of approved assets in the batch.
assignment_total_valuenumberTotal assignment value in BRL.

Step 2 — Remove assets

With the batch reopened, remove each desired asset by changing its status to denied. Make one request per asset to be removed.

Request

ENDPOINT
/trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}/asset/{asset_external_id}
METHOD
PUT

Path params

ParameterTypeDescription
asset_external_idstringThe external_id of the asset to be removed.
Request Body
{
"asset_status": "denied"
}

Body attributes

FieldTypeRequiredDescription
asset_statusstringrequiredStatus to update the asset to. To remove, send denied.

Response

STATUS
200
Response Body
{
"external_id": "9eec85be-97c9-41e0-88b3-b17a39869b36",
"status": "denied"
}

Response attributes

FieldTypeDescription
external_idstringAsset external key.
statusstringNew asset status: denied.

Step 3 — Close the batch again

After removing the desired assets, close the batch so it proceeds again to manager approval.

Request

ENDPOINT
/trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}
METHOD
PUT
Request Body
{
"assignment_status": "completed_assets_insertion"
}

Body attributes

FieldTypeRequiredDescription
assignment_statusstringrequiredStatus to update the batch to. To close, send completed_assets_insertion.

Response

STATUS
200
Response Body
{
"assignment_key": "8e515a17-8b4d-49a3-aed6-47c9574e426a",
"external_id": "9eec85be-97c9-41e0-88b3-b17a39869b36",
"status": "completed_assets_insertion",
"number_of_approved_assets": 10,
"assignment_total_value": 1234.99
}

Response attributes

FieldTypeDescription
assignment_keystringUnique batch identifier (UUID).
external_idstringExternal batch key provided by the partner.
statusstringNew batch status: completed_assets_insertion.
number_of_approved_assetsintegerNumber of remaining approved assets.
assignment_total_valuenumberUpdated total assignment value in BRL.

After closing the batch, it will proceed again to manager approval and continue the flow normally.

Possible errors

STATUS
404
Asset not found

The asset_external_id provided in the URL does not match any asset in the batch. Verify the identifier is correct and that the asset belongs to the specified batch.

{
"title": "Asset not found",
"description": "Asset not found",
"translation": "Ativo não foi encontrado",
"code": "TRC000020"
}
STATUS
400
Asset cannot be removed

The specified asset cannot be denied/removed in its current status. This can occur when the asset has already been discarded or when the batch is not open for modification.

{
"title": "Cant deny this asset.",
"description": "This asset cant be denied.",
"translation": "Esse ativo não pode ser negado",
"code": "TRC000086"
}
STATUS
400
Invalid batch status for this operation

The batch is not in a status that allows this operation. To remove assets, the batch must be in pending_assets_insertion status. Check the current batch status and, if necessary, reopen it first (Step 1).

{
"title": "Invalid assignment status",
"description": "Assignment is not in a valid status for this operation",
"translation": "O lote não está em um status valido para essa operação",
"code": "TRC000087"
}