Skip to main content

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.

Eventevent.typeInvoice status
Invoice Created as Draftinvoice_draftDRAFT
Invoice Sentinvoice_sentSENT
Invoice Partially Paidinvoice_pendingPENDING
Invoice Fully Paidinvoice_paidPAID

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}}"
}
}
FieldWhat it holds
event.timeStampWhen the event happened (UTC)
event.keyThe invoice id
invoice.date, invoice.dueDateInvoice and due dates (YYYY-MM-DD, in the location's time zone)
invoice.statusDRAFT, SENT, PENDING or PAID
invoice.total, invoice.pendingAmountInvoice total and the amount still to be paid, in invoice.currency
invoice.itemsLine items: type (SERVICE or PRODUCT), item, quantity (unit), price, taxes, discount and line total
invoice.client, invoice.staffThe client billed and the team member on the invoice; left out when the invoice has none
invoice.clientNotes, invoice.internalNotesNotes shown to the client, and notes for your team only
invoice.invoicePDFLink 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"
}
}