> For the complete documentation index, see [llms.txt](https://docs.getpurpledot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-a-headless-storefront/express-checkout.md). Agents can also search and read this documentation through its [MCP server](https://docs.getpurpledot.com/~gitbook/mcp).

# Set up express checkout for a headless storefront

Show pre-order state and open express checkout for one variant on a headless Shopify storefront.

Express checkout sells one pre-order immediately and does not add it to the Shopify cart. See [Express checkout](https://docs.getpurpledot.com/understanding-purple-dot/choosing-a-checkout-method.md#express-checkout).

## Before you start

* `@purple-dot/browser` is initialized with the public API key. See [Integrate with a headless storefront](https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-a-headless-storefront.md).
* The store's checkout method is express checkout.

## Steps

1. Read the selected variant:

```js
import * as api from '@purple-dot/browser/api';

const variant = await api.fetchVariantsPreorderState(variantId);
```

`state` is one of `NO_OPEN_WAITLISTS`, `AVAILABLE_IN_STOCK`, `ON_PREORDER`, or `SOLD_OUT`. For `ON_PREORDER`, label the button **Pre-order**, show `waitlist.display_dispatch_date`, and render `<purple-dot-learn-more />`. For `SOLD_OUT`, disable the button. Use `fetchProductsPreorderState(handle)` where no variant is selected, such as a collection card.

If the store uses [location-aware waitlists](https://docs.getpurpledot.com/understanding-purple-dot/inventory-and-virtual-locations.md#location-aware-waitlists), pass the shopper's country code as the second argument to either call, such as `fetchVariantsPreorderState(variantId, 'GB')`. See [Show pre-order state on a product page](https://docs.getpurpledot.com/e-commerce-platforms/other-and-custom/show-pre-order-state-on-a-product-page.md).

2. On the pre-order button, open express checkout for that variant. `releaseId` is `waitlist.id`. `variantId` is the Shopify variant id. `currency` is the store currency. `quantity` is the selected quantity, or `1`.

```js
import * as checkout from '@purple-dot/browser/checkout';

await checkout.openExpressCheckout({
  variantId: String(variantId),
  releaseId: variant.waitlist.id,
  currency: 'USD',
  quantity: 1,
});
```

Do not add the variant to the Shopify cart.

3. On the shopper page, render `<purple-dot-self-service />`. Set **Cancel link** under **Settings** > **Email** to that page. See [Customize shopper emails](https://docs.getpurpledot.com/set-up-and-launch/checkout-and-shopper-experience/customize-shopper-emails.md).

## Verify

Choosing **Pre-order** opens the Purple Dot checkout for that variant. The Shopify cart does not gain a line for it.

## Troubleshooting

* [The pre-order button is not showing](https://docs.getpurpledot.com/troubleshooting/storefront-and-checkout/pre-order-button-is-not-showing.md)

## Related

* **Concept:** [Express checkout](https://docs.getpurpledot.com/understanding-purple-dot/choosing-a-checkout-method.md#express-checkout)
* **Do this:** [Integrate with a headless storefront](https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-a-headless-storefront.md)
* **Look up:** [Public API](https://docs.getpurpledot.com/purple-dot-apis/public-api.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-a-headless-storefront/express-checkout.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
