Checkout

The Checkout component provides a complete purchase flow with customer info, payment (Stripe), and confirmation.

What you get

  • Customer, billing, and shipping info

  • Gift and marketing preferences

  • Promo codes and gift cards

  • Order summary and totals

  • Hosted checkout or drawer checkout

Default: drawer checkout

Checkout opens automatically from the cart drawer. No setup required.

Hosted checkout (inject)

const client = await Elements('YOUR_API_KEY', { env: 'production' });
await client.injectCheckoutElement({
  containerId: 'checkout',
  checkoutId: 'optional_checkout_id',
  hideHeader: false
});

Hosted checkout (URL param)

Hosted checkout uses two things together:

  1. data-checkout-url on the main script (so the cart can redirect to your hosted checkout page).

  2. data-checkout-param on the hosted page (so it can read the checkout ID from the URL).

Hosted page example:

Main script example (cart redirects here):

Hosted checkout UI controls

Use these attributes on the hosted checkout page to customize the UI:

  • hide-header on the checkout container Hides the SDK header so you can render your own.

  • data-lce-exit-checkout on any element Lets you build your own “Exit checkout” button or link.

Checkout-only build

If a page only needs hosted checkout, use the checkout-only script. It supports the same hosted-checkout attributes but ships ~50% less JavaScript for faster load time.

Checkout actions

Checkout events (examples)

Last updated