Payment-method icon

Boleto Bancário for API only

Add Boleto Bancário to an existing API-only integration.

Accept Boleto Bancário payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

Requirements

Requirement Description
Integration type Make sure that you have built an API-only integration.
Setup steps Before you begin, add Boleto Bancário in your test Customer Area.

Build your payment form for Boleto Bancário

To show Boleto Bancário in your payment form, you need to:

  1. Show Boleto Bancário as an available payment method.

    We provide a Boleto Bancário logo which you can use on your payment form. For more information, refer to Downloading logos.

  2. After the shopper selects Boleto, collect the following details from the shopper:

    Category Details to collect
    Personal details First name, last name, and CPF/CNPJ of the shopper.

    The CPF/CNPJ is a unique identifier similar to a social security number. The shopper can provide their Cadastro de Pessoas Físicas (CPF) number or their Cadastro Nacional da Pessoa Jurídica (CNPJ) number.

    Billing address Shopper street, house number or name, city, postal code, and state or province.

    You'll also want to collect the shopper's email address so that you can send them a copy of the form details.

  3. Pass the following data to your server:

    • The data you have collected from your shopper.
    • The payment method type: boletobancario.

      You can also get the list of payment methods from the /paymentMethods response, as explained in the API-only integration guide.

      In your /paymentMethods request, specify:

      If the response provides other payment method types for Boleto, for example boletobancario_santander, you can still pass boletobancario to your server because we will handle the routing on our end.

Make a payment

In your /payments request, specify:

Parameter name Required Description
paymentMethod.type -white_check_mark- boletobancario
shopperName -white_check_mark- The shopper's firstName and lastName.
billingAddress -white_check_mark- The shopper's city, country, houseNumberOrName, postalCode,stateOrProvince, and street.
socialSecurityNumber -white_check_mark- The shopper's CPF or CNPJ number.
deliveryDate The due date of the payment, using ISO 8601 format in UTC. If this is in a weekend or national holiday, the shopper can pay the Boleto the next working day.
By default, the shopper has five days to complete the payment.
shopperStatement Free-text field with payment instructions. If you include this, make sure to state that you do not accept payments for a higher or lower amount than the original amount, or payments after the due date.

If you leave the shopperStatement empty, it is populated with the following default Portuguese text:

Não aceitar pagamento via cheque e/ou após a data do vencimento. Do not accept payment by cheque and/or after the due date.
Seu pedido será enviado somente após a confirmação do pagamento deste boleto, desde que não tenha divergência de valores entre o valor cobrado e o valor pago. Your order will only be processed once the payment of this Boleto has been confirmed and as long as there is no difference between the payable and paid amounts.
A falta de pagamento deste boleto não implica em qualquer multa ou juros e o pedido será automaticamente cancelado. Failure to pay this boleto will not incur any penalty or interest and your order will be automatically cancelled.
Não deposite nem faça transferência. Do not pay by deposit or bank transfer.

The /payments response with action.type voucher contains:

  • pspReference: Our unique reference for the payment.
  • resultCode: PresentToShopper
  • action: Object containing information about the voucher :

    • downloadUrl: Link to the downloadable Boleto in PDF format.
    • expiresAt: The date and time when the due date expires.
    • paymentMethodType: Indicates the issuing bank.
    • reference: The barcode number for the payment.
    • totalAmount: The currency and value of the amount due.

Present the voucher

Use the information in the action object in the /payments response to present the voucher to the shopper.

  • action.downloadUrl: Link to the downloadable Boleto in PDF format.
  • action.expiresAt: The date and time when the due date expires.
  • action.reference: The barcode number for the payment.
  • action.totalAmount: The currency and value of the amount due.

Make sure that you show an option to download the Boleto, and an option to copy the barcode number. The shopper can then print the downloaded Boleto and pay in cash, or pay the Boleto at an ATM or through internet banking using the barcode number.

Present the payment result

Use the resultCode that you received in the /payments response to inform your shopper of the payment status. You receive payment updates and results through a webhook.

The resultCode value you can receive for Boleto Bancário is:

resultCode Description Action to take
PresentToShopper Present the voucher. After you present the voucher to the shopper, inform the shopper that you are waiting for the payment to be completed.

If you set up PENDING webhooks for Boleto Bancário, you receive a webhook for pending payments.

You will receive the final result of the payment in an AUTHORISATION webhook.

Test and go live

Boleto Bancário is an offline payment method.

In the test environment, you can simulate a Boleto payment by promoting the pending payment to a sale.

  1. Log in to your test Customer Area.
  2. Go to Transactions > Offers.
  3. Select the PSP reference of the pending Boleto payment.
  4. Select the Promote this offer to a sale button.

Check the status of Boleto Bancário test payments in your Customer Area:

  • Boletos that are pending or that have expired are under Transactions > Offers.
  • Boletos that have been paid (including test offers that you manually promoted to sale) are under Transactions > Payments.

Test the reconciliation process by promoting test payments from offer to sale in your test Customer Area.

Before you can accept live Boleto Bancário payments, you need to submit a request for Boleto Bancário in your live Customer Area.

See also