---
title: "Brazilian Boleto Validation & Bank Lookup API"
slug: brazilian-boleto-validation-bank-lookup
url: https://apyhub.com/dam4g/service/brazilian-boleto-validation-bank-lookup
provider: DAM4G APIs
categories: [Data Validation, Finance]
tags: [boleto-validation, brasil-payments, barcode-validation, digitable-line, invoice-validation]
auth: api_key
version: 0.1.0
service_type: sync
endpoints: 3
atoms: 10
mcp: true
---

# Brazilian Boleto Validation & Bank Lookup API

Validate boleto barcodes or digitable lines and get parsed payment details, status checks, and error messages for Brazilian slips.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| GET | `https://api.eu.apyhub.com/dam4g/brazilian-boleto-validation-bank-lookup/v1/validate` | What it does Checks whether a Brazilian boleto is valid using the official FEBRABAN check-digit alg… | 10 |
| POST | `https://api.eu.apyhub.com/dam4g/brazilian-boleto-validation-bank-lookup/v1/validate` | What it does Performs the same validation as Validate a Boleto (GET), but accepts the boleto code i… | 10 |
| GET | `https://api.eu.apyhub.com/dam4g/brazilian-boleto-validation-bank-lookup/v1/banks/:code` | What it does Looks up a Brazilian bank by its 3-digit COMPE code and returns its name. Use this whe… | 10 |

## Endpoint reference

### Validate a boleto

`GET https://api.eu.apyhub.com/dam4g/brazilian-boleto-validation-bank-lookup/v1/validate` · 10 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `code` | query | string | no |  |

#### Quickstart
 
Validate a boleto by its digitable line.
 
```bash
curl -X GET "https://api.eu.apyhub.com/dam4g/brazilian-boleto-validation-bank-lookup/v1/validate?code=21290001192110001210904475617405975870000002000" \
  -H "apy-token: $APY_TOKEN"
```

#### What you'll get back
 
You will receive whether the boleto is valid, its type and input format, the issuing bank, currency, amount, due date and overdue status, the boleto as a barcode and as a digitable line, and the results of each check with any errors or warnings.
 
#### Response Example
 
```json
{
  "valid": true,
  "type": "bank_slip",
  "input_format": "digitable_line",
  "barcode": "21299758700000020000001121100012100447561740",
  "digitable_line": "21290001192110001210904475617405975870000002000",
  "digitable_line_formatted": "21290.00119 21100.012109 04475.617405 9 75870000002000",
  "checks": {
    "length": true,
    "characters": true,
    "field_check_digits": true,
    "barcode_check_digit": true
  },
  "errors": [],
  "warnings": [],
  "bank": {
    "code": "212",
    "name": "Banco Original"
  },
  "currency": "BRL",
  "segment": null,
  "amount_cents": 2000,
  "amount": "20.00",
  "due_date": "2018-07-16",
  "due_date_status": "ok",
  "overdue": true
}
```

### Validate a boleto

`POST https://api.eu.apyhub.com/dam4g/brazilian-boleto-validation-bank-lookup/v1/validate` · 10 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `code` | body | string | yes |  |

#### Quickstart
 
Validate a boleto by its digitable line.
 
```bash
curl -X GET "https://api.eu.apyhub.com/dam4g/brazilian-boleto-validation-bank-lookup/v1/validate" \
  -H "apy-token: $APY_TOKEN"
```
 
#### What you'll get back
 
You will receive whether the boleto is valid, its type and input format, the issuing bank, currency, amount, due date and overdue status, the boleto as a barcode and as a digitable line, and the results of each check with any errors or warnings.
 
#### Response Example
 
```json
{
  "valid": true,
  "type": "bank_slip",
  "input_format": "digitable_line",
  "barcode": "21299758700000020000001121100012100447561740",
  "digitable_line": "21290001192110001210904475617405975870000002000",
  "digitable_line_formatted": "21290.00119 21100.012109 04475.617405 9 75870000002000",
  "checks": {
    "length": true,
    "characters": true,
    "field_check_digits": true,
    "barcode_check_digit": true
  },
  "errors": [],
  "warnings": [],
  "bank": {
    "code": "212",
    "name": "Banco Original"
  },
  "currency": "BRL",
  "segment": null,
  "amount_cents": 2000,
  "amount": "20.00",
  "due_date": "2018-07-16",
  "due_date_status": "ok",
  "overdue": true
}
```

### Look up a bank by its 3-digit COMPE code

`GET https://api.eu.apyhub.com/dam4g/brazilian-boleto-validation-bank-lookup/v1/banks/:code` · 10 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `code` | path | string | yes |  |

#### Quickstart
 
Look up the bank with COMPE code `212`.
 
```bash
curl -X GET "https://api.eu.apyhub.com/dam4g/brazilian-boleto-validation-bank-lookup/v1/banks/:code" \
  -H "apy-token: $APY_TOKEN"
```
 
#### What you'll get back
 
You will receive the bank code you sent and the matching bank name.
 
#### Response Example
 
```json
{
  "code": "212",
  "name": "Banco Original"
}
```

## About

## What it does
Boleto Validator checks whether a Brazilian boleto is valid and extracts the payment details encoded in its barcode or digitable line. A **boleto (boleto bancário)** is a common payment method in Brazil, used for bills, invoices, online purchases, utility bills, taxes, fines, and other payments.

Send a `code` containing either a barcode or a digitable line, and the API validates its check digits using FEBRABAN algorithms. It returns whether the boleto is `valid`, along with the `detected  type,input_format, bank, segment`, `currency`, `amount`, `amount_cents`, `due_date`, `due_date_status`, and `overdue` status. It also returns the `barcode`, `digitable_line`, and `digitable_line_formatted` when available, along with a `checks` object and any detected `errors` or `warnings`.

The API supports both `bank_slip` and `collection` boletos, making it suitable for validating standard bank slips, utility bills, taxes, fines, and other payment documents. You can use it to verify a payment slip before displaying it to a customer, reconcile checkout details, or process incoming bills. Since it accepts either format and can return both, it also works as a barcode-to-digitable-line and digitable-line-to-barcode converter.

The service also includes a Bank Lookup API that identifies a Brazilian bank by its 3-digit COMPE code (3-digit number used to identify a bank in Brazil.). Send a code such as 212 for Banco do Brasil or 341 for Itaú Unibanco to retrieve the corresponding bank name. COMPE codes are used in Brazilian payment systems, including boleto barcodes, bank account details, and transfers. This endpoint helps you display readable bank names instead of raw numeric codes.

Validation is performed through local calculations without contacting banks or external systems, enabling fast responses without sending payment data to external services.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/dam4g/service/brazilian-boleto-validation-bank-lookup
