Quaderno Templates: Variables

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}} Full name
{{ account.tax_id }} Tax ID
{{ 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/Zip code
{{ account.city }} City
{{ account.region }} Region
{{ account.country }} Country ISO code
{{ account.phone_1 }} Phone 1
{{ account.phone_2 }} Phone 2
{{ account.fax }} Fax
{{ 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.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.subject }} Subject
{{ document.po_number }} PO number
{{ document.subtotal }} Subtotal Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ 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.taxes }} Taxes
{{ document.total }} Total Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ document.exchange }} Exchange Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ document.payment_details }} Payment details
{{ 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.state }} State
{{ 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
{{ document_item.description }} Description
{{ document_item.unit_price }} Unit price Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ document_item.quantity }} Quantity
{{ document_item.discount_rate }} Discount rate
{{ document_item.tax_1_rate }} Tax 1 rate
{{ document_item.tax_2_rate }} Tax 2 rate
{{ document_item.subtotal }} Subtotal Quantity * UnitPrice. Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ document_item.gross_amount }} Gross Amount Subtotal - Discount. Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ document_item.total_amount }} Total Amount Subtotal - Discount + TaxAmount. Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)

Document tax

Information about a tax within the document.

Code Description Notes
{{ document_tax.label }} Label
{{ document_tax.taxable_base }} Taxable base Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
{{ document_tax.rate }} Rate Output format: [quantity]% (e.g. 21%)
{{ document_tax.amount }} Amount Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)

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

Bonus: GoCardless variables

We also have some mappings between GoCardless fields and our template codes to make your life easier.

Customers

GoCardless Field Template Code
given_name {{ contact.first_name }}
family_name {{ contact.last_name }}
company_name {{ contact.full_name }}
address_line1 {{ contact.street_line_1 }}
address_line2 {{ contact.street_line_2 }}
city {{ contact.city }}
postal_code {{ contact.postal_code }}
region {{ contact.region }}
country_code {{ contact.country }}
email {{ contact.email }}

Payments

GoCardless Field Template Code
charge_date {{ document.issue_date }}
amount {{ document_item.total_amount }}
description {{ document_item.description }}

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!).

Still need help? Contact Us Contact Us