---
title: "Add item to cart"
method: POST
path: "/add-item"
tags: ["items"]
---

# Add item to cart

`POST /add-item`

Adds a product item to the customer's cart.

## Request body

- object
  - `product_id` string — Unique identifier for the product.
  - `quantity` string, required — The quantity amount of the item to add to cart.
  - `variation_id` integer — Unique identifier for the variation.
  - `variation` object — The variation attributes that identity the variation of the item.
  - `cart_item_data` object — Additional item data passed to make item unique.
  - `return_cart` boolean — Returns the cart once item is added.

## Response `200`

Item added to cart successfully.

- AddItemResponse
  - `item_key` string — Unique identifier for the item within the cart.
  - `id` integer — Product ID.
  - `name` string — Product name.
  - `title` string — Product title.
  - `price` string — Current product price.
  - `quantity` object — Quantity information for this item.
    - `value` number — Current quantity of the item in the cart.
    - `min_purchase` number — Minimum quantity that can be purchased.
    - `max_purchase` number — Maximum quantity that can be purchased.
  - `totals` object — Item totals.
    - `subtotal` number — Line subtotal (before discounts).
    - `subtotal_tax` number — Line subtotal tax.
    - `total` number — Line total (after discounts).
    - `tax` number — Line total tax.
  - `slug` string — Product slug.
  - `meta` object — Item metadata.
    - `product_type` string — Product type.
    - `sku` string — Product SKU.
    - `dimensions` object — Product dimensions.
      - `length` string — Product length.
      - `width` string — Product width.
      - `height` string — Product height.
      - `unit` string — Dimension unit.
    - `weight` string — Product weight.
    - `variation` union — Chosen attributes (for variations).
      - object
      - string[]
  - `backorders` string — Backorder status.
  - `cart_item_data` object — Custom cart item data.
  - `featured_image` string — Product featured image URL.

## Other responses

- `400` — Bad request - invalid parameters or product not found.
- `404` — Product not found.

---

[API](https://skmtc.net/cocartapi/apis/cocart-jwt-authentication.md) · [All operations](https://skmtc.net/cocartapi/apis/cocart-jwt-authentication/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cocartapi/cocart-jwt-authentication/revisions/2031b047ca5f/schema)
