Template variables
Learn how to use variables to parameterize your invoice notes and email messages.
Overview
Variables are named placeholders in strings that are later replaced with actual values. For example, if you want to add an invoice note addressing the counterpart (customer) personally, you can use the {company_name}
variable in the note text and Monite will automatically substitute it with the counterpart name associated with that invoice.
Variables can be used in any of the following ways:
- The
memo
field of Accounts Receivable documents (invoices, quotes, credit notes). - Email templates
- Text templates
- The email subject and body when sending documents via email by using the following endpoints:
Specifics of using variables in memo
fields
Variables inserted into the text string on Accounts Receivables’ memo
fields are immediately substituted with their values. That is, the replacement happens immediately during the document creation (POST) or update (PATCH), rather than later when the document gets issued.
Keep this in mind when repeatedly updating draft documents, as the memo
text with earlier substitutions might no longer reflect the current values of the variables.
Retrieving variables
Certain variables are document-specific and can only be used on a particular document. You can retrieve variables depending on the document type. Monite provides separate endpoints to retrieve Payable, Purchase order, and Receivable document variables.
Payables
To retrieve variables associated with Payables, call GET /payables/variables
:
The successful response returns an object containing an array of variable names and descriptions associated with payables.
Purchase orders
To retrieve variables associated with Purchase order documents, call GET /payables_purchase_order/variables
:
The successful response returns an object containing an array of variable names and descriptions associated with purchase orders.
Receivables
To retrieve variables associated with Accounts Receivable documents, call GET /receivables/variables
:
The successful response returns an object containing an array of variable names and descriptions associated with each receivable document type (invoices, quotes, credit notes, etc.) and invoice reminders.
Variable list
When retrieving document variables, their responses include an object_type
and object_subtype
field that differentiates each document type.
The following table shows the object_type
values and their corresponding possible object_subtype
values and descriptions:
Common variables
These variables are available for all document types:
Additional variables for payables
In addition to the common variables, payables can use the following variables:
Additional variables for purchase orders
In addition to the common variables, purchase orders can use the following variables:
Additional variables for invoices
In addition to the common variables, outgoing invoices can use these variables:
Additional variables for quotes
In addition to the common variables, quotes can use the following variables:
Additional variables for credit notes
In addition to the common variables, credit notes can use these variables:
Additional variables for invoice reminders
Variables for invoice reminders are available in the response from the GET
request to the receivable/variables
endpoint. These variables have an object_type
value of reminder
. The possible object_subtype
value for these variables include discount_reminder
, final_reminder
, and overdue_reminder
.
Payment reminders
Payment reminders refer to reminder emails sent to a counterpart before the invoice’s due dates and early discount dates. In addition to the common variables, invoice payment reminders can include the following variables in their email subject and body.
Overdue reminders
In addition to the common variables, overdue reminders can include the following variables in their email subject and body: