71 endpoints · OpenAPI 3.0

Documentação técnica.

API REST multi-tenant para cobrar, pagar, emitir e monitorar — com split automático sobre a conta mestre. Tratamos pagamentos como o mercado financeiro tradicional trata capital: com auditoria, segregação e rastreabilidade.

Base URL
Versão v1
Sandbox ativo

Autenticação

Toda requisição em /api/v1/* precisa de um token no header X-API-Key. Gere-o em /api-keys — cada token pertence a um tenant e fica logado por chamada.

bash
curl "http://localhost:3100/api/v1/account/me" \
  -H "X-API-Key: baas_••••••••••"
Hash SHA-256
O token em claro só aparece uma vez — depois fica só hash no DB.
Revogável
Revogar desativa na hora, sem grace period.
Logado por chamada
Veja método, path, status e ms em /usage.

Sua primeira chamada

I

Crie um cliente

bash
curl -X POST "http://localhost:3100/api/v1/customers" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "João da Silva",
    "cpfCnpj": "24971563792",
    "email": "joao@exemplo.com",
    "notificationDisabled": true
  }'

notificationDisabled: true = o O banco não envia NENHUM email/SMS/WhatsApp. Você controla a comunicação.

II

Crie uma cobrança PIX

bash
curl -X POST "http://localhost:3100/api/v1/payments" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": "cus_000007805883",
    "billingType": "PIX",
    "value": 149.90,
    "dueDate": "2026-04-25",
    "description": "Assinatura Pro"
  }'
III

Pegue o QR Code

bash
curl "http://localhost:3100/api/v1/payments/pay_abc123/pix-qr" \
  -H "X-API-Key: baas_••••"

# Retorna:
# {
#   "encodedImage": "iVBORw0KGgo...",  // PNG base64
#   "payload": "00020101021226...",    // payload PIX EMV
#   "expirationDate": "2026-04-26 00:00:00"
# }
IV

Ou pegue os dados do boleto

bash
curl "http://localhost:3100/api/v1/payments/pay_abc123/boleto" \
  -H "X-API-Key: baas_••••"

# Retorna:
# {
#   "identificationField": "23793.38128 60007...",  // linha digitável
#   "barCode": "23791381260000000...",              // cód. barras
#   "nossoNumero": "12345678",
#   "bankSlipUrl": "https://.../b/pdf/xyz"         // PDF
# }

Erros

Respostas de erro sempre vêm em JSON com error e message:

json
{
  "error": "bank_error",
  "message": "A url informada é inválida.",
  "details": {
    "errors": [
      { "code": "invalid_object", "description": "A url informada é inválida." }
    ]
  }
}
400
invalid_request

JSON malformado ou campos obrigatórios ausentes.

401
missing_api_key / invalid_api_key

Header X-API-Key faltando ou inválido.

403
tenant_disabled

Tenant foi desativado pelo admin.

422
bank_error

Banco rejeitou — ver details.errors.

429
rate_limited

Chamando rápido demais (em breve).

500
internal_error

Exceção não tratada — reporta.

502
bank_error

Banco fora do ar ou erro de rede.

Webhooks

Registre um URL HTTPS pra receber eventos do banco. Nosso BaaS persiste cada evento em WebhookEvent e você consulta via GET /api/v1/webhook-events.

bash
# 1) Registrar webhook
curl -X POST "http://localhost:3100/api/v1/webhooks" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "prod-payments",
    "url": "https://sua-api.com/webhook/baas",
    "enabled": true,
    "sendType": "SEQUENTIALLY",
    "events": [
      "PAYMENT_RECEIVED",
      "PAYMENT_CONFIRMED",
      "PAYMENT_OVERDUE"
    ]
  }'
Eventos disponíveis
PAYMENT_CREATED
PAYMENT_UPDATED
PAYMENT_CONFIRMED
PAYMENT_RECEIVED
PAYMENT_OVERDUE
PAYMENT_DELETED
PAYMENT_REFUNDED
PAYMENT_RECEIVED_IN_CASH
SUBSCRIPTION_CREATED
SUBSCRIPTION_UPDATED
TRANSFER_CREATED
TRANSFER_DONE
TRANSFER_FAILED
Payload típico
{
  "event": "PAYMENT_RECEIVED",
  "payment": {
    "id": "pay_abc123",
    "customer": "cus_xyz",
    "value": 149.90,
    "netValue": 148.50,
    "status": "RECEIVED",
    "paymentDate": "2026-04-25"
  }
}

Paginação

Endpoints de listagem aceitam limit (padrão 10, máx 100) e offset. A resposta sempre vem no formato:

json
{
  "object": "list",
  "hasMore": true,
  "totalCount": 243,
  "limit": 50,
  "offset": 0,
  "data": [ /* objetos */ ]
}

Clientes

Cadastre pessoas físicas ou jurídicas. Use notificationDisabled=true pra silenciar as notificações banco.

GET/customers
Query params
email
filtro por email
cpfCnpj
filtro por documento
name
busca por nome
limit
padrão 10
offset
paginação
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/customers" \
  -H "X-API-Key: baas_••••"
POST/customers
Body JSON
name
nome obrigatório
cpfCnpj
CPF/CNPJ obrigatório
email
email
mobilePhone
celular
notificationDisabled
true = zero notif. banco
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/customers" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "cpfCnpj": "<cpfCnpj>",
  "email": "<email>",
  "mobilePhone": "<mobilePhone>",
  "notificationDisabled": "<notificationDisabled>"
}'
GET/customers/{id}
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/customers/PAY_ID" \
  -H "X-API-Key: baas_••••"
PUT/customers/{id}
Exemplo cURL
curl -X PUT "http://localhost:3100/api/v1/customers/PAY_ID" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{}'
DELETE/customers/{id}
Exemplo cURL
curl -X DELETE "http://localhost:3100/api/v1/customers/PAY_ID" \
  -H "X-API-Key: baas_••••"

Cobranças

Boleto, PIX, cartão ou UNDEFINED (cliente escolhe). O retorno inclui invoiceUrl + dados específicos.

GET/payments
Query params
customer
id do cliente
status
PENDING/RECEIVED/OVERDUE/…
billingType
PIX/BOLETO/CREDIT_CARD
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/payments" \
  -H "X-API-Key: baas_••••"
POST/payments
Body JSON
customer
id
billingType
PIX | BOLETO | CREDIT_CARD | UNDEFINED
value
valor em R$
dueDate
yyyy-MM-dd
description
descrição
externalReference
seu id
postalService
false = não enviar boleto por correio
split
[{ walletId, percentualValue }]
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/payments" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "customer": "cus_000007805883",
  "billingType": "PIX",
  "value": 149.9,
  "dueDate": "2026-04-25",
  "description": "Mensalidade abril"
}'
GET/payments/{id}
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/payments/PAY_ID" \
  -H "X-API-Key: baas_••••"
DELETE/payments/{id}
Exemplo cURL
curl -X DELETE "http://localhost:3100/api/v1/payments/PAY_ID" \
  -H "X-API-Key: baas_••••"
POST/payments/{id}/refund
Body JSON
value
opcional — parcial
description
motivo
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/payments/PAY_ID/refund" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "value": "<value>",
  "description": "<description>"
}'
GET/payments/{id}/pix-qr
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/payments/PAY_ID/pix-qr" \
  -H "X-API-Key: baas_••••"
GET/payments/{id}/boleto
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/payments/PAY_ID/boleto" \
  -H "X-API-Key: baas_••••"

Assinaturas

Cobranças recorrentes — banco gera os payments automaticamente no ciclo configurado.

GET/subscriptions
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/subscriptions" \
  -H "X-API-Key: baas_••••"
POST/subscriptions
Body JSON
customer
id
billingType
PIX/BOLETO/CREDIT_CARD
value
valor
cycle
WEEKLY/BIWEEKLY/MONTHLY/QUARTERLY/SEMIANNUALLY/YEARLY
nextDueDate
yyyy-MM-dd
description
descrição
endDate
término
maxPayments
qtd máxima de cobranças
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/subscriptions" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "customer": "<customer>",
  "billingType": "<billingType>",
  "value": "<value>",
  "cycle": "<cycle>",
  "nextDueDate": "<nextDueDate>",
  "description": "<description>",
  "endDate": "<endDate>",
  "maxPayments": "<maxPayments>"
}'
GET/subscriptions/{id}
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/subscriptions/PAY_ID" \
  -H "X-API-Key: baas_••••"
PUT/subscriptions/{id}
Exemplo cURL
curl -X PUT "http://localhost:3100/api/v1/subscriptions/PAY_ID" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{}'
DELETE/subscriptions/{id}
Exemplo cURL
curl -X DELETE "http://localhost:3100/api/v1/subscriptions/PAY_ID" \
  -H "X-API-Key: baas_••••"

Parcelamento

Quando você cria payments com installmentCount>1, banco agrupa num Installment.

GET/installments
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/installments" \
  -H "X-API-Key: baas_••••"
GET/installments/{id}
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/installments/PAY_ID" \
  -H "X-API-Key: baas_••••"
DELETE/installments/{id}
Exemplo cURL
curl -X DELETE "http://localhost:3100/api/v1/installments/PAY_ID" \
  -H "X-API-Key: baas_••••"
GET/installments/{id}/payments
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/installments/PAY_ID/payments" \
  -H "X-API-Key: baas_••••"

PIX

Chaves PIX da conta, QR codes estáticos, envio/recebimento e consulta de transações.

GET/pix/keys
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/pix/keys" \
  -H "X-API-Key: baas_••••"
POST/pix/keys
Body JSON
type
EVP/EMAIL/PHONE/CPF/CNPJ
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/pix/keys" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "<type>"
}'
DELETE/pix/keys/{id}
Exemplo cURL
curl -X DELETE "http://localhost:3100/api/v1/pix/keys/PAY_ID" \
  -H "X-API-Key: baas_••••"
POST/pix/qr
Body JSON
addressKey
sua chave PIX
value
opcional
description
descrição
format
ALL/PAYLOAD/IMAGE
allowsMultiplePayments
bool
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/pix/qr" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "addressKey": "<addressKey>",
  "value": "<value>",
  "description": "<description>",
  "format": "<format>",
  "allowsMultiplePayments": "<allowsMultiplePayments>"
}'
POST/pix/qr/decode
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/pix/qr/decode" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{}'
POST/pix/pay
Body JSON
qrCode
{payload}
value
valor
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/pix/pay" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "qrCode": "<qrCode>",
  "value": "<value>"
}'

Transferências

Envie PIX ou TED/DOC pra qualquer conta.

GET/transfers
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/transfers" \
  -H "X-API-Key: baas_••••"
POST/transfers
Body JSON
value
valor
operationType
PIX | TED
pixAddressKey
chave do destinatário
pixAddressKeyType
EVP/EMAIL/…
bankAccount
objeto pra TED
description
descrição
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/transfers" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "value": "<value>",
  "operationType": "<operationType>",
  "pixAddressKey": "<pixAddressKey>",
  "pixAddressKeyType": "<pixAddressKeyType>",
  "bankAccount": "<bankAccount>",
  "description": "<description>"
}'
POST/transfers/{id}/cancel
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/transfers/PAY_ID/cancel" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{}'

Checkouts

Sessão de checkout one-shot — retorna URL de pagamento.

POST/checkouts
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/checkouts" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{}'

Webhooks

Registre URLs pra receber notificações de eventos (payment_received, etc).

GET/webhooks
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/webhooks" \
  -H "X-API-Key: baas_••••"
POST/webhooks
Body JSON
name
nome
url
https://…
email
email de notificação
enabled
true
events
array de eventos
authToken
token que será enviado como header
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/webhooks" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "url": "<url>",
  "email": "<email>",
  "enabled": "<enabled>",
  "events": "<events>",
  "authToken": "<authToken>"
}'
GET/webhooks/{id}
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/webhooks/PAY_ID" \
  -H "X-API-Key: baas_••••"
PUT/webhooks/{id}
Exemplo cURL
curl -X PUT "http://localhost:3100/api/v1/webhooks/PAY_ID" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{}'
DELETE/webhooks/{id}
Exemplo cURL
curl -X DELETE "http://localhost:3100/api/v1/webhooks/PAY_ID" \
  -H "X-API-Key: baas_••••"
GET/webhook-events
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/webhook-events" \
  -H "X-API-Key: baas_••••"

Pagamentos de contas

Pague boletos, tributos, contas de consumo.

GET/bills
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/bills" \
  -H "X-API-Key: baas_••••"
POST/bills
Body JSON
identificationField
linha digitável
dueDate
yyyy-MM-dd
scheduleDate
quando pagar
description
descrição
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/bills" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "identificationField": "<identificationField>",
  "dueDate": "<dueDate>",
  "scheduleDate": "<scheduleDate>",
  "description": "<description>"
}'
POST/bills/simulate
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/bills/simulate" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{}'

Antecipação de recebíveis

Receba adiantado o valor de cobranças já aprovadas.

GET/anticipations
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/anticipations" \
  -H "X-API-Key: baas_••••"
POST/anticipations
Body JSON
payment
id do payment
installment
OU id do parcelamento
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/anticipations" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "payment": "<payment>",
  "installment": "<installment>"
}'
POST/anticipations/simulate
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/anticipations/simulate" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{}'
GET/anticipations/limits
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/anticipations/limits" \
  -H "X-API-Key: baas_••••"

Notas fiscais

Emissão de NFS-e vinculadas a cobranças.

GET/invoices
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/invoices" \
  -H "X-API-Key: baas_••••"
POST/invoices
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/invoices" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{}'
GET/invoices/{id}
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/invoices/PAY_ID" \
  -H "X-API-Key: baas_••••"
PUT/invoices/{id}
Exemplo cURL
curl -X PUT "http://localhost:3100/api/v1/invoices/PAY_ID" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{}'
DELETE/invoices/{id}
Exemplo cURL
curl -X DELETE "http://localhost:3100/api/v1/invoices/PAY_ID" \
  -H "X-API-Key: baas_••••"

Configuração fiscal

Configurações necessárias pra emitir NF.

GET/fiscal-info
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/fiscal-info" \
  -H "X-API-Key: baas_••••"
POST/fiscal-info
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/fiscal-info" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{}'

Negativação (Serasa)

Negative clientes inadimplentes.

GET/dunning
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/dunning" \
  -H "X-API-Key: baas_••••"
POST/dunning
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/dunning" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{}'
GET/dunning/{id}
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/dunning/PAY_ID" \
  -H "X-API-Key: baas_••••"

Chargebacks

Contestação de cartão.

GET/chargebacks
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/chargebacks" \
  -H "X-API-Key: baas_••••"
GET/chargebacks/{id}
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/chargebacks/PAY_ID" \
  -H "X-API-Key: baas_••••"

Consulta de crédito

Boa Vista / Serasa — score e análise do tomador.

GET/credit-bureau
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/credit-bureau" \
  -H "X-API-Key: baas_••••"
POST/credit-bureau
Body JSON
customer
id OU
cpfCnpj
documento direto
state
UF
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/credit-bureau" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "customer": "<customer>",
  "cpfCnpj": "<cpfCnpj>",
  "state": "<state>"
}'

Recarga de celular

Recarregue qualquer número.

GET/mobile-recharges
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/mobile-recharges" \
  -H "X-API-Key: baas_••••"
POST/mobile-recharges
Body JSON
phoneNumber
(11)999999999
value
valor
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/mobile-recharges" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "phoneNumber": "<phoneNumber>",
  "value": "<value>"
}'

Sub-contas (BaaS)

Crie contas-filha pra cada empresa cliente do seu BaaS.

GET/sub-accounts
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/sub-accounts" \
  -H "X-API-Key: baas_••••"
POST/sub-accounts
Body JSON
name
nome
email
email
cpfCnpj
CNPJ
companyType
MEI/LIMITED/INDIVIDUAL/ASSOCIATION
incomeValue
faturamento mensal estimado
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/sub-accounts" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "email": "<email>",
  "cpfCnpj": "<cpfCnpj>",
  "companyType": "<companyType>",
  "incomeValue": "<incomeValue>"
}'

Tokenização de cartão

Tokenize cartão uma vez, reutilize sem PCI.

POST/credit-cards/tokenize
Body JSON
customer
id
creditCard
dados completos
creditCardHolderInfo
dados do titular
remoteIp
IP
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/credit-cards/tokenize" \
  -H "X-API-Key: baas_••••" \
  -H "Content-Type: application/json" \
  -d '{
  "customer": "<customer>",
  "creditCard": "<creditCard>",
  "creditCardHolderInfo": "<creditCardHolderInfo>",
  "remoteIp": "<remoteIp>"
}'

Conta

Dados e saldo da conta mestre.

GET/account/me
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/account/me" \
  -H "X-API-Key: baas_••••"
GET/account/balance
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/account/balance" \
  -H "X-API-Key: baas_••••"
GET/account/statistics
Query params
startDate
yyyy-MM-dd
finishDate
yyyy-MM-dd
Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/account/statistics" \
  -H "X-API-Key: baas_••••"

Pronto pra integrar?

Acesse a área restrita e gere sua primeira API key em /api-keys.