Criar Fatura com Captura
POST
http://{{app_url}}/api/v1/invoices/createRequisição
Parâmetros Header
client-id
string
requerido
Exemplo:
{{client-id}}
client-secret
string
requerido
Exemplo:
{{client-secret}}
Parâmetros Bodyapplication/json
ref
string
requerido
due_date
string
requerido
description
string
requerido
discount_amount
integer
requerido
tax_amount
integer
requerido
customer
object
requerido
name
string
requerido
email
string
requerido
cellphone
string
requerido
cpfcnpj
string
requerido
address
object
requerido
items
array [object {4}]
requerido
name
string
requerido
description
string
requerido
quantity
integer
requerido
price
string
requerido
capture
object
requerido
method
string
requerido
payment
object
requerido
Exemplo
{
"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",
"zipcode": "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
}
}
}
}
Exemplos de Requisição
Respostas
Criar Fatura com Captura(200)
Criar Fatura com Captura
Código HTTP: 200
Tipo de Conteúdo: JSONapplication/json
Esquema de Dados
id
string
requerido
ref
string
requerido
description
string
requerido
status
string
requerido
subtotal_amount
string
requerido
total_amount
string
requerido
tax_amount
string
requerido
discount_amount
string
requerido
link_token
string
requerido
link
string
requerido
customer
object
requerido
id
string
requerido
name
string
requerido
email
string
requerido
description
null
requerido
cellphone
string
requerido
cpfcnpj
string
requerido
address
object
requerido
items
array [object {4}]
requerido
id
string
requerido
product
object
requerido
quantity
integer
requerido
total
string
requerido
payment
object
requerido
id
string
requerido
status
string
requerido
method
string
requerido
interest_amount
string
requerido
fee_amount
string
requerido
discount_amount
string
requerido
total_amount
string
requerido
transaction
object
requerido
next_withdraw_available
string
requerido
withdraw_agenda
object
requerido
paid_at
string
requerido
payable_with
array[string]
requerido
shipping
null
requerido
due_date
string
requerido
paid_at
null
requerido
notification_url
null
requerido
created_at
string
requerido
notifications
array [object {5}]
requerido
title
string
opcional
message
string
opcional
type
string
opcional
created_at
string
opcional
meta
array
opcional
ExemploCriar Fatura com Captura
{
"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",
"zipcode": "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": []
}
]
}
Last modified: 4 months ago