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:
memo and footer fields of accounts receivable invoices, quotes, and credit notes.memo and footer fieldsVariables inserted into the text of the memo and footer 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.
Consider a draft invoice created for a counterpart named Trustwave.
If you add an invoice memo containing the {company_name} (counterpart name) variable:
the returned memo value will contain the hard-coded counterpart name:
But if you then change the counterpart_id for this invoice, the memo will still contain the old counterpart name.
To avoid issues, you can use these approaches:
memo and footer as the last update before issuing the document.PATCH /receivables/{receivable_id} to update draft documents, provide the memo and footer values containing {variables} to ensure the resulting formatted strings remain up-to-date.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.
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.
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.
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.
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:
These variables are available for all document types, unless noted otherwise:
In addition to the common variables, payables can use the following variables:
In addition to the common variables, purchase orders can use the following variables:
In addition to the common variables, outgoing invoices can use these variables:
In addition to the common variables, quotes can use the following variables:
In addition to the common variables, credit notes can use these variables:
Variables for invoice reminders are available in the response from the GET /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 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.
In addition to the common variables, overdue reminders can include the following variables in their email subject and body: