Empréstimos
- Empréstimos
- Políticas de crédito
- Esteira
- Produtos
- Ofertas
- Parcelas
Empresas
- Empresas
- Grupos de empresas
- Operadores
- Permissões
- Métodos de pagamento
Clientes
- Clientes
- Funcionários
Fundos
- Fundos
Eventos
- Eventos
- Assinaturas
- Webhooks externos
- Notificações
Cobrança
- Itens da fatura
- Intenções de pagamento
- Faturas
- GETListar faturas
- GETObter fatura
- GETObter item da fatura
- GETListar itens da fatura
- GETObter intenção de pagamento
- GETListar intenções de pagamento da fatura
- POSTCriar fatura
- POSTAtualizar fatura
- POSTCriar item da fatura
- POSTCriar intenção de pagamento
- POSTAnular fatura
- POSTMarcar fatura como incobrável
- POSTFinalizar fatura
- DELExcluir fatura
- DELExcluir item da fatura
- GET
Arquivos
- Links de arquivos
- Arquivos
Configurações
- Temas
- Chaves da API
- Configurações
Entidades
- Entidade de dados
- Documentos
Automações
- Workflows
Modelos
- Modelos
Criar fatura
Cria uma nova fatura.
curl --request POST \
--url https://api.base39.io/v1/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payer": "<string>",
"beneficiary": "<string>",
"dueDate": "2023-12-25",
"type": "pay_off",
"description": "<string>",
"items": [
{
"installment": "inst_631a1f531a40784a5b1df6ed",
"amount": 123,
"discount": 123,
"fine": 123,
"interest": 123,
"description": "<string>",
"metadata": {}
}
],
"autoFinalize": true,
"updateInvoiceItemOnInsert": true,
"paidAt": "2023-12-25",
"metadata": {}
}'
{
"id": "inv_5f92f01728e009f403d8502e",
"status": "draft",
"payer": "<string>",
"beneficiary": "<string>",
"dueDate": "2023-12-25",
"amountDue": 200000,
"amountPaid": 150050,
"amountRemaining": 95000,
"type": "pay_off",
"invoiceItems": {
"url": "<string>",
"hasMore": true,
"data": [
{
"id": "item_5f92f01728e009f403d8502e",
"installment": "inst_631a1f531a40784a5b1df6ed",
"invoice": "inv_631a1f531a40784a4b0df5ed",
"amount": 123,
"discount": 123,
"fine": 123,
"interest": 123,
"description": "<string>",
"metadata": {},
"createdAt": "2023-08-25T22:38:41.134Z",
"updatedAt": "2023-08-25T22:38:41.134Z",
"deleted": false
}
]
},
"paymentIntents": {
"hasMore": true,
"data": [
{
"id": "pi_5f92f01728e009f403d8502e",
"invoice": "inv_631a1f531a40784a4b0df5ed",
"status": "open",
"amount": 123,
"paymentDetails": {
"paidAt": "2023-12-25",
"amountPaid": 123,
"metadata": {}
},
"expireAt": "2023-12-25",
"method": "boleto",
"methodData": {
"externalId": "<string>",
"type": "boleto",
"provider": "kobana",
"description": "<string>",
"typeableLine": "<string>",
"url": "<string>",
"barcode": "<string>",
"ourNumber": "<string>",
"customer": "cust_631a2a321a40784a4b0df641",
"events": [
{}
]
},
"metadata": {},
"createdAt": "2023-08-25T22:38:41.134Z",
"updatedAt": "2023-08-25T22:38:41.134Z"
}
]
},
"description": "<string>",
"history": [
{
"description": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"status": "draft",
"metadata": {}
}
],
"paidAt": "2023-12-25",
"metadata": {},
"createdAt": "2023-08-25T22:38:41.134Z",
"updatedAt": "2023-08-25T22:38:41.134Z",
"deleted": false,
"createdBy": {
"clientId": "key_643969122d598f5b62d15fbc",
"externalClientId": "optr_643969122d598f5b62d15fbd"
},
"updatedBy": {
"clientId": "key_643969122d598f5b62d15fbc",
"externalClientId": "optr_643969122d598f5b62d15fbd"
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
Chave única de idempotência para evitar duplicação de requisições.
Query Parameters
Expande as referências.
Pode ser um valor único ou uma lista separada por vírgula (csv) de referências retornadas neste endpoint.
Uma lista separada por vírgulas de atributos a serem incluídos na resposta. Isso pode ser usado para solicitar campos que normalmente não são retornados em uma resposta padrão.
Esteja ciente de que especificar este parâmetro terá o efeito que nenhum dos campos padrão seja retornado na resposta, a menos que seja explicitamente especificado.
Body
Criar uma fatura
Response
Retorna o objeto Invoice
se a criação for bem-sucedida. Retorna um erro se os parâmetros de criação forem inválidos.
Este objeto representa uma fatura.
curl --request POST \
--url https://api.base39.io/v1/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payer": "<string>",
"beneficiary": "<string>",
"dueDate": "2023-12-25",
"type": "pay_off",
"description": "<string>",
"items": [
{
"installment": "inst_631a1f531a40784a5b1df6ed",
"amount": 123,
"discount": 123,
"fine": 123,
"interest": 123,
"description": "<string>",
"metadata": {}
}
],
"autoFinalize": true,
"updateInvoiceItemOnInsert": true,
"paidAt": "2023-12-25",
"metadata": {}
}'
{
"id": "inv_5f92f01728e009f403d8502e",
"status": "draft",
"payer": "<string>",
"beneficiary": "<string>",
"dueDate": "2023-12-25",
"amountDue": 200000,
"amountPaid": 150050,
"amountRemaining": 95000,
"type": "pay_off",
"invoiceItems": {
"url": "<string>",
"hasMore": true,
"data": [
{
"id": "item_5f92f01728e009f403d8502e",
"installment": "inst_631a1f531a40784a5b1df6ed",
"invoice": "inv_631a1f531a40784a4b0df5ed",
"amount": 123,
"discount": 123,
"fine": 123,
"interest": 123,
"description": "<string>",
"metadata": {},
"createdAt": "2023-08-25T22:38:41.134Z",
"updatedAt": "2023-08-25T22:38:41.134Z",
"deleted": false
}
]
},
"paymentIntents": {
"hasMore": true,
"data": [
{
"id": "pi_5f92f01728e009f403d8502e",
"invoice": "inv_631a1f531a40784a4b0df5ed",
"status": "open",
"amount": 123,
"paymentDetails": {
"paidAt": "2023-12-25",
"amountPaid": 123,
"metadata": {}
},
"expireAt": "2023-12-25",
"method": "boleto",
"methodData": {
"externalId": "<string>",
"type": "boleto",
"provider": "kobana",
"description": "<string>",
"typeableLine": "<string>",
"url": "<string>",
"barcode": "<string>",
"ourNumber": "<string>",
"customer": "cust_631a2a321a40784a4b0df641",
"events": [
{}
]
},
"metadata": {},
"createdAt": "2023-08-25T22:38:41.134Z",
"updatedAt": "2023-08-25T22:38:41.134Z"
}
]
},
"description": "<string>",
"history": [
{
"description": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"status": "draft",
"metadata": {}
}
],
"paidAt": "2023-12-25",
"metadata": {},
"createdAt": "2023-08-25T22:38:41.134Z",
"updatedAt": "2023-08-25T22:38:41.134Z",
"deleted": false,
"createdBy": {
"clientId": "key_643969122d598f5b62d15fbc",
"externalClientId": "optr_643969122d598f5b62d15fbd"
},
"updatedBy": {
"clientId": "key_643969122d598f5b62d15fbc",
"externalClientId": "optr_643969122d598f5b62d15fbd"
}
}