> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pureclarity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# set_basket event

> The set_basket tracking event sets the contents of the users basket in its entirety. This event is useful for PureClarity to associate strong buying signals for a given product for the user. Note, the context is an array of basket products.

The set\_basket tracking event sets the contents of the users basket in its entirety. This event is useful for PureClarity to associate strong buying signals for a given product for the user. Note, the context is an array of basket products.

<Note>Send an empty array to clear the basket.</Note>

## Basket Item Properties

Each item in the basket array must contain:

<ParamField body="id" type="string" required>
  The product Id of the item in the basket

  **Example:** `P41923`
</ParamField>

<ParamField body="qty" type="number" required>
  The amount of this product that is in the basket

  **Example:** `5`
</ParamField>

<ParamField body="unitprice" type="number" required>
  The price of a single unit

  **Example:** `29.95`
</ParamField>

## Example

```json theme={null}
[
  {
    "id": "P41923",
    "qty": 5,
    "unitprice": 29.95
  },
  {
    "id": "P41924",
    "qty": 2,
    "unitprice": 15.50
  }
]
```

### Clear Basket

```json theme={null}
[]
```
