Loading article…
Loading article…
Last updated on Aug 28, 2026
Advanced Billing builds every email it sends from a template you can edit. Templates use Liquid, a templating language that lets you drop live values into the message, so a receipt can quote the amount actually paid and a renewal reminder can name the product and its price. This article lists every variable available to you, grouped by the object it belongs to. Maxio Core keeps its own message text separately, in Maxio Email Message Library.
Templates use Liquid syntax. Liquid lets you inject variables and apply conditional logic to your templates. Wrap every variable in double braces, such as {{product.name}}.
The following information isn't accessible through Liquid in email templates:
Maxio provides example Liquid snippets for more advanced templates, covering tasks such as capitalizing names and varying content by product type. See the Customize Emails with Liquid Examples help article.
To go back to the wording Advanced Billing ships with, see the Restore Default Email Templates help article.
WARNING: Don't use these legacy variables in new templates.
{{return_url}}{{product.return_url}}{{product.return_params}}These variables sit at the top level of every template, without an object prefix.
| Email field | Description |
|---|---|
{{from_address}} | Replaced with your site's reply address if left as {{from_address}}, though any valid email address works. |
{{name}} | The customer's first name. e.g. Bill |
{{full_name}} | The customer's full name. e.g. Bill Williams |
{{product_price}} | The recurring price of the subscription's current product, formatted in its currency |
{{price_in_cents}} | The same recurring price. Despite the name, this returns formatted currency rather than an integer. |
{{product_name}} | The name of the product. e.g. Basic Plan |
{{product_family}} | The name of the product family. e.g. Wonderful Products |
{{product_family_and_name}} | The product family name in parentheses, followed by the product name. e.g. (Wonderful Product Family) Basic Plan |
{{balance_in_cents}} | The amount, if any, still owed, in cents. e.g. 0 (for $0.00) or 23100 (for $231.00). Useful for conditionally adding a reminder. |
{{balance}} | The amount, if any, still owed, formatted in the subscription's currency. e.g. $231.00 |
{{merchant_name}} | Your business name, falling back to your seller name if no business name is set. e.g. Acme, Inc. |
{{masked_card_number}} | The masked credit card number. e.g. XXXX-XXXX-XXXX-1234. Blank when no payment profile is on file. |
{{update_url}} | The self-service URL for the subscription |
{{payment_profile_exists}} | True/false indicating whether a valid payment method is on file for the subscription |
{{reason_for_decline}} | The gateway's memo from the most recent failed payment, or None when the last payment succeeded or there is none |
{{failure_subject}} | Failed Credit Card Transaction when a payment profile is on file, or No Credit Card On File when one isn't. Intended for use as a subject line. |
{{days_until_card_expiration}} | The number of days until the stored card expires. Blank when no payment profile is on file. |
You can email subscribers direct links to specific Billing Portal tasks. Use the following URLs in any email to send a subscriber straight to the task.
Important: These URLs only work if the Billing Portal is enabled. Replace
[your_subdomain]with your own subdomain.
| Task | URL |
|---|---|
| Cancel my account | https://www.billingportal.com/s/[your_subdomain]/subscriptions/{{subscription.id}}/cancel |
| Configure your plan | https://www.billingportal.com/s/[your_subdomain]/subscriptions/{{subscription.id}}/components |
| Plan change | https://www.billingportal.com/s/[your_subdomain]/subscriptions/{{subscription.id}}/migrations/new |
| Update payment method | https://www.billingportal.com/s/[your_subdomain]/subscriptions/{{subscription.id}}/payment_method/edit |
| View my account | https://www.billingportal.com/s/[your_subdomain]/accounts/{{customer.id}}/edit |
Two Billing Portal variables are also available in portal invitation emails.
| Email field | Description |
|---|---|
{{billing_portal.invite_url}} | The URL inviting this customer into the Billing Portal |
{{billing_portal.seller_name}} | Your seller name, as shown in the invitation |
You can pull metadata (custom fields) into emails with the custom_field filter:
{{ subscription | custom_field: "Color" }}In this example, "Color" is the name of the custom field. The filter works on the customer as well as the subscription, so a field stored on the customer is reached the same way:
{{ customer | custom_field: "Account manager" }}To use a custom field in a conditional:
{% capture gift_wrap %}{{ subscription | custom_field: "Gift wrap?" }}{% endcapture %}
{% if gift_wrap == "" %}...{% endif %}Important: The
capturetag must be on the same line as the variable.
| Email field | Description |
|---|---|
{{customer.id}} | The unique customer id within Advanced Billing |
{{customer.first_name}} | The customer's first name |
{{customer.last_name}} | The customer's last name |
{{customer.email}} | The email address of the customer |
{{customer.organization}} | The customer's organization |
{{customer.reference}} | The unique identifier used within your application for this customer |
{{customer.created_at}} | Timestamp for when the customer was created |
{{customer.address}} | The shipping address for the customer |
{{customer.address_2}} | Additional shipping information for the customer |
{{customer.city}} | The customer's city information |
{{customer.state}} | The customer's state information |
{{customer.zip}} | The zip code of the customer |
{{customer.country}} | The country of the customer |
{{customer.phone}} | The customer's phone number |
{{customer.locale}} | The customer's language settings. Only available on invoice-centric sites. |
{{customer.billing_portal?}} | True/false indicating whether this customer is managed in the Billing Portal |
{{customer.portal_invite_sent?}} | True/false indicating whether the customer was emailed an invitation to manage their subscriptions in the Billing Portal |
Advanced Billing has a separate set of dunning-related variables for use only in dunning emails. See the Configure Credit Card Dunning help article.
Important: Use these fields only in the receipt email. In other templates they return unexpected values.
| Email field | Description |
|---|---|
{{payment.amount}} | The amount just paid, formatted in your currency |
{{payment.amount_in_cents}} | The amount just paid, in cents |
{{payment.card_expiration}} | The expiration date of the card |
{{payment.card_number}} | The customer's credit card, obscured to show only the last 4 digits. e.g. XXXX-XXXX-XXXX-1234 |
{{payment.card_type}} | The type of card used (bogus, visa, master, discover, american_express, diners_club, JCB, switch, solo, dankort, maestro, forbrugsforeningen, laser) |
{{payment.memo}} | The memo associated with the transaction |
{{payment.success}} | True/false indicating whether the payment was successful |
{{payment.test}} | True/false indicating whether the payment was a test |
{{payment.gateway_transaction_id}} | The transaction id from the gateway |
{{payment.component_proration?}} | True/false indicating whether the payment is a component proration charge |
| Email field | Description |
|---|---|
{{payment_profile.id}} | The unique payment profile id within Advanced Billing |
{{payment_profile.first_name}} | The first name on the customer's payment information |
{{payment_profile.last_name}} | The last name on the customer's payment information |
{{payment_profile.masked_card_number}} | The customer's credit card, obscured to show only the last 4 digits. e.g. XXXX-XXXX-XXXX-1234 |
{{payment_profile.card_type}} | The type of card used (bogus, visa, master, discover, american_express, diners_club, JCB, switch, solo, dankort, maestro, forbrugsforeningen, or laser) |
{{payment_profile.brand}} | The type of card used, with its display spelling (Bogus, Visa, Master, and so on) |
{{payment_profile.billing_address}} | The billing address for the payment profile |
{{payment_profile.billing_address_2}} | Additional billing information for the payment profile |
{{payment_profile.billing_city}} | The billing city for the payment information |
{{payment_profile.billing_state}} | The billing state for the payment information |
{{payment_profile.billing_zip}} | The zip code of the payment information |
{{payment_profile.billing_country}} | The country of the billing information |
{{payment_profile.expiration_month}} | Expiration month of the credit card on file |
{{payment_profile.expiration_year}} | Expiration year of the credit card on file |
{{payment_profile.payment_method_type}} | One of card, PayPal, or bank account |
{{payment_profile.payment_method_masked_number}} | The masked card number for a card, or the masked bank account number for a bank account. Use this when one template has to cover both. |
{{payment_profile.masked_bank_account_number}} | The bank account number, masked |
{{payment_profile.masked_bank_routing_number}} | The bank routing number, masked |
{{payment_profile.bank_name}} | The name of the bank |
{{payment_profile.bank_account_type}} | The bank account type recorded on the payment profile |
{{payment_profile.bank_account_holder_type}} | The account holder type recorded on the payment profile |
{{payment_profile.verified?}} | True/false indicating whether the bank account has been verified |
{{payment_profile.verification_url}} | The URL where the customer can verify the bank account |
{{payment_profile.current_vault}} | The vault storing the payment method |
{{payment_profile.gateway_handle}} | The handle of the gateway the payment method is stored against |
Important: Wrap card-specific fields such as
masked_card_numberin a{% if subscription.card_on_file? %}...{% endif %}block so they're only used when the payment profile is a credit card. Wrap bank-account-specific fields in{% if subscription.bank_account_on_file? %}...{% endif %}the same way.
Each reference to product represents the product price point your customer is subscribed to.
| Email field | Description |
|---|---|
{{product.id}} | The unique product id within Advanced Billing |
{{product.name}} | The product name |
{{product.handle}} | The product API handle |
{{product.description}} | The product description |
{{product.accounting_code}} | The product's accounting code (has no bearing in Advanced Billing, may be used within your app) |
{{product.price_in_cents}} | The product price, in integer cents |
{{product.initial_charge?}} | True/false indicating whether the product has an initial charge |
{{product.initial_charge_in_cents}} | The upfront charge you have specified |
{{product.expires?}} | True/false indicating whether the product expires |
{{product.offers_trial?}} | True/false indicating whether the product offers a trial price |
{{product.trial_price_in_cents}} | The product trial price, in integer cents |
{{product.update_return_url}} | The URL a buyer is returned to after a successful account update. See the Creating Plans help article. |
{{product.update_return_params}} | The parameters string used to construct your return URL. See the Creating Plans help article. |
{{product.request_credit_card?}} | True/false indicating whether the product requests a credit card at signup |
{{product.require_credit_card?}} | True/false indicating whether the product requires a credit card at signup |
{{product.archived?}} | True/false indicating whether the product is currently archived |
{{product.archived_at}} | Timestamp for when the product was archived, if it was |
{{product.currency}} | The product currency |
{{product.price}} | The product price, formatted in the product currency |
{{product.initial_charge}} | The initial charge, formatted in the product currency |
{{product.trial_price}} | The trial price, formatted in the product currency |
{{product.recurring_duration}} | The length of one renewal period. e.g. 30 days, 1 year |
{{product.expiration_duration}} | The length of time before the product expires, if it does |
{{product.trial_duration}} | The length of the product trial, if there is one |
| Email field | Description |
|---|---|
{{subscription.id}} | The subscription unique id within Advanced Billing |
{{subscription.reference}} | The unique identifier used within your application for this subscription |
{{subscription.state}} | The current state of the subscription. See the Understand Subscription States help article. |
{{subscription.subscriber_name}} | The name of the subscriber |
{{subscription.customer_phone}} | The phone number on the subscription's customer record |
{{subscription.balance_in_cents}} | The current outstanding subscription balance, in cents |
{{subscription.current_account_balance}} | The current account balance, formatted in the subscription's currency |
{{subscription.current_period_started_at}} | Timestamp for the start of the current recurring period |
{{subscription.current_period_starts_at}} | Timestamp for the start of the current recurring period |
{{subscription.current_period_ends_at}} | Timestamp for the end of the current recurring period, when the next regularly scheduled charge is attempted |
{{subscription.trial_started_at}} | Timestamp for when the trial period began, if any |
{{subscription.trial_ended_at}} | Timestamp for when the trial period ended, if any |
{{subscription.trial_ends_at}} | Timestamp for when the trial period ends, if any |
{{subscription.activated_at}} | Read-only timestamp for when the subscription began, either coming out of a trial or at signup when there was none |
{{subscription.expires_at}} | Timestamp giving the expiration date of this subscription, if any |
{{subscription.cancellation_message}} | Seller-provided reason for, or note about, the cancellation |
{{subscription.canceled_at}} | Timestamp for when the subscription canceled, if it did |
{{subscription.cancel_at_end_of_period}} | Whether the subscription will, or has, canceled at the end of the period |
{{subscription.cancel_at_end_of_period?}} | True/false indicating whether the subscription is set to cancel at the end of the current period |
{{subscription.expires_at_end_of_period?}} | True/false indicating whether the subscription expires at the end of the current period |
{{subscription.payment_collection_method}} | The type of payment collection used. May be automatic, remittance, or invoice. |
{{subscription.coupon_code}} | The coupon code currently applied to the subscription, if any |
{{subscription.total_revenue_in_cents}} | The total revenue from the subscription, in cents |
{{subscription.total_revenue}} | The total revenue from the subscription, formatted in the subscription's currency |
{{subscription.estimated_renewal_amount_in_cents}} | The estimated amount of the next renewal, in cents |
{{subscription.estimated_renewal_amount}} | The estimated renewal amount, formatted in the subscription's currency |
{{subscription.current_billing_amount_in_cents}} | The balance_in_cents plus the estimated_renewal_amount_in_cents |
{{subscription.current_billing_amount}} | The current_billing_amount_in_cents, formatted in the subscription's currency |
{{subscription.update_url}} | The self-service URL for this subscription |
{{subscription.payment_method_on_file?}} | True/false indicating whether a payment profile is present |
{{subscription.card_on_file?}} | True/false indicating whether the payment profile is a credit card |
{{subscription.bank_account_on_file?}} | True/false indicating whether the payment profile is a bank account |
{{subscription.billing_portal?}} | True/false indicating whether this customer is managed in the Billing Portal |
{{subscription.billing_portal_management_url}} | The Billing Portal management URL for this subscription, when the Billing Portal is enabled |
{{subscription.portal_invite_sent?}} | True/false indicating whether the customer was emailed a Billing Portal invitation |
{{subscription.referral_code}} | The referral code, which can be appended to Public Signup Page URLs. See the Understanding Referrals help article. |
{{subscription.dunning_final_step_at}} | The date and time of the final step of the active dunning schedule, in your site's time zone. Blank when no dunning is in progress. |
{{subscription.agreement_terms}} | The ACH authorization agreement text accepted for this subscription |
{{subscription.authorizer_first_name}} | The first name of the person who accepted the ACH authorization agreement |
{{subscription.authorizer_last_name}} | The last name of the person who accepted the ACH authorization agreement |
{{subscription.require_introductory_offer_trial_information?}} | True/false indicating whether the subscription is in an introductory offer period. See the Understand Trialing Subscriptions help article. |
{{subscription.introductory_offer_period_length}} | The length of the introductory offer trial period |
{{subscription.introductory_offer_ends_at}} | Estimated end of the introductory offer trial period |
{{subscription.introductory_offer_estimated_renewal_amount}} | The estimated amount of the first transaction after the introductory offer trial period ends |
These variables carry your site's branding into an email or layout, and are what the default Advanced Billing layout uses to render your logo and colors.
| Email field | Description |
|---|---|
{{branding_theme.id}} | The unique id of the branding theme |
{{branding_theme.name}} | The name of the branding theme |
{{branding_theme.logo_url}} | The URL of your uploaded logo |
{{branding_theme.primary_color}} | The theme's primary color |
{{branding_theme.secondary_color}} | The theme's secondary color |
{{branding_theme.font}} | The theme's font |
Direct Debit Instruction templates support a restricted set of variables: all Direct Debit Instruction variables, all Customer variables, all Payment Profile variables, and these basic fields only: from_address, name, full_name, merchant_name, and masked_card_number.
| Email field | Description |
|---|---|
{{direct_debit.creditor_name}} | Creditor's name |
{{direct_debit.scheme_identifier_reference}} | Scheme identifier reference |
{{direct_debit.scheme_identifier_name}} | Scheme identifier name |
{{direct_debit.bank_name}} | Bank name |
{{direct_debit.masked_bank_branch_code}} | Masked bank branch code |
{{direct_debit.mandate_url}} | URL to the GoCardless mandate, in PDF form |
The following variables are for Relationship Invoicing sites only.
Invoice emails support the fields below. A multi-invoice email can also iterate {{invoices}}, which holds the same fields for each invoice in the message.
| Email field | Description |
|---|---|
{{invoice.id}} | Unique ID of the invoice displayed in the URL |
{{invoice.uid}} | The invoice's unique identifier |
{{invoice.number}} | Customer-facing number of the invoice |
{{invoice.sequence_number}} | The sequential number of the invoice |
{{invoice.url}} | URL of the current invoice |
{{invoice.status}} | Current status of the invoice |
{{invoice.collection_method}} | The collection method for payment. Can be automatic or remittance. |
{{invoice.currency}} | Currency of the invoice |
{{invoice.created_at}} | Date the invoice was created |
{{invoice.updated_at}} | Date the invoice was updated, if any |
{{invoice.issue_date}} | Issue date of the invoice |
{{invoice.due_date}} | Due date of the invoice |
{{invoice.paid_date}} | Date the invoice was paid in full |
{{invoice.transaction_time}} | Time the line items on the current on-demand invoice were generated |
{{invoice.terms}} | The payment terms, returned as due_on_receipt or net_<days> |
{{invoice.net_terms}} | The number of net terms days on the invoice |
{{invoice.memo}} | Invoice memo |
{{invoice.subtotal_amount}} | Subtotal of the invoice |
{{invoice.discount_amount}} | Discount amount applied to the invoice, if any |
{{invoice.tax_amount}} | Tax amount applied to the invoice |
{{invoice.total_amount}} | Total amount of the invoice |
{{invoice.formatted_total}} | The invoice total, formatted in the invoice currency |
{{invoice.paid_amount}} | Amount of payments made against the invoice |
{{invoice.due_amount}} | Amount still due on the invoice |
{{invoice.line_items}} | The invoice's line items, for iterating with a Liquid for loop |
{{invoice.recipient_emails}} | Any email-based recipients of the invoice |
{{invoice.site_id}} | Site ID that contains the associated invoice |
{{invoice.customer_id}} | Customer ID |
{{invoice.subscription_id}} | Subscription ID associated with the invoice |
{{invoice.subscription_reference}} | Unique subscription reference number, typically populated with your own ID for quick reference |
{{invoice.customer.name}} | Customer full name |
{{invoice.customer.first_name}} | Customer first name |
{{invoice.customer.last_name}} | Customer last name |
{{invoice.customer.email}} | Customer email |
{{invoice.customer.organization}} | Customer organization |
{{invoice.customer.locale}} | Customer language settings |
{{invoice.payer.*}} | The customer responsible for payment, which differs from invoice.customer when another customer pays. Supports the same fields as invoice.customer. |
{{invoice.seller.name}} | Seller name of the Advanced Billing account |
{{invoice.seller.phone}} | Seller phone number of the Advanced Billing account |
{{invoice.billing_address.street}} | Billing street address |
{{invoice.billing_address.line2}} | Billing street address line 2 |
{{invoice.billing_address.city}} | Billing address city |
{{invoice.billing_address.state}} | Billing address state |
{{invoice.billing_address.zip}} | Billing zip code or postal code |
{{invoice.billing_address.country}} | Billing address country |
{{invoice.shipping_address.street}} | Shipping street address |
{{invoice.shipping_address.line2}} | Shipping street address line 2 |
{{invoice.shipping_address.city}} | Shipping address city |
{{invoice.shipping_address.state}} | Shipping address state |
{{invoice.shipping_address.country}} | Shipping address country |
Depending on which architecture you use, statement emails may not be available. You can use email templates in statements, but if you've enabled the Billing Portal, Liquid syntax in your statements won't render there.
Maxio considers Liquid syntax in statements an edge case. Use it sparingly, since the formatting of statements doesn't lend itself to this delivery method. Prefer Liquid in emails to your subscribers instead.
Custom fields aren't available in the test data used when editing an email template. Instead, the preview shows placeholder text:
[PLACEHOLDER: The value of "Color" on the Subscription will be included in the real email.]If you misspell the name of a custom field, the preview shows a warning instead, which is a quick way to catch a typo before you send:
[WARNING: The custom field "Gift warp?" does not exist for Subscriptions. This will always be blank in a real email.]To see how your email looks with real values, create subscriptions on a site in test mode using your own email address, so the emails reach you.
For more on the sample data behind the preview, see the Preview Emails with Test Data help article.
Still need help?
Reach out and our support team will take it from here.