boleto-billing) on a wallet. Portão 3 registers the boleto at the bank and returns its digitable line and barcode, which you share with the payer — or send them the boleto’s PDF. When they pay, the amount is credited to the wallet. A boleto charge has no webhook: read it back to follow it.
Flow
Step 1: Create the charge
The bank registers the boleto right away, so the charge comes back
CREATED, with the digitableLine and barcode:
INITIATED, still without digitableLine and barcode: read it back until it is CREATED.
Reference: Create a boleto charge
Step 2: Share the boleto
Show the payer thedigitableLine (linha digitável), which they type into their bank app, or render the barcode. To send them the boleto itself, download its PDF. The response is the PDF file encoded in base64, as plain text — decode it to save the file:
data:application/pdf;base64, to open or download it.
Reference: Download a boleto charge’s PDF
Step 3: Know when it’s paid
There is no webhook for a boleto charge. Read the charge to follow itsstatus, or list the wallet’s charges filtered by status — for example ?status=PAID. A paid charge carries what was credited to the wallet in confirmedAmount (with any discount, fine or interest applied) and when in confirmedAt; the payment also appears in the wallet’s transactions.
A charge can’t be cancelled through the API: an unpaid boleto stays payable until
expiresAt, and the bank then writes it off (CANCELED).
Discount, fine and interest
Amounts are in centavos. Percentages are fractions oftxnAmount: 0.02 is 2%, from 0.01 (1%) to 1 (100%).
Errors
When the bank refuses the boleto (a
4xx), the charge is also left PROCESSING; creating it again is safe. Each endpoint’s reference page lists every error it can return.
Next steps
Charge with PIX
Generate a Pix QR Code instead.
Recurring billing with Pix Automático
Charge a customer every month, with a boleto as the fallback.