Authorization: Bearer ********************
{
"ref": "42",
"due_date": "28-04-2023",
"description": "Descrição da Fatura",
"discount_amount": 0,
"tax_amount": 0,
"customer": {
"name": "João da Silva",
"email": "joao@testeste.com.br",
"cellphone": "11999999999",
"cpfcnpj": "07120188917",
"address": {
"street": "Rua de Teste",
"number": "123",
"complement": "Sala 1",
"neighborhood": "Bairro Teste",
"city": "São Paulo",
"state": "SP",
"zip_code": "01234000"
}
},
"items": [
{
"name": "Produto 1",
"description": "Meu produto",
"quantity": 5,
"price": "900.25"
},
{
"name": "Produto 2",
"description": "Meu produto 2",
"quantity": 2,
"price": "711.44"
}
],
"capture": {
"method": "credit_card",
"payment": {
"card": {
"holder": "Daniel Leal dos Santos",
"holder_document": "07120188917",
"number": "5502093769921690",
"expiry": "01/2031",
"cvv": "411",
"brand": "mastercard",
"installment": 10
}
}
}
}
curl --location -g --request POST 'http://{{app_url}}/api/v1/invoices/create' \
--header 'client-id: {{client-id}}' \
--header 'client-secret: {{client-secret}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"ref": "42",
"due_date": "28-04-2023",
"description": "Descrição da Fatura",
"discount_amount": 0,
"tax_amount": 0,
"customer": {
"name": "João da Silva",
"email": "joao@testeste.com.br",
"cellphone": "11999999999",
"cpfcnpj": "07120188917",
"address": {
"street": "Rua de Teste",
"number": "123",
"complement": "Sala 1",
"neighborhood": "Bairro Teste",
"city": "São Paulo",
"state": "SP",
"zip_code": "01234000"
}
},
"items": [
{
"name": "Produto 1",
"description": "Meu produto",
"quantity": 5,
"price": "900.25"
},
{
"name": "Produto 2",
"description": "Meu produto 2",
"quantity": 2,
"price": "711.44"
}
],
"capture": {
"method": "credit_card",
"payment": {
"card": {
"holder": "Daniel Leal dos Santos",
"holder_document": "07120188917",
"number": "5502093769921690",
"expiry": "01/2031",
"cvv": "411",
"brand": "mastercard",
"installment": 10
}
}
}
}'
{
"id": "67669e34-2cee-450a-b7f0-626fc09b8497",
"ref": "2",
"description": "Descrição da Fatura",
"status": "paid",
"subtotal_amount": "5.924,13",
"total_amount": "5.924,13",
"tax_amount": "0",
"discount_amount": "0",
"link_token": "vutfW0sB9Hb3TeFd8wfZRXyREyuSQZ",
"link": "http://localhost:5180/hapo-code-ltda./public/fatura/vutfW0sB9Hb3TeFd8wfZRXyREyuSQZ",
"customer": {
"id": "da55e5ed-c073-4dce-b649-14e4fe382a11",
"name": "João da Silva",
"email": "joao@testeste.com.br",
"description": null,
"cellphone": "11999999999",
"cpfcnpj": "07120188917",
"address": {
"street": "Rua de Teste",
"number": "123",
"complement": "Sala 1",
"neighborhood": "Bairro Teste",
"city": "São Paulo",
"state": "SP",
"zip_code": "01234000"
}
},
"items": [
{
"id": "b1a6c415-2bf8-4480-ba91-2a38379e78f8",
"product": {
"id": "c1fa2f2e-cbbb-40ec-a6c7-958013ba86f7",
"name": "Produto 1",
"description": "Meu produto",
"price": "900,25"
},
"quantity": 5,
"total": "4.501,25"
},
{
"id": "99f7aae6-2555-4aec-8670-915c804440fe",
"product": {
"id": "0cdbcd18-4733-4675-9109-eb8d416b9dbf",
"name": "Produto 2",
"description": "Meu produto 2",
"price": "711,44"
},
"quantity": 2,
"total": "1.422,88"
}
],
"payment": {
"id": "c5928192-3577-4a65-a14c-1dacf89924b5",
"status": "paid",
"method": "credit_card",
"interest_amount": "0",
"fee_amount": "15403",
"discount_amount": "0",
"total_amount": "592413",
"transaction": {
"card_brand": "MasterCard",
"card_last_four": null,
"card_holder": "Daniel Leal dos Santos",
"card_holder_cpf": "07120188917",
"card_installments": "10"
},
"next_withdraw_available": "27/05/2023",
"withdraw_agenda": {
"2023-05-27": {
"amount": "59242",
"fee_amount": "15403"
},
"2023-06-26": {
"amount": "59242",
"fee_amount": "15403"
},
"2023-07-26": {
"amount": "59242",
"fee_amount": "15403"
},
"2023-08-25": {
"amount": "59242",
"fee_amount": "15403"
},
"2023-09-24": {
"amount": "59242",
"fee_amount": "15403"
},
"2023-10-24": {
"amount": "59242",
"fee_amount": "15403"
},
"2023-11-23": {
"amount": "59242",
"fee_amount": "15403"
},
"2023-12-23": {
"amount": "59242",
"fee_amount": "15403"
},
"2024-01-22": {
"amount": "59242",
"fee_amount": "15403"
},
"2024-02-21": {
"amount": "59242",
"fee_amount": "15403"
}
},
"paid_at": "2023-04-27 15:16:13"
},
"payable_with": [
"credit_card",
"pix",
"boleto"
],
"shipping": null,
"due_date": "28/04/2023",
"paid_at": null,
"notification_url": null,
"created_at": "27/04/2023",
"notifications": [
{
"title": "Nova fatura criada",
"message": "Fatura com id: 67669e34-2cee-450a-b7f0-626fc09b8497 criada com sucesso.",
"type": "success",
"created_at": "27/04/2023 15:16",
"meta": []
}
]
}