Boleto Simples
agora é Kobana

Nos tornamos uma plataforma mais segura e eficiente, agora somos Kobana. Focada em tudo aquilo que você precisa, e portanto, focada totalmente em você!

Documentação da Kobana

Documentação para Desenvolvedores

Lotes

Recurso Descrição
POST /api/v1/bank_billet_batches Criar lote
GET /api/v1/bank_billet_batches/:id Informações do lote
GET /api/v1/bank_billet_batches Listar lotes
DELETE /api/v1/bank_billet_batches/:id Excluir boleto
PUT /api/v1/bank_billet_batches/:id/add_bank_billets Incluir boletos no lote
DELETE /api/v1/bank_billet_batches/:id/remove_bank_billet Excluir boleto do lote
POST /api/v1/bank_billet_batches/:id/zip Exportar lote no formato .zip
POST /api/v1/bank_billet_batches/:id/pdf Exportar lote no formato .pdf

Modelo de Dados

Parâmetro Obrigatório Tipo Tamanho Descrição
id N/A Integer   ID do lote
name Sim String   Nome do lote.
bank_billet_ids Não String   IDs de Boleto separados por vírgula.

Criar lote

POST /api/v1/bank_billet_batches

Exemplo de requisição inválida

Requisição:
curl -i \
-H "Authorization: Bearer $BOLETOSIMPLES_TOKEN" \
-d '{"bank_billet_batch":{}}' \
-H 'Content-Type: application/json' \
-H 'User-Agent: MyApp (myapp@example.com)' \
-X POST 'https://api-sandbox.kobana.com.br/v1/bank_billet_batches'
Resposta:
HTTP/1.1 422 Unprocessable Entity
Date: Fri, 17 Oct 2014 18:39:47 GMT
Status: 422 Unprocessable Entity
Content-Type: application/json; charset=utf-8
...

{"errors":[{"title":"bank_billet_batch não pode ficar em branco","status":422,"code":422}]}

Exemplo de requisição válida

Requisição:
curl -i \
-H "Authorization: Bearer $BOLETOSIMPLES_TOKEN" \
-d '{"bank_billet_batch":{"name":"Lote 1"}}' \
-H 'Content-Type: application/json' \
-H 'User-Agent: MyApp (myapp@example.com)' \
-X POST 'https://api-sandbox.kobana.com.br/v1/bank_billet_batches'
Resposta:
HTTP/1.1 201 Created
Date: Fri, 17 Oct 2014 19:30:06 GMT
Status: 201 Created
Location: https://api-sandbox.kobana.com.br/v1/bank_billet_batches/1
Content-Type: application/json; charset=utf-8
...

{
  "id": 1,
  "created_at": "2021-09-16T12:31:06-03:00",
  "updated_at": "2021-09-16T12:31:06-03:00",
  "name": "Lote 1",
  "bank_billet_ids": []
}

Informações do lote

GET /api/v1/bank_billet_batches/:id

Exemplo

Requisição:
curl -i \
-H "Authorization: Bearer $BOLETOSIMPLES_TOKEN" \
-H 'Content-Type: application/json' \
-H 'User-Agent: MyApp (myapp@example.com)' \
-X GET 'https://api-sandbox.kobana.com.br/v1/bank_billet_batches/1'
Resposta:
HTTP/1.1 200 OK
Date: Fri, 17 Oct 2014 19:46:16 GMT
Status: 200 OK
Content-Type: application/json; charset=utf-8
...

{
  "id": 1,
  "created_at": "2021-09-16T12:31:06-03:00",
  "updated_at": "2021-09-16T12:31:06-03:00",
  "name": "Lote 1",
  "bank_billet_ids": [1, 2, 3]
}

Listar lotes

GET /api/v1/bank_billet_batches

Parâmetro Obrigatório Tipo Descrição
page
Não Number Número da Página
per_page Não Number Quantidade de registros por página (Máximo de 50)

Exemplo

Requisição:
curl -i \
-H "Authorization: Bearer $BOLETOSIMPLES_TOKEN" \
-H 'Content-Type: application/json' \
-H 'User-Agent: MyApp (myapp@example.com)' \
-X GET "https://api-sandbox.kobana.com.br/v1/bank_billet_batches?page=1&per_page=50"
Resposta:
HTTP/1.1 200 OK
Date: Fri, 17 Oct 2014 19:46:16 GMT
Status: 200 OK
Link: [https://api-sandbox.kobana.com.br/v1/bank_billet_batches?page=3&per_page=50](https://api-sandbox.kobana.com.br/v1/bank_billet_batches?page=3&per_page=50); rel="last", [https://api-sandbox.kobana.com.br/v1/bank_billet_batches?page=2&per_page=50](https://api-sandbox.kobana.com.br/v1/bank_billet_batches?page=2&per_page=50); rel="next"
Total: 101
Content-Type: application/json; charset=utf-8
...

\[
{
  "id": 1,
  "created_at": "2021-09-16T12:31:06-03:00",
  "updated_at": "2021-09-16T12:31:06-03:00",
  "name": "Lote 1",
  "bank_billet_ids": [1, 2, 3]
}
\]

Excluir lote

DELETE /api/v1/bank_billet_batches/:id

Requisição:
curl -i \
-H "Authorization: Bearer $BOLETOSIMPLES_TOKEN" \
-H 'Content-Type: application/json' \
-H 'User-Agent: MyApp (myapp@example.com)' \
-X DELETE https://api-sandbox.kobana.com.br/v1/bank_billet_batches/1
Resposta:
HTTP/1.1 204 No Content
Date: Fri, 17 Oct 2014 19:46:16 GMT
Status: 204 No Content
Content-Type: application/json; charset=utf-8
...

Incluir boletos no lote

POST /api/v1/bank_billet_batches/:id/add_bank_billets

Modelo de Dados

Parâmetro Obrigatório Tipo Tamanho Descrição
id Sim Integer   ID do lote
bank_billet_ids Sim String   IDs de Boleto separados por vírgula.

Exemplo de requisição inválida

Requisição:
curl -i \
-H "Authorization: Bearer $BOLETOSIMPLES_TOKEN" \
-d '{"bank_billet_batch":{"bank_billet_ids": "0"}}' \
-H 'Content-Type: application/json' \
-H 'User-Agent: MyApp (myapp@example.com)' \
-X PUT https://api-sandbox.kobana.com.br/v1/bank_billet_batches/1/add_bank_billet
Resposta:
HTTP/1.1 422 Unprocessable Entity
Date: Fri, 17 Oct 2014 19:46:16 GMT
Status: 422 Unprocessable Entity
Content-Type: application/json; charset=utf-8
...

{"errors":{"bank_billet_batch_associations":["não é válido"]}}

Exemplo de requisição válida

Requisição:
curl -i \
-H "Authorization: Bearer $BOLETOSIMPLES_TOKEN" \
-d '{"bank_billet_batch":{"bank_billet_ids": "1"}}' \
-H 'Content-Type: application/json' \
-H 'User-Agent: MyApp (myapp@example.com)' \
-X PUT https://api-sandbox.kobana.com.br/v1/bank_billet_batches/1/add_bank_billet
Resposta:
HTTP/1.1 204 No Content
Date: Fri, 17 Oct 2014 19:46:16 GMT
Status: 204 No Content
Content-Type: application/json; charset=utf-8
...

Excluir boleto do lote

DELETE /api/v1/bank_billet_batches/cancel_all

Modelo de Dados

Parâmetro Obrigatório Tipo Tamanho Descrição
id Sim Integer   ID do lote
bank_billet_id Sim Integer   IDs de Boleto.

Exemplo de requisição inválida

Requisição:
curl -i \
-H "Authorization: Bearer $BOLETOSIMPLES_TOKEN" \
-d '{"bank_billet_id":""}' \
-H 'Content-Type: application/json' \
-H 'User-Agent: MyApp (myapp@example.com)' \
-X POST 'https://api-sandbox.kobana.com.br/v1/bank_billet_batch/1/remove_bank_billet'
Resposta:
HTTP/1.1 404 Not Found
Date: Fri, 17 Oct 2014 18:39:47 GMT
Status: 404 Not Found
Content-Type: application/json; charset=utf-8
...

{"errors":[{"title":"Não foi possível encontrar o registro","status":404,"code":404,"detail":"Este registro não existe, ou foi deletado."}]}

Exemplo de requisição válida

Requisição:
curl -i \
-H "Authorization: Bearer $BOLETOSIMPLES_TOKEN" \
-d '{"bank_billet_id":"1"}' \
-H 'Content-Type: application/json' \
-H 'User-Agent: MyApp (myapp@example.com)' \
-X POST 'https://api-sandbox.kobana.com.br/v1/bank_billet_batch/1/remove_bank_billet'
Resposta:
HTTP/1.1 204 No Content
Date: Fri, 17 Oct 2014 19:46:16 GMT
Status: 204 No Content
Content-Type: application/json; charset=utf-8
...

Exportar lote no formato .zip

POST /api/v1/bank_billet_batches/:id/zip

Após a requisição a exportação entra numa fila para gerar o arquivo do lote. A URL do arquivo do lote será retornada pelo endpoint de Exportação do Lote.

Requisição:
curl -i \
-H "Authorization: Bearer $BOLETOSIMPLES_TOKEN" \
-H 'Content-Type: application/json' \
-H 'User-Agent: MyApp (myapp@example.com)' \
-X POST 'https://api-sandbox.kobana.com.br/v1/bank_billet_batches/1/zip'
Resposta:
HTTP/1.1 201 Created
Date: Fri, 17 Oct 2014 19:30:06 GMT
Status: 201 Created
Location: https://api-sandbox.kobana.com.br/v1/bank_billet_batch_exports/1
Content-Type: application/json; charset=utf-8
...

{
  "id": 1,
  "account_id": 1,
  "bank_billet_batch_id": 1,
  "status": "enqueued",
  "file_format": "zip",
  "processed_at": null,
  "output_url": null,
  "created_at": "2021-09-16T15:06:13-03:00",
  "updated_at": "2021-09-16T15:06:13-03:00"
}

Exportar lote no formato .pdf

POST /api/v1/bank_billet_batches/:id/pdf

Após a requisição a exportação entra numa fila para gerar o arquivo do lote. A URL do arquivo do lote será retornada pelo endpoint de Exportação do Lote.

Requisição:
curl -i \
-H "Authorization: Bearer $BOLETOSIMPLES_TOKEN" \
-H 'Content-Type: application/json' \
-H 'User-Agent: MyApp (myapp@example.com)' \
-X POST 'https://api-sandbox.kobana.com.br/v1/bank_billet_batches/1/pdf'
Resposta:
HTTP/1.1 201 Created
Date: Fri, 17 Oct 2014 19:30:06 GMT
Status: 201 Created
Location: https://api-sandbox.kobana.com.br/v1/bank_billet_batch_exports/1
Content-Type: application/json; charset=utf-8
...

{
  "id": 1,
  "account_id": 1,
  "bank_billet_batch_id": 1,
  "status": "enqueued",
  "file_format": "pdf",
  "processed_at": null,
  "output_url": null,
  "created_at": "2021-09-16T15:06:13-03:00",
  "updated_at": "2021-09-16T15:06:13-03:00"
}