Pular para o conteúdo principal

Renegociação em lote

ATENÇÃO

A renegociação em lote só pode ser criada com operações de um mesmo emitente e mesma chave de integração.

ATENÇÃO

Há um limite de 50 operações para cada renegociação em lote.

1. Simular uma renegociação em lote

Request

ENDPOINT
/renegotiation/batch_proposal_simulation
MÉTODO
POST
Request Body
{
"amortization_type": "installment_payment",
"reference_date": "2022-07-20",
"discount_percentage": 0.0,
"operations": [
{
"contract_number": "ABCD/1",
"installments": [{
"installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88"
}]
},
{
"contract_number": "ABCD/2",
"installments": [{
"installment_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e"
}]
}
]
}

Response

Response Body
{
"amortization_type": "installment_payment",
"discount_percentage": 0.0,
"discount_amount": 0.0,
"payment_amount": 240,
"requester_name": "Requester",
"requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
"issuer_name": "issuer",
"reference_date": "2022-07-20",
"issuer_document_number": "98765432100",
"operations": [
{
"contract_number": "ABCD/1",
"payment_amount": 100,
"discount_amount": 0,
"affected_installments": [
{
"installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
"due_date": "2022-05-01",
"principal_amount": 100,
"interest_amount": 20,
"fine_amount": 5,
"total_amount": 125,
"present_amount": 100,
"paid_amount": 100
}
],
"remaining_installments": [
{
"installment_key": "7ac54a3e-fd11-46b2-b811-4c7d6d158fd5",
"due_date": "2022-08-01",
"principal_amount": 100,
"interest_amount": 20,
"fine_amount": 5,
"total_amount": 125
}
]
},
{
"contract_number": "ABCD/2",
"payment_amount": 140,
"discount_amount": 0,
"affected_installments": [
{
"installment_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e",
"due_date": "2022-05-01",
"principal_amount": 100,
"interest_amount": 20,
"fine_amount": 5,
"total_amount": 200,
"present_amount": 140,
"paid_amount": 140
}
],
"remaining_installments": [
{
"installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18907",
"due_date": "2022-08-01",
"principal_amount": 100,
"interest_amount": 20,
"fine_amount": 5,
"total_amount": 125
}
]
}
]
}

Campos de desconto

Adicionar um destes campos na requisição permite definir um valor de desconto percentual ou absoluto na criação ou simulação da proposta de renegociação.

Desconto percentual
{
"discount_percentage": 0.5
}
Desconto absoluto
{
"discount_amount": 200
}

2. Criar uma renegociação em lote

ATENÇÃO

O Campo 'request_control_key' é livre e opcional e possui a finalidade de garantir a unicidade das requisições.

Request

ENDPOINT
/renegotiation/batch_proposal
MÉTODO
POST
Request Body
{
"amortization_type": "installment_payment",
"reference_date": "2022-07-20",
"proposal_due_date": "2022-07-20",
"discount_percentage": 0.0,
"payment_type": "bank_slip",
"request_control_key": "4f75374c-e02f-4459-bddc-b9a7a0c9b0f3",
"operations": [
{
"contract_number": "ABCD/1",
"installments": [{
"installment_key": "767f6ce0-add7-4334-a843-0e82cd1e7360"
}]
},
{
"contract_number": "ABCD/2",
"installments": [{
"installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e89"
}]
}
]
}

Response

Response Body
{
"batch_proposal_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
"batch_proposal_status": "pending_payment",
"amortization_type": "installment_payment",
"discount_percentage": 0.0,
"discount_amount": 0.0,
"payment_amount": 240,
"requester_name": "Requester",
"requester_key": "0193d113-9abd-4a13-8edb-2d94c2fdb70b",
"issuer_name": "issuer",
"reference_date": "2022-07-20",
"proposal_due_date": "2022-07-20",
"issuer_document_number": "98765432100",
"payment_type": "bank_slip",
"request_control_key": "4f75374c-e02f-4459-bddc-b9a7a0c9b0f3",
"payment": {
"digitable_line": "",
"qr_code_url": "",
"qr_code_key": "",
"bank_slip_key": "",
"paid_method_type": null
},
"operations": [
{
"contract_number": "ABCD/1",
"payment_amount": 100,
"discount_amount": 0,
"affected_installments": [
{
"installment_key": "767f6ce0-add7-4334-a843-0e82cd1e7360",
"due_date": "2022-05-01",
"principal_amount": 100,
"interest_amount": 20,
"fine_amount": 5,
"total_amount": 125,
"present_amount": 100,
"paid_amount": 100
}
],
"remaining_installments": [
{
"installment_key": "6807c8ee-8deb-40da-9b39-653d64ee8db7",
"due_date": "2022-08-01",
"principal_amount": 100,
"interest_amount": 20,
"fine_amount": 5,
"total_amount": 125
}
]
},
{
"contract_number": "ABCD/2",
"payment_amount": 140,
"discount_amount": 0,
"affected_installments": [
{
"installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e89",
"due_date": "2022-05-01",
"principal_amount": 100,
"interest_amount": 20,
"fine_amount": 5,
"total_amount": 200,
"present_amount": 140,
"paid_amount": 140
}
],
"remaining_installments": [
{
"installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18907",
"due_date": "2022-08-01",
"principal_amount": 100,
"interest_amount": 20,
"fine_amount": 5,
"total_amount": 125
}
]
}
]
}

3. Listar renegociações em lote

Path params

CampoTipoDescriçãoCaracteres
batch_proposal_status *stringStatus proposta de renegociação em lote.-
issuer_document_number *stringNúmero de documento do emitente-
request_control_key *stringChave de identificação do solicitante-

Request

ENDPOINT
/renegotiation/batch_proposal
MÉTODO
GET
Response Body
{
"data": [
{
"batch_proposal_key": "7eba74fb-e893-40ac-91bb-9a9d8f8108d7",
"request_control_key": "cb55f099-d7cf-4b0a-9ddb-8e3ac3fefe8e",
"batch_proposal_status": "pending_payment",
"amortization_type": "installment_payment",
"discount_percentage": 0,
"discount_amount": 0.0,
"payment_amount": 240,
"requester_name": "Requester",
"requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
"issuer_name": "issuer",
"reference_date": "2022-07-25",
"proposal_due_date": "2022-07-25",
"issuer_document_number": "98765432100",
"payment_type": "bank_slip"
},
{
"batch_proposal_key": "272d1b0f-c06d-47c0-943b-812609ff2e6f",
"request_control_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e",
"batch_proposal_status": "pending_payment",
"amortization_type": "installment_payment",
"discount_percentage": 0,
"discount_amount": 0.0,
"payment_amount": 240,
"requester_name": "Requester",
"requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
"issuer_name": "issuer",
"reference_date": "2022-07-20",
"proposal_due_date": "2022-07-20",
"issuer_document_number": "98765432100",
"payment_type": "bank_slip"
}
],
"pagination": {
"current_page": 1,
"next_page": 2,
"rows_per_page": 2,
"total_pages": 5,
"total_rows": 140
}
}

4. Consultar uma renegociação em lote

Request

ENDPOINT
/renegotiation/batch_proposal/BATCH-PROPOSAL-KEY
MÉTODO
GET
Response Body
{
"batch_proposal_key": "7ac54a3e-fd11-46b2-b811-4c7d6d158fd5",
"request_control_key": "61905b8b-3ed2-46bc-8e9c-a5e99ceaea37",
"batch_proposal_status": "pending_payment",
"amortization_type": "installment_payment",
"discount_percentage": 0.0,
"discount_amount": 0.0,
"payment_amount": 240,
"requester_name": "Requester",
"requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
"issuer_name": "issuer",
"reference_date": "2022-07-20",
"proposal_due_date": "2022-07-20",
"issuer_document_number": "98765432100",
"payment_type": "bank_slip",
"payment": {
"digitable_line": "",
"qr_code_url": "",
"qr_code_key": "",
"bank_slip_key": "",
"paid_method_type": null
},
"operations": [
{
"contract_number": "ABCD/1",
"payment_amount": 100,
"discount_amount": 0,
"affected_installments": [
{
"installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18903",
"due_date": "2022-05-01",
"principal_amount": 100,
"interest_amount": 20,
"fine_amount": 5,
"total_amount": 125,
"present_amount": 100,
"paid_amount": 100
}
],
"remaining_installments": [
{
"installment_key": "34f81236-e24a-4788-88e0-86cd697c36b7",
"due_date": "2022-08-01",
"principal_amount": 100,
"interest_amount": 20,
"fine_amount": 5,
"total_amount": 125
}
]
},
{
"contract_number": "ABCD/2",
"payment_amount": 140,
"discount_amount": 0,
"affected_installments": [
{
"installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e89",
"due_date": "2022-05-01",
"principal_amount": 100,
"interest_amount": 20,
"fine_amount": 5,
"total_amount": 200,
"present_amount": 140,
"paid_amount": 140
}
],
"remaining_installments": [
{
"installment_key": "44cad2ae-60e9-4eb8-bb2a-b37e9557873f",
"due_date": "2022-08-01",
"principal_amount": 100,
"interest_amount": 20,
"fine_amount": 5,
"total_amount": 125
}
]
}
]
}

5. Cancelamento de uma renegociação em lote

ENDPOINT
/renegotiation/batch_proposal/BATCH-PROPOSAL-KEY
MÉTODO
DELETE

Response

ENDPOINT
/renegotiation/batch_proposal/BATCH-PROPOSAL-KEY
MÉTODO
DELETE
HTTP STATUS
204
Response Body
    {}

6. Webhooks

6.1. Webhook de pagamento de renegociação em lote

Webhook Body
{
"webhook_type": "renegotiation.batch_proposal",
"key": "\<BATCH-PROPOSAL-KEY\>",
"event_datetime": "\<DATA E HORA DO ENVIO DO WEBHOOK\>",
"status": "paid",
"data": {
"paid_method_type": "<METODO DE PAGAMENTO>",
"paid_in": {
"code_number": "<CODIGO DO BANCO LIQUIDANTE>",
"ispb": "<ISPB DO BANCO LIQUIDANTE>",
"name": "<NOME DO BANCO LIQUIDANTE>"
}
}
}

6.2. Webhook de rejeição de renegociação em lote

ATENÇÃO

Uma renegociação em lote pode ser rejeitada pelo decurso de prazo do pagamento ou por um pagamento de parcela por fora da renegociação.

Webhook Body
{
"webhook_type": "renegotiation.batch_proposal",
"key": "\<BATCH-PROPOSAL-KEY\>",
"event_datetime": "\<DATA E HORA DO ENVIO DO WEBHOOK\>",
"status": "rejected",
"data": {}
}

6.3. Exemplo de payment data da installment paga através de renegociação em lote

Webhook Body
{
"batch_renegotiation_proposal_key": "f9addba2-ec91-41bf-a150-c59eb1c3fbef",
"paid_in": {
"ispb": "18236120",
"name": "NU PAGAMENTOS - IP",
"code_number": 260
},
"resource_account_key": "ea44b9f2-ad00-4896-b8a3-b1a3da28a72f"
}