> For the complete documentation index, see [llms.txt](https://developers.spiffy.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.spiffy.co/spiffyjs/introduction.md).

# Checkouts

Checkouts are scoped based on their URL which means you can access the checkout object at any time by using the `checkout(url, [configObj])` method ([see method docs](https://developers.spiffy.co/spiffyjs/methods.md#checkout-url-configobj)). If the checkout exists on the page it will access that instance or create a new instance

```javascript
spiffy.on('ready', function () {
    // find or create an instance of this checkout
    spiffy.checkout("https://yourcompany.spiffy.co/checkout/test-checkout")
})
```

Checkouts have shared instances. Meaning if you have the same checkout on the same page multiple times, any changes you make to the settings of one of them will affect all of them (eg, applying a discount).

This makes having multiple popups or a mixture of popups and an inline checkout easy to customize and manage.

{% hint style="info" %}
Accessing a checkout instance should only be done within the `ready` event to ensure SpiffyJS is fully mounted
{% endhint %}

## Updating Settings

When you're getting a checkout instance you can also pass in a [settings object](https://developers.spiffy.co/spiffyjs/introduction/settings.md) to make changes directly to that checkout instance:

```javascript
spiffy.on('ready', function () {
    // find or create an instance of this checkout
    spiffy.checkout("https://yourcompany.spiffy.co/checkout/test-checkout", {
        // set customer info
        customer: {
            email: 'jon@snow.com',
            name_first: 'Jon',
            name_last: 'Snow',
        }
    })
})
```
