> For the complete documentation index, see [llms.txt](https://docs.barte.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.barte.com/banking/readme.md).

# Introdução

Documentação da API Barte Banking para parceiros.

## Informações Gerais

| Item             | Valor                                              |
| ---------------- | -------------------------------------------------- |
| **Sandbox**      | `https://sandbox-api-banking.barte.com`            |
| **Produção**     | `https://api-banking.barte.com`                    |
| **Autenticação** | mTLS + Bearer Token (OAuth 2.0 Client Credentials) |

## Serviços disponíveis

* Autenticação
* Abertura e gestão de contas bancárias PJ
* Webhooks
* Transferências PIX (saída)
* Consulta de saldo

## Headers

Todas as requisições à API devem incluir:

| Header          | Obrigatório            | Descrição                    |
| --------------- | ---------------------- | ---------------------------- |
| `Authorization` | Sim                    | `Bearer {access_token}`      |
| `Content-Type`  | Sim (POST/PUT)         | `application/json`           |
| `X-Request-Id`  | Recomendado            | UUID v4 para rastreabilidade |
| `X-Seller-Id`   | Sim (POST criar conta) | ID do seller na Barte        |

## Formato de Erro

Todas as respostas de erro seguem o formato padrão:

```json
{
  "errors": [
    {
      "code": "BNK-0040",
      "title": "Banking flow error",
      "description": "Business account with id 123 not found"
    }
  ],
  "metadata": {
    "totalRecords": 1,
    "totalPages": 1,
    "requestDatetime": "2026-01-30T15:30:00Z"
  }
}
```

### Códigos de Erro

| Código         | HTTP Status | Descrição                                       |
| -------------- | ----------- | ----------------------------------------------- |
| `BNK-0501`     | 400         | Erro de validação de campos                     |
| `BNK-0040`     | 404         | Recurso não encontrado                          |
| `BNK-0041`     | 409         | Status inválido para a operação                 |
| `BNK-0042`     | 400         | Erro ao comunicar com provider                  |
| `BNK-0044`     | 403         | Acesso negado - sem acesso a conta              |
| `BNK-0045`     | 400         | Conta sem sellerId configurado                  |
| `BNK-0046`     | 409         | ExternalId já cadastrado                        |
| `BNK-0048`     | 409         | Erro de negócio / Provider (ex: CNPJ duplicado) |
| `BNK-0049`     | 400         | Filtro de busca não informado                   |
| `BNK-0052`     | 409         | KYC em andamento (não é possível atualizar)     |
| `BNK-0053`     | 409         | Conta já está ativa                             |
| `BNK-0002`     | 404         | Conta bancária não encontrada                   |
| `BNK-0301`     | 404         | Pagamento/transferência não encontrado          |
| `BNK-0305`     | 400         | Valor de PIX inválido ou não informado          |
| `BNK-0313`     | 400         | Falha no pagamento do seller                    |
| `BNK-0316`     | 409         | Já existe pagamento para a idempotency key      |
| `UNAUTHORIZED` | 401         | Token inválido ou expirado                      |
| `FORBIDDEN`    | 403         | Acesso negado                                   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.barte.com/banking/readme.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
