Webhooks
Invoice created
Aira sends this event after it creates an invoice: the invoice of a billing act of a contract, the replacement of a reopened invoice, a one-off invoice and an imported invoice. The event carries the invoice as GET /v1/invoices answers it, without its line items, which GET /v1/invoices/{id} answers.
WEBHOOK
invoice.created
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event": "invoice.created",
"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,
"contractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isLocked": true,
"sentAt": "2023-11-07T05:31:56Z",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
}
}
}
}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.created",
"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,
"contractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isLocked": true,
"sentAt": "2023-11-07T05:31:56Z",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
}
}
}
}