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:

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:

1curl -X GET 'https://api.sandbox.monite.com/v1/payables/variables' \
2 -H 'X-Monite-Version: 2024-01-31' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer ACCESS_TOKEN'

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:

1curl -X GET 'https://api.sandbox.monite.com/v1/payables_purchase_order/variables' \
2 -H 'X-Monite-Version: 2024-01-31' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer ACCESS_TOKEN'

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:

1curl -X GET 'https://api.sandbox.monite.com/v1/receivables/variables' \
2 -H 'X-Monite-Version: 2024-01-31' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer ACCESS_TOKEN'

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:

object_typeobject_subtype
"receivable""invoice"
"quote"
"credit_note"
"reminder"

"discount_reminder" - invoice payment reminders sent before the first and second early payment dates (if any) if the invoice has not been fully paid.

"final_reminder" - payment reminder sent before the invoice due date.

"overdue_reminder" - reminders sent after the invoice due date has passed in case the invoice has not been fully paid.

Common variables

These variables are available for all document types:

VariableDescription
{company_email}The email address of the counterpart.
{company_name}The counterpart name (either the company name or an individual’s name).
{contact_email}

The email address of the counterpart’s default contact. If no contacts are defined, the counterpart’s email address is used instead.

Note: This variable exists only if the counterpart is an organization.

{contact_name}

The name of the counterpart’s default contact. If no contacts are defined, the counterpart name is used instead.

Note: This variable exists only if the counterpart is an organization.

{entity_email}The email address of the entity, as specified by the email field of the Entity object.
{entity_name}The name of the entity.
{entity_website}

The URL of the entity’s website, as specified by the website field of the Entity object.

Note: This variables is only available in email templates.

{total_value}The invoice subtotal (without VAT), formatted with cents but without the currency sign. For example, 50.00. See also {amount_due}.

Additional variables for payables

In addition to the common variables, payables can use the following variables:

VariableDescription
{currency}The currency of the quote, as a 3-letter currency code. For example, EUR.
{customer_name}The customer name, as returned by the counterpart_name value of the Payable object.
{document_id}The value returned on the document_id field of the Payable object.
{due_date}The value returned on the due_date field of the Payable object.
{invoice_id}The value returned on the id field of the Payable object.
{total_amount}The value returned on the amount field of the Payable object.
{uploaded_username}

Additional variables for purchase orders

In addition to the common variables, purchase orders can use the following variables:

VariableDescription
{issue_date}The date when the purchase order was issued.
{payables_purchase_order_link}The URL of the PDF version of the purchase order, as returned by its file.url property.
{purchase_order_number}The purchase order number, as returned by the document_id value of the Receivable object.
{total_amount}Calculated from purchase_order.items and converted to minor units based on the currency.
{total_amount_with_vat}Calculated from purchase_order.items and converted to minor units based on currency and includes the VAT of the items.
{validity_date}Calculated as the date of today plus the value purchase_order.valid_for_days.

Additional variables for invoices

In addition to the common variables, outgoing invoices can use these variables:

VariableDescription
{amount_due}The total invoice amount (including VAT). For example, 611.25. See also {total_value}.
{currency}Invoice currency as a 3-letter currency code. For example, EUR.
{due_date}The invoice due date, as returned by the due_date field of the Receivable object.
{fulfillment_date}The invoice fulfillment date, as specified by the corresponding property of the Receivable object.
{invoice_link}The URL of the PDF version of the invoice, as returned by the file.url property of the Receivable object.
{invoice_number}The invoice number, as returned by the document_id property of the Receivable object.
{issue_date}The date when the invoice was issued.
{payment_link}The URL of the invoice payment page, as returned by the payment_page_url property of the Receivable object.
{total_value}The invoice subtotal (without VAT). For example, 600.00. See also {amount_due}.

Additional variables for quotes

In addition to the common variables, quotes can use the following variables:

VariableDescription
{currency}The currency of the quote, as a 3-letter currency code. For example, EUR.
{fulfilled_date}Unused.
{issue_date}The date when the quote was issued.
{payment_link}A URL that points to the quote accept/decline page, as specified by the quote_accept_url field of the Receivable object.
{quote_link}The URL of the PDF version of the quote, as returned by the file.url property of the Receivable object.
{quote_number}The quote number, as returned by the document_id value of the Receivable object.
{total_value}The quote subtotal (without VAT). For example, 600.00.

Additional variables for credit notes

In addition to the common variables, credit notes can use these variables:

VariableDescription
{amount_due}
{based_on_amount_due}
{based_on_document_id}The document_id value of the invoice for which the credit note was created.
{credit_note_link}The URL of the PDF version of the credit note, as returned by the file.url property of the Receivable object.
{credit_note_number}The credit note number, as returned by the document_id value of the Receivable object.
{currency}Credit note currency, as a 3-letter currency code. For example, EUR.
{due_date}
{fulfillment_date}
{issue_date}The date when the credit note was issued.
{payment_link}Unused.
{total_value}

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.

VariableDescription
{amount_due}
{currency}Invoice currency, as a 3-letter currency code. For example, EUR.
{document_id}The invoice number, as returned by the document_id property of the Receivable object.
{due_date}The invoice due date, as returned by the due_date field of the Receivable object.
{fulfillment_date}
{invoice_link}The URL of the PDF version of the invoice, as returned by the file.url property of the Receivable object.
{invoice_number}The invoice number, as returned by the document_id property of the Receivable object.
{issue_date}The date when the invoice was issued.
{payment_link}
{payment_term_discount}
{total_value}

Overdue reminders

In addition to the common variables, overdue reminders can include the following variables in their email subject and body:

VariableDescription
{amount_due}
{currency}Invoice currency, as a 3-letter currency code. For example, EUR.
{document_id}The invoice number, as returned by the document_id property of the Receivable object.
{due_date}
{fulfillment_date}
{invoice_link}The URL of the PDF version of the invoice, as returned by the file.url property of the Receivable object.
{invoice_number}The invoice number, as returned by the document_id property of the Receivable object.
{issue_date}The date when the invoice was issued.
{payment_link}
{payment_term_discount}
{total_value}