# Basket Operations

> Tracks changes to the user's shopping cart using the BASKET_OPERATIONS event.

Tracks changes to the user's shopping cart using the `BASKET_OPERATIONS` event. All three requests share the same event name and differ only in the `step` field.

**Requests:**
- **Basket Add** — fires when a product is added to the cart (`step: "add"`). Requires `productId`, `price`, `quantity`, and `basketId`.
- **Basket Remove** — fires when a product is removed from the cart (`step: "remove"`). Requires `productId`, `price`, `quantity`, and `basketId`.
- **Basket Clear** — fires when the entire cart is emptied (`step: "clear"`). No product-level fields are needed.

All requests use the `{dataCenterUrl}` endpoint and require `userId`, `sessionId`, `lang`, `currency`, and `basketId`.

## Basket Add

**Example body**

```json
{
  "name": "BASKET_OPERATIONS",
  "userId": "1234567890123456789",
  "sessionId": "323232",
  "testMode": "false",
  "device": "PC",
  "nextPage": false,
  "params": {},
  "os": "ANDROID",
  "lang": "EN",
  "currency": "EUR",
  "productId": "T59008765Y0",
  "basketId": "basket_1234567890123456789",
  "step": "add",
  "price": "1999",
  "quantity": 1
}
```

:::tip[Try it]
Send this request from the [Events API reference](/reference/events/): pick **Basket Operations / Basket Add** in the request body examples of *Send events*.
:::


## Basket Remove

**Example body**

```json
{
  "name": "BASKET_OPERATIONS",
  "basketId": "basket_1234567890123456789",
  "userId": "1234567890123456789",
  "sessionId": "9876543210987654321",
  "testMode": "false",
  "device": "PC",
  "params": {},
  "recommendIds": [],
  "pageUrl": "",
  "referrer": "",
  "lang": "EN",
  "currency": "EUR",
  "region": "",
  "productId": "PRODUCT_ID",
  "price": "1000",
  "quantity": "1",
  "email": "user@example.com",
  "step": "remove"
}
```

:::tip[Try it]
Send this request from the [Events API reference](/reference/events/): pick **Basket Operations / Basket Remove** in the request body examples of *Send events*.
:::


## Basket Clear

**Example body**

```json
{
  "name": "BASKET_OPERATIONS",
  "basketId": "basket_1234567890123456789",
  "userId": "1234567890123456789",
  "sessionId": "9876543210987654321",
  "testMode": "false",
  "device": "PC",
  "params": {},
  "recommendIds": [],
  "referrer": "",
  "lang": "EN",
  "currency": "EUR",
  "region": "",
  "email": "user@example.com",
  "step": "clear"
}
```

:::tip[Try it]
Send this request from the [Events API reference](/reference/events/): pick **Basket Operations / Basket Clear** in the request body examples of *Send events*.
:::
