---
layout: default
title: discount
nav:
group: Liquid Variables
---
# discount
The discount object has the following attributes:
{% table_of_contents %}
{% anchor_link "discount.id", "discount.id" %}
Returns the id of the discount.
{% anchor_link "discount.code", "discount-code" %}
Returns the code of the discount.
Input
{% highlight html %}{% raw %}
{{ discount.code }}
{% endraw %}{% endhighlight %}
Output
{% highlight html %}{% raw %}
SPRING14
{% endraw %}{% endhighlight %}
{% anchor_link "discount.amount", "discount-amount" %}
Returns the amount of the discount. Use one of the money filters to return the value in a monetary format.
Input
{% highlight html %}{% raw %}
{{ discount.amount | money }}
{% endraw %}{% endhighlight %}
Output
{% highlight html %}{% raw %}
$25
{% endraw %}{% endhighlight %}
{% anchor_link "discount.savings", "discount-savings" %}
Returns the amount of the discount's savings. The negative opposite of amount. Use one of the money filters to return the value in a monetary format.
Input
{% highlight html %}{% raw %}
{{ discount.savings | money }}
{% endraw %}{% endhighlight %}
Output
{% highlight html %}{% raw %}
$-25
{% endraw %}{% endhighlight %}
{% anchor_link "discount.type", "discount-type" %}
Returns the type of the discount. The possible values of discount.type are:
- FixedAmountDiscount
- PercentageDiscount
- ShippingDiscount