Boleto bancario is a Brazilian payment voucher regulated by the Banco Central do Brasil. At checkout you issue a boleto for the amount due, with a barcode and a number. The customer pays it before it expires at a bank, an ATM, an authorized agent or in online banking (Stripe). Nothing moves until they do.
That's the whole merchant problem in one sentence. A card says yes or no inside your API call. A boleto says "maybe, in a few days", and your order system has to hold that answer without shipping or forgetting it.
The Timeline on Stripe
| Step | When | Source |
|---|---|---|
Voucher issued, PaymentIntent in requires_action | At checkout | Stripe |
| Voucher expires | 3 calendar days by default, configurable from 0 to 60, at 23:59 Sao Paulo time | Stripe |
Paid voucher confirmed (payment_intent.succeeded) | Next business day after the customer pays | Stripe |
Expired voucher reported (payment_intent.payment_failed) | 1 business day after expiry | Stripe |
| Funds settle | Up to 2 business days (T+2) | Stripe |
Add those up for a Friday order with the default expiry and a customer who pays on the last day. The voucher runs to Monday 23:59, Monday's payment is confirmed on Tuesday, and settlement takes up to two more business days, so the money can land on Thursday, six days after the sale. Pick the expiry for your stock, not for the customer's convenience: a 60-day boleto is a 60-day reservation.
Stripe's boleto is domestic only: a Stripe account in Brazil, a customer in Brazil, BRL, from R$5.00 to R$49,999.99 per voucher. You collect the customer's name, email, address and CPF or CNPJ (Stripe). Stripe's Brazilian price is R$3.45 per boleto (Stripe Brazil), a flat fee, so it's cheapest relative to the basket on large orders.
import stripe
from flask import Flask, request
app = Flask(__name__)
stripe.api_key = "sk_test_..."
ENDPOINT_SECRET = "whsec_..."
def create_boleto_payment(order, days_to_pay=3):
return stripe.PaymentIntent.create(
amount=order.total_centavos,
currency="brl", # Boleto is BRL only
payment_method_types=["boleto"],
payment_method_options={"boleto": {"expires_after_days": days_to_pay}},
metadata={"order_id": order.id},
idempotency_key="boleto-create-" + order.id,
)
@app.post("/webhooks/stripe")
def stripe_webhook():
try:
event = stripe.Webhook.construct_event(
request.get_data(), request.headers.get("Stripe-Signature"), ENDPOINT_SECRET
)
except (ValueError, stripe.SignatureVerificationError):
return "", 400
pi = event.data.object
order_id = pi.metadata["order_id"]
if event.type == "payment_intent.requires_action":
# Voucher issued: email the link, the customer is about to close the tab.
voucher = pi.next_action.boleto_display_details
send_voucher_email(order_id, voucher.hosted_voucher_url, voucher.expires_at)
elif event.type == "payment_intent.succeeded":
mark_paid(order_id, event_id=event.id) # next business day after payment
elif event.type == "payment_intent.payment_failed":
release_stock(order_id, event_id=event.id) # voucher expired unpaid
offer_pix_instead(order_id)
return "", 200
No Chargebacks, No Refunds, Lots of Unpaid Vouchers
- No chargebacks. Customers can't dispute a boleto through the card-style process. Stripe notes that bank-side irregularities can still happen, and contacts you if one does (Stripe).
- No refunds through Stripe. Boleto supports neither full nor partial refunds there (Stripe). Refunding means a bank transfer or Pix to details you collect afterwards, or store credit, and a support script written before the first request.
- Unpaid vouchers are the normal failure. Nobody declines a boleto. The customer simply doesn't pay it, and you find out a business day after it expires. We couldn't find a primary source that publishes boleto non-payment or conversion rates, so measure your own: issued, paid and expired per week, by basket size.
Boleto or Pix?
If you can only add one Brazilian method this quarter, the trade-off is clear from the mechanics. Pix confirms in seconds, can be refunded, and settles on the same T+2 at Stripe; boleto confirms a business day after payment and can't be refunded through the API (Stripe, Stripe). Boleto still earns its place for customers who want a document to pay from, B2B invoices with a due date, and payers who'd rather pay at a bank or an authorized agent than in an app.
You also don't have to choose on the voucher itself. Resolution BCB 443 of 12 December 2024 lets a boleto be paid through other BCB arrangements such as Pix, and the BCB is standardizing "hybrid" collection: one document with both a barcode and a Pix QR code (BCB). Ask your PSP whether its boleto carries a Pix QR. It's the cheapest way to turn some of those unpaid vouchers into paid ones.
The pending state a voucher needs: two timers, one code path. From chapter 22.
Asynchronous Confirmation
Cards give you an answer inside the API call. Most of this chapter doesn't. A bank redirect returns the customer to you with no promise that the bank has told you anything yet. Chapter 5 covers the payment state machine in general; this is what it has to do for these methods.
The order needs a real pending state, not a spinner. When create_payment returns PENDING, record the order as awaiting payment and hold whatever you promised (stock, a seat, a license) for a bounded time. Then show the customer a page that says the payment is pending and what they still have to do. For a redirect, that's a return page that doesn't claim a success it hasn't seen. For a voucher, it's the voucher plus an email, because the customer is about to close the tab and walk to a store.
Two timers govern the pending state, and they're different lengths. The confirmation timer is how long you'll wait for the provider to say paid. Set it from the method's own expiry (a voucher's expiration date, or a short window for a redirect that never came back) and mark the order expired when it fires. The hold timer is how long stock stays reserved, and it can be shorter than the confirmation timer when the item is scarce. A payment that confirms after the hold lapsed leaves you a paid order and nothing to ship, so decide whether that means a backorder or an automatic refund; either works if it's decided in advance.
Confirmation itself arrives as a webhook, and it races the customer's browser: the redirect return and the webhook can land in either order, seconds or hours apart, and each can arrive more than once. Make the transition idempotent: the first signal that says paid moves the order to paid, and every later one is a no-op. The return page reads the order's state instead of trusting the query string it arrived with. For a webhook that never comes, get_payment_status is the fallback, polled on a schedule for orders still pending near their expiry. Chapter 39 covers signature verification and delivery semantics for the webhooks themselves.
Fulfillment waits on the paid state and nothing else. It doesn't wait on the return URL, on the customer's emailed receipt, or on AUTHORIZED, which for BNPL only means the provider approved the plan and you still have to capture. What makes the pattern tolerable is that it's the same pattern for every method: a PIX transfer that confirms in seconds and a Boleto that confirms days later are one code path with different timers.
Where boleto sits next to Pix, OXXO and Mercado Pago. From chapter 6.
Latin America
- Boleto Bancário: Brazil (voucher, paid at a bank, ATM, or online banking)
- OXXO: Mexico (cash at convenience stores)
- PIX: Brazil (instant payments)
- MercadoPago: Multiple countries
Questions
What is a boleto?
Boleto bancario is a Brazilian payment voucher regulated by the Banco Central do Brasil. The merchant issues a voucher with a barcode and a number, and the customer pays it before it expires at a bank, an ATM, an authorized agent or in online banking.
How long does a boleto take to clear?
On Stripe, the voucher expires after 3 calendar days by default (configurable from 0 to 60), a paid voucher is confirmed the next business day after the customer pays, and funds settle in up to 2 business days.
Can boleto payments be charged back or refunded?
Customers can't file a chargeback on a boleto. Stripe doesn't support boleto refunds either, so refunding means a bank transfer or Pix to details you collect, or store credit.
How much does Stripe charge for boleto?
Stripe's Brazilian pricing page lists R$3.45 per boleto. Boleto on Stripe needs a Stripe account in Brazil and a customer in Brazil, in BRL, from R$5.00 to R$49,999.99.
What happens when a boleto isn't paid?
It expires. Stripe sends payment_intent.payment_failed one business day after the expiry date, and the PaymentIntent returns to requires_payment_method, so you can offer another method or cancel the order.