Skip to main content
Pay boletos, utility bills and DARF from a Midaz account when BTG pays them for your institution.
The partner’s documentation prevails over this page. Your institution validates the flow and implements it on the Lerian APIs. See how to read the diagrams.

Participants


  • Your institution. Calls the Payments BTG API and receives its webhooks.
  • Payments BTG. Reserves the amount in Midaz and pays the bill at BTG.
  • Midaz. The ledger that holds the accounts of your customers.
  • BTG. The partner that pays the bill.

Before you start


  • The paying account exists in Midaz and has a holder.
  • Payments BTG is connected to BTG for your institution.
  • Configure your webhook with POST /v1/admin/webhooks. Send an HTTPS callbackUrl, a secret of at least 32 characters, and the events that you want in enabledEvents. Send an Idempotency-Key.

Diagram


Pay a boleto or a utility bill

Bills and payments through a partner: Pay a boleto or a utility bill

Pay a DARF

Bills and payments through a partner: Pay a DARF

Know when a payment settled

Bills and payments through a partner: Know when a payment settled

Rules


Pay a boleto, a utility bill or a DARF

  • Payments BTG reserves the amount in Midaz before it pays. When the reservation fails, BTG does not receive the payment.
  • Send an Idempotency-Key with each payment request. The key is a UUID.
  • A new key starts a new payment. Read the payment before you send a new key for the same bill.

Know when a payment settled

  • The webhook of step 3 can arrive before step 2 ends.
  • Payments BTG sends only the events that you list in enabledEvents.

How you know it finished


  • GET /v1/payments/{id} shows the result: SETTLED, REJECTED, CANCELED or FAILED.
  • At your callbackUrl, the webhooks PAYMENT_SETTLED, PAYMENT_REJECTED, PAYMENT_CANCELED and PAYMENT_FAILED show the same results.

What can go wrong


The Payments BTG error list describes each code.