- Autenticação
- Fatura
- Clientes
- Merchant
- Produtos
- Webhooks & Gatilhos
- Utilidades
- Login Admin CopyPOST
- Create Merchant CopyPOST
Criar Fatura
POST
http://{{app_url}}/api/v1/invoices/create
Requisição
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.Exemplo:
Authorization: Bearer ********************
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
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
integer
requerido
payable_with
object
requerido
boleto
boolean
requerido
pix
boolean
requerido
credit_card
boolean
requerido
pixboleto
boolean
requerido
credit_card_installments_without_interest
integer
requerido
credit_card_installments_min
integer
requerido
>= 1<= 12
credit_card_installments_max
integer
requerido
>= 1<= 12
credit_card_fee_mdr_responsible
string
requerido
Padrão:
merchant
Exemplo:
customermerchant
credit_card_fee_antecipation_responsible
string
requerido
Padrão:
merchant
Exemplo:
customermerchant
notification_url
string
requerido
notification_enabled
boolean
requerido
Padrão:
false
Exemplo
{
"ref": "001",
"due_date": "01-12-2025",
"description": "Minha Fatura",
"discount_amount": 0,
"customer": {
"name": "Jorge Tadeu",
"email": "jtadeu@email.com",
"cellphone": "11999999999",
"cpfcnpj": "01234567890",
"address": {
"street": "Rua dos Jardins",
"number": "123",
"complement": "Sala 1",
"neighborhood": "Jardins",
"city": "São Paulo",
"state": "SP",
"zipcode": "01234000"
}
},
"items": [
{
"name": "Produto 1",
"description": "Meu produto",
"quantity": 5,
"price": 10025
},
{
"name": "Produto 2",
"description": "Meu produto 2",
"quantity": 2,
"price": 1144
}
],
"payable_with": {
"boleto": false,
"pix": true,
"credit_card": false,
"pixboleto": false,
"credit_card_installments_without_interest": 0,
"credit_card_installments_min": 1,
"credit_card_installments_max": 12,
"credit_card_fee_mdr_responsible": "merchant",
"credit_card_fee_antecipation_responsible": "merchant"
},
"notification_enabled": false,
"notification_url": "https://mywebhook.com"
}
Exemplos de Requisição
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
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": "001",
"due_date": "01-12-2025",
"description": "Minha Fatura",
"discount_amount": 0,
"customer": {
"name": "Jorge Tadeu",
"email": "jtadeu@email.com",
"cellphone": "11999999999",
"cpfcnpj": "01234567890",
"address": {
"street": "Rua dos Jardins",
"number": "123",
"complement": "Sala 1",
"neighborhood": "Jardins",
"city": "São Paulo",
"state": "SP",
"zipcode": "01234000"
}
},
"items":[
{
"name": "Produto 1",
"description": "Meu produto",
"quantity": 5,
"price": 10025
},
{
"name": "Produto 2",
"description": "Meu produto 2",
"quantity": 2,
"price": 1144
}
],
"payable_with": {
"boleto": false,
"pix": true,
"credit_card": false,
"pixboleto": false,
"credit_card_installments_without_interest": 0,
"credit_card_installments_min": 1,
"credit_card_installments_max": 12,
"credit_card_fee_mdr_responsible": "merchant",
"credit_card_fee_antecipation_responsible": "merchant"
},
"notification_enabled": false,
"notification_url" : "https://mywebhook.com"
}'
Respostas
🟢200Criar Fatura
application/json
Body
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 {3}]
requerido
id
string
requerido
product
object
requerido
quantity
integer
requerido
payment
null
requerido
payable_with
object
requerido
boleto
boolean
requerido
pix
boolean
requerido
credit_card
boolean
requerido
shipping
null
requerido
due_date
string
requerido
paid_at
null
requerido
notification_url
null
requerido
created_at
string
requerido
notifications
array[string]
requerido
Exemplo
{
"id": "83a0843b-0a98-402e-bb5f-75fcc44e11b1",
"ref": "150",
"description": "Descrição da Fatura",
"status": "unpaid",
"subtotal_amount": "5924.13",
"total_amount": "5924.13",
"tax_amount": "0",
"discount_amount": "0",
"link_token": "BdvkH6j2icCfSpj1E0Zxp9pnwuSrPm",
"link": "http://localhost:5180/hapo-code/public/fatura/BdvkH6j2icCfSpj1E0Zxp9pnwuSrPm",
"customer": {
"id": "e00e6af0-7775-4a0e-8f36-6f5f4af2bf16",
"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": "a274156f-7aa7-4be2-a735-e5bb428c9124",
"product": {
"id": "b7567ebc-924b-4604-948f-00afd4b697ef",
"name": "Produto 1",
"description": "Meu produto",
"price": "900.25"
},
"quantity": 5
},
{
"id": "4feb80eb-f07c-4e78-9822-97a5b5b6da9a",
"product": {
"id": "86cf4814-62d0-4704-9e19-74319f5c2282",
"name": "Produto 2",
"description": "Meu produto 2",
"price": "711.44"
},
"quantity": 2
}
],
"payment": null,
"payable_with": {
"boleto": true,
"pix": true,
"credit_card": true
},
"shipping": null,
"due_date": "25/04/2023",
"paid_at": null,
"notification_url": null,
"created_at": "05/04/2023",
"notifications": []
}
Modified at 2025-02-04 16:59:31