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

# Paddle.Checkout.close()

Use to close an opened checkout.

---

Use `Paddle.Checkout.close()` to close [an opened checkout](https://developer.paddle.com/paddle-js/methods/paddle-checkout-open.md).

Typically used when working with [overlay checkout](https://developer.paddle.com/concepts/sell/overlay-checkout.md) to close the Paddle Checkout overlay. If used with [inline checkout](https://developer.paddle.com/concepts/sell/branded-integrated-inline-checkout.md), removes the Paddle Checkout iframe from the DOM.

{% callout type="note" %}
For success workflows, you can redirect to a success URL or pass an `eventCallback` to `Paddle.Initialize()` for `checkout.completed`. See [Handle checkout success](https://developer.paddle.com/build/checkout/handle-success-post-checkout.md).
{% /callout %}

## Example

This example shows how you can use `Paddle.Checkout.close()` to close an inline checkout.

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

```html
<!-- Checkout buttons -->
<button onclick="openCheckout()">Open checkout</button>
<button onclick="closeCheckout()">Close checkout</button>

<!-- Inline checkout container -->
<div class="checkout-container"></div>

<script type="text/javascript">
  Paddle.Initialize({
    token: "live_7d279f61a3499fed520f7cd8c08",
  });

  function openCheckout() {
    var items = [
      {
        priceId: "pri_01gsz8x8sawmvhz1pv30nge1ke",
        quantity: 10,
      },
      {
        priceId: "pri_01gsz95g2zrkagg294kpstx54r",
        quantity: 1,
      },
      {
        priceId: "pri_01gsz98e27ak2tyhexptwc58yk",
        quantity: 1,
      },
    ];

    var settings = {
      displayMode: "inline",
      theme: "light",
      locale: "en",
      frameTarget: "checkout-container",
      frameStyle: "min-width: 600px;",
      frameInitialHeight: "450",
    };

    // Open checkout
    Paddle.Checkout.open({
      settings: settings,
      items: items,
    });
  }

  // Close checkout
  function closeCheckout() {
    Paddle.Checkout.close();
  }
</script>
```

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

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

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

paddle?.Checkout.close();
```

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