Skip to content

Variables

Carlos Hernández Medina edited this page Dec 6, 2017 · 19 revisions

Template variables are pieces of data we can use in your templates.

Account

Information about your account.

Field Code Notes
Full name {{ account.full_name }}
Tax ID {{ account.tax_id }}
VAT Number {{ account.vat_number }}
Formatted address {{ account.formatted_address }}
First line of the street address {{ account.street_line_1 }}
Second line of the street address {{ account.street_line_2 }}
Postal code {{ account.postal_code }}
City {{ account.city }}
Region {{ account.region }}
Country ISO code {{ account.country }}
Phone 1 {{ account.phone_1 }}
Phone 2 {{ account.phone_2 }}
Fax {{ account.fax }}
E-mail address {{ account.email }}
Web address {{ account.web }}
Logo URL {{ account.logo_url }}

Document

Information about the document.

Field Code Notes
Number {{ document.number }}
Issue date {{ document.issue_date }} For dates, you can use filters like "date: "%d/%m/%Y". Read more here.
Subject {{ document.subject }}
PO number {{ document.po_number }}
Subtotal {{ document.subtotal }} Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
Discount {{ document.discount }} Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
Gross Amount {{ document.gross_amount }} Subtotal - Discount. Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
Taxes {{ document.taxes }}
Total {{ document.total }} Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
Exchange {{ document.exchange }} Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
Payment details {{ document.payment_details }}
Due date {{ document.due_date }} For dates, you can use filters like "date: "%d/%m/%Y". Read more here.
Valid until {{ document.valid_until }} Only for estimates. For dates, you can use filters like "date: "%d/%m/%Y". Read more here.
Notes {{ document.notes }}
State {{ document.state }}
Secure ID {{ document.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: ```html {% for item in document.items %} Your logic here. {% end %} ``` Document collections are:
Field Code Notes
Items {{ document.items}} Refer to Document Item reference.
Taxes {{ document.taxes }} Refer to Document Tax reference.
Payments {{ document.payments }} Refer to Payment reference.
Tags {{ document.tag_list }} Each element is a tag.

Document item

Information about a item within the document

Field Code Notes
Description {{ document_item.description }}
Unit price {{ document_item.unit_price }} Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
Quantity {{ document_item.quantity }}
Discount rate {{ document_item.discount_rate }}
Tax 1 rate {{ document_item.tax_1_rate }}
Tax 2 rate {{ document_item.tax_2_rate }}
Subtotal {{ document_item.subtotal }} Quantity * UnitPrice. Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
Gross Amount {{ document_item.gross_amount }} Subtotal - Discount. Output format: [amount] [currency ISO-code] (e.g. 235.00 USD)
Total Amount {{ document_item.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

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

Payment

Information about the document payment

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

Contact

Information about the contact, client or provider.

Field Code Notes
First name {{ contact.first_name }}
Last name {{ contact.last_name }} Only when the contact is a person.
Full name {{ contact.full_name }}
Tax ID {{ contact.tax_id }}
VAT Number {{ contact.vat_number }}
Name of the contact person {{ contact.contact_name }} Only when the contact is a company.
Formatted address {{ contact.formatted_address }}
First line of the street address {{ contact.street_line_1 }}
Second line of the street address {{ contact.street_line_2 }}
Postal code {{ contact.postal_code }}
City {{ contact.city }}
Region {{ contact.region }}
Country ISO code {{ contact.country }}
Phone 1 {{ contact.phone_1 }}
Phone 2 {{ contact.phone_2 }}
E-mail address {{ contact.email }}
Web address {{ contact.web }}
EU member {{ contact.eu_member? }} Return true if the contact is based in the EU