Webhook Events
Invoice recalculated
Aira sends this event each time that it creates or recalculates a contract invoice, after it saves the invoice, also when the total of the invoice does not change. Aira recalculates the open invoices every night, so a URL that subscribes to the event receives one event for each open invoice each day. A one-off invoice and an imported invoice send no event.
WEBHOOK
invoice.recalculated
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event": "invoice.recalculated",
"payload": {
"invoice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Mercado Bom Preço",
"externalId": "705faf65-9c8b-4053-8c0b-2021281ce83f"
},
"contractInvoiceSequence": 2,
"billingAccount": {
"businessName": "Mercado Bom Preço Ltda",
"taxId": "01234567000195"
},
"invoiceNumber": "ACMEI-0042",
"invoiceDate": "2023-12-25",
"dueDate": "2023-12-25",
"totalAmount": 123,
"contract": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
}
}Headers
Body
application/json
The event, with its identifier, its name and its payload.
Response
2XX
Answer with a 2XX status to confirm the delivery. Aira retries a delivery that gets another status, a redirect or no answer.
⌘I
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event": "invoice.recalculated",
"payload": {
"invoice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Mercado Bom Preço",
"externalId": "705faf65-9c8b-4053-8c0b-2021281ce83f"
},
"contractInvoiceSequence": 2,
"billingAccount": {
"businessName": "Mercado Bom Preço Ltda",
"taxId": "01234567000195"
},
"invoiceNumber": "ACMEI-0042",
"invoiceDate": "2023-12-25",
"dueDate": "2023-12-25",
"totalAmount": 123,
"contract": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
}
}