# Order

In a theme's Liquid templates you access the order object through customer.orders.

In a theme's Liquid templates you access the `order` object through `customer.orders`.

Money attributes such as prices and totals are returned in the customer's local (presentment) currency. Use a money filter to show the result as a money amount.

The `order` object has the following attributes:

## order.attributes

Returns the custom cart attributes of the order, if there are any. You can add [as many custom attributes to your cart as you need](https://developer.versacommerce.de/articles/liquid-objects-cart#cart-attributes).

When you loop through the attributes, use `{{ attribute | first }}` for the name of the attribute and `{{ attribute | last }}` for its value.

```liquid
{% if order.attributes %}
  <p>Order notes:</p>
  <ul>
    {% for attribute in order.attributes %}
      <li><strong>{{ attribute | first }}</strong>: {{ attribute | last }}</li>
    {% endfor %}
  </ul>
{% endif %}
```

```html
<p>Order notes:</p>
 <ul>

  <li><strong>Message to merchant</strong>: I love your products! Thanks!</li>

 </ul>
```

## order.billing_address

Returns the [billing address](https://developer.versacommerce.de/articles/liquid-objects-address) of the order.

## order.cancelled

Returns `true` if the order is cancelled, `false` otherwise.

## order.cancelled_at

Returns the timestamp of when the order was cancelled. Use the [date filter](https://developer.versacommerce.de/articles/liquid-filters-additional-filters#date) to format it.

## order.cancel_reason

Returns one of these cancellation reasons if the order was cancelled:

- items unavailable
- fraudulent order
- customer changed/cancelled order
- other

## order.cancel_reason_label

Returns the translated output of the order's `cancel_reason`.

```liquid
English: {{ order.cancel_reason }}
French: {{ order.cancel_reason_label }}
```

```text
English: Items unavailable
French: Produits indisponibles
```

## order.cart_level_discount_applications

Returns an array of order-level discount applications for an order.

```liquid
{% for discount_application in order.cart_level_discount_applications %}
  Discount code: {{ discount_application.title }}
  Savings: -{{ discount_application.total_allocated_amount | money }}
{% endfor %}
```

```text
Discount code: SUMMER16
Savings: -€20.00
```

## order.created_at

Returns the timestamp of when the order was created. Use the [date filter](https://developer.versacommerce.de/articles/liquid-filters-additional-filters#date) to format it.

## order.customer

Returns the [customer](https://developer.versacommerce.de/articles/liquid-objects-customer) of the order.

## order.customer_url

Returns a unique URL the customer can use to access the order.

```liquid
{{ order.name | link_to: order.customer_url }}
```

```html
<a href="https://example-shop.versacommerce.de/account/orders/d94ec4a1956f423dc4907167c9ef0413">#1025</a>
```

## order.discount_applications

Returns an array of discount applications for an order.

```liquid
{% for discount_application in order.discount_applications %}
  Discount code: {{ discount_application.title }}
  Savings: -{{ discount_application.total_allocated_amount | money }}
{% endfor %}
```

```text
Discount code: SUMMER16
Savings: -€20.00
```

## order.email

Returns the email address of the order, if it exists.

## order.financial_status

Returns the financial status of an order. Possible values:

- `pending`
- `authorized`
- `paid`
- `partially_paid`
- `refunded`
- `partially_refunded`
- `voided`

## order.financial_status_label

Returns the translated output of the order's `financial_status`.

```liquid
English: {{ order.financial_status }}
Spanish: {{ order.financial_status_label }}
```

```text
English: paid
Spanish: Pagado
```

## order.fulfillment_status

Returns the fulfillment status of an order.

## order.fulfillment_status_label

Returns the translated output of the order's `fulfillment_status`.

```liquid
English: {{ order.fulfillment_status }}
Spanish: {{ order.fulfillment_status_label }}
```

```text
English: unfulfilled
Spanish: No confirmado
```

## order.line_items

Returns an array of the order's [line items](https://developer.versacommerce.de/articles/liquid-objects-lineitem).

## order.line_items_subtotal_price

Returns the sum of the order's line item prices after all line item discounts. The subtotal does not include cart discounts, taxes (unless taxes are included in the prices) or shipping costs.

```liquid
<!-- subtotal = total value of cart items - line item discounts -->
Subtotal: {{ order.line_items_subtotal_price | money }}
```

```html
<!-- for a cart containing a €500 product with a €50 line item discount -->
Subtotal: €450.00
```

For a subtotal that includes all types of discounts, see `order.subtotal_price`.

## order.location

**(POS only)** Returns the physical location of the order. Locations are configured in the location settings of the shop admin.

## order.name

Returns the name of the order in the format set in the general settings of the shop admin.

```liquid
{{ order.name }}
```

```text
#1025
```

## order.note

Returns the note of a customer order.

To show an order note in an email notification or an order printer template, use `{{ note }}`. To show it in a template file such as `customers/account.liquid`, use `{{ order.note }}`.

```liquid
Special instructions: {{ order.note }}
```

```text
Special instructions: Please deliver after 5 pm
```

## order.order_number

Returns the integer representation of the order name.

```liquid
{{ order.order_number }}
```

```text
1025
```

## order.order_status_url

Returns the unique URL of the order status page of the order.

## order.payment_terms

Returns the `payment_terms` object attached to the order.

## order.phone

Returns the phone number of the order, if it exists.

## order.shipping_address

Returns the [shipping address](https://developer.versacommerce.de/articles/liquid-objects-address) of the order.

## order.shipping_methods

Returns an array of [shipping_method](https://developer.versacommerce.de/articles/liquid-objects-shippingmethod) variables of the order.

## order.shipping_price

Returns the shipping price of an order.

## order.subtotal_line_items

Returns an array of the [line items](https://developer.versacommerce.de/articles/liquid-objects-lineitem) used to calculate the [subtotal price](#order-subtotalprice) of an order. Tip line items are excluded.

## order.subtotal_price

Returns the subtotal price of all items in the order after line item and cart discounts. The subtotal does not include taxes (unless taxes are included in the prices), shipping costs or tips.

For a subtotal that only includes line item discounts, see `order.line_items_subtotal_price`.

## order.tags

Returns an array of all tags of the order. The tags are returned in alphabetical order.

```liquid
{% for tag in order.tags %}
  {{ tag }}
{% endfor %}
```

```text
leather
new
sale
special
```

## order.tax_lines

Returns an array of [tax_line](https://developer.versacommerce.de/articles/liquid-objects-taxline) variables for an order.

```liquid
{% for tax_line in order.tax_lines %}
  Tax ({{ tax_line.title }} {{ tax_line.rate | times: 100 }}%): {{ tax_line.price | money }}
{% endfor %}
```

```text
Tax (VAT 19.0%): €25
```

## order.tax_price

Returns the tax amount of the order.

## order.total_discounts

Returns the total value of all discounts applied to the order.

## order.total_net_amount

Returns the net amount of the order.

`order.total_net_amount` is calculated after refunds. It equals `order.total_price` minus `order.total_refunded_amount`.

## order.total_price

Returns the total price of an order.

`order.total_price` is calculated before refunds. For the refunded value, use `order.total_refunded_amount`.

## order.total_refunded_amount

Returns the total refunded amount of an order.

## order.transactions

Returns an array of [transactions](https://developer.versacommerce.de/articles/liquid-objects-transaction) of the order.


## More properties

VersaCommerce also provides these properties on the `order` object:

| Properties | Returns |
|---|---|
| `code`, `ordered_at`, `currency`, `source`, `item_count`, `invoice_id`, `confirmation_number`, `metafields`, `pickup_in_store?`, `cart_attributes`, `tax_rate`, `reduced_tax_rate`, `tax_amount`, `tax_of_shipping`, `coupon_value`, `payment_type`, `payment_cost`, `shipping_cost`, `extra_price`, `item_total`, `shipping_type`, `total`, `order_total`, `customer_order_url` | Order metadata, pricing, pickup state and aliases |
