---
title: "Add to cart"
method: PUT
path: "/6/{hashid}/stats/cart/{session_id}"
tags: ["Session & Events"]
---

# Add to cart

`PUT /6/{hashid}/stats/cart/{session_id}`

Registers a click event on the cart.

## Path parameters

- `hashid` string, required
- `session_id` string, required — Identifier of search session

## Request body

- AddToCartClickRequest
  - `id` string, required — id of the item to be added/removed
  - `index` string, required — Name of the indice the item belongs to. i.e. "product"
  - `title` string, required — The title that describe the item. Usually, the title of item's page.

## Response `200`

OK

- StatsResponse — Response returned over register stat operation.
  - `status` string — Result of the stats request. i.e. 'registered'

## Other responses

- `400` — Bad Request — missing required cart item fields (id, index, title), session_id exceeds 32 characters, or invalid cart item data.
- `403` — Forbidden — missing or invalid API token, client IP is blocked, or CORS `Origin` not allowed.

---

[API](https://skmtc.dev/doofinder/apis/recommendations-api.md) · [All operations](https://skmtc.dev/doofinder/apis/recommendations-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/doofinder/recommendations-api/revisions/50dc63ab0921/schema)
