Skip to main content

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.

When each profile can remove assets

The asset must be in pending_eligibility, pending_invoice_validation, pending_documentation or pre_approved. The batch must be in one of these statuses:

ProfileBatch status in which it can remove assets
Managerpending_assets_insertion, completed_assets_insertion, pending_consultant_approval, pending_manager_approval
Consultantpending_assets_insertion, completed_assets_insertion, pending_consultant_approval
Assignorpending_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.

Available on
ProfileHostRequired permission
Managermanager-apiWrite
Consultantconsultant-apiBatches
Assignorassignor-apiWrite

Base URL for each host: Environments (Hosts).

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
assignment_external_idstringThe external_id of the batch.
asset_external_idstringThe external_id of the asset to be removed.
Request Body
{
"asset_status": "denied",
"denial_reason": {
"reason_type": "manager",
"denial_reason": "Sacado fora da política do fundo"
}
}

Body attributes​

FieldTypeRequiredDescription
asset_statusstringrequiredOnly accepted value: denied.
denial_reasonobjectoptionalRemoval 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​

STATUS
200

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:

Response Body (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.

Available on
ProfileHostRequired permission
Managermanager-apiWrite
Consultantconsultant-apiBatches
Assignorassignor-apiWrite

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​

ENDPOINT
/trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}
METHOD
PUT
Request Body — reopen
{
"assignment_status": "pending_assets_insertion"
}
FieldTypeRequiredDescription
assignment_statusstringrequiredpending_assets_insertion to reopen. To close it again, send completed_assets_insertion — see Close Asset 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": 0,
"assignment_total_value": 1234.99
}
FieldTypeDescription
assignment_keystringUnique batch identifier (UUID).
external_idstringExternal key of the batch provided by the partner.
statusstringNew batch status: pending_assets_insertion.
number_of_approved_assetsintegerAlways 0 in this call.
assignment_total_valuenumberLast total value calculated for the batch, in reais. It is recalculated at the next closing.

Errors​

StatusCodeWhen it happens
400TRC000086The asset is not in pending_eligibility, pending_invoice_validation, pending_documentation or pre_approved (for example, already denied or formalized).
400TRC000023asset_status other than denied, or assignment_status with a value that is not accepted.
400TRC000087The batch status does not allow your profile to remove assets or reopen the batch (see the tables above).
400TRC000024Reopening requested for a batch that is not in completed_assets_insertion, pending_consultant_approval or pending_manager_approval.
404TRC000018No batch with that external_id in this assignment configuration.
404TRC000020No asset with that asset_external_id in the batch.

Authentication, permission and host errors: see API Errors.