---
title: "Partial update a cart"
method: PATCH
path: "/carts/{id}"
tags: ["Carts"]
---

# Partial update a cart

`PATCH /carts/{id}`

## Request

- Base URL: `https://dummyjson.com`
- URL: `https://dummyjson.com/carts/{id}`
- Auth: none required

## Path parameters

- `id` integer, required

## Query parameters

- `delay` integer

## Request body

- CartInput
  - `userId` integer
  - `products` object[]
    - `id` integer, required: Product id
    - `quantity` integer
  - `merge` boolean: PUT/PATCH only: keep the existing cart products and add the new ones.

## Response `200`

Updated cart

- Cart
  - `id` integer
  - `products` object[]
    - `id` integer
    - `title` string
    - `price` number
    - `quantity` integer
    - `total` number
    - `discountPercentage` number
    - `discountedTotal` number
    - `thumbnail` string
  - `total` number
  - `discountedTotal` number
  - `userId` integer
  - `totalProducts` integer
  - `totalQuantity` integer

## Other responses

- `404`: Error

---

[API](https://skmtc.dev/dummyjson/apis/dummyjson-api.md) - [All operations](https://skmtc.dev/dummyjson/apis/dummyjson-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dummyjson/apis/dummyjson-api/revisions/5e704f33a559?raw)
