Skip to content

Template objects

These are the SparkLayer objects you can use in templates and invoice content zones. Which objects are available depends on the template: check the template's documentation to see what it receives.

Nested properties are shown with dot notation (for example dates.created_at), and [] marks an array item.

Address

Properties

KeyTypeDescriptionExample(s)
namestringThe addressee's name-
companystringThe company name-
address_line1stringLine 1 of the address-
address_line2string,nullLine 2 of the address-
citystringThe city-
region_codestring,nullThe region code, such as a state or county code-
postal_codestring,nullThe postal code or postcode-
country_codestringThe country code. Use the country filter to show the country name-
phonestring,nullThe phone number-

Customer

Properties

KeyTypeDescriptionExample(s)
idstringThe customer's SparkLayer ID-
titlestringThe customer's title-
first_namestringThe customer's first name-
last_namestringThe customer's last name-
emailstringThe customer's email address-
company_namestring,nullThe customer's company name-
external_idstring--
accounting_idstring--

ContentZone

Content zones are configured as part of the invoicing feature. They can contain Liquid variables, so handle them accordingly in your templates.

Properties

KeyTypeDescriptionExample(s)
titlestring,nullThe content zone's title-
contentstring,nullThe content zone's content, which can contain Liquid variables-

InvoiceSettings

Properties

KeyTypeDescriptionExample(s)
content_zones.zone_1ContentZoneInvoice content zone 1-
content_zones.zone_2ContentZoneInvoice content zone 2-
content_zones.zone_3ContentZoneInvoice content zone 3-

LineItem

Properties

KeyTypeDescriptionExample(s)
custom_attributes.[].keystringA custom attribute's key-
custom_attributes.[].valuestringA custom attribute's value-
identifiers.skustring,nullThe product's SKU-
name_childstring,null--
name_parentstring--
quantityintegerThe quantity ordered-
line_totalLineTotal or nullThe totals for the whole line-
unit_totalUnitTotal or nullThe totals for one unit-
image_urlstring,nullThe URL of the product's image-
product_slugstring,null--
rrpMoney or nullThe recommended retail price (RRP)-
barcodestring,nullThe product's barcode-

LineTotal

Properties

KeyTypeDescriptionExample(s)
total_netMoneyThe line total, excluding tax-
discount_netMoneyThe discount on the line, excluding tax-
tax_ratenumberThe tax rate applied to the line-

Merchant

The merchant's store details.

Properties

KeyTypeDescriptionExample(s)
address1string,nullLine 1 of the merchant's store address-
address2string,nullLine 2 of the merchant's store address-
base_currencystring,nullThe base currency used by the storeUSD,GBP
citystring,nullCity of the merchant's store address-
regionstring,nullRegion code of the merchant's store address-
countrystring,nullCountry code of the merchant's store addressGB
emailstring,nullThe merchant's email address-
phonestring,nullThe merchant's store phone number-
postcodestring,nullPostcode of the merchant's store address-
store_namestring,nullThe connected platform's store name-
timezonestring,nullThe store's time zone-
urlstring,nullThe store's URL-
localestring,nullThe default locale of the storeen,fr

Money

A monetary value.

Properties

KeyTypeDescriptionExample(s)
amountstringThe amount-
currencystringThe currency codeGBP,USD

Package

Properties

KeyTypeDescriptionExample(s)
line_itemsarray of LineItemThe line items in the package-
shipping_addressAddressThe address the package is shipped to-

Purchase

Properties

KeyTypeDescriptionExample(s)
currency_codestringThe purchase's currency code-
billing_addressAddressThe billing address-
customers.sparklayerCustomerThe SparkLayer customer who placed the purchase-
custom_fields.[].namestringA custom field's name-
custom_fields.[].valuestring,nullA custom field's value-
customer_referencestring,nullThe customer's own reference for the purchase-
dates.created_atstringWhen the purchase was created-
dates.updated_atstringWhen the purchase was last updated-
dates.placed_atstring,nullWhen the purchase was placed-
dates.calculated_submitted_atstring,null--
identifiers.visiblestringThe purchase ID shown to customers-
packagesarray of PackageThe purchase's packages, each with its line items and shipping address-
line_itemsarray of LineItemThe purchase's line items-
subtotalMoneyThe subtotal-
taxMoneyThe total tax-
shipping_costMoneyThe shipping cost-
calculated_totalMoneyThe calculated total-
tax_linesarray of TaxLineThe tax lines that make up the total tax-

UnitTotal

Properties

KeyTypeDescriptionExample(s)
total_netMoneyThe unit price, excluding tax-
total_grossMoneyThe unit price, including tax-
total_taxMoneyThe tax on one unit-
tax_ratenumberThe tax rate applied-

TaxLine

Properties

KeyTypeDescriptionExample(s)
titlestringThe tax line's name-
ratenumberThe tax rate-
amount.numberstringThe tax amount-
amount.currencystringThe tax amount's currency code-

PurchaseHistoryMessage

Properties

KeyTypeDescriptionExample(s)
bodystringThe message's text-
created_atstringWhen the message was sent-
customerCustomerThe customer who sent the message-

AssignmentDetails

Properties

KeyTypeDescriptionExample(s)
assigned_byCustomerWho assigned the quote-
assigned_onstringWhen the quote was assigned-

If a property doesn't behave as described here, contact our support team.

Next steps

  • Templates: the templates you can customise and the filters they can use.
  • Invoices: the invoice PDF and its settings.
Was this page helpful?

Last updated