---
url: https://developer.youcan.shop/themes/objects/customer.md
---
# `customer` object
The logged in customer. It is available in every template, and it is nil when no customer is logged in.
### Properties
***
| Name | Type | Description |
| ------------------- | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------- |
| `id` | [string](../basics/types#string) | The customer id |
| `email` | [string](../basics/types#string) | The email |
| `phone` | [string](../basics/types#string) | The phone number, or nil |
| `first_name` | [string](../basics/types#string) | The first name, or nil |
| `last_name` | [string](../basics/types#string) | The last name, or nil |
| `name` | [string](../basics/types#string) | The first and last name |
| `accepts_marketing` | [boolean](../basics/types#boolean) | Whether the customer accepts marketing emails |
| `tags` | [array](../basics/types#array) of [string](../basics/types#string) | The tags the seller added to the customer |
| `has_account` | [boolean](../basics/types#boolean) | Whether the customer has an account |
| `orders_count` | [number](../basics/types#number) | The number of orders |
| `total_spent` | [string](../basics/types#string) | The total of all orders, in the store currency |
| `orders` | [array](../basics/types#array) of [order](order) object | The orders, newest first, 50 at a time. Use [paginate](../tags/paginate.md) for more |
| `last_order` | [order](order) object or `null` | The most recent order |
| `addresses` | [array](../basics/types#array) of [address](address) object | The saved addresses, the default address first |
| `addresses_count` | [number](../basics/types#number) | The number of saved addresses |
| `default_address` | [address](address) object or `null` | The default address, or the first address when none is the default |
| `new_address` | [address](address) object | An empty address for the form that adds an address |
```liquid
{% if customer %}
{{ customer.first_name }}
Log out
{% else %}
Log in
{% endif %}
```
### Orders
`{% paginate customer.orders by 10 %}` paginates the orders. `order.customer_url` is the URL of the order page.
```liquid
{% paginate customer.orders by 10 %}
{% for order in customer.orders %}
{{ order.name }}
{{ order.financial_status }}
{{ order.total | money }}
{% endfor %}
{% endpaginate %}
```