> ## Documentation Index
> Fetch the complete documentation index at: https://docs.smartwpplugins.com/llms.txt
> Use this file to discover all available pages before exploring further.

# The boot payload

> What the admin panel is handed at load time, and how to add to it

The admin panel is a bundle of its own, and it publishes no JavaScript API. There's one global, and it's data rather than code: the payload the panel is handed before its first fetch.

> [!WARNING]
>
> This exists on the plugin's admin page only. Nothing is enqueued on your storefront, so there's no front-end equivalent and there won't be one.

## The boot payload

Everything the panel is handed at load time is on `window.cartPresetsBoot`:

| Key | Holds |
| - | - |
| `restUrl` | The REST base for `cartpresets/v1` |
| `homeUrl` | The site's home URL |
| `version` | Plugin version |
| `now` | The store's current time, on the store's clock rather than the browser's |
| `currency` | Code, symbol, position, decimals and separators |
| `statuses` | The derived status ladder |
| `filterFields` | The listing's filter fields, each with its operators, from the allow-list the REST route validates against. `listed` marks the ones the **Filters** popover offers, and `pro` marks the ones locked on the free version |
| `settings` | Resolved store settings |
| `isPro` | Whether Pro is running |
| `counts` | Presets per derived status, plus `all`, for the whole store. The same numbers `GET /presets` returns, so the list can draw its header, status tabs and pager before its first fetch |
| `upgradeUrl` | Where the upgrade call to action points |
| `carrierReady` | Whether a usable carrier product is linked. The editor warns when a custom item would need one and there isn't one |
| `links` | Every address the panel links out to: the documentation, support, reviews and, on Pro, the licence account. Filterable through [`cartpresets_admin_links`](https://docs.smartwpplugins.com/cartpresets/developers/hooks-reference#the-admin-panel) |
| `notices` | The wording catalogue, as `groups` and `items` |
| `licence`Pro | `status` (`active`, `expired`, `cancelled` or `inactive`) and `expires` (an ISO date, or `null`), added by Pro through `cartpresets_admin_boot` |

If you work out a status yourself, use `now`. A preset's status is derived live, and `new Date()` answers in the visitor's timezone. A merchant abroad, or anyone near midnight, would otherwise see a status the server disagrees with.

## Adding your own keys

Add them from PHP through [`cartpresets_admin_boot`](https://docs.smartwpplugins.com/cartpresets/developers/hooks-reference#the-admin-panel), and read them here without a second request.

```php theme={null}
add_filter( 'cartpresets_admin_boot', function ( $data ) {
	$data['myPlugin'] = array( 'enabled' => true );

	return $data;
} );
```

```js theme={null}
const mine = window.cartPresetsBoot.myPlugin;
```

> [!WARNING]
>
> That filter is additive only. Removing or rewriting an existing key breaks the panel, and nothing downstream checks.

## Nothing else is exported

The panel's pricing, status and formatting helpers are internal, and there's no component library to import.

If you need the same values, ask the server. It's the code the cart itself runs:

| You want | Ask for |
| - | - |
| A preset's totals | The `totals` block on a preset from [`GET /presets`](https://docs.smartwpplugins.com/cartpresets/developers/rest-api) |
| A preset's derived status | `derived_status` on the same payload |
| Money or a date formatted to store settings | WooCommerce's own `wc_price()` and `wc_format_datetime()`, which is where the panel's currency and date settings come from |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.