Settlement Removal
Endpoint to discard an individual settlement previously inserted into a payment batch. Only settlements in batches that have not yet been closed can be removed.
Use this endpoint when you need to remove an incorrect or unwanted settlement before closing the batch. After the batch is closed, individual settlements cannot be removed.
Request
Path params
| Parameter | Type | Description |
|---|---|---|
external_id | string | The external_id of the payment batch. |
settlement_external_id | string | The external_id of the settlement to be discarded. |
{
"status": "discarded"
}
Body attributes
| Field | Type | Required | Description |
|---|---|---|---|
status | string | required | New settlement status. To discard, send discarded. |
Response
{
"external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
"status": "discarded"
}
Response attributes
| Field | Type | Description |
|---|---|---|
external_id | string | External settlement key provided by the partner. |
status | string | New settlement status: discarded. |
Possible errors
Settlement not found
The settlement_external_id provided in the URL does not match any settlement registered in this batch. Verify that the batch and settlement identifiers are correct.
{
"title": "Settlement not found",
"description": "The Settlement with external_id {external_id} was not found",
"translation": "A Liquidação com identificador externo {external_id} não foi encontrada",
"code": "SET000011"
}
Invalid status
The value provided in the status field is not valid. For removal, use only discarded.
{
"title": "Invalid status",
"description": "The status given: {status} is not suported.",
"translation": "O status: {status} não possui suporte.",
"code": "SET000026"
}
Batch already closed
The payment batch has already been closed and no longer allows changes to settlements. It is not possible to remove settlements from batches that have passed the pending_settlements_insertion status.
{
"title": "Payment Batch Status mismatch",
"description": "Payment batch of key: {payment_batch_key} with status: {current} was expected to be: {expected}",
"translation": "O lote de pagamento com chave: {payment_batch_key} e com status: {current} não passou, era esperado que fosse: {expected}",
"code": "SET000016"
}
Incompatible settlement status
The settlement is in a status that does not allow it to be discarded. Only settlements with validated status can be removed.
{
"title": "Settlement type mismatch",
"description": "The settlement given has the status: {current_status} and was expected: {expected_status}",
"translation": "A liquidação com status: {current_status} era esperado ter: {expected_status}",
"code": "SET000024"
}