Appearance
Invoice Created
This event is triggered when an existing case invoice is deleted on WillSuite.
Input
Payload
webhook_type string
This is set to case_invoice.deleted
invoice_data object
The deleted invoice
invoice_items_data object
The deleted invoice items
case_data object
This is the case data related to the invoice
Response
WARNING
A response of 202 status code is expected
INFO
202 status code indicates the request has been accepted for processing, but the processing has not been finished yet.
Payload
json
{
"case_data": { "id": "840a1286-e4eb-414e-8b7c-2baf3462a9b9", "ref": "06062024 - RPTEST002" },
"invoice_data": {
"id": "e69550fe-8890-4b73-87a3-c8280f839694",
"ref": null,
"notes": null,
"terms": "If this invoice is not paid within 30 days, 1% interest shall be added for each week it is overdue.",
"total": 175,
"date_due": "28/08/2024",
"subtotal": 175,
"date_paid": null,
"date_sent": null,
"vat_amount": 0,
"date_created": "25/07/2024",
"payment_terms": "30 Days Payment Period",
"invoice_number": "ANDR0007-1",
"recipients_name": "Mr C. Andrews",
"customer_case_id": "840a1286-e4eb-414e-8b7c-2baf5462a7b9"
},
"webhook_type": "case_invoice.deleted",
"invoice_items_data": [
{
"id": "e5edb97f-47ca-4b3a-53c5-c50bc35326c3",
"rate": 175,
"amount": 175,
"status": null,
"paid_at": null,
"quantity": 1,
"subtotal": 175,
"vat_amount": 0,
"description": "Cancer Research Will",
"case_invoice_id": "e69550fe-8890-4b73-87a3-c8280f839694",
"customer_case_id": "840a1286-e4eb-414e-8b7c-2baf5462a7b9"
}
]
}json
{
"type": "object",
"properties": {
"case_data": {
"type": "object",
"properties": {
"id": { "type": "string" },
"ref": { "type": "string" }
},
"required": ["id", "ref"]
},
"invoice_data": {
"type": "object",
"properties": {
"id": { "type": "string" },
"ref": { "type": ["string", "null"] },
"notes": { "type": ["string", "null"] },
"terms": { "type": "string" },
"total": { "type": "number" },
"date_due": { "type": "string" },
"subtotal": { "type": "number" },
"date_paid": { "type": ["string", "null"] },
"date_sent": { "type": ["string", "null"] },
"vat_amount": { "type": "number" },
"date_created": { "type": "string" },
"payment_terms": { "type": "string" },
"invoice_number": { "type": "string" },
"recipients_name": { "type": "string" },
"customer_case_id": { "type": "string" }
},
"required": [
"id",
"terms",
"total",
"date_due",
"subtotal",
"vat_amount",
"date_created",
"payment_terms",
"invoice_number",
"recipients_name",
"customer_case_id"
]
},
"webhook_type": { "type": "string" },
"invoice_items_data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "string" },
"rate": { "type": "number" },
"amount": { "type": "number" },
"status": { "type": ["string", "null"] },
"paid_at": { "type": ["string", "null"] },
"quantity": { "type": "number" },
"subtotal": { "type": "number" },
"vat_amount": { "type": "number" },
"description": { "type": "string" },
"case_invoice_id": { "type": "string" },
"customer_case_id": { "type": "string" }
},
"required": [
"id",
"rate",
"amount",
"quantity",
"subtotal",
"vat_amount",
"description",
"case_invoice_id",
"customer_case_id"
]
}
}
},
"required": ["case_data", "invoice_data", "webhook_type", "invoice_items_data"]
}