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.
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
{
"assignment_status": "pending_assets_insertion"
}
Body attributes
| Field | Type | Required | Description |
|---|---|---|---|
assignment_status | string | required | Status to update the batch to. To reopen, send pending_assets_insertion. |
Response
{
"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
| Field | Type | Description |
|---|---|---|
assignment_key | string | Unique batch identifier (UUID). |
external_id | string | External batch key provided by the partner. |
status | string | New batch status: pending_assets_insertion. |
number_of_approved_assets | integer | Number of approved assets in the batch. |
assignment_total_value | number | Total 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
Path params
| Parameter | Type | Description |
|---|---|---|
asset_external_id | string | The external_id of the asset to be removed. |
{
"asset_status": "denied"
}
Body attributes
| Field | Type | Required | Description |
|---|---|---|---|
asset_status | string | required | Status to update the asset to. To remove, send denied. |
Response
{
"external_id": "9eec85be-97c9-41e0-88b3-b17a39869b36",
"status": "denied"
}
Response attributes
| Field | Type | Description |
|---|---|---|
external_id | string | Asset external key. |
status | string | New 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
{
"assignment_status": "completed_assets_insertion"
}
Body attributes
| Field | Type | Required | Description |
|---|---|---|---|
assignment_status | string | required | Status to update the batch to. To close, send completed_assets_insertion. |
Response
{
"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
| Field | Type | Description |
|---|---|---|
assignment_key | string | Unique batch identifier (UUID). |
external_id | string | External batch key provided by the partner. |
status | string | New batch status: completed_assets_insertion. |
number_of_approved_assets | integer | Number of remaining approved assets. |
assignment_total_value | number | Updated total assignment value in BRL. |
After closing the batch, it will proceed again to manager approval and continue the flow normally.
Possible errors
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"
}
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"
}
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"
}