Template Stable

Invoice

Sent when an invoice is issued.

invoice - billing

billing Stable Latest stable

Invoice v1

invoice - v1

Subject: Invoice {{invoiceNumber}}

Preheader: Your invoice is ready.

Required fields

Name Type Required Description Example
invoice object Yes Invoice {"items":[{"quantity":"Quantity","code":"Code","description":"Description","amount":"GBP 20.00"}],"totals":{"subtotal":"GBP 20.00","tax":"Tax","total":"GBP 20.00"}}
invoiceNumber text Yes Invoice Number
Max 1000 characters
Invoice Number

Optional fields

Name Type Required Description Example
actionButton.label text No Action Button Label
Max 120 characters
View invoice
actionButton.url url No Action Button URL
Max 2048 characters
https://example.com/app
heading text No Heading
Max 180 characters
Invoice Invoice Number
intro text No Intro
Max 1000 characters
Your invoice is ready.
preheader text No Preheader
Max 220 characters
Your invoice is ready.
subject text No Subject
Max 180 characters
Invoice Invoice Number

Defaults

{
  "actionButton.label": "View invoice",
  "heading": "Invoice {{invoiceNumber}}",
  "intro": "Your invoice is ready.",
  "preheader": "Your invoice is ready.",
  "subject": "Invoice {{invoiceNumber}}"
}

Example data

{
  "templateId": "invoice",
  "data": {
    "invoice": {
      "items": [
        {
          "quantity": "Quantity",
          "code": "Code",
          "description": "Description",
          "amount": "GBP 20.00"
        }
      ],
      "totals": {
        "subtotal": "GBP 20.00",
        "tax": "Tax",
        "total": "GBP 20.00"
      }
    },
    "invoiceNumber": "Invoice Number"
  }
}

Template messages

TypeCodeMessage
Return accepted Valid template data can be queued by the send endpoint.
Error missing_required_variable Invoice is required.
Error missing_required_variable Invoice Number is required.
Error field_too_long Invoice Number must be 1000 characters or fewer.
Error field_too_long Action Button Label must be 120 characters or fewer.
Error field_too_long Action Button URL must be 2048 characters or fewer.
Error invalid_url Action Button URL must be a valid http or https URL.
Error field_too_long Heading must be 180 characters or fewer.
Error field_too_long Intro must be 1000 characters or fewer.
Error field_too_long Preheader must be 220 characters or fewer.
Error field_too_long Subject must be 180 characters or fewer.