Storefronts

Swell's Liquid implementation is based on LiquidJS, with the addition of several standard tags, filters and objects to support working with Themes.

The goal is a template language is to render static and dynamic content with a language that is easy to learn and widely supported. Liquid was originally created by Shopify for this purpose, but has since gained broad adoption among developers and users, in many different categories of business. In our effort to grow access to new capabilities for merchants, we believe that adopting the most widely known template language for themes serves everyone's interest.

The examples in this guide are in reference to Swell-native objects and properties. When using a Shopify theme with a compatible storefront app, you'll instead use equivalent Shopify objects and properties as noted in each section.

The following are logical and comparison operators used within conditional tags.

OperatorDescription
==equals
!=does not equal
>greater than
<less than
>=greater than or equal to
<=less than or equal to
ormatches condition A or B
andmatches condition A and B
containsmatches substrings or strings in arrays

Numerical operators such as + and - are not supported. Instead, you would use the mathematical filters such as {{ a | plus: b }} and {{ a | plus: b }}. See the Math filter section for more details.

Tags are surrounded by {% ... %} delimiters and are always closed with a matching end tag.

Example
{% if account %}
  Hello, {{ account.name }}
{% endif %}

Filters are used to modify output or assignment of a variable, separate by a pipe | character. They can take one or more positional or named arguments.

Example
{{ product.price | money }}

Liquid templates are formatted for readability, however it can affect the HTML output in undesirable ways. Use a hyphen - character on either or both sides of any tag to cause Liquid to strip whitespace on the left and right sides of the tag.

Example
{%- if category.products.size > 0 -%}
  ...
{%- endif -%}

Also note, each tag outputs a trailing newline \n character, however adding a hyphen to the end of the tag will strip the newline from output.

Example
{% assign author = "emmett" -%}
{{ author }}

The following are supported conditional tags for output control.

TagDescription
ifrender output if conditions match
elseifalternate `if` expression
elserender output if no previous conditions match
unlessrender output if conditions do not match
caseswitch output between one or more `when` tags

See the Conditional tags section for more details.

The following are tags used to iterate through array and collection values.

` and `
TagDescription
forrenders output for every item of an array
elsealternate output when `for` has zero length
breakstops a `for` loop from iterating
continuecauses a `for` loop to skip to the next iteration
cyclerenders an output from a list of strings for each `for` loop iteration
tablerowrender HTML `
tags for each item in an array
paginateiterates through a collection across multiple pages

See the Iteration tags section for more details.

The following are tags to control how Liquid is processed and rendered.

TagDescription
commentprevents an expression from being rendered
echooutputs an expression, usable inside `{% liquid %}` tags
liquida block of Liquid code without individual delimiters
rawouputs any Liquid code without rendering it

See the Syntax tags section for more details.

TagDescription
assigncreates or overwrites a variable with the assigned value
capturecapture a variable value as the expression output
decrementdecreases the value of a numeric variable by 1
incrementincreases the value of a numeric variable by 1

See the Variable tags section for more details.

Tags are logical code that dynamically control the output of theme templates.

Conditional tags control if and when expressions are rendered.


Executes a block of code only if a specified condition evaluates to truthy. It allows for conditional rendering of content based on variables or expressions.

Syntax
{% if condition %}
  expression
{% endif %}
  • condition: The condition to evaluate.
  • expression: The expression to render when the condition is met.

Adds additional conditions to an if or unless block, executing its code only if previous conditions are falsy and its own condition is truthy. This tag must follow an if or another elsif and precede any else.

Example
{% if product.sale %}
  On sale
{% elsif price < 10 %}
  Under $10
{% endif %}

Provides a fallback block of code that executes if all preceding if and elsif conditions in the structure are falsy. This tag is optional and can only appear once at the end of an if or unless block.

Syntax
{% else %}
  expression

Executes a block of code only if a specified condition evaluates to falsy, acting as the inverse of the if tag. Like if, it can be combined with elsif and else for more complex flows.

Syntax
{% unless condition %}
  expression
{% endunless %}
  • condition: The condition to evaluate.
  • expression: The expression to render unless the condition is met.

Creates a switch statement that compares a variable against multiple values, executing the corresponding when block for the first match. Each when can check one or more values, and an optional else handles unmatched cases.

Syntax
{% case variable %}
  {% when value_one %}
    expression
  {% when value_two %}
    expression
  {% else %}
    expression
{% endcase %}
  • variable: The variable used to evaluate the case statement.
  • value_one: A specific value to match against.
  • value_two: A specific value to match against.
  • expression: The expression to render when the value is matched.

HTML tags are used to output HTML with Swell-specific attributes.


Renders an HTML <form> tag to submit <input> and other form values to a specific endpoint. Forms are defined by each storefront app, such as Proxima, to coincide with their intended functionality. Refer to the app's documentation for specific forms that are available in its environment.

Syntax
{% form 'type' %}
  content
{% endform %}
  • type: The specific type of form to render.
  • content: Content rendered inside the <form> HTML tag.

Optional tag parameters

  • return_to: URL to redirect the page to after the form is successfully submitted.

HTML attributes

You may add additional named parameters to the form tag in order to attach HTML attributes to the rendered form.

Example
{% form 'type', id: 'custom-id', class: 'custom-class', data-example: 'value' %}
  <!-- content -->
{% endform %}

Renders a <style> tag with attributes required by the Swell Theme Editor.

You may reference theme color settings, and other global values within the style tag. If your theme includes plain <style> tags without this syntax, then Liquid values may not update as expected within the editor.

Syntax
{% style %}
  css_rules
{% endstyle %}
  • css_rules: The CSS rules to evaluate at run-time.

Iteration tags are used to repeatedly evaluate blocks of code.


Iterates over an array or a range of numbers, executing the enclosed code block for each item.

Syntax
{% for variable in array %}
  expression
{% endfor %}
  • variable: A variable to assign for each item in the array.
  • array: The array or collection to iterate over.
  • expression: The expression to render for each iteration.

Optional tag parameters

  • limit: The maximum number of iterations.
  • offset: A number of iterations to start from.
  • reversed: Reverse the order of iteration.

Range iteration

Instead of iterating over array items, specify a numeric range in the format of (number..number).

Syntax
{% for num in (1..3) %}
  {{ num }}
{% endfor %}

forloop object

Contains information about the current for iteration, from within the expression.

Properties

  • first (boolean): Indicates the current iteration is the first one.
  • index (number): The 1-based index of the current iteration.
  • index0 (number): The 0-based index of the current iteration.
  • last (boolean): Indicates the current iteration is the last one.
  • length (number): The total number of iterations.
  • parentloop (forloop): The parent forloop object, if nested inside another for loop.
  • rindex (number): The 1-based index of the current iteration in reverse order.
  • rindex0 (number): The 0-based index of the current iteration in reverse order.
Example
{% for product in products %}
  Product #{{ forloop.index }}
  {% if forloop.last %}
    There are {{ forloop.length }} products
  {% endif %}
{% endfor %}

When used within a for or tablerow loop, executes its code block if the iterated collection is empty. It provides a fallback for no results.

Syntax
{% for variable in array %}
  expression
{% else %}
  expression
{% endfor %}
  • variable: A variable to assign for each item in the array.
  • array: The array or collection to iterate over.
  • expression: The expression to render for each iteration.

Terminates the enclosing for or tablerow loop immediately when encountered. It exits the loop without processing remaining iterations.

Syntax
{% break %}
Example
{% for num in (1..3) -%}
  {% if num > 1 %}
    {% break %}
  {% else %}
    {{ num }}
  {% endif %}
{% endfor %}

Skips the rest of the current iteration in a for or tablerow loop and proceeds to the next one. It jumps to the next loop cycle.

Syntax
{% continue %}
Example
{% for num in (1..3) -%}
  {% if num == 2 %}
    {% continue %}
  {% else %}
    {{ num }}
  {% endif %}
{% endfor %}

Outputs values from a provided list in sequence, repeating as needed during iterations. It accepts a group name for independent cycling across multiple uses.

Syntax
{% cycle 'string', 'string', ... %}
Example
{% for num in (1..3) -%}
  {% cycle 'one', 'two', 'three' %}
{% endfor %}

Iiterates over a collection like for, but formats output into an HTML table row with cells.

A tablerow tag should be enclosed in a <table> HTML element.

Syntax
{% tablerow variable in array %}
  expression
{% endtablerow %}
  • variable: A variable to assign for each item in the array.
  • array: The array or collection to iterate over.
  • expression: The expression to render for each iteration.
Example
<table>
  {% tablerow product in products cols: 2 %}
    {{ product.name }}
  {% endtablerow %}
</table>

Optional tag parameters

  • cols: The number of columns the table should have.
  • limit: The maximum number of iterations.
  • offset: A number of iterations to start from.

Range iteration

Instead of iterating over array items, specify a numeric range in the format of (number..number).

Syntax
{% tablerow num in (1..3) %}
  {{ num }}
{% endtablerow %}

tablerowloop object

Contains information about the current for iteration, from within the expression.

Properties

  • col (number): The 1-based index of the current column.
  • col0 (number): The 0-based index of the current column.
  • col_first (boolean): Indicates the current column is the first one.
  • col_last (boolean): Indicates the current column is the last one.
  • first (boolean): Indicates the current iteration is the first one.
  • index (number): The 1-based index of the current iteration.
  • index0 (number): The 0-based index of the current iteration.
  • last (boolean): Indicates the current iteration is the last one.
  • length (number): The total number of iterations.
  • rindex (number): The 1-based index of the current iteration in reverse order.
  • rindex0 (number): The 0-based index of the current iteration in reverse order.
  • row (number): The 1-based index of the current row.

Splits a collection object into pages and provides information about the current page, items, and navigation links. Pagination is typically used with collections of records, such as products, categories, blogs, customer addresses, etc.

A for loop should be used inside a paginate tag to iterate over the collection's items.

Syntax
{% paginate collection by limit %}
  {% for item in collection %}
    for_content
  {% endfor %}
{% endpaginate %}
  • collection: The collection object or array to paginate with
  • limit: The maximum number of items to include per page, up to 1,000.
  • item: The the item of the for loop being iterated inside the paginate tag.
  • for_content: The content of each for loop iteration.
Example
{% paginate category.products by 15, window_size: 3 %}
  {% for product in category.products %}
    {{ product.name }}
  {% endfor %}

  {{ paginate | default_pagination }}
{% endpaginate %}

Optional tag parameters

  • window_size: The number of pages that should be displayed in pagination navigation.

Syntax tags effect how Liquid is processed and rendered.


Adds non-rendered text to the code.

Syntax
{% comment %}
  content
{% endcomment %}
  • content: The content of the comment.

Inline comments

You may use a hash # character to prevent the following expression from being evaluated inside any tag.

Example
{% # a single line comment %}

{% # for num in (1..3) -%}
  {{ num }}
{% # endfor %}

Inline comments can also be used inside Liquid tags.

Example
{% liquid
  # this is an inline comment
  assign num_products = products.length
%}

Renders the value of an expression directly to the template. It functions similarly to the {{ }} output tag but in a procedural context.

Syntax
{% liquid
  echo expression
%}
  • expression: The expression to be rendered.

Encloses a block of procedural Liquid code, allowing commands like echo, if, and assign on separate lines. It supports multi-line scripting without needing individual {% %} tags for each statement.

Syntax
{% liquid
  expression
%}
  • expression: The expression to be evaluated.

Prevents the enclosed content from being parsed as Liquid code, outputting it as plain text.

Syntax
{% raw %}
  expression
{% endraw %}
  • expression: The expression to output without being evaluated.

Theme tags are used to control output for layouts, sections and blocks.


Renders a component (snippet) file, allowing access to parent template variables. The component has access to variables in the parent scope.

Note: include deprecated in favor of the render tag for better performance.

Syntax
{% include 'component' %}
  • file_name: The name of the component file (snippet) to render, without the .liquid extension.

Encloses JavaScript code within layouts, sections, blocks, or components. It generates a <script> tag for execution in the theme.

Syntax
{% javascript %}
  code
{% endjavascript %}
  • code: The JavaScript code to be executed at run-time.

Specifies which layout file to use for the current template from the layouts/ folder. Without a name, it defaults to theme.liquid.

Syntax
{% layout 'name' %}
  • name: The name of the layout file to use, or none for no layout.

Renders a snippet or app block, isolating variables from the parent template. It supports passing variables as parameters for controlled access.

Syntax
{% render 'file_name' %}
  • file_name: The name of the component file (snippet) to render, without the .liquid extension.

Passing variables

You may pass variables as named parameters to the component, which become available within its scope when rendered.

Example
{% render 'file_name', variable: value %}

Render for

Use the for parameter to render a component for every item in a collection or array.

Example
{% render 'file_name' for array as item %}

Render with

Use the with parameter to pass an entire object to the component, assigned as a variable with the name specified.

Example
{% render 'file_name' with object as name %}

Renders a section file from the sections/ folder. It integrates customizable sections into templates. This renders a section statically, such that its settings are not editable in the Swell Theme Editor.

Syntax
{% section 'name' %}
  • name: The name of the section file to render.

Renders a group of sections as part of a theme's layout. It allows dynamic inclusion of multiple sections grouped by name in the layout.

Place the sections tag where you want the section group to be rendered.

Syntax
{% sections 'name' %}
  • name: The name of the section group file to render.

Variable tags are used to assign and modify variables used throughout theme logic.


Creates a new variable or updates an existing one with the result of an expression. It supports assigning values like strings, numbers, arrays, or outputs from filters.

Syntax
{% assign variable = value %}
  • variable: The name of the variable being created or updated.
  • value: The value to assign to the variable.
Example
{% assign product_name = product.name | upcase %}

{{ product_name }}

Assigns the rendered content between its tags to a variable, without outputting it directly. The captured variable can then be used or manipulated elsewhere in the template.

Syntax
{% capture variable %}
  value
{% endcapture %}
  • variable: The name of the variable being created or updated.
  • value: The value to assign to the variable.

Decreases a number variable by 1 and outputs the new value. If the variable doesn't exist, it starts at -1 before decrementing.

Syntax
{% decrement variable %}
  • variable: The name of the variable being decremented.

Increases a number variable by 1 and outputs the new value. If the variable doesn't exist, it starts at -1 before incrementing.

Syntax
{% increment variable %}
  • variable: The name of the variable being incremented.

Tags implemented strictly to enable compatibility with Shopify themes.


Encloses CSS rules within sections, blocks, or components (snippets). Its contents are combined with other stylesheet output on a page and rendered as combined optimized output.

Liquid code is not rendered inside the {% stylesheet %} tag.

Syntax
{% stylesheet %}
  css_rules
{% endstylesheet %}
  • css_rules: The CSS styles to render for the section, block, or component.

Filters are used to modify Liquid output.

Array filters are used to modify arrays.


Removes empty values from an array.

Example
{{ array | compact }}

Combines two arrays by concatenating them.

Example
{{ array1 | concat: array2 }}

Returns the first object in an array for which the queried attribute has the given value or nil if no match.

Example
{{ array | find: 'property', 'value' }}

Returns the first object in an array for which the given expression evaluates to true or nil if no item satisfies the expression.

Example
{{ array | find_exp: 'item', 'item.property == value' }}

Returns the 0-based index of the first object in an array for which the queried attribute has the given value or nil if no match.

Example
{{ array | find_index: 'property', 'value' }}

Returns the 0-based index of the first object in an array for which the given expression evaluates to true or nil if no item satisfies the expression.

Example
{{ array | find_index_exp: 'item', 'item.property == value' }}

Returns the first element of an array.

Example
{{ array | first }}

Dot notation

You can use the first filter with dot notation inside a tag.

Example
{% assign first_item = array.first %}

Groups array items by a common attribute.

Example
{{ array | group_by: 'property' }}

The group_by_exp filter groups an array's items using a Liquid expression.

Example
{{ array | group_by_exp: 'item', 'item.property == value' }}

Returns true if an item exists in an array for which the queried attribute has the given value or false otherwise.

Example
{{ array | has: 'property', 'value' }}

Returns true if an item exists in an array for which the given expression evaluates to true or false if no item satisfies the expression.

Example
{{ array | has_exp: 'item', 'item.property == value' }}

Joins elements of an array into a string with a separator.

Example
{{ array | join }}

You can also use a custom separator for joined items.

Example
{{ array | join: ', ' }}

Returns the last element of an array.

Example
{{ array | last }}

Dot notation

You can use the last filter with dot notation inside a tag.

Example
{% assign last_item = array.last %}

Creates an array of values by extracting the values of a named property from another object.

Example
{{ array | map: 'property' }}

Creates an array excluding objects with a given property value or excluding truthy values by default if no property is given.

Example
{{ array | reject: 'property', 'value' }}

Creates an array excluding objects for which the given expression evaluates to true.

Example
{{ array | reject_exp: 'item', 'item.property == value' }}

Reverses the order of an array.

Example
{{ array | reverse }}

Returns the number of items in an array.

Example
{{ array | size }}

Dot notation

You can use the size filter with dot notation inside a tag.

Example
{% assign count = array.size %}

Sorts elements of an array.

Example
{{ array | sort }}

You can also sort the array by an item's property.

Example
{{ array | sort: 'property' }}

Sorts elements of an array in a natural order.

Example
{{ array | sort_natural }}

You can also sort the array by an item's property.

Example
{{ array | sort_natural: 'property' }}

Returns the sum of all elements in an array.

Example
{{ array | sum }}

You can also specify a property to sum object values.

Example
{{ array | sum: 'property' }}

Removes duplicate elements from an array.

Example
{{ array | uniq }}

Filters an array based on a matching attribute value.

Example
{{ array | where: 'property', 'value' }}

Filters used to retrieve theme or object related URLs for rendering.


Generates a URL for a theme asset file, such as scripts, or stylesheets. It takes a filename and returns the full path to the asset hosted on the store's CDN.

If you're referencing an image asset, use asset_img_url.

Example
{{ 'main.js' | asset_url }}

Generates a URL for an image file stored in the theme's assets directory. It accepts optional parameters like size to specify image dimensions or formats, returning the full CDN-hosted path.

Example
{{ 'image.png' | asset_img_url }}

Image sizes

You may pass a size parameter to resize the image accordingly. Specify either [width]x, x[height], or both [width]x[height]. You may also specify one of the named sizes below.

  • pico: 16x16 px
  • icon: 32x32 px
  • thumb: 50x50 px
  • small: 100x100 px
  • compact: 160x160 px
  • medium: 240x240 px
  • large: 480x480 px
  • grande: 600x600 px
  • original or master: 1024x1024 px
Example
{{ 'image.png' | asset_img_url: 'large' }}

{{ 'image.png' | asset_img_url: 'x480' }}

{{ 'image.png' | asset_img_url: '480x' }}

{{ 'image.png' | asset_img_url: '480x480' }}

Generates an HTML <img> tag for an image, using its URL or asset path. It supports optional parameters like alt, class, or width/height for customizing the tag's attributes.

Commonly used in combination with image_url.

Example
{{ product | image_url: width: 250 | image_tag: attribute: 'value' }}

Returns the URL for an image, either from an object such as product or file. It can accept width and height parameter to specify its size.

Example
{{ product | image_url: width: 250, height: 350 }}

Country flags

You may pass a string representing a locale and this filter will return an SVG representing that country's flag.

Example
{{ store.locale | image_url }}

Cart filters are used to retrieve or modify details of a shopping cart.


Returns the total quantity of a specific product variant in the cart. It takes a variant ID as input and outputs the sum of quantities across all matching cart line items.

Example
{{ cart | item_count_for_variant: variant_id }}

Color filters are used to mofy and output color values for CSS styling.


Calculates the brightness difference between two colors, returning a value between 0 and 255. It takes two color values (e.g., hex, RGB) as inputs.

Example
{{ '#57349B' | brightness_difference: '#FFE5F8' }}

Returns the perceived brightness of a color on a scale from 0 (black) to 255 (white). It accepts a color value like hex or RGB.

Example
{{ '#57349B' | color_brightness }}

Calculates the contrast ratio between two colors, returning a value between 1 and 21. It takes two color values as inputs, useful for accessibility checks.

Example
{{ '#57349B' | color_contrast: '#FFE5F8' }}

Darkens a color by a specified percentage (0 to 100). It takes a color value and a percentage as inputs, returning the darkened color in the same format.

Example
{{ '#57349B' | color_darken: 25 }}

Reduces a color’s saturation by a specified percentage (0 to 100). It takes a color value and a percentage, returning the desaturated color.

Example
{{ '#57349B' | color_desaturate: 25 }}

Calculates the perceptual difference between two colors using the CIEDE2000 algorithm, returning a value between 0 and 100. It takes two color values as inputs.

Example
{{ '#57349B' | color_difference: '#FFE5F8' }}

Extracts a specific component (e.g., red, green, blue, hue, saturation, lightness) from a color. It takes a color value and the component name as inputs.

Example
{{ '#57349B' | color_extract: 'red' }}

Color components

  • alpha
  • red
  • green
  • blue
  • hue
  • saturation
  • lightness

Lightens a color by a specified percentage (0 to 100). It takes a color value and a percentage, returning the lightened color in the same format.

Example
{{ '#57349B' | color_lighten: 25 }}

Blends two colors by a specified percentage (0 to 100). It takes two color values and a percentage, returning the mixed color.

Example
{{ '#57349B' | color_mix: '#FFE5F8', 50 }}

If one color has an alpha component and the other does not, the alpha component of 1.0 will be assumed for the color without alpha.

Example
{{ 'rgba(87, 52, 155, 0.50)' | color_mix: '#FFE5F8', 50 }}

Adjusts a specific color component (e.g., red, hue, lightness) by a given value. It takes a color, component name, and adjustment value as inputs.

Example
{{ '#57349B' | color_modify: 'blue', 255 }}

Color components

  • red, green, blue: An integer between 0 and 255
  • alpha: A decimal between 0 and 1
  • hue: An integer between 0 and 360
  • saturation, lightness: An integer between 0 and 100

Increases a color’s saturation by a specified percentage (0 to 100). It takes a color value and a percentage, returning the saturated color.

Example
{{ '#57349B' | color_saturate: 25 }}

Converts a color (e.g., RGB, HSL) to its hexadecimal representation. It takes a color value and returns a hex string (e.g., #FFFFFF).

Example
{{ 'rgb(87, 52, 155)' | color_to_hex }}

Converts a color (e.g., hex, RGB) to its HSL representation. It takes a color value and returns a string like hsl(360, 100%, 50%).

Example
{{ '#57349B' | color_to_hsl }}

Converts a color to the OKLCH color space, which is perceptually uniform. It takes a color value and returns a string like oklch(0.5, 0.2, 360).

Example
{{ '#57349B' | color_to_oklch }}

Converts a color (e.g., hex, HSL) to its RGB representation. It takes a color value and returns a string like rgb(255, 255, 255).

Example
{{ '#57349B' | color_to_rgb }}

Converts a hex color to its RGBA representation, with an optional alpha channel value (0 to 1). It takes a hex color and an optional alpha value, returning a string like rgba(255, 255, 255, 1).

Example
{{ '#57349B' | hex_to_rgba: 0.5 }}

Default filters provide fallback values and HTML markup.


Returns a fallback value for a variable if it is nil, empty, or false. It takes a variable and a default value as inputs, returning the default if the variable is not set.

Example
{{ product | image_url | default: 'product-default.png' }}

Formats validation errors for a form field into a human-readable string. It takes a form object and a field name, returning error messages or an empty string if none exist.

Example
{{ form.errors | default_errors }}

Generates HTML pagination links for a paginated collection. It takes a paginate object and returns navigation links with customizable styling.

Example
{{ paginate | default_pagination }}

Next and previous labels

You can specify text labels for Next and Previous links to be generated by this filter.

Example
{{ paginate | default_pagination: next: 'Next', previous: 'Previous' }}

Font filters are used to output and modify font objects that are defined in font theme settings.

Generates a CSS @font-face rule for a font asset, specifying its source and properties. It takes a font file name and optional parameters like font-weight or font-style, returning the complete CSS rule.

Example
{{ settings.header_font | font_face }}

You may specify the font display property of the @font-face declaration.

Example
{{ settings.header_font | font_face: font_display: 'swap' }}

Adjusts a font’s properties (e.g., weight, style) for use in a theme. It takes a font object or name and a property to modify, returning the updated font definition.

Example
{% assign bold_font = settings.body_font | font_modify: 'weight', 'bold' %}

h1 { font-weight: {{ bold_font.weight }}; }

Font properties

  • style
    • normal: The normal variant of the same weight, if it exists.
    • italic: The italic variant of the same weight, if it exists.
    • oblique: The oblique variant of the same weight, if it exists. Some fonts support only italic or oblique variants, but not both.
  • weight
    • normal: 400 weight of the same style, if it exists.
    • bold: 700 weight of the same style, if it exists.
    • lighter: The lighter weight of the same style using the CSS font-weight property, if it exists.
    • bolder: The bolder weight of the same style using the CSS font-weight property, if it exists.
    • 100900: Specified weight of the same style, if it exists.
    • +100+900: Incremented weight by the given amount of the same style, if it exists.
    • -100-900: Decremented weight by the given amount of the same style, if it exists.

The font_url filter generates a URL for a font theme setting.

Example
{{ settings.header_font | font_url }}

Filters used to format dates and data into human or machine readable formats.


Formats a date or timestamp into a specified string format. It takes a date input (e.g., string, variable) and a format string, returning the formatted date based on Liquid’s date formatting syntax.

Example
{{ blog.date_created | date: '%B %d, %Y' }}

Current date

You may specify the string 'now' or 'today' to render the current date.

Example
{{ 'now' | date: '%B %d, %Y' }}

Date formatting

The format argument primarily conforms to Ruby's Format for Dates and Times. See to the LiquidJS documentation for details regarding the differences.

You may specify locale-aware formats using the following identifiers.

  • abbreviated_date
  • basic
  • date
  • date_at_time
  • default
  • on_date
  • short (deprecated)
  • long (deprecated)
Example
{{ blog.date_created | date: format: 'on_date' }}

Converts a Liquid object (e.g., array, hash, or variable) into a JSON string. It takes the object as input and returns a compact JSON representation suitable for scripts or APIs.

Example
{{ product | json }}

Converts a Liquid object into a JSON string with formatted, human-readable indentation. It takes the object as input and returns the formatted JSON string.

Example
{{ product | json_pretty }}

Generates structured data markup (e.g., JSON-LD) for SEO purposes, based on an object like a product or blog. It takes the object and optional parameters to customize the schema output.

Product objects are rendered as a schema.org Product or ProductGroup.

Blog objects are rendered as a schema.org Article.

Example
<script type="application/ld+json">
  {{ product | structured_data }}
</script>

HTML filters help render assets and properties using standard HTML elements and attributes.


Retrieves the content of an asset file (e.g., CSS, JS, or text) and outputs it directly in the template. It takes the asset file name as input and returns the file’s raw content.

Example
{{ 'logo.svg' | inline_asset_content }}

Generates an HTML <svg> tag for a placeholder image, typically used for lazy-loaded images. It takes a placeholder type (e.g., product, category) and optional attributes like class or width.

Example
{{ 'product-1' | placeholder_svg_tag }}

The following placeholder names are used for compatibility with Shopify.

Outline illustrations

  • product-1
  • product-2
  • product-3
  • product-4
  • product-5
  • product-6
  • collection-1
  • collection-2
  • collection-3
  • collection-4
  • collection-5
  • collection-6
  • lifestyle-1
  • lifestyle-2
  • image

Color illustrations

  • product-apparel-1
  • product-apparel-2
  • product-apparel-3
  • product-apparel-4
  • collection-apparel-1
  • collection-apparel-2
  • collection-apparel-3
  • collection-apparel-4
  • hero-apparel-1
  • hero-apparel-2
  • hero-apparel-3
  • blog-apparel-1
  • blog-apparel-2
  • blog-apparel-3
  • detailed-apparel-1

Generates an HTML <script> tag for a JavaScript file from the theme’s assets. It takes the asset file name and optional attributes like defer or async, returning the complete tag.

Example
{{ 'main.js' | asset_url | script_tag }}

Generates an HTML <link> tag for a CSS file from the theme’s assets. It takes the asset file name and optional attributes like media, returning the complete tag.

Example
{{ 'main.css' | asset_url | stylesheet_tag }}

Generates an HTML <time> tag with a formatted date or timestamp. It takes a date input and optional format string, returning the tag with a datetime attribute and formatted content.

This filter accepts the same formatting objects as the date filter.

Example
{{ blog.date_created | time_tag }}

Used to translate text and format object output according to a customer's preferred locale or currency.


Formats an address object into a standardized, multi-line string. It takes an address object as input and returns a properly formatted address with fields like street, city, and country.

Example
{{ account.shipping | format_address }}

Retrieves the translated text for a given key from the theme's translation files. It takes a translation key and optional locale or parameters, returning the localized string.

Example
{{ 'path.to.key' | t }}

Math filters are used to perform mathematical operations on numbers.


Returns the absolute value of a number. It takes a number as input and returns its non-negative value, removing any negative sign.

Example
{{ -10 | abs }} # returns 10

Ensures a number is not less than a specified minimum value. It takes a number and a minimum value, returning the greater of the two.

Example
{{ 2 | at_least: 4 }} # returns 4

{{ 6 | at_least: 4 }} # returns 6

Ensures a number is not greater than a specified maximum value. It takes a number and a maximum value, returning the lesser of the two.

Example
{{ 5 | at_most: 4 }} # returns 4

{{ 2 | at_most: 4 }} # returns 2

Rounds a number up to the nearest integer. It takes a number as input and returns the smallest integer greater than or equal to it.

Example
{{ 2.3 | ceil }} # returns 3

Divides a number by another number. It takes a number and a divisor, returning the quotient as a float or integer depending on inputs.

Example
{{ 10 | divided_by: 2 }} # returns 5

{{ 10 | divided_by: 1.2 }} # returns 8.3333333333

Rounds a number down to the nearest integer. It takes a number as input and returns the largest integer less than or equal to it.

Example
{{ 2.3 | floor }} # returns 2

Subtracts one number from another. It takes a number and a value to subtract, returning the difference.

Example
{{ 10 | minus: 2 }} # returns 8

Returns the remainder of a number divided by another. It takes a number and a divisor, returning the remainder of the division.

Example
{{ 5 | modulo: 2 }} # returns 1

Adds one number to another. It takes a number and a value to add, returning the sum.

Example
{{ 1 | plus: 1 }} # returns 2

Rounds a number to a specified number of decimal places. It takes a number and an optional precision value (default: 0), returning the rounded number.

Example
{{ 1.6 | round }} # returns 2

{{ 2.1 | round }} # returns 2

Rounding decimal places

You may specify a number of decimals to round to. If omitted, the filter rounds to the nearest integer.

Example
{{ 1.234 | round: 2 }} # returns 1.23

Multiplies a number by another number. It takes a number and a multiplier, returning the product.

Example
{{ 3 | times: 3 }} # returns 9

Filters that are used to render currency values in different ways.


Formats a number as a currency string using the store’s default currency and settings. Takes a number as input and returns a formatted string, e.g., $12.99.

Example
{{ product.price | money }}

Formats a number as a currency string, including the currency code or symbol. Takes a number and optional currency code, returning a string like $12.99 USD.

Example
{{ product.price | money_with_currency }}

Formats a number as a currency string without the currency code or symbol. Takes a number and returns a string like 12.99.

Example
{{ product.price | money_without_currency }}

Formats a number as a currency string, removing trailing zeros after the decimal point. Takes a number and returns a string like $12 for whole amounts or $12.5 for non-zero decimals.

Example
{{ product.price | money_without_trailing_zeros }}

Filters used to modify strings.


Concatenates a string with another string. Takes a string as input and returns the combined result.

Example
{{ request.origin | append: '/products' }}

Capitalizes the first character of a string and converts the rest to lowercase. Takes a string and returns the capitalized version.

Example
{{ 'this is a capitalized sentence.' | capitalize }}

Converts a string to lowercase. Takes a string and returns the lowercase result.

Example
{{ product.name | downcase }}

Escapes HTML special characters in a string (e.g., < to &lt;). Takes a string and returns the escaped version.

Example
{{ '<p>This will be escaped.</p>' | escape }}

Escapes HTML special characters in a string but does not double-escape already escaped characters. Takes a string and returns the escaped version.

Example
{{ "&lt;p&gt;This is already escaped.&lt;/p&gt;" | escape }}

Converts a string to a hyphenated lowercase handle, often used in URLs.

Example
{{ product.name | handleize }} # My Product => my-product

Removes leading whitespace from a string. Takes a string and returns it with no whitespace at the start.

Example
{{ "    Space on the left will be stripped." | lstrip }}

Replaces newline characters (\n) with HTML <br> tags. Takes a string and returns it with newlines converted.

Example
{{ product.description | newline_to_br }}

Prefixes a string with another string. Takes a string as input and returns the combined result.

Example
{{ '/products' | prepend: request.origin }}

Removes all occurrences of a substring from a string. Takes a string and substring, returning the string with all matches removed.

Example
{{ 'one two three' | remove: 'three' }}

Removes the first occurrence of a substring from a string. Takes a string and substring, returning the string with the first match removed.

Example
{{ 'There is a very nice piece in a very beautiful place.' | remove_first: 'very' }}

Removes the last occurrence of a substring from a string. Takes a string and substring, returning the string with the last match removed.

Example
{{ 'There is a very nice piece in a very beautiful place.' | remove_last: 'very' }}

Replaces all occurrences of a substring with another string. Takes a string, the substring to replace, and the replacement string, returning the modified string.

Example
{{ product.slug | replace: '-', ' ' }}

Replaces the first occurrence of a substring with another string. Takes a string, the substring to replace, and the replacement string, returning the modified string.

Example
{{ product.slug | replace_first: '-', ' ' }}

Replaces the last occurrence of a substring with another string. Takes a string, the substring to replace, and the replacement string, returning the modified string.

Example
{{ product.slug | replace_last: '-', ' ' }}

Removes trailing whitespace from a string. Takes a string and returns it with no whitespace at the end.

Example
{{ "Space on the right will be stripped.    " | rstrip }}

Extracts a substring from a string based on index and optional length. Takes a string, start index, and optional length, returning the extracted portion.

Example
{{ '/products' | slice: 1 }} # 'products'

{{ '/products' | slice: 0, 1 }} # '/'

Divides a string into an array based on a delimiter. Takes a string and delimiter, returning an array of substrings.

Example
{{ 'one two three' | split: ' ' }}

Removes leading and trailing whitespace from a string. Takes a string and returns it with whitespace removed from both ends.

Example
{{ "    Space on both sides will be stripped.    " | strip }}

Removes HTML tags from a string, leaving only the text content. Takes a string and returns it without HTML tags.

Example
{{ product.description | strip_html }}

Removes all newline characters (\n) from a string. Takes a string and returns it with newlines removed.

Example
{{ product.description | strip_newlines }}

Shortens a string to a specified length, appending an ellipsis (...) if truncated. Takes a string, length, and optional ellipsis string, returning the truncated result.

Example
{{ product.description | truncate: 40 }}

A second parameter can be used to specify a custom ellipsis, or an empty string for no ellipsis.

Example
{{ product.description | truncate: 40, '))' }}

{{ product.description | truncate: 40, '' }}

Shortens a string to a specified number of words, appending an ellipsis (...) if truncated. Takes a string, word count, and optional ellipsis string, returning the truncated result. Note: HTML tags are treated as words.

Example
{{ product.description | strip_html | truncatewords: 40 }}

A second parameter can be used to specify a custom ellipsis, or an empty string for no ellipsis.

Example
{{ product.description | strip_html | truncatewords: 40, '))' }}

{{ product.description | strip_html | truncatewords: 40, '' }}

Converts a string to uppercase. Takes a string and returns the uppercase result.

Example
{{ product.name | upcase }}

Decodes a URL-encoded string, converting percent-encoded characters back to their original form. Takes a string and returns the decoded version.

Example
{{ 'user%40example.com' | url_decode }} # user@example.com

Encodes a string for safe use in URLs, converting special characters to percent-encoded format. Takes a string and returns the encoded version.

Example
{{ 'user@example.com' | url_decode }} # user%40example.com

Escapes a string for use in URLs, similar to url_encode, ensuring special characters are properly encoded. Takes a string and returns the escaped version.

Example
{{ '<p>This will become URL safe.</p>' | url_escape }}

Filters implemented strictly to enable compatibility with Shopify themes.


Generates a URL for a globally accessible Shopify asset.

  • option_selection.js
  • api.jquery.js
  • shopify_common.js
  • customer_area.js
  • currencies.js
  • customer.css
Example
{{ 'option_selection.js' | shopify_asset_url }}

Objects represent Swell data that are used to render output in theme templates. This reference describes Liquid objects that are accessible in storefront apps using Swell Liquid for themes, however individual storefront apps like Proxima may differ in how objects or named, or on which pages that are accessible. Refer to documentation on your chosen storefront app for those details.

Model and fields references

The Liquid objects in this guide refer to models and fields that coincide directly with Swell's Backend API. To find descriptions of various object properties listed here, see to the equivalent field in our backend API documentation.

Shopify compatibility

For Shopify themes, this guide will refer to both the Swell object structure and its Shopify equivalent object name, if applicable. Note that when a theme is rendered in Shopify compatibility mode, both Swell object properties, as described here, and Shopify object properties are available at the same time.


Represents the logged-in customer account.

Model: account

Shopify equivalent: customer

Properties

  • addresses (collection<account_address>): Collection of addresses associated with account.
  • balance (number): Current balance of account.
  • billing (account_billing): Billing information for account.
  • cards (collection<account_card>): Collection of payment cards linked to account.
  • content (content_object): Content object associated with account.
  • date_created (date): Date account was created.
  • date_first_order (date): Date of account's first order.
  • date_last_order (date): Date of account's last order.
  • email (string): Email address of account holder.
  • email_optin (boolean): Indicates whether account holder has opted into email communications.
  • first_name (string): First name of account holder.
  • group (string): Group or category account belongs to.
  • id (string): Unique identifier for account.
  • last_name (string): Last name of account holder.
  • metadata (object): Additional metadata associated with account.
  • name (string): Full name of account holder, combining first and last names.
  • order_count (date): Number of orders placed by account.
  • order_value (number): Total value of orders placed by account.
  • orders (collection<order>): Collection of orders associated with account.
  • phone (string): Phone number associated with account.
  • shipping (account_address): Shipping address for account.
  • subscriptions (collection<subscription>): Collection of subscriptions linked to account.
  • type (string): Type or classification of account.
  • vat_number (string): VAT number associated with account, if applicable.

Returned by

  • Global


Represents a customer’s shipping or billing address.

Model: account address

Shopify equivalent: address

Properties

  • address1 (string): Primary street address.
  • address2 (string): Secondary street address, such as an apartment or suite number.
  • city (string): City of the address.
  • company (string): Company name associated with the address, if applicable.
  • country (string): Country of the address.
  • first_name (string): First name of the contact.
  • id (string): Unique identifier for the address.
  • last_name (string): Last name of the contact.
  • name (string): Full name of the contact, combining first and last names.
  • phone (string): Phone number associated with the address.
  • state (string): State or province of the address.
  • zip (string): Postal or ZIP code of the address.

Returned by

  • account.addresses[]
  • account.shipping
  • account.billing
  • order.shipping
  • order.billing
  • subscription.shipping
  • subscription.billing


Represents a customer's default billing details.

Model: account.billing

Properties

  • account_card_id (string): The ID of the payment card associated with the billing address.
  • address1 (string): The primary street address for billing.
  • address2 (string): The secondary street address for billing, such as an apartment or suite number.
  • card (account_card): The payment card object linked to the billing address.
  • city (string): The city of the billing address.
  • company (string): The company name associated with the billing address, if applicable.
  • country (string): The country of the billing address.
  • first_name (string): The first name of the billing contact.
  • id (string): The unique identifier for the billing address.
  • last_name (string): The last name of the billing contact.
  • method (string): The payment method type used for billing, such as credit card or PayPal.
  • name (string): The full name of the billing contact, combining first and last names.
  • phone (string): The phone number associated with the billing address.
  • state (string): The state or province of the billing address.
  • zip (string): The postal or ZIP code of the billing address.

Returned by

  • account.billing


Represents a customer's credit card on file.

Model: account.cards

Properties

  • address_check (string): Address verification check result for payment card.
  • brand (string): Brand of the payment card, for example visa or mastercard.
  • cvc_check (string): CVC verification check result for payment card.
  • display_brand (string): Display-friendly version of the payment card brand.
  • exp_month (number): Expiration month of the payment card.
  • exp_year (number): Expiration year of the payment card.
  • gateway (string): Payment gateway used for the card transaction.
  • id (string): Unique identifier for the payment card.
  • last4 (string): Last four digits of the payment card number.
  • token (string): Token representing the payment card for secure transactions.
  • zip_check (string): ZIP code verification check result for payment card.

Returned by

  • account.cards[]
  • cart.billing.card
  • order.billing.card
  • subscription.billing.card


Generates HTML <option> tags for all available countries in a dropdown. Output should be wrapped in a <select> tag.

Shopify equivalent: all_country_option_tags

Example
<select name="country">
  {{ all_country_option_tags }}
</select>


Represents the user which authored a blog.

Properties

  • email (string): Email address of the author.
  • name (string): Full name of the author.
  • username (string): Username of the author.

Returned by

  • blog.author


Represents a customizable section block in a theme, such as a text or image block.

Shopify equivalent: block

Properties

  • id (string): Unique identifier for the block.
  • settings (object): Configuration settings for the block.
  • type (string): Type of the block, indicating its purpose or layout.

Returned by

  • section.blocks[]


Represents a blog post.

Shopify equivalent: article

Properties

  • author (author): Author object associated with the blog post.
  • author_id (string): ID of the author.
  • category (blog_category): Category object the blog post belongs to.
  • category_id (string): ID of the category.
  • content (string): Main content of the blog post.
  • date_created (date): Date the blog post was created.
  • date_updated (date): Date the blog post was last updated.
  • id (string): Unique identifier for the blog post.
  • image (image): Image object associated with the blog post.
  • meta_title (string): Meta title for SEO purposes.
  • meta_description (string): Meta description for SEO purposes.
  • slug (string): URL-friendly slug of the blog post.
  • summary (string): Brief summary of the blog post.
  • tags (array<string>): Array of tags associated with the blog post.
  • theme_template (string): Alternate template used to render the blog post in a storefront.

Returned by

  • blog_category.blogs[]


Represents a blog category.

Shopify equivalent: blog

Properties

  • blogs (collection<blog>): Collection of blogs associated with the category.
  • id (string): Unique identifier for the category.
  • meta_title (string): Meta title for SEO purposes.
  • meta_description (string): Meta description for SEO purposes.
  • slug (string): URL-friendly slug of the category.
  • title (string): Title of the category.

Returned by

  • blog.category


Returns the canonical URL for the current page, used to avoid duplicate content pages from being indexed by search engines.

Learn more about canonical URLs here.


Represents the customer’s shopping cart.

Model: cart

Shopify equivalent: cart

Properties

  • account_id (string): ID of the account associated with the cart.
  • account_info_saved (boolean): Indicates if account information is is to be saved when the order is submitted.
  • account_logged_in (boolean): Indicates if the account is logged in when placing the order.
  • auth_total (number): Total authorized amount for the cart.
  • billing (cart_billing): Billing information for the cart.
  • capture_total (number): Total captured amount for the cart.
  • checkout_id (string): Unique identifier for the checkout process.
  • checkout_url (string): URL for the checkout page.
  • comments (string): Comments added to the cart.
  • content (content_object): Content object associated with the cart.
  • coupon (coupon): Coupon object applied to the cart.
  • coupon_code (string): Coupon code applied to the cart.
  • coupon_id (string): ID of the applied coupon.
  • currency (string): Currency used for the cart.
  • date_created (date): Date the cart was created.
  • discounts (array<cart_discount>): Array of discount objects applied to the cart.
  • discount_total (number): Total discount amount applied.
  • display_currency (string): Display currency for the cart.
  • display_locale (string): Display locale for the cart.
  • gift (boolean): Indicates if the cart is a gift purchase.
  • gift_message (string): Gift message included with the cart.
  • giftcards (array<cart_giftcards>): Array of gift card objects applied to the cart.
  • giftcard_delivery (boolean): Indicates if the cart contains gift cards to be sent when the order is submitted.
  • giftcard_total (number): Total gift card amount applied as a payment source.
  • grand_total (number): Grand total amount of the cart.
  • guest (boolean): Indicates if the cart is for a guest user.
  • id (string): Unique identifier for the cart.
  • items (array<cart_item>): Array of items in the cart.
  • item_discount (number): Total discount amount for all items.
  • item_quantity (number): Total quantity of all items in the cart.
  • item_shipment_weight (number): Total shipment weight of all items.
  • item_tax (number): Total tax amount for all items.
  • item_tax_included (boolean): Indicates if item tax is included in the price.
  • metadata (metadata_object): Metadata object associated with the cart.
  • order_id (string): ID of the associated order after the cart is converted.
  • payment_intent (object): Payment intent object for the cart, if applicable.
  • promotions (collection<promotion>): Collection of promotion objects applied to the cart.
  • recovered (boolean): Indicates if the was recovered after being abandoned.
  • shipment_delivery (boolean): Indicates if cart contains physical items to be fulfilled when the order is submitted.
  • shipment_price (number): Price of the shipment.
  • shipment_rating (shipment_rating): Shipment rating object for the cart.
  • shipment_tax (number): Tax amount for the shipment.
  • shipment_tax_included (boolean): Indicates if shipment tax is included.
  • shipment_total (number): Total shipment cost.
  • shipping (cart_shipping): Shipping information for the cart.
  • sub_total (number): Subtotal amount of the cart.
  • subscription_delivery (boolean): Indicates if cart contains subscription items to be converted when the order is submitted.
  • taxes (array<cart_tax>): Array of tax objects applied to the cart.
  • tax_included_total (number): Total amount of taxes included with item prices.
  • tax_total (number): Total tax amount applied.

Returned by

  • Global


Represents a customer's billing address applied to the shopping cart.

Model: cart.billing

Properties

  • account_card_id (string): ID of the payment card associated with the billing.
  • address1 (string): Primary street address for billing.
  • address2 (string): Secondary street address for billing, such as an apartment or suite number.
  • card (account_card): Payment card object linked to the billing.
  • city (string): City of the billing address.
  • company (string): Company name associated with the billing, if applicable.
  • country (string): Country of the billing address.
  • default (boolean): Indicates if this is the default billing method.
  • first_name (string): First name of the billing contact.
  • intent (object): Intent object related to the billing process.
  • last_name (string): Last name of the billing contact.
  • method (string): ID of the payment method type used for billing, for example card or account.
  • name (string): Full name of the billing contact, combining first and last names.
  • phone (string): Phone number associated with the billing.
  • province (string): Province or region of the billing address, if applicable.
  • state (string): State of the billing address, used for countries like the US.
  • zip (string): Postal or ZIP code of the billing address.

Returned by

  • cart.billing
  • order.billing
  • subscription.billing


Represents a bundle item as a part of a cart item in the customer's shopping cart.

Model: cart.items.bundle_items

Properties

  • id (string): Unique identifier for the bundle item.
  • options (array<cart_item_option>): Array of product options for the bundle item.
  • product (product): Reference to the product associated with the bundle item.
  • product_id (string): ID of the product in the bundle.
  • quantity (number): Quantity of the item in the bundle.
  • variant (variant): Reference to the variant associated with the bundle item, if applicable.
  • variant_id (string): ID of the variant in the bundle, if applicable.

Returned by

  • cart_item.bundle_items[]


Represents a customer's billing address applied to the shopping cart.

Model: cart.discounts

Properties

  • amount (number): Amount of the discount applied.
  • id (string): Unique identifier for the discount.
  • rule (object): Rule object defining the discount conditions.
  • source_id (string): ID of the source applying the discount.
  • type (string): Type of the discount, percent or fixed.

Returned by

  • cart.discounts
  • order.discounts
  • subscription.discounts


Represents one or more gift cards used as payment sources on the customer's shopping cart.

Model: cart.giftcards

Properties

  • amount (number): Amount of the gift card value applied.
  • code (string): Code of the gift card.
  • code_formatted (string): Formatted version of the gift card code.
  • id (string): Unique identifier for the gift card.
  • las4 (string): Last four digits of the gift card number.

Returned by

  • cart.giftcards
  • order.giftcards


Represents line item within the customer’s shopping cart.

Model: cart.items

Properties

  • bundle_items (array<cart_bundle_item>): Array of bundle items as a part of the item, if applicable.
  • discount_each (number): Discount amount per unit of the cart item.
  • discount_total (number): Total discount amount for the cart item.
  • id (string): Unique identifier for the cart item.
  • metadata (object): Metadata object associated with the cart item.
  • options (array<cart_item_option>): Array of options applied to the cart item, relative to the selected product and variant.
  • orig_price (number): Original price of the cart item before any manual modifications.
  • price (number): Current price of the cart item.
  • price_total (number): Total price for the cart item based on quantity.
  • purchase_option (cart_purchase_option): Purchase option selected for the cart item.
  • product (product): Reference to the product associated with the cart item.
  • quantity (number): Quantity of the cart item.
  • shipment_weight (number): Shipment weight of the cart item, if applicable.
  • taxes (array<cart_item_tax>): Array of tax lines applied to the cart item.
  • tax_each (number): Tax amount per unit of the cart item.
  • tax_total (number): Total tax amount for the cart item.
  • variant (product_variant): Reference to the variant associated with the cart item.

Returned by

  • cart.items[]


Represents an option applied to a line item in the customer's shopping cart. Variants are resolved using these values if a variant_id is not assigned directly.

Model: cart.items.options

Properties

  • name (string): Name of the option for the cart item.
  • id (string): Unique identifier for the option.
  • price (number): Price adjustment associated with the option.
  • shipment_weight (number): Shipment weight adjustment for the option.
  • value (string): Value of the option.
  • value_id (string): ID of the option value relative to the product option.
  • variant (boolean): Indicates if the option is a variant.

Returned by

  • cart.items.options
  • order.items.options
  • subscription.items.options

Gift card item options

If the item is a gift card, the application may indicate special options to affect the gift card recipient and an optional note.

Option to send to a specific recipient email

  • id: 'send_email'
  • value: 'recipient@example.com'

Option to send to a gift note

  • id: 'send_note'
  • value: 'For your special day!'


Represents a single tax line applied to an item in the customer's shopping cart.

Model: cart.items.taxes

Properties

  • amount (number): Amount of tax applied to the cart item.
  • id (string): Unique identifier for the applied tax.

Returned by

  • cart_item.taxes[]


Represents a chosen purchase option for an item within the customer's shopping cart, either a standard purchase or subscription.

Model: cart.items.purchase_option

Shopify equivalent: selling_plan

Properties

  • auth_amount (number): Pre-authorized amount for the purchase option, if applicable
  • billing_schedule (purchase_option_schedule): Billing schedule for subscriptions
  • id (string): Unique identifier for the purchase option.
  • name (string): Descriptive name of the purchase option.
  • order_schedule (purchase_option_schedule): Order schedule for subscriptions
  • plan_id (string): ID of the associated product purchase optionplan.
  • plan_description (string): Description of the associated plan.
  • plan_name (string): Descriptive name of the associated plan.
  • price (number): Price of the purchase option.
  • type (string): Type of the purchase option, either standard or subscription.

Returned by

  • cart.items.purchase_option
  • order.items.purchase_option
  • subscription.items.purchase_option


Properties

  • account_address_id (string): ID of the account address applied to the cart.
  • account_address (account_address): Reference to the account address record.
  • address1 (string): Primary street address.
  • address2 (string): Secondary street address, such as an apartment or suite number.
  • city (string): City of the address.
  • company (string): Company name associated with the address, if applicable.
  • country (string): Country of the address.
  • default (boolean): Indicates whether the shipping address was set as the default for the account.
  • first_name (string): First name of the contact.
  • id (string): Unique identifier for the address.
  • last_name (string): Last name of the contact.
  • name (string): Full name of the contact, combining first and last names.
  • phone (string): Phone number associated with the address.
  • pickup (boolean): Indicates the order is to be fulfilled at a physical pickup location.
  • price (number): Price of the selected shipping service.
  • service: (string): ID of the selected shipping service.
  • service_name (string): Name of the selected shipping service
  • state (string): State or province of the address.
  • zip (string): Postal or ZIP code of the address.

Returned by

  • cart.shipping
  • order.shipping
  • subscription.shipping


Represents a tax line applied to the customer's shopping cart.

Model: cart.taxes

Properties

  • amount (number): Amount of the tax applied.
  • id (string): Unique identifier for the tax.
  • name (string): Name of the tax.
  • priority (number): Priority level of the tax application.
  • rate (number): Rate of the tax as a decimal.
  • shipping (boolean): Indicates if the tax applies to shipping costs.

Returned by

  • cart.taxes
  • order.taxes
  • subscription.taxes


Represents a product category.

Model: category

Shopify equivalent: collection

Properties

  • children (collection<category>): Collection of child categories.
  • content (content_object): Content object associated with the category.
  • description (string): Description of the category.
  • id (string): Unique identifier for the category.
  • image (image): Primary image associated with the category.
  • images (array<image>): Array of secondary images associated with the category.
  • meta_description (string): Meta description for SEO purposes.
  • meta_title (string): Meta title for SEO purposes.
  • name (string): Name of the category.
  • parent (category): Reference to the parent category.
  • parent_id (string): ID of the parent category.
  • products (collection<product>): Collection of products in the category.
  • slug (string): URL-friendly slug of the category.
  • sort (string): Sort position for the category in a collection, ascending.
  • theme_template (string): Alternate template used to render the category in a storefront.
  • top (category): Reference to the top-level category.
  • top_id (string): ID of the top-level category.


Represents a color setting value. Returns a hexidecimal color code when rendered directly.

Shopify equivalent: color

Returned by

Example
{{ settings.color_primary }}


Represents a color scheme setting value. Returns the scheme ID when rendered directly.

Shopify equivalent: color_scheme

Returned by

Example
{{ settings.color_accent_scheme }}


Represents a color scheme group setting value. Used output all color schemes to CSS rules.

Shopify equivalent: color_scheme_group

Returned by

  • settings.color_schemes

Example
{% for scheme in settings.color_schemes %}
  .color-scheme-{{ scheme.id }} {
    --color-text: {{ scheme.settings.text }};
    --color-background: {{ scheme.settings.background }};
  }
{% endfor %}


Injects necessary scripts and meta tags into the HTML <head> of a page. Automatically populated by the platform for essential functionality.

Returned by

  • Global

Example
<html>
  <head>
    {{ content_for_header }}
  </head>
  ...
</html>


Renders the main content of a template, excluding the layout file’s wrapper. Used within layout files to insert page-specific content.

Returned by

  • Global

Example
<html>
  ...
  <body>
    {{ content_for_layout }}
  </body>
  ...
</html>


Represents a content model defined in the store either manually, or as installed by a Swell App.

Model: content

Shopify equivalent: metaobject

Properties

  • collection (string): API name of the collection representing the content model, for example reviews.
  • date_created (date): Date the content model was created.
  • date_updated (date): Date the content model was last updated.
  • fields (array<object>): Array of field definitions for the content model.
  • id (string): Unique identifier for the content model.
  • label (string): Label or display name of the content model entries.
  • name (string): Name of the content model itself.


Represents content field values present on another object. For example, product.content contains values in accordance with custom or app-defined fields applied to the product model.

Returned by

  • account.content
  • cart.content
  • order.content
  • subscription.content

Example
{{ product.content.my_content_field }}


Generates HTML <option> tags for all available countries in a dropdown. Output should be wrapped in a <select> tag. Note: this is an alias for all_country_option_tags.

Shopify equivalent: country_option_tags

Returned by

  • Global

Example
<select name="country">
  {{ all_country_option_tags }}
</select>


Represents a coupon applied to the customer's shopping cart.

Model: coupon

Properties

  • content (content_object): Content object associated with the coupon.
  • description (string): Description of the coupon.
  • id (string): Unique identifier for the coupon.
  • name (string): Name of the coupon, representing the coupon code if the coupon only has one code.

Returned by

  • cart.coupon
  • order.coupon
  • subscription.coupon


Returns the current page number for paginated content, such as products and search results.

Shopify equivalent: current_page

Returned by

  • Global

Example
Page: {{ current_page }}


Represents a file stored by another object, such as a content model value representing an attached document. If the file is an image, it will also have width and length properties.

Model: file

Shopify equivalent: generic_file

Properties

  • content_type (string): MIME type of the file.
  • date_created (date): Date the file was created.
  • filename (string): Name of the file in the filesystem.
  • height (number): Height of the file in pixels, if applicable.
  • id (string): Unique identifier for the file.
  • length (number): Size of the file in bytes.
  • md5 (string): MD5 hash of the file for integrity verification.
  • url (string): URL where the file can be accessed.
  • width (number): Width of the file in pixels, if applicable.

Returned by

  • image.file


Represents a font setting value. Used to apply font setting values in theme CSS styles.

Shopify equivalent: font

Properties

  • fallback_families (string): Fallback font families as a string.
  • family (string): Primary font family name.
  • style (string): Style of the font, for example normal or italic.
  • system (boolean): Indicates if the font is a system font.
  • variants (array<font>): Array of font variant objects.
  • weight (number): Weight of the font, for example 400 or 700.

Returned by

Example
{% style %}
  --font-body-family: {{ settings.body_font.family }}, {{ settings.body_font.fallback_families }};
  --font-body-style: {{ settings.body_font.style }};
  --font-body-weight: {{ settings.body_font.weight }};
{% endstyle %}


Provides metadata about a for loop, such as iteration status.

Shopify equivalent: forloop

Properties

  • first (boolean): Indicates if the current iteration is the first one.
  • index (number): 1-based index of the current iteration.
  • index0 (number): 0-based index of the current iteration.
  • last (boolean): Indicates if the current iteration is the last one.
  • length (number): Total number of iterations.
  • parentloop (forloop): Parent forloop object if nested.
  • rindex (number): 1-based index in reverse order.
  • rindex0 (number): 0-based index in reverse order.

Returned by

Example
{% for product in products -%}
  {%- if forloop.length > 0 -%}
    {{ product.name }}{% unless forloop.last %}, {% endunless -%}
  {%- endif -%}
{% endfor %}


Represents an HTML form for user input, such as login or checkout forms. Each form may provide different properties represented in the form object. See the form tag for more details.

Properties

  • errors (array<form_error>): Array of error objects for the form, if any.
  • params (object): Parameters submitted with the form.
  • success (boolean): Indicates if the form submission was successful.

Returned by

Example
{% form 'account_subscribe' %}
  {% if form.success %}
    You have been subscribed to our newsletter.
  {% elsif form.errors %}
    Something went wrong.
  {% endif %}
{% endform %}


Represents an error that occurred while processing a form submission.

Properties

  • code (string): Error code associated with the form error.
  • field_label (string): Label of the field where the error occurred.
  • field_name (string): Name of the field where the error occurred.
  • message (string): Detailed message describing the error.

Returned by

  • form.errors


Represents an image including its caption and reference to the image file.

Shopify equivalent: image

Properties

  • caption (string): Caption to use as alt-text on the image.
  • file (file): File used as the product image.
  • id (string): Unique identifier of the product image.

Returned by

  • blog.image
  • category.image
  • category.images[]
  • product.images[]
  • product_variant.images[]


Represents all navigation menu configured for the storefront in the Swell dashboard. Menus may have any number of nested items supported by the theme, and can be accessed directly using their ID.

Shopify equivalent: linklists

Returned by

  • Global

Example
<!-- Main menu -->
{% for link in menus.main_menu.items -%}
  {{ item.name | link_to: item.url }}
{%- endfor %}

<!-- Footer menu -->
{% for link in menus.footer_menu.items -%}
  {{ item.name | link_to: item.url }}
{%- endfor %}


Represents an individual navigation menu configured for the storefront in the Swell dashboard.

Shopify equivalent: linklist

Properties

  • id (string): Unique identifier for the menu.
  • items (array<menu_item>): Array of menu item objects.
  • name (string): Name of the menu to display in the storefront.

Returned by

  • menus


Represents a navigation menu item.

Shopify equivalent: link

Properties

  • active (boolean): Indicates if the menu item is active.
  • child_active (boolean): Indicates if any child item is active.
  • child_current (boolean): Indicates if any child item is the current page.
  • current (boolean): Indicates if the menu item is the current page.
  • items (array<menu_item>): Array of nested menu item objects.
  • levels (number): Number of nesting levels for the menu item.
  • name (string): Name of the menu item.
  • resource (mixed): Resource associated with the menu item.
  • type (string): Type of the menu item.
  • url (string): URL linked to the menu item.

Returned by

  • menu.items[]


Represents metadata values applied via API to an account, cart, order or subscription.

Returned by

  • account.metadata
  • cart.metadata
  • order.metadata
  • subscription.metadata

Example
{{ order.metadata.my_meta_field }}


Represents a customer order.

Model: order

Shopify equivalent: order

Properties

  • account_credit_amount (number): Total account credit available.
  • account_credit_applied (number): Amount of account credit applied to the order.
  • account_id (string): ID of the account that placed the order.
  • account_info_saved (boolean): Indicates if account information is is to be saved when the order is updated.
  • account_logged_in (boolean): Indicates if the account is logged in when placing the order.
  • authorized_payment_id (string): Unique identifier of the authorized payment, if applicable.
  • billing (cart_billing): Customer billing information for the order.
  • canceled (boolean): Indicates if the order is canceled.
  • comments (string): Comments added to the order.
  • content (content_object): Content object associated with the order.
  • coupon (coupon): Coupon object applied to the order.
  • coupon_code (string): Coupon code applied to the cart.
  • coupon_id (string): Unique identifier of the applied coupon.
  • currency (string): Currency used for the order.
  • date_created (date): Date the order was created.
  • delivered (boolean): Indicates if the order is delivered.
  • discounts (array<cart_discount>): Array of discount objects applied to the order.
  • discount_total (number): Total discount amount applied.
  • gift (boolean): Indicates if the order is a gift purchase.
  • gift_message (string): Gift message included with the order.
  • giftcards (array<cart_giftcard>): Array of gift card objects applied to the order.
  • giftcard_delivery (boolean): Indicates if order contains gift cards items to be sent when submitted.
  • giftcard_total (number): Total gift card amount applied.
  • grand_total (number): Grand total amount of the order.
  • guest (boolean): Indicates if the order is for a guest user.
  • id (string): Unique identifier for the order.
  • items (array<cart_item>): Array of items in the order.
  • item_discount (number): Total discount amount for items.
  • item_quantity (number): Total quantity of items in the order.
  • item_quantity_cancelable (number): Quantity of items eligible for cancellation.
  • item_quantity_canceled (number): Quantity of items canceled.
  • item_quantity_deliverable (number): Quantity of items eligible for delivery.
  • item_quantity_delivered (number): Quantity of items delivered.
  • item_quantity_returnable (number): Quantity of items eligible for return.
  • item_quantity_returned (number): Quantity of items returned.
  • item_shipment_weight (number): Total shipment weight of items.
  • item_tax (number): Total tax amount for items.
  • item_tax_included (boolean): Indicates if item tax is included in the price.
  • metadata (metadata_object): Metadata object associated with the order.
  • number (string): Order number for reference.
  • paid (boolean): Indicates if the order is paid.
  • payments (collection<payment>): Collection of payment objects for the order.
  • payment_balance (number): Remaining balance to be paid.
  • payment_intent (object): Payment intent object for the order, if applicable.
  • payment_total (number): Total payment amount received.
  • promotions (collection<promotion>): Collection of promotion objects applied to the order.
  • refunds (collection<refund>): Collection of refund objects for the order.
  • refund_total (number): Total amount of refunds for the order.
  • returns (collection<return>): Collection of return objects for the order.
  • shipments (collection<shipment>): Collection of shipment objects for the order.
  • shipment_delivery (boolean): Indicates if order contains subscription items to be converted when submitted.
  • shipment_discount (number): Discount amount applied to shipment.
  • shipment_price (number): Price of the shipment.
  • shipment_rating (shipment_rating): Shipment rating object for the order.
  • shipment_tax (number): Tax amount for the shipment.
  • shipment_tax_included (boolean): Indicates if shipment tax is included.
  • shipment_total (number): Total shipment cost.
  • shipping (cart_shipping): Customer shipping information for the order.
  • status (string): Status of the order, for example pending or completed.
  • sub_total (number): Subtotal amount of the order.
  • subscription_delivery (boolean): Indicates if order contains subscription items to be converted when submitted.
  • taxes (array<cart_tax>): Array of tax objects applied to the order.
  • tax_included_total (number): Total amount including tax.
  • tax_total (number): Total tax amount applied.

Returned by

  • account.orders[]


Represents a static page in the store, such as an “About Us” page.

Shopify equivalent: page

Properties

  • content (string)
  • date_created (date)
  • date_updated (date)
  • id (string)
  • meta_title (string)
  • meta_description (string)
  • slug (string)
  • theme_template (string): Alternate template used to render the page in a storefront.


Returns the meta description for a page, used for search engine listings and social media previews. Falls back to a truncated version of the page content if not set.

Returned by

  • Global

Example
<html>
  <head>
    <meta name="description" content="{{ page_description }}">
  </head>
  ...
</html>


Returns the title of the current page, used for search engine listings and social media previews.

Returned by

  • Global

Example
<html>
  <head>
    <title>{{ page_title }}</title>
  </head>
  ...
</html>


Provides details about pagination inside of paginate tags.

Shopify equivalent: paginate

Properties

  • count (number): Total number of items in the paginated collection.
  • limit (number): Maximum number of items per page.
  • next (paginate_page): Next page object in the pagination sequence.
  • page (number): Current page number.
  • pages (array<paginate_page>): Array of page objects for all pages.
  • page_count (number): Total number of pages.
  • previous (paginate_page): Previous page object in the pagination sequence.

Returned by


Represents a page target within a pagination object, with numbers indexing the start and end of items on the page, and a URL to navigate to the page.

Properties

  • end (number): Ending index of items on the page.
  • start (number): Starting index of items on the page.
  • url (string): URL for the page.

Returned by

  • paginate.next
  • paginate.pages
  • paginate.previous


Represents a payment made by a customer, applied to an order or subscription.

Model: payment

Properties

  • amount (number): Amount of the payment.
  • amount_refundable (number): Amount eligible for refund.
  • authorized (boolean): Indicates if the payment was pre-authorized.
  • captured (boolean): Indicates if the payment was captured.
  • card (account_card): Card object associated with the payment.
  • currency (string): Currency of the payment.
  • date_created (date): Date the payment was created.
  • gateway (string): Payment gateway used for the transaction.
  • id (string): Unique identifier for the payment.
  • method (string): Payment method used, for example card or account.
  • number (string): Payment transaction number.
  • status (string): Status of the payment, for example pending or success.
  • success (boolean): Indicates if the payment was successful.

Returned by

  • order.payments[]
  • subscription.payments[]


Represents a single product in the store.

Model: product

Shopify equivalent: product

Properties

  • attributes (object): Attributes associated with the product.
  • categories (collection<category>): Collection of categories the product belongs to.
  • cross_sells (array<product_cross_sell>): Array of cross-sell products.
  • currency (string): Currency used for the product price.
  • description (string): Description of the product.
  • bundle (boolean): Indicates if the product is a bundle of other products.
  • bundle_items (array<product_bundle_item>): Array of bundle items included in the product.
  • id (string): Unique identifier for the product.
  • images (array<image>): Array of images associated with the product.
  • meta_description (string): Meta description for SEO purposes.
  • meta_title (string): Meta title for SEO purposes.
  • name (string): Name of the product.
  • options (array<product_option>): Array of option objects for the product.
  • price (number): Base price of the product.
  • prices (array<product_price>): Array of price variations for the product.
  • purchase_options (purchase_options): Purchase options available for the product.
  • sale (boolean): Indicates if the product is on sale.
  • sku (string): Stock Keeping Unit for the product.
  • slug (string): URL-friendly slug of the product.
  • stock_level (number): Current stock level of the product.
  • stock_purchasable (boolean): Indicates if the product is purchasable based on stock.
  • stock_status (string): Status of the product stock, for example in_stock or out_of_stock.
  • stock_tracking (boolean): Indicates if stock is tracked for the product.
  • tags (array<string>): Array of tags associated with the product.
  • theme_template (string): Alternate template used to render the product in a storefront.
  • up_sells (array<product_up_sell>): Array of up-sell product objects.
  • variants (collection<product_variant>): Collection of variant objects for the product.

Scopes

  • category.products[]


Represents an item as part of a bundle product.

Model: product.bundle_items

Properties

  • id (string): Unique identifier for the bundle item.
  • product (product): Product object associated with the bundle item.
  • product_id (string): Unique identifier of the product.
  • product_name (string): Name of the product in the bundle.
  • quantity (number): Quantity of the bundle item.
  • variant (product_variant): Variant object associated with the bundle item.
  • variant_id (string): Unique identifier of the variant.

Returned by

  • product.bundle_items[]


Represents a cross-sell relationship between products, including an optional discount for offers that combine complementary items. Cross-sells are used to make additional offers when an item is added to the shopping cart.

Model: product.cross_sells

Properties

  • id (string): Unique identifier for the cross-sell item.
  • discount_amount (number): Discount amount applied to the cross-sell, if applicable.
  • discount_percent (number): Discount percentage applied to the cross-sell, if applicable.
  • discount_type (string): Type of discount, fixed or percent.
  • product (product): Product object for the cross-sell item.
  • product_id (string): Unique identifier of the cross-sell product.

Returned by

  • product.cross_sells[]


Represents an individual product option, such as "size" or "color". Options may represent variant attributes which correlate to product_variant objects, or non-variant options. May also represent a subscription purchase option.

Model: product.options

Shopify equivalent: product_option

Properties

  • active (boolean): Indicates if the option is active.
  • attribute_id (string): Unique identifier of the associated attribute.
  • description (string): Description of the option.
  • id (string): Unique identifier for the option.
  • input_type (string): Type of input field, for example text or select.
  • input_multi (boolean): Indicates if multiple values can be selected.
  • input_hint (string): Hint text for the input field.
  • name (string): Name of the option.
  • parent_id (string): Unique identifier of the parent option, if applicable.
  • parent_value_ids (array<string>): Array of parent value identifiers.
  • price (number): Price adjustment associated with the option.
  • required (boolean): Indicates if the option is required.
  • subscription (boolean): Indicates if the option is for a subscription purchase option.
  • values (array<product_option_value>): Array of value objects for the option.
  • variant (boolean): Indicates if the option defines a variant.

Returned by

  • product.options[]


Represents an individual value of a product option for multiple-select options such as "blue" for color. May also represent a subscription option such as "monthly".

Model: product.options.values

Shopify equivalent: product_option_value

Properties

  • description (string): Description of the option value.
  • id (string): Unique identifier for the option value.
  • name (string): Name of the option value.
  • price (currency): Price associated with the option value.
  • shipment_weight (number): Shipment weight adjustment for the option value, if applicable.
  • subscription_interval (string): Interval period for subscription, for example monthly or yearly, if applicable.
  • subscription_interval_count (number): Number of intervals for the subscription, if applicable.
  • subscription_trial_days (number): Number of trial days for the subscription, if applicable.

Returned by

  • product_option.values[]


Represents a product price rule, supporting volume and account-specific prices.

Model: product.prices

Properties

  • account_group (string): Account group associated with the price.
  • discount_percent (number): Discount percentage applied to the price.
  • price (number): Price value.
  • quantity_max (number): Maximum quantity for the price tier.
  • quantity_min (number): Minimum quantity for the price tier.

Returned by

  • product.prices[]


Represents an ups-sell relationship between products.. Up-sells are used in product recommendations.

Model: product.up_sells

Properties

  • product (product): Reference to the product in the up-sell relationship.
  • product_id (string): ID of the up-sell product.

Returned by

  • product.up_sells[]


Represents a variation of a product in the store. Products have variants only when variant options are configured.

Model: product variant

Shopify equivalent: variant

Properties

  • attributes (object): Attributes associated with the variant.
  • currency (string): Currency used for the variant price.
  • id (string): Unique identifier for the variant.
  • images (array<image>): Array of images associated with the variant.
  • name (string): Name of the variant.
  • option_value_ids (array<string>): Array of option value identifiers.
  • price (number): Price of the variant.
  • prices (array<product_price>): Array of price variations for the variant.
  • purchase_options (purchase_options): Purchase options available for the variant.
  • sku (string): Stock Keeping Unit for the variant.
  • stock_level (number): Current stock level of the variant.

Returned by

  • product.variants[]


Represents a promotion applied to the customer's shopping cart.

Model: promotions

Properties

  • content (content_object): Content object associated with promotion.
  • date_end (date): End date of the promotion.
  • date_start (date): Start date of the promotion.
  • description (string): Description of the promotion.
  • id (string): ID of the promotion.
  • name (string): Name of the promotion.

Returned by

  • cart.promotions[]
  • order.promotions[]


Represents the purchase options available for a product, such as standard meaning one-time purchase, and subscription.

Model: product.purchase_options

Properties

Returned by

  • product.purchase_options


Represents a standard product purchase option.

Model: product.purchase_options.standard

Properties

  • description (string): Description of the standard purchase option.
  • id (string): Unique identifier for the purchase option.
  • name (string): Name of the standard purchase option.
  • price (number): Base price of the purchase option.
  • prices (array<product_price>): Array of price variations for the purchase option.
  • sale (boolean): Indicates if the purchase option is on sale.
  • sale_price (number): Sale price of the purchase option, if applicable.

Returned by

  • purchase_options.standard


Represents a subscription product purchase option.

Model: product.purchase_options.subscription

Properties

  • description (string): Description of the subscription purchase option.
  • id (string): Unique identifier for the subscription purchase option.
  • name (string): Name of the subscription purchase option.
  • plans (array<purchase_option_subscription_plan>): Array of subscription plan objects.

Returned by

  • purchase_options.subscription


Represents a subscription purchase option plan, such as a monthly or yearly plan.

Model: product.purchase_options.subscription.plans

Properties

  • billing_schedule (purchase_option_schedule): Billing schedule for the subscription plan.
  • description (string): Description of the subscription plan.
  • id (string): Unique identifier for the subscription plan.
  • name (string): Name of the subscription plan.
  • order_schedule (purchase_option_schedule): Order schedule for the subscription plan.
  • price (number): Price of the subscription plan.

Returned by

  • purchase_option_subscription.plans[]


Represents the schedule to trigger billing (payment) and order (fulfillment) of a subscription purchase option in a customer's shopping cart.

Properties

  • interval (string): Interval period for the schedule, daily, weekly, monthly, or yearly.
  • interval_count (number): Number of intervals between occurrences.
  • limit (number): Maximum number of occurrences for the schedule.

Returned by

  • cart_purchase_option.billing_schedule
  • cart_purchase_option.order_schedule
  • purchase_option_subscription_plan.billing_schedule
  • purchase_option_subscription_plan.order_schedule


Represents a payment refund applied to a customer's order or subscription.

Model: payment refund

Properties

  • amount (number): Amount of the refund.
  • card (account_card): Card object associated with the refund.
  • currency (string): Currency of the refund.
  • date_created (date): Date the refund was created.
  • gateway (string): Payment gateway used for the refund, for example stripe.
  • id (string): Unique identifier for the refund.
  • method (string): Payment method used for the refund, for example card.
  • number (string): Refund transaction number.
  • status (string): Status of the refund, for example pending or success.
  • success (boolean): Indicates if the refund was successful.
  • canceled (boolean): Indicates if the refund is canceled.

Returned by

  • order.refunds[]
  • subscription.refunds[]


Represents a shipment return authorization for a customer's order.

Model: return

Properties

  • canceled (boolean): Indicates if the return shipment is canceled.
  • destination (shipment_endpoint): Destination endpoint for the return shipment.
  • items (array<shipment_item>): Array of items included in the return shipment.
  • number (string): Return shipment tracking number.
  • origin (shipment_address): Origin address for the return shipment.
  • tracking_code (object): Carrier tracking code for the return shipment.

Returned by

  • order.returns[]


Provides information about the current page request.

Shopify equivalent: request

Properties

  • currency (string): User-selected currency of the request.
  • host (string): Hostname of the request.
  • is_editor (boolean): Indicates if the request is from the Swell Theme editor.
  • is_preview (boolean): Indicates if the request is in preview mode.
  • locale (string): User-selected locale of the request.
  • origin (string): Origin URL of the request.
  • path (string): Path of the request.
  • query (object): Query parameters of the request.

Returned by

  • Global


Provides access to section properties within a section Liquid template.

Shopify equivalent: section

Properties

  • blocks (array<block>): Array of block objects within the section.
  • id (string): Unique identifier for the section.
  • settings (object): Configuration settings for the section.

Returned by

  • Global

Example
{% if settings.enable_floating_cart %}
  {% render 'floating-cart' %}
{% endif %}


Provides access to theme settings defined in the theme editor.

Shopify equivalent: settings

Returned by

  • Global

Example
{% if settings.enable_floating_cart %}
  {% render 'floating-cart' %}
{% endif %}


Represents a physical shipment for a customer's order.

Model: shipment

Properties

  • canceled (boolean): Indicates if the shipment is canceled.
  • carrier (string): ID of the shipping carrier, for example ups or fedex.
  • carrier_name (string): Full name of the shipping carrier.
  • date_estimated (date): Estimated delivery date of the shipment.
  • date_created (date): Date the shipment was created.
  • destination (shipment_address): Destination address for the shipment.
  • items (array<shipment_item>): Array of items included in the shipment.
  • number (string): Shipment tracking number.
  • origin (shipment_endpoint): Origin endpoint for the shipment.
  • service (string): ID of the service used for the shipment.
  • service_name (string): Full name of the shipping service.
  • tracking_code (string): Carrier tracking code for the shipment.

Returned by

  • order.shipments[]


Represents an address for a shipment destination, or return origin.

Model: shipment.destination

Properties

  • address1 (string): Primary street address for the shipment.
  • address2 (string): Secondary street address for the shipment, such as an apartment or suite number.
  • city (string): City of the shipment address.
  • country (string): Country of the shipment address.
  • name (string): Name associated with the shipment address.
  • phone (string): Phone number associated with the shipment address.
  • state (string): State or province of the shipment address.
  • zip (string): Postal or ZIP code of the shipment address.

Returned by

  • return.origin
  • shipment.destination


Represents a location for products to be shipped from, or returned to.

Model: shipment.origin

Properties

  • location (string): ID of the shipment location.

Returned by

  • return.destination
  • shipment.origin


Represents an item to be shipped or returned.

Model: shipment.items

Properties

  • bundle_item_id (string): ID of the bundle item in the order, if applicable
  • id (string): Unique identifier for the shipment item.
  • options (cart_item_option): Options associated with the product in the shipment.
  • order_item_id (string): ID of the order item.
  • product_id (string): ID of the product.
  • product (product): Reference to the product associated with the shipment item.
  • quantity (number): Quantity of the shipment item.
  • variant_id (string): ID of the product variant, if applicable.
  • variant (product_variant): Reference to the variant associated with the shipment item.

Returned by

  • return.items[]
  • shipment.items[]


Represents the shipping services calculated for the customer's shopping cart.

Model: cart.shipment_rating

Properties

  • date_created (date): Date the shipment rating was created.
  • errors (array<shipment_rating_error>): Array of errors that occurred while rating the shipment.
  • md5 (string): Unique identifier of parameters used to calculate the shipment rating.
  • services (array<shipment_rating_service>): Array of shipping services rated for the shipment.

Returned by

  • cart.shipment_rating
  • order.shipment_rating
  • subscription.shipment_rating


Represents an error that that was returned by an external integration when calculating shipment rates.

Model: cart.shipment_rating.errors

Properties

  • code (string): Error code.
  • message (string): Error message.

Returned by

  • shipment_rating.errors[]


Represents a shipment service calculation performed either using Swell shipping rules or by an external integration.

Model: cart.shipment_rating.services

Properties

  • carrier (string): Carrier name for the shipping service.
  • id (string): Unique identifier for the rated service.
  • name (string): Name of the shipping service.
  • pickup (boolean): Indicates if pickup is available.
  • price (number): Price of the shipping service.
  • tax_code (string): Tax code associated with the rating service, if applicable.

Returned by

  • shipment_rating.services[]


Represents the store and its configuration.

Shopify equivalent: shop

Properties

  • country (string): Country where the store is based.
  • currency (string): Default currency of the store.
  • currencies (array<store_currency>): Array of supported store currencies.
  • id (string): Store ID. The first part of the dashboard URL, for example [store.id].swell.store.
  • locale (string): Default locale of the store.
  • locales (array<store_locale>): Array of supported store locales.
  • name (string): Name of the store.
  • public_key (string): Public key for the frontend API.
  • support_email (string): Email address for store support.
  • support_phone (string): Phone number for store support.
  • url (string): URL of the store.

Returned by

  • Global


Represents a configured store currency.

Shopify equivalent: currency

Properties

  • code (string): ISO currency code, for example USD.
  • name (string): Name of the currency, for example United States Dollar.
  • symbol (string): Currency symbol, for example $.

Returned by

  • store.currencies[]


Represents a configured store locale.

Properties

  • code (string): ISO language code, for example en-US.
  • name (string): Name of the locale, for example English.

Returned by

  • store.locales[]


Represents a customer subscription.

Model: subscription

Properties

  • account_id (string): ID of the account that created the subscription.
  • billing (cart_billing): Customer billing information for the subscription.
  • billing_schedule (subscription_schedule): Billing schedule of the subscription.
  • cancel_at_end (boolean): Indicates if the subscription cancels at the end of the period.
  • canceled (boolean): Indicates if the subscription is canceled.
  • content (content_object): Content object associated with the subscription.
  • coupon (coupon): Coupon object applied to the subscription.
  • coupon_code (string): Coupon code applied to the subscription.
  • coupon_id (string): Unique identifier of the applied coupon.
  • currency (string): Currency used for the subscription.
  • date_canceled (date): Date the subscription was canceled.
  • date_created (date): Date the subscription was created.
  • date_order_period_end (date): Date the current order period ends for the subscription.
  • date_paused (date): Date the subscription was paused.
  • date_pause_end (date): Date the subscription pause ends.
  • date_payment_retry (date): Date of the next payment retry attempt.
  • date_period_end (date): Date the current billing period ends.
  • date_period_start (date): Date the current billing period starts.
  • date_trial_end (date): Date the trial period ends.
  • date_trial_start (date): Date the trial period starts.
  • date_updated (date): Date the subscription was last updated.
  • discounts (array<cart_discount>): Array of discount objects applied to the subscription.
  • discount_total (number): Total discount amount applied to the subscription.
  • grand_total (number): Grand total amount of the subscription.
  • id (string): Unique identifier for the subscription.
  • interval (string): Interval period for the subscription, for example monthly or yearly.
  • interval_count (number): Number of intervals between subscription renewals.
  • invoice_total (number): Total amount invoiced for the subscription.
  • items (array<cart_item>): Array of items in the subscription.
  • item_discount (number): Total discount amount for subscription items.
  • item_tax (number): Total tax amount for subscription items.
  • item_total (number): Total cost of items in the subscription.
  • metadata (metadata_object): Metadata object associated with the subscription.
  • number (string): Subscription number for reference.
  • options (array<cart_item_option>): Array of options applied to subscription items.
  • order_id (string): Unique identifier of the associated order.
  • order_schedule (subscription_schedule): Order schedule of the subscription.
  • paid (boolean): Indicates if the subscription is paid.
  • payments (collection<payment>): Collection of payment objects for the subscription.
  • payment_balance (number): Remaining balance to be paid for the subscription.
  • payment_total (number): Total payment amount received for the subscription.
  • price (number): Base price of the subscription.
  • price_total (number): Total price for the subscription based on quantity.
  • product_id (string): Unique identifier of the product associated with the subscription.
  • product (product): Product object associated with the subscription.
  • product_discounts (array<cart_discount>): Array of product-specific discount objects.
  • product_discount_each (number): Discount amount per product unit.
  • product_discount_total (number): Total product discount amount.
  • product_tax_each (number): Tax amount per product unit.
  • product_tax_total (number): Total tax amount for products.
  • quantity (number): Quantity of items in the subscription.
  • recurring_discount_total (number): Total recurring discount amount.
  • recurring_item_discount (number): Recurring discount amount per item.
  • recurring_item_tax (number): Recurring tax amount per item.
  • recurring_item_total (number): Total recurring cost of items.
  • recurring_tax_included_total (number): Total recurring amount including tax.
  • recurring_tax_total (number): Total recurring tax amount.
  • recurring_total (number): Total recurring amount for the subscription.
  • refunds (collection<refund>): Collection of refund objects for the subscription.
  • refund_total (number): Total amount of refunds for the subscription.
  • shipping (cart_shipping): Customer shipping information for the subscription.
  • status (string): Status of the subscription, for example active or paused.
  • sub_total (number): Subtotal amount of the subscription.
  • subscription_delivery (boolean): Indicates if the subscription includes delivery items.
  • taxes (array<cart_tax>): Array of tax objects applied to the subscription.
  • tax_included_total (number): Total amount including tax for the subscription.
  • tax_total (number): Total tax amount applied to the subscription.
  • trial (boolean): Indicates if the subscription is in a trial period.
  • trial_days (number): Number of days in the trial period.
  • unpaid (boolean): Indicates if the subscription has unpaid amounts.
  • variant_id (number): Unique identifier of the variant.
  • variant (product_variant): Variant object associated with the subscription.

Returned by

  • account.subscriptions[]


Represents the billing or order schedule of a subscription.

Model: subscription.billing_schedule

Properties

  • date_limit_end (date): Date the schedule will end based on its limit.
  • interval (string): Interval period for the schedule, daily, weekly, monthly, or yearly.
  • interval_count (number): Number of intervals between occurrences.
  • limit (number): Maximum number of occurrences for the schedule.
  • limit_current (number): Current number of iterations toward the limit.
  • trial_days (number): Number of trial days before the schedule starts iterating.

Returned by

  • subscription.billing_schedule
  • subscription.order_schedule


Provides metadata about a tablerow loop, similar to forloop.

Shopify equivalent: tablerowloop

Properties

  • col (number): 1-based index of the current column.
  • col0 (number): 0-based index of the current column.
  • col_first (boolean): Indicates if the current column is the first one.
  • col_last (boolean): Indicates if the current column is the last one.
  • first (boolean): Indicates if the current iteration is the first one.
  • index (number): 1-based index of the current iteration.
  • index0 (number): 0-based index of the current iteration.
  • last (boolean): Indicates if the current iteration is the last one.
  • length (number): Total number of iterations.
  • parentloop (forloop): Parent tablerowloop object if nested.
  • rindex (number): 1-based index in reverse order.
  • rindex0 (number): 0-based index in reverse order.
  • row (number): 1-based index of the current row.

Returned by


Provides information about the current template being rendered.

Shopify equivalent: template

Properties

  • alt_name (string): Alternate name of the template, if applicable.
  • name (string): Name of the template.
  • path (string): Path of the template within the theme.

Returned by

  • Global