Webhooks
Invoice deleted
Aira sends this event after it deletes an invoice, which the deletion of its customer deletes. The event carries the invoice as GET /v1/invoices answered it before the deletion, without its line items. GET /v1/invoices/{id} answers 404 for a deleted invoice, so read there the line items that your system keeps while the invoice exists, such as after invoice.created and invoice.updated.
WEBHOOK
invoice.deleted
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event": "invoice.deleted",
"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.deleted",
"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"
]
}
}
}
}