Invoice items
The invoice items object contains information about items on an invoice.
When printed, an items list will consist of a group, the items inside the group, and then a subtotal row.

To build this in Liquid, you'd use a similar structure:
{% for item in invoice.items %}
{% if item.is_group? %}
{{ item.name }} <!-- Group name -->
{% elsif item.is_item? %}
{{ item.name }} <!-- Item name -->
{% elsif item.is_subtotal? %}
{{ item.subtotal_name }} <!-- Subtotal name, i.e. group name -->
{% endif %}
{% endfor %}There's no subtotal row in the web interface. Subtotal items are included in the invoice items object to make it easy to include and style a subtotal row. A subtotal item iterates after a group and its items have iterated. They're purely informational rows, so most of the objects below will return "Liquid error" when used with a subtotal item.

Invoice items may depend slightly differently depending on how an invoice was generated. An invoice can be created manually, from an opportunity, or from a project.
When created from an opportunity or project, you can choose to itemize, or create summed lines for opportunity groups, product groups, or opportunities. Keep this in mind when building custom documents: some objects might make sense when itemized, but not when grouped by opportunity.
Invoice item objects are always accessed within a forloop that iterates for each item.
Document layouts
The item object can be accessed in document layouts created against the following modules:
Invoice
Opportunity
Returns invoice items for invoices linked to a particular opportunity.
Member
Returns invoice items for invoices linked to a particular organization.
Returns invoice items for active invoices linked to a particular organization.
Discussion templates
The item object can be accessed in discussion templates created against the following modules:
Invoice
Opportunity
Returns invoice items for invoices linked to a particular opportunity
Organization
Returns invoice taxes for invoices linked to a particular organization.
Returns invoice items for active invoices linked to a particular organization.
accessory_is_default?
accessory_is_default?Returns true if an invoice item is an accessory and the accessory’s inclusion type is “Default”.
Input
Output
accessory_is_mandatory?
accessory_is_mandatory?Returns true if an invoice item is an accessory and the accessory’s inclusion type is “Mandatory”.
Input
Output
accessory_is_optional?
accessory_is_optional?Returns true if an invoice item is an accessory and the accessory’s inclusion type is “Optional”.
Input
Output
accessory_mode_is_accessory?
accessory_mode_is_accessory?Returns true if an invoice item is an accessory and the accessory’s mode is “Accessory”.
Input
Output
accessory_mode_is_component?
accessory_mode_is_component?Returns true if an invoice item is an accessory and the accessory’s mode is “Component”.
Input
Output
accessory_mode_is_safety?
accessory_mode_is_safety?Returns true if an invoice item is an accessory and the accessory’s mode is “Safety”.
Input
Output
accessory_mode_name
accessory_mode_nameReturns the accessory’s mode name where an invoice item is an accessory; blank otherwise.
accessory
component
safety item
Input
Output
charge_ends_at
charge_ends_atReturns the charging end date for an invoice item. Generally used for invoice items with transaction types of rental or service.
Input
Output
charge_excluding_tax_total
charge_excluding_tax_totalReturns an invoice item charge total excluding tax.
Input
Output
charge_including_tax_total
charge_including_tax_totalReturns an invoice item charge total including tax.
Input
Output
charge_starts_at
charge_starts_atReturns the charging start date for an invoice item. Generally used for invoice items with transaction types of rental or service.
Input
Output
charge_total
charge_totalReturns an invoice item charge total.
This may be including or excluding tax depending on the value of the “Catalog Prices” setting in System Preferences.
Input
Output
chargeable_days
chargeable_daysReturns the number of chargeable days for an invoice item.
For service items, the value of the “Rate Quantity” field is returned. The rate type may be hour or distance.
For sale items, returns 0.0.
Input
Output
charging_periods
charging_periodsReturns charging period objects for an invoice item.
Input
Output
Charging periodchildren
childrenReturns invoice item objects for an invoice item.
When an item is an item, this will return accessories .
When the item is a group, this will return items within that group.
The children object only returns objects that are the next level deep in the tree. For example, accessories on accessories aren't returned.
Input
Output
depth
depthReturns the depth of an item in the tree. An item’s depth is determined by how it is nested under items.

Input
Output
depth_padding
depth_paddingReturns the depth padding for an invoice item. Generally used to apply an inline style to a table cell in HTML so that items appear nested.
Increments in multiples of 16.
Input
Output
description
descriptionReturns an invoice item’s description.
Input
Output
discount_amount
discount_amountReturns the amount of discount applied to an invoice item.
Returns 0.0 for groups and subtotals.
Input
Output
discount_percent
discount_percentReturns the percentage discount applied to an invoice item.
Returns 0.0 for groups and subtotals.
Input
Output
discounted_price
discounted_priceReturns an invoice item’s price after discount.
Input
Output
has_child_items?
has_child_items?Returns true if an invoice item has children items; false otherwise. Generally used for detecting if an invoice item has accessories.
Input
Output
has_discount?
has_discount?Returns true if an invoice item has a discount applied; false otherwise.
Where an invoice item has a negative discount applied, has_discount will return false. For example, -50% would increment the charge total by 50% so has_discount will return false.
Input
Output
id
idReturns an invoice item ID.
Input
Output
invoiceable_item_description
invoiceable_item_descriptionReturns the description of the record that this invoice item is linked to.
When invoicing by item, this will return the description set against the product or service records.
When invoicing by product group, this will return the product group description set in System Setup > Product Groups.
When invoicing by opportunity, this will return the (internal) description set against the opportunity.
Returns blank for part invoice line items.
Input
Output
invoiceable_name
invoiceable_nameInput
Returns the name of the record that this invoice item is linked to.
When invoicing by item, this will return the name of the product or service.
When invoicing by product group, this will return the product group name set in System Setup > Product Groups.
When invoicing by opportunity, this will return the name set against the opportunity.
The invoiceable_name should generally be the same as the item name; it may be different if you’ve changed the name of a record after it’s been added to an invoice.
For part invoice line items, returns the value of the “Final Invoice Credit Text” in System Preferences. This is used when your final invoice is created at a later point.
Output
invoiceable_object
invoiceable_objectReturns opportunity item, product, service, or opportunity objects for an invoice item.
The type of object depends on an invoice item’s invoiceable type.
Input
Invoiceable type
Object
Opportunity
opportunity
Opportunity Item
opportunity item
Item
product or service
Items with the invoiceable type Item may be part invoice line items; be sure to cater for this in your code.
Input
Output
invoiceable_type
invoiceable_typeReturns the type of an invoice item. Generally describes the circumstances why an invoice item was created.
Invoiceable type
Description
Opportunity
An item created from an invoice grouped by opportunity.
Opportunity Item
An item created from an invoice grouped by opportunity item.
Product Group
An item created from an invoice grouped by product group.
Surcharge
An item created for an opportunity item surcharge total.
OpportunityDeal
An item created for an opportunity or opportunity group deal price.
Item
An item created by adding it directly to an invoice, or any other item.
Input
Output
is_accessory?
is_accessory?Returns true if an invoice item is an accessory; false otherwise.
Input
Output
is_deal_item?
is_deal_item?Returns true if an invoice item is a deal item, i.e. it is an item created with a charge total for a deal; false otherwise.
Deal items have a red ”Deal Price” label in the list.
Input
Output
Deal pricingis_group?
is_group?Returns true if an invoice item is a group; false otherwise.
Input
Output
is_in_deal?
is_in_deal?Returns true if an invoice item is inside a deal, i.e. if it is an informational line included underneath a deal price line on an invoice; false otherwise.
An item that is_in_deal? will always be nested under an item that is_deal_item?.
Input
Output
Deal pricingis_item?
is_item?Returns true if an invoice item is an item; false otherwise.
Input
Output
is_principal?
is_principal?Returns true if an invoice item has accessory items nested underneath it; false otherwise.
Input
Output
is_product?
is_product?Returns true if an invoice item is linked to a product record; false otherwise.
Input
Output
is_rental?
is_rental?Returns true if an invoice item is a rental charge, i.e. its transaction type is "Rental"; false otherwise.
Input
Output
is_sale?
is_sale?Returns true if an invoice item is for a sale charge, i.e. its transaction type is "Sale"; false otherwise.
Input
Output
is_service?
is_service?Returns true if an invoice item is for a service charge, i.e. its transaction type is "Service"; false otherwise.
This doesn't determine necessarily whether an invoice item is linked to a service record; a text item may have the transaction type "Service".
Input
Output
is_service_item?
is_service_item?Returns true if an invoice item is linked to a service record; false otherwise.
Input
Output
is_subtotal?
is_subtotal?Returns true if an invoice item is a group item's subtotal; false otherwise.
Subtotal rows are informational only and many invoice item objects will print "Liquid error: internal" rather than return blank or false.
Input
Output
is_text_item?
is_text_item?Returns true if an invoice item is a text item; false otherwise.
Input
Output
name
nameReturns an invoice item's name.
Input
Output
order
orderReturns opportunity objects for the opportunity that an invoice item is related to.
Input
Output
Opportunityprice
priceReturns an invoice item's price without discount.
Input
Output
price_unit
price_unitReturns an invoice item's price unit name.
The price unit name output depends on the rental charge used. Some common examples:
Daily
Weekly
Per period
Each
Input
Output
project_name
project_nameReturns the name of the project that an invoice item is related to. Generally the name of the project linked to the opportunity that was the origin of an invoice item.
Input
Output
quantity
quantityReturns the quantity of an invoice item.
Input
Output
rate_definition_name
rate_definition_nameReturns the rate definition name for an invoice item where the item is a rental.
Returns blank for sales, services, surcharges, and group items.
Input
Output
service_unit_name
service_unit_nameReturns the service unit name for an invoice item.
Day
Days
Hour
Hours
miles
km
Input
Output
source_name
source_nameReturns the name of the source of an invoice item. Generally the name of the opportunity that was the origin of an invoice item.
Input
Output
subtotal
subtotalReturns the subtotal amount for an invoice item group.
Subtotal rows are informational only. This will only return a value for subtotal rows. This will match the charge_total of the corresponding invoice item group.
Input
Output
subtotal_name
subtotal_nameReturns the subtotal name for an invoice item group.
Subtotal rows are informational only. This will only return a value for subtotal rows. This will match the name of the corresponding invoice item group.
Input
Output
tax_class_name
tax_class_nameReturns the tax class name against an invoice item. This is set against the product or service record, or when creating a text item.
Input
Output
tax_total
tax_totalReturns the tax total for an invoice item.
Input
Output
transaction_type_name
transaction_type_nameReturns the transaction type name for an invoice item.
Rental
Sale
Service
Input
Output
unit_charge
unit_chargeReturns the unit charge for an invoice item.
The unit charge is the price for one unit of an invoice item.
Input
Output
unit_charge_amount
unit_charge_amountReturns the unit charge for an invoice item excluding discount.
The unit charge is the price for one unit of an invoice item.
Input
Output
use_chargeable_days
use_chargeable_daysReturns true if an invoice item has overriden chargeable days.
This will be the case where the source opportunity of an invoice has the "Chargeable Days" toggle set to YES.
Input
Output
Last updated
Was this helpful?