Invoice Updates
These events are sent when an invoice is created or its status changes. They need the Sales add-on. Set them up in Webhooks.
| Event | event.type | Invoice status |
|---|---|---|
| Invoice Created as Draft | invoice_draft | DRAFT |
| Invoice Sent | invoice_sent | SENT |
| Invoice Partially Paid | invoice_pending | PENDING |
| Invoice Fully Paid | invoice_paid | PAID |
An event is sent once each time the invoice moves into one of these statuses, including when it is first created. Saving an invoice without changing its status sends nothing.
All invoice events use the same payload; event.type tells you which one it is.
Invoice Updates
(i) Payload Format: This is the payload Whautomate sends to your endpoint for every invoice event.
{
"event": {
"id": "{{event.id}}",
"type": "{{event.type}}",
"timeStamp": "{{event.timeStamp}}",
"key": "{{event.key}}"
},
"invoice": {
"id": "{{invoice.id}}",
"location": {
"id": "{{invoice.location.id}}",
"title": "{{invoice.location.title}}"
},
"client": {
"id": "{{invoice.client.id}}",
"fullName": "{{invoice.client.fullName}}",
"countryCode": "{{invoice.client.countryCode}}",
"phone": "{{invoice.client.phone}}",
"email": "{{invoice.client.email}}"
},
"staff": {
"id": "{{invoice.staff.id}}",
"name": "{{invoice.staff.name}}"
},
"dueDate": "{{invoice.dueDate}}",
"date": "{{invoice.date}}",
"status": "{{invoice.status}}",
"invoiceNumber": "{{invoice.invoiceNumber}}",
"internalNotes": "{{invoice.internalNotes}}",
"clientNotes": "{{invoice.clientNotes}}",
"currency": "{{invoice.currency}}",
"total": "{{invoice.total}}",
"pendingAmount": "{{invoice.pendingAmount}}",
"items": "{{invoice.items}}",
"invoicePDF": "{{invoice.invoicePDF}}",
"createdAt": "{{invoice.createdAt}}",
"updatedAt": "{{invoice.updatedAt}}"
}
}
| Field | What it holds |
|---|---|
event.timeStamp | When the event happened (UTC) |
event.key | The invoice id |
invoice.date, invoice.dueDate | Invoice and due dates (YYYY-MM-DD, in the location's time zone) |
invoice.status | DRAFT, SENT, PENDING or PAID |
invoice.total, invoice.pendingAmount | Invoice total and the amount still to be paid, in invoice.currency |
invoice.items | Line items: type (SERVICE or PRODUCT), item, quantity (unit), price, taxes, discount and line total |
invoice.client, invoice.staff | The client billed and the team member on the invoice; left out when the invoice has none |
invoice.clientNotes, invoice.internalNotes | Notes shown to the client, and notes for your team only |
invoice.invoicePDF | Link to the invoice PDF, or empty when it has not been generated yet |
(ii) Example: an invoice created as a draft.
{
"event": {
"id": "ecKyX3x8IY",
"type": "invoice_draft",
"timeStamp": "2024-03-28T10:00:00Z",
"key": "AZEa1bTPqE"
},
"invoice": {
"id": "AZEa1bTPqE",
"location": {
"id": "YFoWQBDuAu",
"title": "Whautomate"
},
"client": {
"id": "XpSCitpwse",
"fullName": "John Doe",
"countryCode": "+65",
"phone": "98765432",
"email": "test@example.com"
},
"staff": {
"id": "DCaR2sMN1o",
"name": "John Doe"
},
"items": [
{
"itemType": "SERVICE",
"itemDetails": [
{
"itemName": "Consultation",
"id": "8UYsHz0naJ"
}
],
"unit": 1,
"price": 500,
"taxes": [],
"discountPrice": 0,
"discountType": "PERCENTAGE",
"total": 500
}
],
"dueDate": "2024-04-08",
"date": "2024-03-25",
"status": "DRAFT",
"invoiceNumber": "INV-1001",
"internalNotes": "Sample Notes for Internal Use",
"clientNotes": "Thank you for your business.",
"currency": "SGD",
"total": 500,
"pendingAmount": 500,
"invoicePDF": "https://example.com/inv-1001.pdf",
"createdAt": "2024-03-28T10:00:00Z",
"updatedAt": "2024-03-28T11:45:00Z"
}
}