# Swell Liquid

Source: https://developers.swell.is/storefronts/swell-liquid-reference

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

### Why Liquid?

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.

> **Note:** 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.

## Basics

#### Operators and delimiters

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

| Operator | Description |
| --- | --- |
| == | equals |
| != | does not equal |
| > | greater than |
| < | less than |
| >= | greater than or equal to |
| <= | less than or equal to |
| or | matches condition A or B |
| and | matches condition A and B |
| contains | matches 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

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

**Example**

```liquid
{% if account %}
  Hello, {{ account.name }}
{% endif %}
```

##### Filters

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**

```liquid
{{ product.price | money }}
```

##### Whitespace

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**

```liquid
{%- 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**

```liquid
{% assign author = "emmett" -%}
{{ author }}
```

#### Basic tags

##### Control flow

The following are supported conditional tags for output control.

| Tag | Description |
| --- | --- |
| if | render output if conditions match |
| elseif | alternate `if` expression |
| else | render output if no previous conditions match |
| unless | render output if conditions do not match |
| case | switch output between one or more `when` tags |

See the **Conditional** tags section for more details.

##### Iteration

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

| Tag | Description |
| --- | --- |
| for | renders output for every item of an array |
| else | alternate output when `for` has zero length |
| break | stops a `for` loop from iterating |
| continue | causes a `for` loop to skip to the next iteration |
| cycle | renders an output from a list of strings for each `for` loop iteration |
| tablerow | render HTML `<tr>` and `<td> tags for each item in an array |
| paginate | iterates through a collection across multiple pages |

See the **Iteration** tags section for more details.

##### Syntax

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

| Tag | Description |
| --- | --- |
| comment | prevents an expression from being rendered |
| echo | outputs an expression, usable inside `{% liquid %}` tags |
| liquid | a block of Liquid code without individual delimiters |
| raw | ouputs any Liquid code without rendering it |

See the **Syntax** tags section for more details.

##### Variables

| Tag | Description |
| --- | --- |
| assign | creates or overwrites a variable with the assigned value |
| capture | capture a variable value as the expression output |
| decrement | decreases the value of a numeric variable by 1 |
| increment | increases the value of a numeric variable by 1 |

See the **Variable** tags section for more details.


## Tags

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

#### Conditional

Conditional tags control if and when expressions are rendered.

---

##### if

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**

```liquid
{% if condition %}
  expression
{% endif %}
```

- `condition`: The condition to evaluate.
- `expression`: The expression to render when the condition is met.

##### elsif

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**

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

##### else

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**

```liquid
{% else %}
  expression
```

##### unless

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**

```liquid
{% unless condition %}
  expression
{% endunless %}
```

- `condition`: The condition to evaluate.
- `expression`: The expression to render unless the condition is met.

##### case

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**

```liquid
{% 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

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

---

##### form

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](https://developers.swell.is/storefronts/proxima-app), to coincide with their intended functionality. Refer to the app's documentation for specific forms that are available in its environment.

**Syntax**

```liquid
{% 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**

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

##### style

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**

```liquid
{% style %}
  css_rules
{% endstyle %}
```

- `css_rules`: The CSS rules to evaluate at run-time.

#### Iteration

Iteration tags are used to repeatedly evaluate blocks of code.

---

##### for

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

**Syntax**

```liquid
{% 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**

```liquid
{% 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**

```liquid
{% for product in products %}
  Product #{{ forloop.index }}
  {% if forloop.last %}
    There are {{ forloop.length }} products
  {% endif %}
{% endfor %}
```

##### else

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**

```liquid
{% 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.

##### break

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

**Syntax**

```liquid
{% break %}
```

**Example**

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

##### continue

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**

```liquid
{% continue %}
```

**Example**

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

##### cycle

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**

```liquid
{% cycle 'string', 'string', ... %}
```

**Example**

```liquid
{% for num in (1..3) -%}
  {% cycle 'one', 'two', 'three' %}
{% endfor %}
```

##### tablerow

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**

```liquid
{% 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**

```liquid
<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**

```liquid
{% 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.

##### paginate

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**

```liquid
{% 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**

```liquid
{% 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

Syntax tags effect how Liquid is processed and rendered.

---

##### comment

Adds non-rendered text to the code.

**Syntax**

```liquid
{% 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**

```liquid
{% # a single line comment %}

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

Inline comments can also be used inside Liquid tags.

**Example**

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

##### echo

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

**Syntax**

```liquid
{% liquid
  echo expression
%}
```

- `expression`: The expression to be rendered.

##### liquid

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
{% liquid
  expression
%}
```

- `expression`: The expression to be evaluated.

##### raw

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

**Syntax**

```liquid
{% raw %}
  expression
{% endraw %}
```

- `expression`: The expression to output without being evaluated.

#### Theme

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

---

##### include

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**

```liquid
{% include 'component' %}
```

- `file_name`: The name of the component file (snippet) to render, without the `.liquid` extension.

##### javascript

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

**Syntax**

```liquid
{% javascript %}
  code
{% endjavascript %}
```

- `code`: The JavaScript code to be executed at run-time.

##### layout

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

**Syntax**

```liquid
{% layout 'name' %}
```

- `name`: The name of the layout file to use, or `none` for no layout.

##### render

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

**Syntax**

```liquid
{% 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**

```liquid
{% render 'file_name', variable: value %}
```

**Render** **`for`**

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

**Example**

```liquid
{% 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**

```liquid
{% render 'file_name' with object as name %}
```

##### section

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**

```liquid
{% section 'name' %}
```

- `name`: The name of the section file to render.

##### sections

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**

```liquid
{% sections 'name' %}
```

- `name`: The name of the section group file to render.

#### Variable

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

---

##### assign

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**

```liquid
{% assign variable = value %}
```

- `variable`: The name of the variable being created or updated.
- `value`: The value to assign to the variable.

**Example**

```liquid
{% assign product_name = product.name | upcase %}

{{ product_name }}
```

##### capture

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**

```liquid
{% capture variable %}
  value
{% endcapture %}
```

- `variable`: The name of the variable being created or updated.
- `value`: The value to assign to the variable.

##### decrement

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

**Syntax**

```liquid
{% decrement variable %}
```

- `variable`: The name of the variable being decremented.

##### increment

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

**Syntax**

```liquid
{% increment variable %}
```

- `variable`: The name of the variable being incremented.

#### Shopify compatibility

Tags implemented strictly to enable compatibility with Shopify themes.

---

##### stylesheet

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.

> **Warning:** Liquid code is not rendered inside the {% stylesheet %} tag.

**Syntax**

```liquid
{% stylesheet %}
  css_rules
{% endstylesheet %}
```

- `css_rules`: The CSS styles to render for the section, block, or component.


## Filters

Filters are used to modify Liquid output.

#### Array

Array filters are used to modify arrays.

---

##### compact

Removes empty values from an array.

**Example**

```liquid
{{ array | compact }}
```

##### concat

Combines two arrays by concatenating them.

**Example**

```liquid
{{ array1 | concat: array2 }}
```

##### find

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

**Example**

```liquid
{{ array | find: 'property', 'value' }}
```

##### find_exp

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

**Example**

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

##### find_index

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**

```liquid
{{ array | find_index: 'property', 'value' }}
```

##### find_index_exp

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**

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

##### first

Returns the first element of an array.

**Example**

```liquid
{{ array | first }}
```

**Dot notation**

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

**Example**

```liquid
{% assign first_item = array.first %}
```

##### group_by

Groups array items by a common attribute.

**Example**

```liquid
{{ array | group_by: 'property' }}
```

##### group_by_exp

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

**Example**

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

##### has

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

**Example**

```liquid
{{ array | has: 'property', 'value' }}
```

##### has_exp

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**

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

##### join

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

**Example**

```liquid
{{ array | join }}
```

You can also use a custom separator for joined items.

**Example**

```liquid
{{ array | join: ', ' }}
```

##### last

Returns the last element of an array.

**Example**

```liquid
{{ array | last }}
```

**Dot notation**

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

**Example**

```liquid
{% assign last_item = array.last %}
```

##### map

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

**Example**

```liquid
{{ array | map: 'property' }}
```

##### reject

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

**Example**

```liquid
{{ array | reject: 'property', 'value' }}
```

##### reject_exp

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

**Example**

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

##### reverse

Reverses the order of an array.

**Example**

```liquid
{{ array | reverse }}
```

##### size

Returns the number of items in an array.

**Example**

```liquid
{{ array | size }}
```

**Dot notation**

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

**Example**

```liquid
{% assign count = array.size %}
```

##### sort

Sorts elements of an array.

**Example**

```liquid
{{ array | sort }}
```

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

**Example**

```liquid
{{ array | sort: 'property' }}
```

##### sort_natural

Sorts elements of an array in a natural order.

**Example**

```liquid
{{ array | sort_natural }}
```

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

**Example**

```liquid
{{ array | sort_natural: 'property' }}
```

##### sum

Returns the sum of all elements in an array.

**Example**

```liquid
{{ array | sum }}
```

You can also specify a property to sum object values.

**Example**

```liquid
{{ array | sum: 'property' }}
```

##### uniq

Removes duplicate elements from an array.

**Example**

```liquid
{{ array | uniq }}
```

##### where

Filters an array based on a matching attribute value.

**Example**

```liquid
{{ array | where: 'property', 'value' }}
```

#### Asset

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

---

##### asset_url

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**

```liquid
{{ 'main.js' | asset_url }}
```

##### asset_img_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**

```liquid
{{ '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**

```liquid
{{ 'image.png' | asset_img_url: 'large' }}

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

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

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

##### image_tag

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**

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

##### image_url

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**

```liquid
{{ 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**

```liquid
{{ store.locale | image_url }}
```

#### Cart

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

---

##### item_count_for_variant

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**

```liquid
{{ cart | item_count_for_variant: variant_id }}
```

#### Color

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

---

##### brightness_difference

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**

```liquid
{{ '#57349B' | brightness_difference: '#FFE5F8' }}
```

##### color_brightness

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**

```liquid
{{ '#57349B' | color_brightness }}
```

##### color_contrast

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**

```liquid
{{ '#57349B' | color_contrast: '#FFE5F8' }}
```

##### color_darken

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**

```liquid
{{ '#57349B' | color_darken: 25 }}
```

##### color_desaturate

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**

```liquid
{{ '#57349B' | color_desaturate: 25 }}
```

##### color_difference

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**

```liquid
{{ '#57349B' | color_difference: '#FFE5F8' }}
```

##### color_extract

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**

```liquid
{{ '#57349B' | color_extract: 'red' }}
```

**Color components**

- `alpha`
- `red`
- `green`
- `blue`
- `hue`
- `saturation`
- `lightness`

##### color_lighten

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**

```liquid
{{ '#57349B' | color_lighten: 25 }}
```

##### color_mix

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

**Example**

```liquid
{{ '#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**

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

##### color_modify

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**

```liquid
{{ '#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`

##### color_saturate

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**

```liquid
{{ '#57349B' | color_saturate: 25 }}
```

##### color_to_hex

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**

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

##### color_to_hsl

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**

```liquid
{{ '#57349B' | color_to_hsl }}
```

##### color_to_oklch

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**

```liquid
{{ '#57349B' | color_to_oklch }}
```

##### color_to_rgb

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**

```liquid
{{ '#57349B' | color_to_rgb }}
```

##### hex_to_rgba

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**

```liquid
{{ '#57349B' | hex_to_rgba: 0.5 }}
```

#### Default

Default filters provide fallback values and HTML markup.

---

##### default

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**

```liquid
{{ product | image_url | default: 'product-default.png' }}
```

##### default_errors

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**

```liquid
{{ form.errors | default_errors }}
```

##### default_pagination

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

**Example**

```liquid
{{ paginate | default_pagination }}
```

**Next and previous labels**

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

**Example**

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

#### Font

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

##### font_face

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**

```liquid
{{ settings.header_font | font_face }}
```

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

**Example**

```liquid
{{ settings.header_font | font_face: font_display: 'swap' }}
```

##### font_modify

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**

```liquid
{% 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`: 7`00` 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.
   - `100` – `900`: 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.

##### font_url

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

**Example**

```liquid
{{ settings.header_font | font_url }}
```

#### Format

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

---

##### date

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**

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

**Current date**

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

**Example**

```liquid
{{ '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**

```liquid
{{ blog.date_created | date: format: 'on_date' }}
```

##### json

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**

```liquid
{{ product | json }}
```

##### json_pretty

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**

```liquid
{{ product | json_pretty }}
```

##### structured_data

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**

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

#### HTML

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

---

##### inline_asset_content

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**

```liquid
{{ 'logo.svg' | inline_asset_content }}
```

##### placeholder_svg_tag

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**

```liquid
{{ '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`

##### script_tag

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**

```liquid
{{ 'main.js' | asset_url | script_tag }}
```

##### stylesheet_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**

```liquid
{{ 'main.css' | asset_url | stylesheet_tag }}
```

##### time_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**

```liquid
{{ blog.date_created | time_tag }}
```

#### Localization

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

---

##### format_address

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**

```liquid
{{ account.shipping | format_address }}
```

##### translate

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**

```liquid
{{ 'path.to.key' | t }}
```

#### Math

Math filters are used to perform mathematical operations on numbers.

---

##### abs

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

**Example**

```liquid
{{ -10 | abs }} # returns 10
```

##### at_least

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**

```liquid
{{ 2 | at_least: 4 }} # returns 4

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

##### at_most

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**

```liquid
{{ 5 | at_most: 4 }} # returns 4

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

##### ceil

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**

```liquid
{{ 2.3 | ceil }} # returns 3
```

##### divided_by

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**

```liquid
{{ 10 | divided_by: 2 }} # returns 5

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

##### floor

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**

```liquid
{{ 2.3 | floor }} # returns 2
```

##### minus

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

**Example**

```liquid
{{ 10 | minus: 2 }} # returns 8
```

##### modulo

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

**Example**

```liquid
{{ 5 | modulo: 2 }} # returns 1
```

##### plus

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

**Example**

```liquid
{{ 1 | plus: 1 }} # returns 2
```

##### round

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**

```liquid
{{ 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**

```liquid
{{ 1.234 | round: 2 }} # returns 1.23
```

##### times

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

**Example**

```liquid
{{ 3 | times: 3 }} # returns 9
```

#### Money

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

---

##### money

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**

```liquid
{{ product.price | money }}
```

##### money_with_currency

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**

```liquid
{{ product.price | money_with_currency }}
```

##### money_without_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**

```liquid
{{ product.price | money_without_currency }}
```

##### money_without_trailing_zeros

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**

```liquid
{{ product.price | money_without_trailing_zeros }}
```

#### String

Filters used to modify strings.

---

##### append

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

**Example**

```liquid
{{ request.origin | append: '/products' }}
```

##### capitalize

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

**Example**

```liquid
{{ 'this is a capitalized sentence.' | capitalize }}
```

##### downcase

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

**Example**

```liquid
{{ product.name | downcase }}
```

##### escape

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

**Example**

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

##### escape_once

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

**Example**

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

##### handleize

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

**Example**

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

##### lstrip

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

**Example**

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

##### newline_to_br

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

**Example**

```liquid
{{ product.description | newline_to_br }}
```

##### prepend

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

**Example**

```liquid
{{ '/products' | prepend: request.origin }}
```

##### remove

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

**Example**

```liquid
{{ 'one two three' | remove: 'three' }}
```

##### remove_first

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

**Example**

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

##### remove_last

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

**Example**

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

##### replace

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**

```liquid
{{ product.slug | replace: '-', ' ' }}
```

##### replace_first

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**

```liquid
{{ product.slug | replace_first: '-', ' ' }}
```

##### replace_last

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**

```liquid
{{ product.slug | replace_last: '-', ' ' }}
```

##### rstrip

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

**Example**

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

##### slice

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**

```liquid
{{ '/products' | slice: 1 }} # 'products'

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

##### split

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

**Example**

```liquid
{{ 'one two three' | split: ' ' }}
```

##### strip

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

**Example**

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

##### strip_html

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

**Example**

```liquid
{{ product.description | strip_html }}
```

##### strip_newlines

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

**Example**

```liquid
{{ product.description | strip_newlines }}
```

##### truncate

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**

```liquid
{{ product.description | truncate: 40 }}
```

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

**Example**

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

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

##### truncatewords

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**

```liquid
{{ 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**

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

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

##### upcase

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

**Example**

```liquid
{{ product.name | upcase }}
```

##### url_decode

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

**Example**

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

##### url_encode

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

**Example**

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

##### url_escape

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**

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

#### Shopify compatibility

Filters implemented strictly to enable compatibility with Shopify themes.

---

##### shopify_asset_url

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**

```liquid
{{ 'option_selection.js' | shopify_asset_url }}
```


## Objects

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](https://developers.swell.is/storefronts/proxima-app) 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](https://developers.swell.is/backend-api/introduction). 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.

---

##### account

Represents the logged-in customer account.

Model: [account](https://developers.swell.is/backend-api/accounts/the-account-model)

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

---

##### account_address

Represents a customer’s shipping or billing address.

Model: [account address](https://developers.swell.is/backend-api/account-addresses/the-account-address-model)

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`

---

##### account_billing

Represents a customer's default billing details.

Model: [account.billing](https://developers.swell.is/backend-api/accounts/the-account-model)

**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`

---

##### account_card

Represents a customer's credit card on file.

Model: [account.cards](https://developers.swell.is/backend-api/accounts/the-account-model)

**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`

---

##### all_country_option_tags

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**

```liquid
<select name="country">
  {{ all_country_option_tags }}
</select>
```

---

##### author

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`

---

##### block

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[]`

---

##### blog

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[]`

---

##### blog_category

Represents a blog category.

Shopify equivalent: blog

**Properties**

- `blogs` (collection<[blog](#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`

---

##### canonical_url

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.

---

##### cart

Represents the customer’s shopping cart.

Model: [cart](https://developers.swell.is/backend-api/carts/the-cart-model)

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

---

##### cart_billing

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

Model: [cart.billing](https://developers.swell.is/backend-api/carts/the-cart-model)

**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](#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`

---

##### cart_bundle_item

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

Model: [cart.items.bundle_items](https://developers.swell.is/backend-api/carts/the-cart-model)

**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[]`

---

##### cart_discount

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

Model: [cart.discounts](https://developers.swell.is/backend-api/carts/the-cart-model)

**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`

---

##### cart_giftcards

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

Model: [cart.giftcards](https://developers.swell.is/backend-api/carts/the-cart-model)

**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`

---

##### cart_item

Represents line item within the customer’s shopping cart.

Model: [cart.items](https://developers.swell.is/backend-api/carts/the-cart-model)

**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[]`

---

##### cart_item_option

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](https://developers.swell.is/backend-api/carts/the-cart-model)

**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!'`

---

##### cart_item_tax

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

Model: [cart.items.taxes](https://developers.swell.is/backend-api/carts/the-cart-model)

**Properties**

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

**Returned by**

- `cart_item.taxes[]`

---

##### cart_purchase_option

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](https://developers.swell.is/backend-api/carts/the-cart-model)

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`

---

##### cart_shipping

**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`

---

##### cart_tax

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

Model: [cart.taxes](https://developers.swell.is/backend-api/carts/the-cart-model)

**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`

---

##### category

Represents a product category.

Model: [category](https://developers.swell.is/backend-api/categories/the-category-model)

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.

---

##### color

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

Shopify equivalent: color

**Returned by**

- settings object

**Example**

```liquid
{{ settings.color_primary }}
```

---

##### color_scheme

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

Shopify equivalent: color_scheme

**Returned by**

- settings object

**Example**

```liquid
{{ settings.color_accent_scheme }}
```

---

##### color_scheme_group

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**

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

---

##### content_for_header

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**

```liquid
<html>
  <head>
    {{ content_for_header }}
  </head>
  ...
</html>
```

---

##### content_for_layout

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**

```liquid
<html>
  ...
  <body>
    {{ content_for_layout }}
  </body>
  ...
</html>
```

---

##### content_model

Represents a [content model](https://developers.swell.is/backend-api/content-models/the-content-model) defined in the store either manually, or as installed by a Swell App.

Model: [content](https://developers.swell.is/backend-api/content-models/the-content-model)

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.

---

##### content_object

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**

```liquid
{{ product.content.my_content_field }}
```

---

##### country_option_tags

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**

```liquid
<select name="country">
  {{ all_country_option_tags }}
</select>
```

---

##### coupon

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

Model: [coupon](https://developers.swell.is/backend-api/coupons/the-coupon-model)

**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`

---

##### current_page

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

Shopify equivalent: current_page

**Returned by**

- Global

**Example**

```liquid
Page: {{ current_page }}
```

---

##### file

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](https://developers.swell.is/backend-api/files/the-file-model)

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`

---

##### font

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**

- settings object

**Example**

```liquid
{% 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 %}
```

---

##### forloop

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**

- for tag

**Example**

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

---

##### form

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**

- form tag

**Example**

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

---

##### form_error

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`

---

##### image

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[]`

---

##### menus

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**

```liquid
<!-- 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 %}
```

---

##### menu

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`

---

##### menu_item

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[]`

---

##### metadata_object

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

**Returned by**

- `account.metadata`
- `cart.metadata`
- `order.metadata`
- `subscription.metadata`

**Example**

```liquid
{{ order.metadata.my_meta_field }}
```

---

##### order

Represents a customer order.

Model: [order](https://developers.swell.is/backend-api/orders/the-order-model)

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[]`

---

##### page

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.

---

##### page_description

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**

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

---

##### page_title

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

**Returned by**

- Global

**Example**

```liquid
<html>
  <head>
    <title>{{ page_title }}</title>
  </head>
  ...
</html>
```

---

##### paginate

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**

- paginate tag

---

##### paginate_page

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`

---

##### payment

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

Model: [payment](https://developers.swell.is/backend-api/payments/the-payment-model)

**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[]`

---

##### product

Represents a single product in the store.

Model: [product](https://developers.swell.is/backend-api/products/the-product-model)

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[]`

---

##### product_bundle_item

Represents an item as part of a bundle product.

Model: [product.bundle_items](https://developers.swell.is/backend-api/products/the-product-model)

**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[]`

---

##### product_cross_sell

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](https://developers.swell.is/backend-api/products/the-product-model)

**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[]`

---

##### product_option

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](https://developers.swell.is/backend-api/products/the-product-model)

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[]`

---

##### product_option_value

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](https://developers.swell.is/backend-api/products/the-product-model)

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[]`

---

##### product_price

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

Model: [product.prices](https://developers.swell.is/backend-api/products/the-product-model)

**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[]`

---

##### product_up_sell

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

Model: [product.up_sells](https://developers.swell.is/backend-api/products/the-product-model)

**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[]`

---

##### product_variant

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

Model: [product variant](https://developers.swell.is/backend-api/variants/the-variant-model)

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[]`

---

##### promotion

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

Model: [promotions](https://developers.swell.is/backend-api/promotions/the-promotion-model)

**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[]`

---

##### purchase_options

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

Model: [product.purchase_options](https://developers.swell.is/backend-api/products/the-product-model)

**Properties**

- `standard` (purchase_option_standard): Standard purchase option configuration.
- `subscription` (purchase_option_subscription): Subscription purchase option configuration.

**Returned by**

- `product.purchase_options`

---

##### purchase_option_standard

Represents a standard product purchase option.

Model: [product.purchase_options.standard](https://developers.swell.is/backend-api/products/the-product-model)

**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`

---

##### purchase_option_subscription

Represents a subscription product purchase option.

Model: [product.purchase_options.subscription](https://developers.swell.is/backend-api/products/the-product-model)

**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`

---

##### purchase_option_subscription_plan

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

Model: [product.purchase_options.subscription.plans](https://developers.swell.is/backend-api/products/the-product-model)

**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[]`

---

##### purchase_option_schedule

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`

---

##### refund

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

Model: [payment refund](https://developers.swell.is/backend-api/refunds/the-refund-model)

**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[]`

---

##### return

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

Model: [return](https://developers.swell.is/backend-api/returns/the-return-model)

**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[]`

---

##### request

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

---

##### section

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**

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

---

##### settings

Provides access to theme settings defined in the theme editor.

Shopify equivalent: settings

**Returned by**

- Global

**Example**

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

---

##### shipment

Represents a physical shipment for a customer's order.

Model: [shipment](https://developers.swell.is/backend-api/shipments/the-shipment-model)

**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[]`

---

##### shipment_address

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

Model: [shipment.destination](https://developers.swell.is/backend-api/shipments/the-shipment-model)

**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`

---

##### shipment_endpoint

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

Model: [shipment.origin](https://developers.swell.is/backend-api/shipments/the-shipment-model)

**Properties**

- `location` (string): ID of the shipment location.

**Returned by**

- `return.destination`
- `shipment.origin`

---

##### shipment_item

Represents an item to be shipped or returned.

Model: [shipment.items](https://developers.swell.is/backend-api/shipments/the-shipment-model)

**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[]`

---

##### shipment_rating

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

Model: [cart.shipment_rating](https://developers.swell.is/backend-api/carts/the-cart-model)

**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`

---

##### shipment_rating_error

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

Model: [cart.shipment_rating.errors](https://developers.swell.is/backend-api/carts/the-cart-model)

**Properties**

- `code` (string): Error code.
- `message` (string): Error message.

**Returned by**

- `shipment_rating.errors[]`

---

##### shipment_rating_service

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

Model: [cart.shipment_rating.services](https://developers.swell.is/backend-api/carts/the-cart-model)

**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[]`

---

##### store

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

---

##### store_currency

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[]`

---

##### store_locale

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[]`

---

##### store_payment_settings

Represents payment settings including information about payment methods enabled on the store. The following properties represent standard payment methods, however this object may also contain properties of custom payments methods if configured.

**Properties**

- `affirm` (store_payment_affirm_settings): Affirm payment settings, if configured
- `amazon` (store_payment_amazon_settings): Amazon payment settings, if configured.
- `card`: (store_payment_card_settings): Credit card payment settings, if configured.
- `paypal` (store_payment_paypal_settings): PayPal payment settings, if configured.

**Returned by**

- `store.payments`

---

##### store_payment_affirm_settings

Represents Affirm payment settings.

**Properties**

- `public_key` (string): Public key to initiate an Affirm payment source.

**Returned by**

- `store_payment_settings.affirm`

---

##### store_payment_amazon_settings

Represents Amazon payment settings.

**Properties**

- `merchant_id` (string): ID of the Amazon merchant account.
- public_key_id (string): ID of the public key to initiate an Amazon payment source.

**Returned by**

- `store_payment_settings.amazon`

---

##### store_payment_card_settings

Represents credit card payment settings.

**Properties**

- `gateway` (string): String ID of the credit card gateway, for example `stripe` or `authorizenet`.
- `merchant_id` (string): ID of the credit card merchant account, if applicable.
- `publishable_key` (string): A publishable key used for client-side payment authorization, if applicable. For example, Stripe's publishable key for `live` or `test` mode, depending on the gateway's status in Swell.

**Returned by**

- `store_payment_settings.card`

---

##### store_payment_paypal_settings

Represents PayPal payment settings.

**Properties**

- `merchant_id` (string): ID of the PayPal merchant account.
- `test_merchant_id` (string): ID of the PayPal merchant's test account, if configured.
- `live_merchant_id` (string): ID of the PayPal merchant's live account, if configured.
- store_owner_email (string): Email of the PayPal merchant's account owner.

**Returned by**

- `store_payment_settings.paypal`

---

##### store_subscription_settings

Represents subscription settings of the store.

**Properties**

- `features` (store_subscription_setting_features): Subscription feature settings configured by the store.
- `pause_next_skip_threshold` (boolean): Number of days before next shipment by which a customer must skip, if applicable.

**Returned by**

- `store.subscriptions`

---

##### store_subscription_setting_features

Represents subscription settings that are enabled or disabled on a store.

**Properties**

- `auto_invoice_payment` (boolean): Indicates that subscription invoices will be automatically charged.
- `auto_payment_retry` (boolean): Indicates that subscription payments will be automatically re-tried if they fail.
- `auto_apply_credit` (boolean): Indicates that account credits will be automatically applied as payments on subscription invoices if any exist on the account.
- `pause_during_trial` (boolean): Indicates that customers are allowed to pause a subscription during the trial period.
- `pause_indefinitely` (boolean): Indicates that customers are allowed to pause a subscription indefinitely.
- `pause_past_due` (boolean): Indicates that customers are allowed to pause a subscription when its payment is past due.
- `pause_skip_next` (boolean): Indicates that customers are allowed to skip the next subscription interval.

**Returned by**

- `store_subscription_settings.features`

---

##### subscription

Represents a customer subscription.

Model: [subscription](https://developers.swell.is/backend-api/subscription-plans/subscriptionp-model)

**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[]`

---

##### subscription_schedule

Represents the billing or order schedule of a subscription.

Model: [subscription.billing_schedule](https://developers.swell.is/backend-api/subscription-plans/subscriptionp-model)

**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`

---

##### tablerowloop

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**

- tablerow tag

---

##### template

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

