€69 €49 Es ist Black Friday! Nur diese Woche: €20 sparen! 00h 00m 00s

Templates

Variables (Invoices)

The following variables are available in the template.ejs files of invoice templates:

#Variables

invoiceInvoiceThe invoice that is being rendered.
showCakedeskBranding boolean Whether or not to display Cakedesk branding on the invoice.

#Invoice

invoiceId string

The user-facing invoice ID.
Example: "2"

language string

The language of the invoice.
Example: "en"

invoiceDate string

The date of the invoice.
Example: "2022-09-13"

hasVat boolean Does the invoice include VAT?
hasQuantities boolean Does the invoice include quantities for each individual item?
invoiceTextRichTextA piece of text to go along with the invoice.
buyerInvoiceBuyerThe client.
sellerInvoiceSellerYou.
itemsInvoiceItem[]The individual items that make up the invoice.
taxSubtotalsTaxSubtotal[]

An array of tax subtotals. Only relevant if hasVat is true. If your invoice items contain multiple VAT percentages, this field will include multiple VAT percentages as well.

totalTaxesMoneyValueThe total amount of taxes included in this invoice. The sum of all VAT.
subtotalMoneyValueThe total amount without taxes.
totalMoneyValueThe total amount including taxes.

#InvoiceBuyer

id string

The client's user-facing ID.
Example: "1643505266"

name string

The full name of the client.
Example: "Restful Ltd."

vatId string

The VAT ID of the client.
Example: "DE123456789"

addressAddressThe address of the client.

#InvoiceSeller

name string

Your company name.
Example: "Restful Ltd."

vatId string

Your VAT ID.
Example: "DE123456789"

addressAddressYour address.
email string

Your email.
Example: "mail@example.com"

website string

Your website.
Example: "https://example.com"

addressAddressYour address.

#Address

To display an address, formatted correctly for its respective country, it's recommended to use the joinAddress helper.

address string

The address part of the address. Usually contains street and street number but can include other information as well and span multiple lines. For countries whose address format is unknown, the entire address will be entered in this field, separated by new lines ('\n').
Example: "Weichselstraße 65"

zipCode string

The zip code of the address
Example: "54747"

city string

The city.
Example: "Berlin"

countryCode string

The country code.
Example: "DE"

#InvoiceItem

title string The title of the item.
descriptionRichTextAn optional description for the item. Can be an empty string.
unitPriceMoneyValueThe price of a single unit of that item. Only relevant if invoice.hasQuantities is true.
quantity number How many of this item were sold. Only relevant if invoice.hasQuantities is true.
unitUnit | null

The unit type for this item, or null if the item has no unit. Only relevant if invoice.hasQuantities is true.

amountMoneyValueThe total price of this item (excluding VAT).
totalMoneyValueThe total price of this item, including subitems (excluding VAT).
itemsInvoiceItem[]Only the top-level invoice items can have child items.
vatPercentage number | null

How much VAT is applied for this item. Only relevant if invoice.hasVat is true.
Example: 19 or null

#Unit

An object describing a unit, for example "hours" or "days" or "kg". To display a unit in a template, it's recommended to use the formatQuantity or formatUnit helper.

unitId string

A unique slug-like identifier of the unit. Can be used in templates to check if a certain type of unit is provided for an item.

label.pluralMultiLangStringThe label for this unit if quantity is 0 or greater than 1.
label.singularMultiLangStringThe label for this unit if quantity is 1.

#Example

{
	"unitId": "hours",
	"label": {
		"plural": {
			"en": "Hours",
			"de": "Stunden"
		},
		"singular": {
			"en": "Hour",
			"de": "Stunde"
		}
	}
}

#TaxSubtotal

vatPercentage number

The VAT percentage of this tax subtotal.
Example: 19

subtotalMoneyValueThe amount of this tax subtotal.

#MoneyValue

currency string

The currency of this particular value.
Example: "EUR"

amount number

The amount for this particular value, in cents.
Example: 450000

#RichText

Variables with type RichText are strings of HTML markup. It can include the following tags:

  • <p>
  • <ul>
  • <ol>
  • <li>
  • <strong>

#MultiLangString

An object containing one or more languages as a key and strings as values. It is not guaranteed that each language is present as a key, or that each key has a value.

#Example

{ "en": "Hello", "de": "Hallo" }