Variables for templates and messages

Variables are key pieces that enable you to make your Quaderno Templates work for your business needs. They represent pieces of data that you can use in your templates (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

Information about your account.

Code Description
{{ account.full_name}} Business's legal name
{{account.trade_name}} Trade name
{{ account.tax_id }} Tax ID (country specific)
{{ account.vat_number }} VAT number (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

Document

Information about the document - invoice, receipt, expense, etc.

Code Description Notes
{{ document.type }} Document type Invoice, credit note, receipt
{{ document.number }} Number e.g. Invoice number
{{ document.issue_date }} Issue date For dates you can use filters like date: "%d/%m/%Y". Read more here.
{{ document.contact }} Contact's name
{{ document.tax_id }} Contact's tax ID
{{ document.vat_number }} Contact's VAT number
{{ document.subject }} Subject
{{ document.po_number }} PO number
{{ document.subtotal }} Subtotal Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ document.currency }} Document currency
{{ document.discount }} Discount Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ document.gross_amount }} Gross Amount Subtotal - Discount. Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ document.total }} Total Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ document.exchange_rate }}
Exchange rate Exchange rate to accounting currency
{{ document.exchange }}   Exchange Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ document.payment_details }} Payment method details
{{ document.amount_paid }} Amount paid
{{ document.amount_due }} Pending amount
    
{{ document.due_date }} Due date For dates you can use filters like  date: "%d/%m/%Y". Read more here.
{{ document.valid_until }} Valid until Only for estimates. For dates you can use filters like  date: "%d/%m/%Y". Read more here.
{{ document.notes }} Notes
{{ document.tag_list }} List of document tags
{{ document.state }} Document state
{{ document.processor_id }} Transaction ID From payment processor
{{ document.secure_id }} Secure ID Identify your document without compromising its real ID.

The document model also has collections. 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 %}<br>

Document collections are:

Code Description Notes
{{ document.items }} Items Refer to Document Item reference below.
{{ document.taxes }} Taxes Refer to Document Tax reference below.
{{ document.payments }} Payments Refer to Payment reference below.
{{ document.tag_list }} Tags A list of tags, each one a string like "acme", "warner", etc

Document item

Information about an item within the document.

Code Description Notes
{{ item.product_code }} Product code
{{ item.description }} Description
{{ item.unit_price }} Unit price Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ item.quantity }} Quantity
{{ item.discount_rate }} Discount rate
{{ item.tax_1_rate }} Tax 1 rate
{{ item.tax_1_amount }} Tax 1 amount
{{ item.tax_2_rate }} Tax 2 rate
{{ item.tax_2_amount }} Tax 2 amount
{{ item.subtotal }} Subtotal Quantity * UnitPrice. Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ item.gross_amount }} Gross Amount Subtotal - Discount. Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ item.total_amount }} Total Amount Subtotal - Discount + TaxAmount. Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)

Document tax

Information about the taxes associated with the document.

Code Description Notes
{{ tax.label }} Label
{{ tax.rate }} Tax rate Output format: [quantity]% (e.g. 21%)
{{ tax.country }} Tax country
{{ tax.taxable.base }} Taxable base Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ tax.amount }} Amount Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ 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

Information about the document payment.

Code Description Notes
{{ payment.date }} Date For dates you can use filters like  date: "%d/%m/%Y". Read more here.
{{ payment.amount }} Amount Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ payment.payment_method_text }} Payment method "credit card", "cash", etc.

Contact

Information about the contact, client or provider.

Code Description Notes
{{ contact.first_name }} First name
{{ contact.last_name }} Last name Only when the contact is a person.
{{ contact.full_name }} Full name
{{ contact.tax_id }} Tax ID
{{ contact.vat_number }} VAT Number
{{ contact.contact_name }} Name of contact person Only when the contact is a company.
{{ 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

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