# Order placed

Learn how to check if a user has placed an order.

This expression checks whether a user has placed an order based on [Order placed](/reference/event/types/ecommerce/order-placed) events.

> **Tracking required**
>
> Make sure your app is tracking the [Order placed](/reference/event/types/ecommerce/order-placed) event before using this expression. Without this event, the expression will always evaluate to false.

## Syntax

The basic syntax for this expression is:

```cql
user has placed order
```

You can optionally include the article for better readability:

```cql
user has placed an order
```

The negation of the expression can be expressed as:

```cql
user has not placed an order
```

You can refine the expression with filters, quantifiers, and time windows:

```cql
user has placed an order /*<criteria>*/ /*<quantifier>*/ /*<window>*/
```

## Parameters

These are the supported parameters:

- `criteria`: [`Criteria`](https://www.google.com/search?q=/reference/cql/expressions/events/criteria/overview) (optional)

  Additional [filtering criteria](#event-properties) for the order placed event.

- `quantifier`: [`Quantifier`](/reference/cql/expressions/events/quantifier) (optional)

  A quantifier to specify how many times the event must have occurred.

- `window`: [`TimeWindow`](/reference/cql/expressions/events/time-window) (optional)

  The time window during which the event must have occurred.

## Event properties

The following event properties can be used within [criteria expressions](/reference/cql/expressions/events/criteria/overview):

- `id`: `string`

  The ID that uniquely identifies the order on your store.

- `currency`: `string`

  The currency in which the monetary values are expressed in the shopping cart, such as "USD" or "EUR".

- `subtotal`: `number|null`

  The total of all items and quantities in the shopping cart including applied item promotions.

- `shippingPrice`: `number|null`

  The total shipping price for the items in the shopping cart, including any handling charges.

- `paymentMethod`: `string|null`

  The payment method used in the payment, such as "credit-card", "credit-balance", "visa", "paypal" "bitcoin", etc

- `installments`: `number|null`

  The number of installments for the payment. For example, 3 for a payment in 3 installments

- `status`: `string`

  The current status of the order.

  The possible values are:

  | Value       | Description                                              |
  | ----------- | -------------------------------------------------------- |
  | `placed`    | The order has been placed but still has pending actions. |
  | `paid`      | The order has been paid but still has pending actions.   |
  | `completed` | The order has been fully completed.                      |

- `taxes`: `object`

  The taxes associated with the transaction.

  It is expressed as a dictionary where the key is the tax name and the value is the tax amount.

  Example:

  ```json
  {
    "state": 3.1,
    "local": 1.5
  }
  ```

- `costs`: `object`

  The costs associated with the transaction, such as manufacturing costs, shipping costs not paid by the customer, or other costs.

  It is expressed as a dictionary where the key is the cost name and the value is the cost amount.

  Example:

  ```json
  {
    "manufacturing": 5.0,
    "packaging": 2.0
  }
  ```

- `discount`: `number|null`

  The amount of discount applied to the shopping cart, as an absolute value. For example, `10.00` for a $10 discount.

- `coupon`: `string|null`

  The coupon applied to the shopping cart. For example, "SUPER\_DEALS".

- `total`: `number`

  The total revenue or grand total associated with the transaction, including shipping, tax, and any other adjustment.

## Examples

You can check whether a user has placed an order:

```cql
user has placed an order
```

Or check that the user has not placed any orders:

```cql
user has not placed an order
```

You can also add criteria, such as checking the order currency:

```cql
user has placed an order with currency "USD"
```

Or check how many times an order was placed:

```cql
user has placed an order exactly 3 times
```

You can even filter by time, such as checking if an order was placed yesterday:

```cql
user has placed an order yesterday
```

Combine criteria, counts, and time windows in one expression:

```cql
user has placed an order with currency "USD" exactly 2 times today
```

> **Scale plan**
>
> This feature is available only to accounts on the Scale plan. See the [pricing page](https://croct.com/pricing) for more information.

## Explore

- [Audiences](/explanation/audience): Understand how to delivery content to specific groups of users.
- [Event tracking](/reference/event/types/ecommerce/order-placed): Learn how to track this event.
