Variables for templates and messages

Variables are key pieces that enable you to make your Quaderno templates and messages work for your business needs. They represent pieces of data that you can use in your templates and messages (without having to hardcode them in).

We provide variables for every type of document you need. Here we've broken them down by object.

Account variables

Information about your account:

Code Description
{{ account.full_name}} Business's legal name
{{account.trade_name}} Trade name
{{ account.tax_id }} Tax ID / VAT number / ABN (country specific)
{{ account.formatted_address }} Formatted address
{{ account.street_line_1 }} First line of the street address
{{ account.street_line_2 }} Second line of the street address
{{ account.postal_code }} Postal code
{{ account.city }} City
{{ account.region }} Region
{{ account.country }} Country
{{ account.phone_1 }} Phone 1
{{ account.phone_2 }} Phone 2
{{ account.email }} E-mail address
{{ account.web }} Web address

{{ account.logo_url }}

Logo URL

Contact variables

Information about your contacts:

Code Description
{{ contact.first_name }} First name
{{ contact.last_name }} Last name
{{ contact.full_name }} Full name
{{ contact.tax_id }} Tax ID / VAT number
{{ contact.contact_name }} Name of contact person (only for companies)
{{ contact.formatted_address }} Formatted address
{{ contact.street_line_1 }} First line of street address
{{ contact.street_line_2 }} Second line of street address
{{ contact.postal_code }} Postal code
{{ contact.city }} City
{{ contact.region }} Region
{{ contact.country }} Country ISO code
{{ contact.phone_1 }} Phone 1
{{ contact.phone_2 }} Phone 2
{{ contact.email }} Email
{{ contact.web }} Web address
{{ contact.currency }} Contact's currency
{{ contact.language }} Contact's language
{{ contact.eu_member? }} Resident in the EU

Document

Information about your documents (receipts, invoices, credit notes, and estimates):

Code Description
{{ document.type }} Document type (receipt, invoice, credit note or estimate). 
{{ document.number }} Number of the document
{{ document.issue_date }} Issue date
{{ document.contact }} Contact's name
{{ document.tax_id }} Contact's tax ID
{{ document.subject }} Subject
{{ document.po_number }} PO number
{{ document.subtotal }} Subtotal
{{ document.currency }} Document currency
{{ document.discount }} Discount
{{ document.gross_amount }} Gross Amount ( subtotal - discount )
{{ document.total }} Total ( gross amount + tax )
{{ document.exchange_rate }}
Exchange rate
{{ document.exchange }}   Exchange amount
{{ document.payment_details }} Payment method details
{{ document.amount_paid }} Amount paid
{{ document.amount_due }} Pending amount
    
{{ document.due_date }} Due date
{{ document.valid_until }} Valid until
{{ document.notes }} Notes
{{ document.legal }}  Legal notes
{{ document.tag_list }} List of document tags
{{ document.state }} Document state
{{ document.processor_id }} Transaction ID
{{ document.secure_id }} Secure ID

Documents also have the following collections:

Code Description
{{ document.items }} Items
{{ document.taxes }} Taxes
{{ document.payments }} Payments
{{ document.tag_list }} Tags

Collections consist of several objects which you can traverse with, for example, a for loop, as in the following example:

{% for item in document.items %}
  Your logic here.
{% end %}

Item variables

Information about an item within the document:

Code Description
{{ item.product_code }} Product code
{{ item.description }} Description
{{ item.unit_price }} Unit price
{{ item.quantity }} Quantity
{{ item.subtotal }} Subtotal ( unit price * quantity )
{{ item.discount_rate }} Discount rate
{{ item.tax_1_rate }} Tax 1 rate ( e.g. 20% VAT )
{{ item.tax_1_amount }} Tax 1 amount
{{ item.tax_2_rate }} Tax 2 rate ( e.g. 5% PST )
{{ item.tax_2_amount }} Tax 2 amount
{{ item.gross_amount }} Gross Amount ( subtotal - discount )
{{ item.total_amount }} Total Amount ( gross amount + tax )

Tax variables

Information about the taxes associated with the document.

Code Description
{{ tax.label }} Label
{{ tax.rate }} Tax rate
{{ tax.country }} Tax country
{{ tax.taxable.base }} Taxable base
{{ tax.amount }} Amount
{{ tax.local_taxable_base }} Taxable base in contact's currency
{{ tax.local_amount }} Tax amount in contact's currency
{{ tax.currency }} Contact's currency

Payment variables

Information about the document payment.

Code Description
{{ payment.date }} Payment date
{{ payment.amount }} Payment amount
{{ payment.payment_method_text }} Payment method

Tips

  • Be sure to wrap potentially missing variables (read: most of them) in {% if %} blocks in case they aren't there for the document or contact in question.
  • Don't assume a certain number of items in a document - it's better to use the looping abilities to make your template expand to more (starting from one or even zero - see first tip!).
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us