# 按购物车ID更新购物车商品

更新现有的购物车商品或在购物车中创建商品。

Endpoint: PUT /v2/project/{project_id}/cart/{cart_id}/item/{item_sku}
Version: 2.0.0
Security: AuthForCart

## Path parameters:

  - `project_id` (integer, required)
    项目ID。您可以在帐户中项目名称旁找到该参数，也可在操作项目时从浏览器地址栏中获取。URL格式如下：https://xsolla.com/for//account//projects//。
    Example: 44056

  - `cart_id` (string, required)
    购物车ID。
    Example: "custom_id"

  - `item_sku` (string, required)
    商品SKU。
    Example: "booster_mega_1"

## Request fields (application/json):

  - `quantity` (number)
    商品数量。

## Response 404 fields (application/json):

  - `statusCode` (integer)
    Example: 404

  - `errorCode` (integer)
    Example: 4001

  - `errorMessage` (string)
    Example: "[0401-4001]: Item with Project Id = 44056 and Sku = booster_mega_12222 not found"

## Response 422 fields (application/json):

  - `statusCode` (integer)
    Example: 422

  - `errorMessage` (string)
    Example: "Item quantity must be non-negative integer."

  - `errorCode` (integer)
    Example: 1102


## Response 204 fields
