Migrating Existing Loans to Boleto Pix

Requesting the change

To change existing Loans to Boleto Pix, you can use this endpoint:

PATCH /loans/{uuid}/

{
    "repayment_method": "Boleto Pix"
}

This endpoint validates whether a Loan can be changed to Boleto Pix. The checks include:

  • The Loan status must be Disbursed (only disbursed loans can be migrated).
  • The Loan must not already be using Boleto Pix.
  • There must be no ongoing migration to Boleto Pix.
  • At least one installment must have a due date later than the minimum allowed (default: current day + 1).

If any of these validations fail, the API returns 400 Bad Request and the migration is not started.

If all validations pass, all eligible installments for this Loan will have a Boleto Pix generated.

Webhook

Since this process runs asynchronously in the background, a new webhook notification has been added to inform you when the newly issued Boleto Pix for the Loan's installments are available.

The loan_repayment_method_changed.

This is the payload you'll receive:

{
  "created_at": "YYYY-MM-DDTHH:MM:SSZ",
  "event": "loan_repayment_method_changed",
  "payload": {
    "loan_uuid": "<loan_uuid>",
    "old_repayment_method": null // or QR Code for example
    "new_repayment_method": "Boleto Pix",
  }
}

At this point, we can already do a GET request to the Loan details (GET /loans/{uuid}) and retrieve the new Boleto Pix infos for the installments.