Criar Nota Fiscal de serviço via API
Endpoint
POST /api/v1/invoice
Você encontra a documentação mais detalhada desse endpoint nas documentações de api
A API aceita dois formatos de payload, sempre exigindo dados de cobrança ou valor, e um cliente (via customerId
ou objeto customer
).
Formato 1 – com valor
{
"description": "Assinatura Pro - Agosto/2025",
"billingDate": "2025-08-31T23:59:59.000Z",
"value": 12990,
"customerId": "cus_123"
}
Formato 2 – com cobrança
{
"description": "Mensalidade Premium",
"billingDate": "2025-08-31T23:59:59.000Z",
"charge": "ch_abc",
"customer": {
"taxID": "12345678909",
"name": "Maria Souza",
"email": "[email protected]",
"phone": "+55 48 99999-0000",
"address": {
"country": "BR",
"zipcode": "88000-000",
"street": "Rua das Flores",
"number": "100",
"state": "SC"
}
}
}
Resposta
Sucesso (201)
{
"invoice": {
"id": "inv_123",
"status": "ISSUED",
"provider": "NFEIO",
"chargeId": "ch_abc",
"customerId": "cus_123",
"value": 12990,
"links": {
"xml": "https://.../inv_123.xml",
"pdf": "https://.../inv_123.pdf"
}
}
}
Erros (400)
You need to configure the invoice integration
Customer not found
Customer is required
Charge not found
Customer address is invalid
Exemplos em código
- Shell + cURL
- JavaScript + Fetch
curl --request POST \
--url https://api.woovi.com/api/v1/invoice \
--header 'Authorization: {AUTHORIZATION TOKEN}' \
--header 'content-type: application/json'\
-d '{
"description": "Mensalidade Premium",
"billingDate": "2025-08-31T23:59:59.000Z",
"charge": "ch_abc",
"customerId": "cus_123"
}'
fetch('https://api.woovi.com/api/v1/invoice', {
method: 'POST',
headers: {
Authorization: {AUTHORIZATION TOKEN},
'Content-Type': 'application/json',
},
body: {
description: "Mensalidade Premium",
billingDate: "2025-08-31T23:59:59.000Z",
charge: "ch_abc",
customerId: "cus_123"
}
}).then(async (res) => res.json)