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.
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.
curl "http://localhost:3100/api/v1/account/me" \
-H "X-API-Key: baas_••••••••••"Sua primeira chamada
Crie um cliente
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.
Crie uma cobrança PIX
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"
}'Pegue o QR Code
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"
# }Ou pegue os dados do boleto
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:
{
"error": "bank_error",
"message": "A url informada é inválida.",
"details": {
"errors": [
{ "code": "invalid_object", "description": "A url informada é inválida." }
]
}
}invalid_requestJSON malformado ou campos obrigatórios ausentes.
missing_api_key / invalid_api_keyHeader X-API-Key faltando ou inválido.
tenant_disabledTenant foi desativado pelo admin.
bank_errorBanco rejeitou — ver details.errors.
rate_limitedChamando rápido demais (em breve).
internal_errorExceção não tratada — reporta.
bank_errorBanco 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.
# 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"
]
}'{
"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:
{
"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.
/customersLista clientes- 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_••••"/customersCria cliente- name
- nome obrigatório
- cpfCnpj
- CPF/CNPJ obrigatório
- 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>"
}'/customers/{id}Busca clienteExemplo cURL
curl -X GET "http://localhost:3100/api/v1/customers/PAY_ID" \
-H "X-API-Key: baas_••••"/customers/{id}Atualiza clienteExemplo cURL
curl -X PUT "http://localhost:3100/api/v1/customers/PAY_ID" \
-H "X-API-Key: baas_••••" \
-H "Content-Type: application/json" \
-d '{}'/customers/{id}Remove clienteExemplo 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.
/paymentsLista cobranças- 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_••••"/paymentsCria cobrança- 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"
}'/payments/{id}Busca cobrançaExemplo cURL
curl -X GET "http://localhost:3100/api/v1/payments/PAY_ID" \
-H "X-API-Key: baas_••••"/payments/{id}Cancela/remove cobrançaExemplo cURL
curl -X DELETE "http://localhost:3100/api/v1/payments/PAY_ID" \
-H "X-API-Key: baas_••••"/payments/{id}/refundEstorna- 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>"
}'/payments/{id}/pix-qrRetorna QR Code PIX (payload + imagem base64)Exemplo cURL
curl -X GET "http://localhost:3100/api/v1/payments/PAY_ID/pix-qr" \
-H "X-API-Key: baas_••••"/payments/{id}/boletoRetorna linha digitável, código de barras, URL do PDFExemplo 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.
/subscriptionsLista assinaturasExemplo cURL
curl -X GET "http://localhost:3100/api/v1/subscriptions" \
-H "X-API-Key: baas_••••"/subscriptionsCria assinatura- 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>"
}'/subscriptions/{id}BuscaExemplo cURL
curl -X GET "http://localhost:3100/api/v1/subscriptions/PAY_ID" \
-H "X-API-Key: baas_••••"/subscriptions/{id}AtualizaExemplo cURL
curl -X PUT "http://localhost:3100/api/v1/subscriptions/PAY_ID" \
-H "X-API-Key: baas_••••" \
-H "Content-Type: application/json" \
-d '{}'/subscriptions/{id}CancelaExemplo 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.
/installmentsLista parcelamentosExemplo cURL
curl -X GET "http://localhost:3100/api/v1/installments" \
-H "X-API-Key: baas_••••"/installments/{id}BuscaExemplo cURL
curl -X GET "http://localhost:3100/api/v1/installments/PAY_ID" \
-H "X-API-Key: baas_••••"/installments/{id}Remove parcelamento e cobrançasExemplo cURL
curl -X DELETE "http://localhost:3100/api/v1/installments/PAY_ID" \
-H "X-API-Key: baas_••••"/installments/{id}/paymentsLista parcelas (payments individuais)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.
/pix/keysLista chavesExemplo cURL
curl -X GET "http://localhost:3100/api/v1/pix/keys" \
-H "X-API-Key: baas_••••"/pix/keysCria chave- 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>"
}'/pix/keys/{id}Remove chaveExemplo cURL
curl -X DELETE "http://localhost:3100/api/v1/pix/keys/PAY_ID" \
-H "X-API-Key: baas_••••"/pix/qrGera QR estático- 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>"
}'/pix/qr/decodeDecodifica um payload PIXExemplo cURL
curl -X POST "http://localhost:3100/api/v1/pix/qr/decode" \
-H "X-API-Key: baas_••••" \
-H "Content-Type: application/json" \
-d '{}'/pix/payPaga PIX via QR/chave- 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.
/transfersLista transferências enviadasExemplo cURL
curl -X GET "http://localhost:3100/api/v1/transfers" \
-H "X-API-Key: baas_••••"/transfersEnvia PIX ou TED- 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>"
}'/transfers/{id}/cancelCancela transferência agendadaExemplo cURL
curl -X POST "http://localhost:3100/api/v1/transfers/PAY_ID/cancel" \
-H "X-API-Key: baas_••••" \
-H "Content-Type: application/json" \
-d '{}'Links de pagamento
Cria um link público pra receber pagamentos sem precisar criar customer antes.
/payment-linksLista linksExemplo cURL
curl -X GET "http://localhost:3100/api/v1/payment-links" \
-H "X-API-Key: baas_••••"/payment-linksCria link- name
- nome público
- description
- descrição
- billingType
- UNDEFINED = cliente escolhe
- chargeType
- DETACHED/RECURRENT/INSTALLMENT
- value
- valor
Exemplo cURL
curl -X POST "http://localhost:3100/api/v1/payment-links" \
-H "X-API-Key: baas_••••" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>",
"description": "<description>",
"billingType": "<billingType>",
"chargeType": "<chargeType>",
"value": "<value>"
}'/payment-links/{id}BuscaExemplo cURL
curl -X GET "http://localhost:3100/api/v1/payment-links/PAY_ID" \
-H "X-API-Key: baas_••••"/payment-links/{id}AtualizaExemplo cURL
curl -X PUT "http://localhost:3100/api/v1/payment-links/PAY_ID" \
-H "X-API-Key: baas_••••" \
-H "Content-Type: application/json" \
-d '{}'/payment-links/{id}RemoveExemplo cURL
curl -X DELETE "http://localhost:3100/api/v1/payment-links/PAY_ID" \
-H "X-API-Key: baas_••••"Checkouts
Sessão de checkout one-shot — retorna URL de pagamento.
/checkoutsCria sessão de checkoutExemplo 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).
/webhooksLista webhooksExemplo cURL
curl -X GET "http://localhost:3100/api/v1/webhooks" \
-H "X-API-Key: baas_••••"/webhooksRegistra webhook- name
- nome
- url
- https://…
- 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>"
}'/webhooks/{id}BuscaExemplo cURL
curl -X GET "http://localhost:3100/api/v1/webhooks/PAY_ID" \
-H "X-API-Key: baas_••••"/webhooks/{id}AtualizaExemplo cURL
curl -X PUT "http://localhost:3100/api/v1/webhooks/PAY_ID" \
-H "X-API-Key: baas_••••" \
-H "Content-Type: application/json" \
-d '{}'/webhooks/{id}RemoveExemplo cURL
curl -X DELETE "http://localhost:3100/api/v1/webhooks/PAY_ID" \
-H "X-API-Key: baas_••••"/webhook-eventsLista eventos recebidos (tabela local)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.
/billsLista contas pagas/agendadasExemplo cURL
curl -X GET "http://localhost:3100/api/v1/bills" \
-H "X-API-Key: baas_••••"/billsAgenda pagamento- 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>"
}'/bills/simulateSimula antes de pagarExemplo 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.
/anticipationsLista antecipaçõesExemplo cURL
curl -X GET "http://localhost:3100/api/v1/anticipations" \
-H "X-API-Key: baas_••••"/anticipationsCria antecipação- 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>"
}'/anticipations/simulateSimula taxaExemplo cURL
curl -X POST "http://localhost:3100/api/v1/anticipations/simulate" \
-H "X-API-Key: baas_••••" \
-H "Content-Type: application/json" \
-d '{}'/anticipations/limitsLimites disponíveisExemplo 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.
/invoicesLista notasExemplo cURL
curl -X GET "http://localhost:3100/api/v1/invoices" \
-H "X-API-Key: baas_••••"/invoicesEmite notaExemplo cURL
curl -X POST "http://localhost:3100/api/v1/invoices" \
-H "X-API-Key: baas_••••" \
-H "Content-Type: application/json" \
-d '{}'/invoices/{id}BuscaExemplo cURL
curl -X GET "http://localhost:3100/api/v1/invoices/PAY_ID" \
-H "X-API-Key: baas_••••"/invoices/{id}AtualizaExemplo cURL
curl -X PUT "http://localhost:3100/api/v1/invoices/PAY_ID" \
-H "X-API-Key: baas_••••" \
-H "Content-Type: application/json" \
-d '{}'/invoices/{id}CancelaExemplo 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.
/fiscal-infoBusca config fiscalExemplo cURL
curl -X GET "http://localhost:3100/api/v1/fiscal-info" \
-H "X-API-Key: baas_••••"/fiscal-infoAtualiza config fiscalExemplo 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.
/dunningLista negativaçõesExemplo cURL
curl -X GET "http://localhost:3100/api/v1/dunning" \
-H "X-API-Key: baas_••••"/dunningNegativa um paymentExemplo cURL
curl -X POST "http://localhost:3100/api/v1/dunning" \
-H "X-API-Key: baas_••••" \
-H "Content-Type: application/json" \
-d '{}'/dunning/{id}BuscaExemplo cURL
curl -X GET "http://localhost:3100/api/v1/dunning/PAY_ID" \
-H "X-API-Key: baas_••••"Chargebacks
Contestação de cartão.
/chargebacksLista chargebacksExemplo cURL
curl -X GET "http://localhost:3100/api/v1/chargebacks" \
-H "X-API-Key: baas_••••"/chargebacks/{id}Busca chargebackExemplo 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.
/credit-bureauLista consultasExemplo cURL
curl -X GET "http://localhost:3100/api/v1/credit-bureau" \
-H "X-API-Key: baas_••••"/credit-bureauNova consulta- 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.
/mobile-rechargesLista recargasExemplo cURL
curl -X GET "http://localhost:3100/api/v1/mobile-recharges" \
-H "X-API-Key: baas_••••"/mobile-rechargesNova recarga- 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.
/sub-accountsLista sub-contasExemplo cURL
curl -X GET "http://localhost:3100/api/v1/sub-accounts" \
-H "X-API-Key: baas_••••"/sub-accountsCria sub-conta- name
- nome
- 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.
/credit-cards/tokenizeTokeniza- 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.
/account/meDados da contaExemplo cURL
curl -X GET "http://localhost:3100/api/v1/account/me" \
-H "X-API-Key: baas_••••"/account/balanceSaldoExemplo cURL
curl -X GET "http://localhost:3100/api/v1/account/balance" \
-H "X-API-Key: baas_••••"/account/statisticsEstatísticas (pagas, recebidas…)- 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_••••"