---
title: "Adds an item in shopping cart"
method: POST
path: "/api/v1/carts/{customerId}/items"
tags: ["cart"]
---

# Adds an item in shopping cart

`POST /api/v1/carts/{customerId}/items`

Adds an item to the shopping cart if it doesn't already exist, or increment quantity by the specified number of items if it does.

## Path parameters

- `customerId` string, required

## Request body

- Item — Items in shopping cart
  - `id` string — Item Identifier
  - `quantity` integer — The item quantity
  - `unitPrice` unknown

## Response `201`

Item added successfully

- Item[]
  - `id` string — Item Identifier
  - `quantity` integer — The item quantity
  - `unitPrice` unknown

## Other responses

- `404` — Given customer ID doesn't exist

---

[API](https://skmtc.dev/packtpublishing/apis/sample-ecommerce-app.md) · [All operations](https://skmtc.dev/packtpublishing/apis/sample-ecommerce-app/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/packtpublishing/sample-ecommerce-app/revisions/51a26ae44206/schema)
