> For the complete documentation index, see [llms.txt](https://developer.paddle.com/llms.txt).

# Paddle.Checkout.updateItems()

Use to dynamically update the items list of an open checkout.

---

Use `Paddle.Checkout.updateItems()` to dynamically update the items list for an open checkout.

Typically used with [inline checkout](https://developer.paddle.com/build/checkout/build-branded-inline-checkout.md) to update quantities or add addons to the checkout.

To use this method, a checkout should already be opened. Use [the `Paddle.Checkout.open()` method](https://developer.paddle.com/paddle-js/methods/paddle-checkout-open.md) to open a checkout.

Pass an array of objects, where each object contains a `priceId` and `quantity` property. `priceId` should be a Paddle ID of [a price entity](https://developer.paddle.com/api-reference/prices/overview.md).

{% callout type="info" %}
Recurring items on a checkout must have the same billing interval. For example, you can't have a checkout with some prices that are billed monthly and some products that are billed annually.
{% /callout %}

Paddle expects the complete list of items that you want to be on the checkout — including existing items. If you don't include an existing item, it's removed from the checkout. To learn more, see [Work with lists](https://developer.paddle.com/api-reference/about/lists.md)

{% callout type="note" %}
Use the [`Paddle.Checkout.updateCheckout()`](https://developer.paddle.com/paddle-js/methods/paddle-checkout-updatecheckout.md) method to update discount and customer information, as well as items. You might do this when you need to swap or remove a discount when updating items.
{% /callout %}

## Parameters

```yaml
title: Paddle.Checkout.updateItems() parameters
type: object
properties:
  items:
    type: array
    description: List of items for this checkout.
    items:
      type: object
      properties:
        priceId:
          type: string
          examples:
            - pri_01gm81eqze2vmmvhpjg13bfeqg
          description: Paddle ID of the price for this item.
        quantity:
          type:
            - integer
            - "null"
          examples:
            - 1
          description: Quantity for this line item.
```

## Example

This example passes an array called `itemsList` to `Paddle.Checkout.updateItems()`.

If successful, the items on the opened checkout are updated.

{% tabs sync="paddlejs-preference" %}
{% tab-item title="Using a script tag" %}

```js
var itemsList = [
  {
    priceId: "pri_01gm81eqze2vmmvhpjg13bfeqg",
    quantity: 1,
  },
  {
    priceId: "pri_01gm82kny0ad1tk358gxmsq87m",
    quantity: 1,
  },
  {
    priceId: "pri_01gm82v81g69n9hdb0v9sw6j40",
    quantity: 1,
  },
];

Paddle.Checkout.updateItems(itemsList);
```

{% /tab-item %}
{% tab-item title="Using a JavaScript package manager" %}

```ts
import { initializePaddle } from "@paddle/paddle-js";

const paddle = await initializePaddle({
  token: "live_7d279f61a3499fed520f7cd8c08",
});

const itemsList = [
  {
    priceId: "pri_01gm81eqze2vmmvhpjg13bfeqg",
    quantity: 1,
  },
  {
    priceId: "pri_01gm82kny0ad1tk358gxmsq87m",
    quantity: 1,
  },
  {
    priceId: "pri_01gm82v81g69n9hdb0v9sw6j40",
    quantity: 1,
  },
];

paddle?.Checkout.updateItems(itemsList);
```

{% /tab-item %}
{% /tabs %}

To learn more, see [Pass or update checkout items](https://developer.paddle.com/build/checkout/pass-update-checkout-items.md)