Skip to main content

Batch Renegotiation

ATTENTION

Batch renegotiation can only be created with operations from the same issuer and same integration key.

ATTENTION

There is a limit of 50 operations for each batch renegotiation.

1. Simulate a batch renegotiation​

Request​

ENDPOINT
/renegotiation/batch_proposal_simulation
METHOD
POST
Request Body
{
"amortization_type": "installment_payment",
"reference_date": "2022-07-20",
"discount_percentage": 0.0,
"operations": [
{
"debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
"installments": [{
"installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88"
}]
},
{
"debt_key": "2cbfb9b1-1gdb-5g8d-9967-b338e5eb83g9",
"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": [
{
"debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
"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
}
]
},
{
"debt_key": "2cbfb9b1-1gdb-5g8d-9967-b338e5eb83g9",
"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
}
]
}
]
}

Discount fields​

Adding one of these fields to the request allows you to define a percentage or absolute discount value when creating or simulating the renegotiation proposal.

Percentage discount
{
"discount_percentage": 0.5
}
Absolute discount
{
"discount_amount": 200
}

2. Create a batch renegotiation​

ATTENTION

The field 'request_control_key' is free and optional and is intended to ensure request uniqueness.

Request​

ENDPOINT
/renegotiation/batch_proposal
METHOD
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": [
{
"debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
"installments": [{
"installment_key": "767f6ce0-add7-4334-a843-0e82cd1e7360"
}]
},
{
"debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
"installments": [{
"installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e89"
}]
}
]
}
Attention

The fields discount_amount and discount_percentage CANNOT be sent together in the same payload.

Body Params​

FieldTypeDescriptionCharacters
debt_keystringUnique key of the credit operation within QI Tech.UUID
amortization_typestringAmortization type.Amortization Type Enumerators
reference_datestringReference date to which the present value of the renegotiation will be calculated (must be D+1).10
proposal_due_datestringDue date of the renegotiation proposal.10
payment_typestringPayment type.Payment Type Enumerators
discount_percentagefloatDiscount percentage that will be calculated on the present value of the renegotiation ((1 - discount percentage) * Present Value).10
discount_amountfloatDiscount amount that will be applied to the present value of the renegotiation (Present Value - Gross Discounted Value).10
installmentsarray of objectsRenegotiated installments.Installments Object

Amortization Type Enumerators​

FieldDescription
installment_paymentA renegotiation will be created for the payment of distinct installments sent in the payload.

To use this amortization type, it is necessary to pass the installment_key of the installment.
overdue_installment_paymentA renegotiation will be created directed to the payment of overdue installments.

To use this amortization type, it is necessary to pass the installment_key of the installment.

Payment Type Enumerators​

FieldDescription
bankslipPayment via bank slip (generates bank slip payment and PIX)
pixPayment via PIX (generates only PIX)
manualPayment made manually (does not generate payment method)

Installments Object​

FieldTypeDescriptionCharacters
installment_keystringkey of the installment to be renegotiateduuid key

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": [
{
"debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
"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
}
]
},
{
"debt_key": "2cbfb9b1-1gdb-5g8d-9967-b338e5eb83g9",
"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. List batch renegotiations​

Path params​

FieldTypeDescriptionCharacters
batch_proposal_status *stringBatch renegotiation proposal status.-
issuer_document_number *stringIssuer document number-
request_control_key *stringRequester identification key-

Request​

ENDPOINT
/renegotiation/batch_proposal
METHOD
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. Query a batch renegotiation​

Request​

ENDPOINT
/renegotiation/batch_proposal/BATCH-PROPOSAL-KEY
METHOD
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": [
{
"debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
"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
}
]
},
{
"debt_key": "2cbfb9b1-1gdb-5g8d-9967-b338e5eb83g9",
"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
}
]
}
]
}

Request​

ENDPOINT
/renegotiation/batch_proposal/request_control_key/REQUEST-CONTROL-KEY
METHOD
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": [
{
"debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
"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
}
]
},
{
"debt_key": "2cbfb9b1-1gdb-5g8d-9967-b338e5eb83g9",
"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. Cancel a batch renegotiation​

ENDPOINT
/renegotiation/batch_proposal/BATCH-PROPOSAL-KEY
METHOD
DELETE

Response​

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

6. Webhooks​

6.1. Batch renegotiation payment webhook​

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. Batch renegotiation rejection webhook​

ATTENTION

A batch renegotiation can be rejected due to payment deadline expiration or by payment of an installment outside the renegotiation.

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. Example of payment data for installment paid through batch renegotiation​

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"
}