Document properties

The document group of properties contain information related to the document contents.

Document Information

The group of properties related to the document type, name, and the document footer.

document.heading

The values of document.name and document.number combined.

Code
{{ document.heading }}
Output
Invoice 1026

document.name

The name of the document, such as invoice or credit note.

Code
{{ document.name }}
Output
Invoice

document.notes

A text displayed in the document footer.

You can edit the text on the SettingsInvoice Settings page in your Sufio account.

Code
{{ document.notes }}
Output
You have not made a mistake.

document.number

The document number in your Sufio account.

Code
{{ document.number }}
Output
1026

The link where the customer can view the document.

Code
{{ document.public_link }}
Output
View this document online at https://acme.sufio.com/cx67326a72?89473e847.

Use the text attribute to render the value as a clickable link formatted in HTML.

Code
{{ document.public_link.text }}
Output
View this document online at <a href="https://acme.sufio.com/cx67326a72?89473e847" target="_blank">https://acme.sufio.com/cx67326a72?89473e847</a>.

document.public_url

The URL address where the customer can view the document.

Code
{{ document.public_url }}
Output
https://acme.sufio.com/cx67326a72?89473e847

Use the text attribute to render the value as a clickable link formatted in HTML.

Code
{{ document.public_url.text }}
Output
<a href=”https://acme.sufio.com/cx67326a72?89473e847” target=”_blank”>https://acme.sufio.com/cx67326a72?89473e847</a>

document.subheading

Subheading for documents created from other documents, for example, a credit note created for an invoice.

Code
{{ document.subheading }}
Output
for Invoice 1026

A text with a link to the Sufio website.

Code
{{ document.sufio_link }}
Output
Created in Sufio

Use the text attribute to render the value as a clickable hyperlink to the Sufio website formatted in HTML.

Code
{{ document.sufio_link.text }}
Output
Created in <a href="https://sufio.com/" target="_blank">Sufio</a>

document.sufio_url

The link to the Sufio website.

Code
{{ document.sufio_url }}
Output
https://sufio.com/

Use the text attribute to render the URL as a clickable link in HTML.

Code
{{ document.sufio_url.text }}
Output
<a href="https://sufio.com/">https://sufio.com/</a>

document.thanks

The “Thank you” note of the document, displayed in the document footer.

You can edit the text on the DesignFooter page in your Sufio account.

Code
{{ document.thanks }}
Output
Thank you for choosing ACME.

Document Type

This group of properties determines the type of the document.

document.is_credit_note

If True, the document is a credit note.

Code
{{ document.is_credit_note }}
Output
False

document.is_invoice

If True, the document is an invoice.

Code
{{ document.is_invoice }}
Output
True

document.is_pro_forma_invoice

If True, the document is a pro forma invoice.

Code
{{ document.is_pro_forma_invoice }}
Output
False

document.is_quote

If True, the document is a quote.

Code
{{ document.is_quote }}
Output
False

document.type

The type of the document. The possible values are:

  • invoice
  • pro-forma-invoice
  • credit-note
  • quote
Code
{{ document.type }}
Output
credit-note

Document Statuses

The document.statuses group of properties contains various checks you can use as conditions in your document templates.

document.has_discount

If True, the document has a discount.

Code
{{ document.has_discount }}
Output
True

document.has_line_shipping

If True, the document has at least one shipping line.

Code
{{ document.has_line_shipping }}
Output
False

document.has_shipping

If True, the document has a shipping.

Code
{{ document.has_shipping }}
Output
False

document.has_tax

If True, the document has a tax.

Code
{{ document.has_tax }}
Output
True

document.has_taxes_included

If True, the unit prices on a document already include taxes.

For documents created from orders, this value reflects the tax settings in the online store at the time the order was created.

Code
{{ document.has_taxes_included }}
Output
True

document.is_cancelled

If True, the document is cancelled.

Code
{{ document.is_cancelled }}
Output
False

document.is_due

If True, the document is past its due date.

Code
{{ document.is_due }}
Output
True

document.is_sent

If True, the document is sent.

Code
{{ document.is_sent }}
Output
False

document.is_paid

If True, the document is paid.

Code
{{ document.is_paid }}
Output
True

Document Currency and Language

The group of properties that describe the document currency and language settings.

document.currency.code

The three-letter code (ISO 4217-alpha-3 format) of the document currency.

Code
{{ document.currency.code }}
Output
EUR

document.currency.decimals

The number of decimals of the document currency.

Code
{{ document.currency.decimals }}
Output
2

document.currency.name

The name of the document currency, rendered in the document language.

Code
{{ document.currency.name }}
Output
Euro

document.currency.symbol

The symbol of the document currency.

Code
{{ document.currency.symbol }}
Output

document.language.code

Two-letter code (ISO 639‑1 format) of the document language, optionally followed by a region modifier.

Code
{{ document.language.code }}
Output
en-us

document.language.is_rtl

If True, the document language uses right-to-left script.

Code
{{ document.language.is_rtl }}
Output
False

document.language.name

The translated name of the document language.

Code
{{ document.language.name }}
Output
Deutsch

Document Dates

The document.dates group of properties contain the document dates.

You can render the dates as date values or as strings formatted in a country-specific date format.

document.dates

The document dates.

Use the following for loop to iterate through all the properties of the group that are supposed to be shown in the document. This depends on the document type, your settings on the Design page, and whether the properties have a value.

{% for date in document.dates %}
    <div id="{{ date.id }}" class="{{ date.css_classes }}">
        {{ date.title }}: {{ date.text }}
    </div>
{% endfor %}

document.dates.delivery_date

The delivery date of the document.

Code
{{ document.dates.delivery_date }}
Output
2024-07-25 00:00:00

Use the text attribute or the format_date filter to format the date according to the language of your document.

Code
{{ document.dates.delivery_date.text }}
Output
July 25, 2024

document.dates.due_date

The due date of the document.

Code
{{ document.dates.due_date }}
Output
2024-08-09 00:00:00

Use the text attribute or the format_date filter to format the date according to the language of your document.

Code
{{ document.dates.due_date.text }}
Output
Aug. 9, 2024

document.dates.important_date

Important date is the date you may want to emphasize on the document. This property is used by some of our document templates.

If the document has a due date, the value is equal to document.dates.due_date. Otherwise, the value is document.dates.issue_date.

Code
{{ document.dates.important_date }}
Output
2024-08-09 00:00:00

Use the text attribute or the format_date filter to format the date according to the language of your document.

Code
{{ document.dates.important_date.text }}
Output
Aug. 9, 2024

document.dates.issue_date

The issue date of the document.

Code
{{ document.dates.issue_date }}
Output
2024-07-25 00:00:00

Use the text attribute or the format_date filter to format the date according to the language of your document.

Code
{{ document.dates.issue_date.text }}
Output
July 25, 2024

Document Payments

The document.payments group includes properties that contain the payment information for the order.

Use the following for loop to iterate through all the properties of the group that are supposed to be shown in the document. This depends on the document type, your settings on the Design page, and whether the properties have a value.

{% for payment in document.payments %}
    <div id="{{ payment.id }}" class="{{ payment.css_classes }}">
        {{ payment.title }}: {{ payment.text }}
    </div>
{% endfor %}

document.payments.bank_account

The bank account number for the payment of the document.

Code
{{ document.payments.bank_account }}
Output
GB33 BUKB 2020 1555 5555 55

document.payments.constant_symbol

The constant symbol number for the payment of the document.

Code
{{ document.payments.constant_symbol }}
Output
0308

document.payments.order_number

The number of the related order.

Code
{{ document.payments.order_number }}
Output
#1026

document.payments.payment_method

The payment method selected for the document.

Code
{{ document.payments.payment_method }}
Output
Bank Transfer

document.payments.po_number

The number of the related purchase order.

Code
{{ document.payments.po_number }}
Output
8507093340

document.payments.variable_symbol

The variable symbol number for the payment of the document.

Code
{{ document.payments.variable_symbol }}
Output
20241026

Document Lines

The document.lines array contains all item lines of the document.

document.lines

Use the {% for line in document.lines %} loop to iterate through the item lines of the document.

Use a second {% for item in line %} loop to iterate through values of each line, such as item name, unit price or quantity, that are supposed to be shown in the document. This depends on the document type and your settings on the Design page.

{% for line in document.lines %}
    <tr id="{{ line.id }}" class="{{ line.css_classes }}">
        {% for item in line %}
            <td id="{{ item.id }}" class="{{ item.css_classes }}">{{ item.text }}</td>
        {% endfor %}
    </tr>
{% endfor %}

document.lines_titles

The document.lines_titles array contains titles of values for the document item lines, such as Unit Price or Quantity.

These titles are typically displayed in the header row of the item table.

Use the {% for title in document.lines_titles %} loop to iterate through titles that are supposed to be shown in the document. This depends on the document type and your settings on the Design page.

{% for title in document.lines_titles %}
    <th id="{{ title.id }}" class="{{ title.css_classes }}">{{ title.text }}</th>
{% endfor %}

document.lines[#].description

The description of the line item.

By default, this is/contains the product’s variant name and SKU code.

Code
{{ document.lines[0].description }}
Output
250g bag - SKU: UGCOLR1

document.lines[#].discount

The discount applied to the line item, either as an amount or as a percentage.

You can use exact amounts (e.g. 2.50) or percentages (e.g. 10%) when entering the discount.

Code
{{ document.lines[0].discount }}
Output
10

Use the text attribute to render the value formatted in a country-specific currency format.

If the discount was applied as a percentage, the formatted value contains the % symbol.

Code
{{ document.lines[0].discount.text }}
Output
10%

document.lines[#].discount_amount

The total value of discounts applied to the line item.

If the discount was specified as a percentage, this is the calucalted discount amount.

Code
{{ document.lines[0].discount_amount }}
Output
1.11

Use the text attribute to render the value formatted in a country-specific currency format.

Code
{{ document.lines[0].discount_amount.text }}
Output
£1.11

document.lines[#].is_shipping

If True, the line contains shipping information.

Code
{{ document.lines[0].is_shipping }}
Output
True

document.lines[#].item

The name of the line item.

In most cases, this is the product name.

Code
{{ document.lines[0].item }}
Output
Uganda Coffee 250g

document.lines[#].quantity

The quantity of the line item.

Code
{{ document.lines[0].quantity }}
Output
3

document.lines[#].tax_#

The tax rate, as a percentage, applied to the line item. One line item can have more than one tax.

The property numbers are sequential and start at 0.

Code
{{ document.lines[0].tax_0 }}
Output
20

document.lines[#].tax_amount_discounted

The total value of discounts applied to the taxes of the line item.

Code
{{ document.lines[0].tax_amount_discounted }}
Output
4.17

Use the text attribute to render the value formatted in a country-specific currency format.

Code
{{ document.lines[0].tax_amount_discounted.text }}
Output
£4.17

document.lines[#].total

The total price of the purchased units of the line item.

Code
{{ document.lines[0].total }}
Output
30.02

Use the text attribute to render the value formatted in a country-specific currency format.

Code
{{ document.lines[0].total.text }}
Output
£30.02

document.lines[#].unit_price

Price for one unit of the line item.

Code
{{ document.lines[0].unit_price }}
Output
10

Use the text attribute to render the value formatted in a country-specific currency format.

Code
{{ document.lines[0].unit_price.text }}
Output
£10.00

Document Taxes

The document.taxes group includes properties that contain the taxes in the document.

Each property represents the total tax amount per each tax rate used in the document.

You can render the property values as plain text strings or as formatted in the document currency.

document.taxes

Use the following for loop to iterate through all the taxes in the document.

{% for tax in document.taxes %}
    <div id="{{ tax.id }}" class="{{ tax.css_classes }}">
        {{ tax.title }}: {{ tax.text }}
    </div>
{% endfor %}

Use the sum filter to return the total amount of taxes of the document.

{{ document.taxes | sum }}

Please note that these tax properties are also included in the document.totals group of properties.

document.taxes[#].rate

The rate of the document tax, as a decimal number.

Code
{{ document.taxes[0].rate }}
Output
0.20

Use the text attribute to render the value formatted as a percentage.

Code
{{ document.taxes[0].rate.text }}
Output
20%

Document Totals

The document.totals group includes properties that contain the invoice total amounts.

You can render the property values as plain text strings or as formatted in a country-specific currency format.

document.totals

The invoice total amounts of the document.

Use the following for loop to iterate through all the properties of the group that are supposed to be shown in the document. This depends on the document type, your settings on the Design page, and whether the properties have a value.

If the document has taxes, this iterator also include properties from document.taxes.

{% for total in document.totals %}
    <div id="{{ total.id }}" class="{{ total.css_classes }}">
        {{ total.title }}: {{ total.text }}
    </div>
{% endfor %}

document.totals.amount_due

The total amount due of the document, that is, the total amount of the document minus the amount paid.

Code
{{ document.totals.amount_due }}
Output
41.77

Use the text attribute to render the value formatted in a country-specific currency format.

Code
{{ document.totals.amount_due.text }}
Output
£41.77

Use the title attribute to render the name of the value.

Code
{{ document.totals.amount_due.title }}
Output
Amount Due

document.totals.amount_paid

The total amount paid of the document.

Code
{{ document.totals.amount_paid }}
Output
0.00

Use the text attribute to render the value formatted in a country-specific currency format.

Code
{{ document.totals.amount_paid.text }}
Output
£0.00

Use the title attribute to render the name of the value.

Code
{{ document.totals.amount_paid.title }}
Output
Amount Paid

document.totals.discount

The total amount of discounts of the document, that means, the sum of all the discounts applied.

Code
{{ document.totals.discount }}
Output
-4.50

Use the text attribute to render the value formatted in a country-specific currency format.

Code
{{ document.totals.discount.text }}
Output
-£4.50

Use the title attribute to render the name of the value.

Code
{{ document.totals.discount.title }}
Output
Discounts

document.totals.shipping

The total amount of shipping of the document, that is, the sum of all the shipping plus taxes, minus shipping discounts.

Code
{{ document.totals.shipping }}
Output
5.00

Use the text attribute to render the value formatted in a country-specific currency format.

Code
{{ document.totals.shipping.text }}
Output
£5.00

Use the title attribute to render the name of the value.

Code
{{ document.totals.shipping.title }}
Output
Shipping

document.totals.shipping_discount

The total amount of shipping discounts of the document.

Code
{{ document.totals.shipping_discount }}
Output
-5.00

Use the text attribute to render the value formatted in a country-specific currency format.

Code
{{ document.totals.shipping_discount.text }}
Output
-£5.00

Use the title attribute to render the name of the value.

Code
{{ document.totals.shipping_discount.title }}
Output
Shipping Discounts

document.totals.subtotal

The subtotal amount of the document, that means, the sum of all the line items totals.

Code
{{ document.totals.subtotal }}
Output
46.27

Use the text attribute to render the value formatted in a country-specific currency format.

Code
{{ document.totals.subtotal.text }}
Output
£46.27

Use the title attribute to render the name of the value.

Code
{{ document.totals.subtotal.title }}
Output
Subtotal price

document.totals.total_excl_tax

The total amount of the document, excluding the taxes

Code
{{ document.totals.total_excl_tax }}
Output
34.81

Use the text attribute to render the value formatted in a country-specific currency format.

Code
{{ document.totals.total_excl_tax.text }}
Output
£34.81

Use the title attribute to render the name of the value.

Code
{{ document.totals.total_excl_tax.title }}
Output
Total excl. VAT

document.totals.total_incl_tax

The total amount of the document, including the taxes

Code
{{ document.totals.total_incl_tax }}
Output
41.77

Use the text attribute to render the value formatted in a country-specific currency format.

Code
{{ document.totals.total_incl_tax.text }}
Output
£41.77

Use the title attribute to render the name of the value.

Code
{{ document.totals.total_incl_tax.title }}
Output
Total incl. VAT

Some documents may have related documents. Typically, a credit note and the invoice for which the credit note is issued are related documents. Or, in case an invoice is created from a pro forma invoice, the two documents are related.

You can retrieve properties from the related documents, such as an issue date of the original invoice on a credit note.

Click on the property name in the list below to learn more about the original property.