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"
}
}
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"
}
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Chave única de idempotência para evitar duplicação de requisições.
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.
Criar uma fatura
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.