Skip to main content

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.

When to use

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

ENDPOINT
/settlement/fund_class/{fund_class_key}/payment_batch/{external_id}/settlement/{settlement_external_id}
METHOD
PUT

Path params

ParameterTypeDescription
external_idstringThe external_id of the payment batch.
settlement_external_idstringThe external_id of the settlement to be discarded.
Request Body
{
"status": "discarded"
}

Body attributes

FieldTypeRequiredDescription
statusstringrequiredNew settlement status. To discard, send discarded.

Response

STATUS
200
Response Body
{
"external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
"status": "discarded"
}

Response attributes

FieldTypeDescription
external_idstringExternal settlement key provided by the partner.
statusstringNew settlement status: discarded.

Possible errors

STATUS
404
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"
}
STATUS
400
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"
}
STATUS
400
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"
}
STATUS
400
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"
}