# API Boleto Fácil

A funcionalidade listada abaixo deve ser acessada através dos seguintes endereços:

**Homologação**: <https://api-hlg.blu.com.br/b2b>

**Produção**: <https://api.blu.com.br/b2b>

<mark style="color:red;">**#ATENÇÃO!**</mark> O envio de boletos devem ser realizados todos para o mesmo banco, seguindo os moldes da geração de boletos através do web services do seu respectivo banco.

## Enviar Boleto Fácil

<mark style="color:green;">`POST`</mark> `/payment-collections/bank-billets`

Realiza o envio de boletos para o portal da Blu.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer Token |

#### Request Body

| Name                                                 | Type   | Description                                                                                                                       |
| ---------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------- |
| bank\_code<mark style="color:red;">\*</mark>         | String | identificação do banco (deve conter 3 dígitos)                                                                                    |
| cedant<mark style="color:red;">\*</mark>             | String | Nome do beneficiário/cobrador                                                                                                     |
| emission                                             | String | Data de emissão do arquivo (obrigatório para Caixa Econômica Federal - DDMMAAAA sendo 'D' = dia / M = mês / A = ano)              |
| wallet<mark style="color:red;">\*</mark>             | String | Carteira utilizada (deve conter 2 dígitos ou menos)                                                                               |
| agency<mark style="color:red;">\*</mark>             | String | Número da agência sem dígito verificador (deve conter 4 dígitos ou menos)                                                         |
| agency\_checker\_digit                               | String | Dígito verificador da agência (obrigatório para o Banco Safra)                                                                    |
| current\_account<mark style="color:red;">\*</mark>   | String | Número da conta corrente sem dígito verificador (deve conter 7 dígitos ou menos)                                                  |
| account\_checker\_digit                              | String | Dígito verificador da conta corrente (obrigatório para o Banco Safra)                                                             |
| agreement<mark style="color:red;">\*</mark>          | Number | Convênio, número do convênio/contrato do cliente junto ao banco emissor                                                           |
| cedant\_document<mark style="color:red;">\*</mark>   | String | Documento do beneficiário/cobrador (CPF ou CNPJ)                                                                                  |
| accept<mark style="color:red;">\*</mark>             | String | Aceite, informa se o banco deve aceitar o boleto após o vencimento.                                                               |
| document\_date<mark style="color:red;">\*</mark>     | String | Data do pedido, Nota fiscal ou documento que originou o boleto (DDMMAAAA sendo 'D' = dia / M = mês / A = ano)                     |
| due\_date<mark style="color:red;">\*</mark>          | String | Data de vencimento do boleto (DDMMAAAA)                                                                                           |
| coin\_type<mark style="color:red;">\*</mark>         | Number | Tipo de moeda utilizada (Real(R$) igual a 9)                                                                                      |
| document\_kind<mark style="color:red;">\*</mark>     | String | Tipo do documento                                                                                                                 |
| payment\_location                                    | String | Informação sobre onde o sacado poderá efetuar o pagamento                                                                         |
| coin\_symbol                                         | String | Símbolo da moeda utilizada (R$ no Brasil)                                                                                         |
| quantity                                             | Number | Quantidade de boleto (padrão igual a 1)                                                                                           |
| charged\_name<mark style="color:red;">\*</mark>      | String | Nome do sacado/cobrado                                                                                                            |
| charged\_cpf\_cnpj<mark style="color:red;">\*</mark> | String | Documento do sacado/cobrado (CPF ou CNPJ)                                                                                         |
| value<mark style="color:red;">\*</mark>              | String | Valor do boleto                                                                                                                   |
| our\_number<mark style="color:red;">\*</mark>        | String | Nosso número (deve conter 11 dígitos ou menos)                                                                                    |
| our\_number\_dv                                      | String | Dígito verificador do nosso número (obrigatório para o Banco Santander)                                                           |
| office                                               | String | Posto, código do posto da cooperativa de crédito (obrigatório para a Cooperativa Sicredi)                                         |
| byte\_idt                                            | String | Byte de identificação do cedente/cobrador do boleto utilizado para compor o nosso número (obrigatório para a Cooperativa Sicredi) |
| barcode                                              | String | Código de barras do boleto                                                                                                        |
| document\_number                                     | String | Identificação do pedido, Nota Fiscal ou documento que originou o boleto                                                           |
| interest\_kind                                       | String | Tipo de juros ('1' = Valor por Dia / '2' = Taxa Mensal / '3' = Isento)                                                            |
| interest                                             | String | Juros                                                                                                                             |
| ticket\_kind                                         | String | Tipo de multa ('1' = Valor Fixo / '2' = Percentual)                                                                               |
| ticket                                               | String | Multa                                                                                                                             |
| abatement\_value                                     | String | Valor do abatimento                                                                                                               |
| anticipation\_discount                               | String | Desconto por antecipação                                                                                                          |
| discount\_kind1                                      | String | Código do desconto 1 ('0' = Sem desconto / '1', '3', '4' = Valor / '2', '5', '6' = Percentual / '7' = Cancelamento de Desconto)   |
| discount\_date1                                      | String | Data do desconto 1 (DDMMAAAA sendo 'D' = dia / M = mês / A = ano)                                                                 |
| discount1                                            | String | Desconto 1                                                                                                                        |
| discount\_kind2                                      | String | Código do desconto 2 (mesma regra do Código do desconto 1)                                                                        |
| discount\_date2                                      | String | Data do desconto 2 (DDMMAAAA)                                                                                                     |
| discount2                                            | String | Desconto 2                                                                                                                        |
| discount\_kind3                                      | String | Código do desconto 3 (vide Código do desconto 1)                                                                                  |
| discount\_date3                                      | String | Data do desconto 3 (DDMMAAAA)                                                                                                     |
| discount3                                            | String | Desconto 3                                                                                                                        |
| digitable\_line                                      | String | Linha digitável                                                                                                                   |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "message": "Recebido X boletos do banco 000 - Banco.",
    "success": true
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "message": "Verifique o campo <nome-do-campo>.",
    "success": false
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity " %}

```json
{
    "message": "Usuário não encontrado para o token informado.",
    "success": false
}
```

{% endtab %}
{% endtabs %}

Exemplos de chamada

{% tabs %}
{% tab title="Exemplo Body" %}

```json
[
    {
        "bank_code": "999",
        "cedant": "NOME DO CEDENTE",
        "emission": "DDMMAAAA",
        "wallet": "99",
        "agency": "9999",
        "agency_checker_digit": "9",
        "current_account": "9999999",
        "account_checker_digit": "9",
        "agreement": 9999999,
        "cedant_document": "99999999999999",
        "accept": "N",
        "document_date": "DDMMAAAA",
        "due_date": "DDMMAAAA",
        "coin_type": 9,
        "document_kind": "99",
        "payment_location": "LOCAL DE PAGAMENTO",
        "coin_symbol": "R$",
        "quantity": 1,
        "charged_name": "NOME DO SACADO",
        "charged_cpf_cnpj": "99999999999999",
        "value": "9999.99",
        "interest_code": "9",
        "interest": "999.99",
        "ticket_kind": "9",
        "ticket": "999.99",
        "abatement_value": "9999.99",
        "anticipation_discount": "999.99",
        "discount_kind1": "9",
        "discount_date1": "DDMMAAAA",
        "discount1": "999.99",
        "discount_kind2": "9",
        "discount_date2": "DDMMAAAA",
        "discount2": "999.99",
        "discount_kind3": "9",
        "discount_date3": "DDMMAAAA",
        "discount3": "999.99",
        "our_number": "9999999999",
        "our_number_dv": "9",
        "office": "999",
        "byte_idt": "999",
        "document_number": "XXXX-XX",
        "barcode": "99999999999999999999999999999999999999999990",
        "digitable_line": "99999999999999999999"
    }
]
```

{% endtab %}

{% tab title="cURL" %}

```javascript
curl --location --request POST 'https://api-hlg.blu.com.br/b2b/payment-collections/bank-billets' \
--header 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '[
    {
        "bank_code": "999",
        "cedant": "NOME DO CEDENTE",
        "emission": "DDMMAAAA",
        "wallet": "99",
        "agency": "9999",
        "agency_checker_digit": "9",
        "current_account": "9999999",
        "account_checker_digit": "9",
        "agreement": 9999999,
        "cedant_document": "99999999999999",
        "accept": "N",
        "document_date": "DDMMAAAA",
        "due_date": "DDMMAAAA",
        "coin_type": 9,
        "document_kind": "99",
        "payment_location": "LOCAL DE PAGAMENTO",
        "coin_symbol": "R$",
        "quantity": 1,
        "charged_name": "NOME DO SACADO",
        "charged_cpf_cnpj": "99999999999999",
        "value": "9999.99",
        "interest_code": "9",
        "interest": "999.99",
        "ticket_kind": "9",
        "ticket": "999.99",
        "abatement_value": "9999.99",
        "anticipation_discount": "999.99",
        "discount_kind1": "9",
        "discount_date1": "DDMMAAAA",
        "discount1": "999.99",
        "discount_kind2": "9",
        "discount_date2": "DDMMAAAA",
        "discount2": "999.99",
        "discount_kind3": "9",
        "discount_date3": "DDMMAAAA",
        "discount3": "999.99",
        "our_number": "9999999999",
        "our_number_dv": "9",
        "office": "999",
        "byte_idt": "999",
        "document_number": "XXXX-XX",
        "barcode": "99999999999999999999999999999999999999999990",
        "digitable_line": "99999999999999999999"
    }
]
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://integracao.useblu.com.br/api-boleto-facil.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
