Boleto Bancário
Last updated: April 29, 2022
Start accepting payments using Boleto Bancário, a favorite payment method in Brazil. Used as vouchers, it can process payments in US Dollars and Brazilian Real.
Information
If you want to use a gateway model for accepting Boleto Bancário payments, you will need to arrange an agreement with our provider, dLocal, and create merchant details (specifically, x_login
and x_trans_key
) and a secret key with them. Share these details with our Customer Support team and we'll get you up and running. If you have already been onboarded for one of our other dLocal payment methods, you can use the same credentials.
Model | Collecting |
---|---|
Payment flow | Cash & ATM |
Payment method type | Voucher |
One-step payment | |
Authorization | |
Capture | |
Refund | |
Partial refund | |
Chargeback | |
Recurring payment |
Boleto Bancário can be used by either redirecting the customer to a statically hosted ticket (redirect
integration method) or by rendering the complete ticket within your own checkout flow (direct
integration method).
Payments follow a two-step process:
Use the details below to set up your request.
You can find the full list, as well as complete request and response examples, in our API reference.
post
https://api.checkout.com/payments
1{2"source": {3"type": "boleto",4"integration_type": "redirect",5"country": "BR",6"payer": {7"name": "John Doe",8"email": "[email protected]",9"document": "53033315550"10},11"description": "boleto payment"12},13"amount": 100,14"currency": "BRL"15}
Whether you used the direct or redirect method, you should get a 202
response with the status
field set to Pending
. This means your request has been accepted.
1{2"id": "pay_hcklpcd45ymepcr7thciirbdaa",3"status": "Pending",4"customer": {5"id": "cus_kh6eqv276rou7ae5s3uwj4emnq"6},7"_links": {8"self": {9"href": "https://api.sandbox.checkout.com/payments/pay_hcklpcd45ymepcr7thciirbdaa"10},11"redirect": {12"href": "https://sandbox.dlocal.com/collect/pay/pay/M-8aaf7e50-682f-11ea-ab15-cd9dd592717d?xtid=CATH-ST-1584436398-2076616064"13}14}15}
To complete the payment, you need to provide the customer with a Boleto Bancário ticket by following one of two flows:
- If you used the
redirect
method, redirect the customer. - If you used the
direct
method, render the ticket.
Information
When using the redirect
integration method, make sure your customer is aware that they will be redirected to the ticket page when they select your Pay now button, and that they should print or save the ticket.
Using the redirection URL returned in the response above via _links.redirect
, redirect your customer to the static, hosted Boleto Bancário ticket page. Once redirected, your customer should save or print the ticket.
A button on the page will allow them to return to your shop:
- If the ticket is still valid, they will be redirected to your success URL.
- If the ticket has expired, they will be redirected to your failure URL.
Note
Your payment confirmation page should make it clear to the customer that their purchase has not yet been completed. Explain that it has been reserved and is pending payment before the order can be completed and the goods/services can be delivered.
Redirect your customer to your payment confirmation page, where you should summarize their order and render the Boleto Bancário ticket so they can complete the payment.
Note
Your payment confirmation page should make it clear to the customer that their purchase has not yet been completed. Explain that it has been reserved and is pending payment before the order can be completed and the goods/services can be delivered.
To get the components necessary to render the ticket, use the 'get payment details' endpoint below. This will return a ticket
object which contains the components to display the ticket.
Information
Tips for displaying the ticket:
- Allow the customer to copy the ticket number. They need to enter this in their banking app/website to complete the payment.
- Include the barcode. Customers who pay at a physical store or use a barcode reader will need this.
- The barcode needs to be in the Interleaved 2 of 5 (ITF) format to be recognized by all Boleto Bancário barcode readers.
- Include the amount and currency on the ticket.
- Make sure the expiry date is clear and visible, and use the dd/mm/yyyy format.
- You can also include a link to the full ticket with the
source.ticket.image_url
. It's not necessary for payment, but some customers prefer to have it.
Here's an example:
Using the following endpoint, pass the payment id
(for example, pay_hcklpcd45ymepcr7thciirbdaa
) from the payment response to get details about the payment.
Use the details below to set up your request.
You can find the full list, as well as complete request and response examples, in our API Reference.
GET
https://api.checkout.com/payments/{payment_id}
The response will differ depending on which integration type (redirect
or direct
) you used in the initial payment request.
1{2"id": "pay_hcklpcd45ymepcr7thciirbdaa",3"requested_on": "2020-03-17T09:13:18Z",4"source": {5"type": "boleto",6"dlocal_order_id": "430fa151c1034a8788950dcaf061c6b8",7"dlocal_payment_id": "D-30150-39d14a21-f598-4163-b8d0-2befaf9acc29"8},9"amount": 100,10"currency": "BRL",11"payment_type": "Regular",12"status": "Pending",13"risk": {14"flagged": false15},16"customer": {17"id": "cus_kh6eqv276rou7ae5s3uwj4emnq"18},19"_links": {20"redirect": {21"href": "https://sandbox.dlocal.com/collect/pay/pay/M-8aaf7e50-682f-11ea-ab15-cd9dd592717d?xtid=CATH-ST-1584436398-2076616064"22},23"self": {24"href": "https://api.sandbox.checkout.com/payments/pay_hcklpcd45ymepcr7thciirbdaa"25}26}27}
1{2"id": "pay_gxw65fs6rijepgn4rb5tqqvp5u",3"requested_on": "2020-03-17T09:14:17Z",4"source": {5"type": "boleto",6"dlocal_order_id": "c0e6cc2bf24c43c79fbbee55df293f5c",7"dlocal_payment_id": "D-30150-e59f330d-4b92-487c-a09a-3307be2184b7",8"ticket": {9"type": "custom",10"number": "10499136581700010004400067492298882020000000100",11"barcode": "10498820200000001009136517000100040006749229",12"id": "14000000000674922",13"expiration_date": "2020-03-23T02:59:00Z",14"company_name": "dLocal",15"provider_name": "caixa",16"provider_logo_url": "https://static-sandbox.dlocal.com/images/providers/caixa.png",17"ticket_url": "https://sandbox.dlocal.com/gmf/payments/M-ae4c2980-682f-11ea-ab15-cd9dd592717d"18}19},20"amount": 100,21"currency": "BRL",22"payment_type": "Regular",23"status": "Pending",24"risk": {25"flagged": false26},27"customer": {28"id": "cus_6unw4ulqvrlenduk4xiurlbiyq"29},30"_links": {31"self": {32"href": "https://api.sandbox.checkout.com/payments/pay_gxw65fs6rijepgn4rb5tqqvp5u"33}34}35}
You can refund a Boleto Bancário payment using our refund API. Partial and multiple – as well as full – refunds are allowed.
The customer will get an email (the email address is taken from the source.payer.email
property in the initial payment request) from dLocal asking for their banking details. Once the customer has provided their details, dLocal transfer the money to the customer's bank account.
The payment status will update to refunded
and you will receive a payment_refunded
(or payment_refund_declined
, if unsuccessful) webhook notification.
A refund processing fee may apply.
There is no chargeback mechanism for Boleto Bancário.
You cannot cancel a Boleto Bancário payment, but it will expire after seven days (or more, if you have requested a longer period) if the customer fails to complete the transaction in this time. If the payment expires, we'll send you a payment_expired
webhook.
Webhooks | Description |
---|---|
| Sent when a payment request is successfully initiated. |
| Sent when the acquirer is in the process of accepting the payment. |
| Sent when the customer has completed the payment with the ticket. |
| Sent when the ticket has expired. |
| Sent when there was a failure in creating the payment. |
| Sent when a refund is successfully initiated. |
| Sent when a refund is successfully processed. |
| Sent when a refund is declined. |
Information
Learn more about webhooks and how to subscribe to them.
Information
To start testing, you'll need to:
- create a test account, and
- contact your Account Manager or Integrations engineer to activate Boleto Bancário payments in the sandbox environment.
In your sandbox environment, you can test payment capture and expiration, as well as refund success and failure.
In order to test these actions, pass the string "simulate"
as part of the source.description
field in the initial payment request.
When you do, you will receive additional hypermedia links in the _links
object in the payment response and in the 'get payment details' response.
Use the URLs contained in the simulator:payment-succeed
, simulator:payment-expire
, simulator:refund-succeed
and simulator:refund-fail
hypermedia objects to simulate the respective action/state change on the test payment.
Note
You can only test the redirect
payment flow in sandbox.