> For the complete documentation index, see [llms.txt](https://docs.tebex.io/developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tebex.io/developers/headless-api/guides/baskets/update-package-quantity.md).

# Update Package Quantity

You will provide the basket and package ID being modified and a `quantity` value reflecting the user's desired quantity of that package.

{% hint style="info" %}
The user must be authorized before package quantities can be changed, otherwise the request will fail. See [Authorize a Basket](/developers/headless-api/guides/baskets/authorize-a-basket.md)
{% endhint %}

## Update package quantity

> Sets the quantity of the given item in the basket. The user must be logged in before the quantity can be changed.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.0.0"},"tags":[{"name":"Baskets","description":"Endpoints requiring only a basket ident with no token"}],"servers":[{"url":"https://headless.tebex.io/api/accounts/{token}","description":"Main API scoped to public token","variables":{"token":{"default":"","description":"The store's public token"}}}],"paths":{"/{basketIdent}/packages/{packageId}":{"put":{"tags":["Baskets"],"operationId":"updatePackageQuantity","summary":"Update package quantity","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"description":"Sets the quantity of the given item in the basket. The user must be logged in before the quantity can be changed.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"quantity":{"type":"integer"}}}}}},"responses":{"200":{"description":"Successful response."},"422":{"description":"The provided request is invalid. The error response will include detail as to which parameter failed validation."}}}}},"components":{"parameters":{"basketIdent":{"name":"basketIdent","in":"path","required":true,"schema":{"type":"string"},"description":"The basket identifier."}}}}
```
