# Change a line's quantity; zero removes it

`PUT /public/shop/carts/{id}/lines/{variantId}` · Rivier · shop

Change a line's quantity; zero removes it.

- Scope: shop:read
- Sdk: shop.publicCart.setLine
- Cli: shop public cart set line
- Publishable: yes

## Parameters

- `id` (path, required), string
- `variantId` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "quantity": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
    }
  },
  "required": [
    "quantity"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X PUT 'https://api.rivier.ai/public/shop/carts/{id}/lines/{variantId}' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "quantity": 0
}'
```
