---
title: "Add Cart Addition"
method: POST
path: "/{databaseId}/cartadditions/"
tags: ["User-Item Interactions"]
---

# Add Cart Addition

`POST /{databaseId}/cartadditions/`

Adds a cart addition of the given item made by the given user.

## Path parameters

- `databaseId` string, required

## Request body

- CartAddition
  - `userId` string, required — User who added the item to the cart
  - `itemId` string, required — Item added to the cart
  - `timestamp` union — UTC timestamp of the cart addition as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
    - string, double
    - number, double
  - `cascadeCreate` boolean — Sets whether the given user/item should be created if not present in the database.
  - `amount` number, double — Amount (number) added to cart. The default is 1. For example, if `user-x` adds two `item-y` during a single order (session...), the `amount` should equal 2.
  - `price` number, double — Price of the added item. If `amount` is greater than 1, the sum of prices of all the items should be given.
  - `recommId` string — If this cart addition is based on a recommendation request, `recommId` is the id of the clicked recommendation.
  - `additionalData` object — A dictionary of additional data for the interaction.

## Response `200`

Successful operation.

## Other responses

- `400` — The `userId` or `itemId` does not match ^[a-zA-Z0-9_\-:@\.]+$, `timestamp` is not a real number ≥ 0.
- `404` — The `cascadeCreate` is not set true and the `userId` or the `itemId` were found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.
- `409` — A cart addition of the exact same `userId`, `itemId`, and `timestamp` is already present in the database. In many cases, you may consider this code a success – it only tells you that nothing has been written to the database.

---

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