Paddle Billing
Search

Update an open checkout with Paddle.js

Pass items, discount, and customer information to a new Paddle.js method to update an open checkout.

What's new?

We added a new Paddle.Checkout.updateCheckout() method to Paddle.js that you can use to update items, discount, and customer information for an open checkout.

To complement this, we added a new checkout.updated event that's emitted when a checkout is updated using this new method.

How it works

You can use Paddle.Checkout.updateItems() to dynamically update items on an open checkout. This method only lets you update items, so it's perfect for simpler inline checkout implementations where you might want to add, remove, or change quantities of items on a checkout.

In more complex implementations, you might like to swap or remove a discount at the same time as changing items. For example, some discounts may be restricted to particular products or prices, so changing items on a checkout might make the discount incompatible.

The new Paddle.Checkout.updateCheckout() method lets you update discount and customer information, as well as updating items. You can pass discountId or discountCode along with an array of items to swap or remove the discount on an open checkout.

The Paddle.Checkout.updateItems() method is not deprecated. You can use it for simpler implementations when you only need to make changes to items for an open checkout.

Examples

This example passes an array of items and a discount code to Paddle.Checkout.updateCheckout().

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

Next steps

This change is live in Paddle.js now, so you can start using Paddle.Checkout.updateCheckout() when you're ready.

You don't need to do anything to get the latest version of Paddle.js — we serve the latest version automatically.

Learn more