Asset Removal from Batch
To take an asset out of a batch before approval, update the asset status to denied. The asset no longer belongs to the batch and its value is removed from the assignment total. If you also need to add assets, reopen the batch, adjust the assets and close the insertion again.
The asset must be in pending_eligibility, pending_invoice_validation, pending_documentation or pre_approved. The batch must be in one of these statuses:
| Profile | Batch status in which it can remove assets |
|---|---|
| Manager | pending_assets_insertion, completed_assets_insertion, pending_consultant_approval, pending_manager_approval |
| Consultant | pending_assets_insertion, completed_assets_insertion, pending_consultant_approval |
| Assignor | pending_assets_insertion, completed_assets_insertion |
The manager removes assets from a batch in pending_manager_approval without reopening it and then approves the batch.
Remove an asset
Make one request for each asset to be removed.
| Profile | Host | Required permission |
|---|---|---|
| Manager | manager-api | Write |
| Consultant | consultant-api | Batches |
| Assignor | assignor-api | Write |
Base URL for each host: Environments (Hosts).
Request
Path params
| Parameter | Type | Description |
|---|---|---|
assignment_external_id | string | The external_id of the batch. |
asset_external_id | string | The external_id of the asset to be removed. |
{
"asset_status": "denied",
"denial_reason": {
"reason_type": "manager",
"denial_reason": "Sacado fora da política do fundo"
}
}
Body attributes
| Field | Type | Required | Description |
|---|---|---|---|
asset_status | string | required | Only accepted value: denied. |
denial_reason | object | optional | Removal reason: reason_type (required inside the object; use manager, consultant or assignor) and denial_reason (free text). Without this object, the recorded source is your profile. |
Response
The response is the updated asset, in the same format as each item of the Asset Query, with the operation object (credit_operation, discounted_credit_right or contract). Excerpt:
{
"asset_key": "f4348106-01c4-4c59-a261-7c09db811c47",
"external_id": "9eec85be-97c9-41e0-88b3-b17a39869b36",
"total_purchase_value": 1231.21,
"asset_type": "ccb",
"status": "denied",
"denied_by": "manager",
"denial_reason": "Sacado fora da política do fundo"
}
Reopen and close the batch
To add new assets to a batch whose insertion has already been closed, reopen it with pending_assets_insertion, insert or remove the assets and close it again with completed_assets_insertion. Once closed, the batch goes through eligibility and the approvals again.
| Profile | Host | Required permission |
|---|---|---|
| Manager | manager-api | Write |
| Consultant | consultant-api | Batches |
| Assignor | assignor-api | Write |
Base URL for each host: Environments (Hosts).
The batch can be reopened when it is in completed_assets_insertion, pending_consultant_approval or pending_manager_approval. The consultant does not reopen batches in pending_manager_approval.
Request
{
"assignment_status": "pending_assets_insertion"
}
| Field | Type | Required | Description |
|---|---|---|---|
assignment_status | string | required | pending_assets_insertion to reopen. To close it again, send completed_assets_insertion — see Close Asset Insertion. |
Response
{
"assignment_key": "8e515a17-8b4d-49a3-aed6-47c9574e426a",
"external_id": "9eec85be-97c9-41e0-88b3-b17a39869b36",
"status": "pending_assets_insertion",
"number_of_approved_assets": 0,
"assignment_total_value": 1234.99
}
| Field | Type | Description |
|---|---|---|
assignment_key | string | Unique batch identifier (UUID). |
external_id | string | External key of the batch provided by the partner. |
status | string | New batch status: pending_assets_insertion. |
number_of_approved_assets | integer | Always 0 in this call. |
assignment_total_value | number | Last total value calculated for the batch, in reais. It is recalculated at the next closing. |
Errors
| Status | Code | When it happens |
|---|---|---|
| 400 | TRC000086 | The asset is not in pending_eligibility, pending_invoice_validation, pending_documentation or pre_approved (for example, already denied or formalized). |
| 400 | TRC000023 | asset_status other than denied, or assignment_status with a value that is not accepted. |
| 400 | TRC000087 | The batch status does not allow your profile to remove assets or reopen the batch (see the tables above). |
| 400 | TRC000024 | Reopening requested for a batch that is not in completed_assets_insertion, pending_consultant_approval or pending_manager_approval. |
| 404 | TRC000018 | No batch with that external_id in this assignment configuration. |
| 404 | TRC000020 | No asset with that asset_external_id in the batch. |
Authentication, permission and host errors: see API Errors.