Boleto

Start accepting payments using Boleto, a favorite payment method in Brazil. Used as vouchers, it can process payments in US Dollars and Brazilian Real.

To start accepting Boleto payments, please contact your customer success manager.

Process a Boleto payment

Boleto payments follow a two-step process:

  1. Request a Boleto payment
  2. Redirect the customer

Step 1: Request a Boleto payment

The request

Use the details below to set up your request.

Endpoints

Live

https://api.checkout.com/payments

Sandbox

https://api.sandbox.checkout.com/payments

Header parameters

Header
Value

Authorization
Required

secret key

Use the valid secret key of your Checkout.com account. You can find this in the Hub.

Content-Type
Required

application/json

Body parameters

The table below describes the minimum recommended fields. You can find the full list, as well as complete request and response examples, in our API reference.

Field name
Description

source
Object
Required

Details about the payment source.

source.type
Object
Required

The type of payment source. Set this to boleto.

source.birthDate
String
Required

The date of birth (YYYY-MM-DD).

source.cpf
String
Required

The Brazilian personal tax identifier (Cadastro de Pessoas Físicas).

source.customerName
String
Required

The customer's name.

amount
String
Optional

The payment amount in the major currency. Omitting the amount or providing 0 will perform a card verification.

currency
String
Required

The three-letter ISO currency code.

Request example

{
  "source": {
    "type": "boleto",
    "birthDate": "1973-11-11",
    "cpf": "00003456789",
    "customerName": "Rafael Goncalves"
  },
  "amount": 1000,
  "currency": "BRL"
}

If a customer ID or email is not provided in the request, then we automatically create a customer profile and return the customer id in the response.

The response

If a payment id is returned, then your request was successful.

Response example

{
  "id": "pay_myrbjxcwvluutk7egfyuo3mxq4",
  "status": "Pending",
  "customer": {
    "id": "cus_o2zfcp5ahitebdmzjq2l5dsfti"
  },
  "_links": {
    "self": {
      "href": "https://api.sandbox.checkout.com/payments/pay_myrbjxcwvluutk7egfyuo3mxq4"
    },
    "redirect": {
      "href": "https://sandbox.checkout.com/LP.Core/api/payment/109091"
    }
  }
}

Step 2: Redirect the customer

Redirect your customer to the redirect link’s href in the response to Step 1. The redirect transfers the customer to their bank's website where they are required to enter their authorization details; if successful, the payment can be approved.

Once completed, the customer is transferred to your predefined success or failure URL. Confirmation of a Boleto payment is communicated only through webhooks. When you receive a payment_captured webhook notification, the transaction has been completed successfully. Until the payment_captured webhook is received (response code 10000), all payments are labeled as Pending.

Get details about a Boleto payment

You can retrieve details about an existing Boleto payment.

The request

Use the details below to set up your request.

Endpoint live

GEThttps://api.checkout.com/payments/{payment_id}

Endpoint sandbox

GEThttps://api.sandbox.checkout.com/payments/{payment_id}

Header and path parameters

Header
Value

Authorization
Required

secret key

Use the valid secret key of your Checkout.com account. You can find this in the Hub.

Content-Type
Required

application/json

Path
Value

payment_id
Required

The payment ID found in the response of the initial payment.

The response

Response example

{
  "id": "pay_myrbjxcwvluutk7egfyuo3mxq4",
  "requested_on": "2018-11-29T15:30:06Z",
  "source": {
    "type": "boleto"
  },
  "amount": 1000,
  "currency": "BRL",
  "payment_type": "Regular",
  "status": "Pending",
  "risk": {
    "flagged": false
  },
  "customer": {
    "id": "cus_o2zfcp5ahitebdmzjq2l5dsfti"
  },
  "_links": {
    "self": {
      "href": "https://api.sandbox.checkout.com/payments/pay_myrbjxcwvluutk7egfyuo3mxq4"
    }
  }
}

Refund a Boleto payment

Boleto supports both partial and full refunds. You can refund a payment through the Hub or using the refund API.

Cancel a Boleto payment

If the customer cancels or fails to complete the transaction at any point after the payment is created, it will automatically be voided, and we'll send you a payment_voided webhook.

Testing Boleto

To start testing, you'll need to:

  • create a test account, and
  • contact your customer success manager or integrations engineer to activate Boleto payments in the sandbox environment.
  1. Create a Boleto transaction as above, following the redirect link in the response to dLocal's website.

  2. Login (no credentials required).

  3. Set the payment status – pending, paid, or refused – and then click "Confirm".

  4. You should then be redirected to your predefined success URL.

Can we help?

Thanks for using Checkout.com. If you need any help or support, then message our support team at support@checkout.com.

Boleto


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.