Try the checkout playground
Customize colors, radius, and fields in real time, then copy the generated embed code.
React setup
Step 1: Install the package
Step 2: Add the checkout element
returnUrl to handle redirects from external payment providers. After a redirect, check the status query parameter:
- success: The payment succeeded. Use the receipt information to render a success page.
- error: The payment failed, or the customer canceled it. Remount the checkout so your customer can try again.
Step 3: Configure optional programmatic controls
To get access to the controls of the checkout embed, you can use theref prop.
submit
To submit checkout programmatically, you can use the submit method on the checkout element.
getEmail
To get the email of the user who is checking out, you can use the getEmail method on the checkout element.
setEmail
To enter the email of the user who is checking out, use the setEmail method on the checkout element.
getAddress
To get the address of the user who is checking out, you can use the getAddress method on the checkout element.
setAddress
To enter the address of the user who is checking out, use the setAddress method on the checkout element.
This method works only when you hide the address form. You can hide the
address form by setting the
hideAddressForm prop to true.Step 4: Configure optional properties
planId
Required - The plan id you want to checkout.
theme
Optional - The theme you want to use for the checkout.
Possible values are light, dark or system.
themeOptions
Optional - Fine-grained theme options for the checkout embed.
themeOptions.backgroundColor - A hex color to match the embed background to your site. The embed automatically picks light or dark text and tints its panels and inputs to fit the color, overriding theme.
themeOptions.accentColor - The accent color used for the submit button, focus rings, and links. Accepts any hex color — the embed derives the full accent palette from it, including a legible button text color. Named palette values like green or blue are also supported (the full list is under data-whop-checkout-theme-accent-color).
themeOptions.highContrast - Set to true to render the submit button with higher contrast on the checkout background.
themeOptions.borderRadius - The corner radius for the embed, in pixels. Inputs and containers use the value unchanged. Buttons scale proportionally (1.5×). Pass 0 for square corners.
sessionId
Optional - The session id to use for the checkout.
Use this property to attach metadata by creating a session through the API and passing its id to the checkout element.
returnUrl
Optional - The URL to redirect the user to after checkout completes.
affiliateCode
Optional - The affiliate code to use for the checkout.
hidePrice
Optional - Turn on to hide the price in the embedded checkout form.
Defaults to false
hideTermsAndConditions
Optional - Set to true to hide the terms and conditions in the embedded checkout form.
Defaults to false
skipRedirect
Optional - Set to true to skip the final redirect and keep the top frame loaded.
Defaults to false
adaptivePricing
Optional - Set to true to enable adaptive pricing on the embedded checkout. When the plan supports it, the checkout presents prices in the buyer’s local currency.
Defaults to false — embedded checkouts must opt in explicitly. The checkout charges buyers in the plan’s base currency unless you enable this property.
See Listening for currency changes to react to currency events from the embed or switch currencies programmatically.
collectPhoneNumbers
Optional - Set to true to require a phone number, "optional" to show a field that buyers may leave blank, or false to disable collection. When omitted, the checkout uses the plan’s feature setting.
collectShipping
Optional - Set to true to collect a shipping address during checkout, even when the plan doesn’t require one. This property works in the regular embedded checkout and the one click checkout button. Apple Pay supports shipping, but Google Pay support is pending. To hide the shipping address, use shipping.address.hidden.
locale
Optional - The language the checkout renders in, as a locale code (e.g. "es", "fr", "pt"). When omitted, the checkout falls back to the buyer’s browser language preference.
onComplete
Optional - A callback function that runs when the checkout completes.
This option will set
skipRedirect to truepayment_method_id — the saved payment method, ready to charge later without
waiting for the setup_intent.succeeded webhook.
utm
Optional - The marketing attribution parameters to add to the checkout URL.
Note - The keys must start with utm_
fallback
Optional - The fallback content to show while the checkout is loading.
prefill
Optional - The prefill options to apply to the checkout embed.
Used to prefill the email or address in the embedded checkout form.
This setting can help when integrating the embed into a funnel that collects the email before payment.
hideEmail
Optional - Set to true to hide the email input in the embedded checkout form. Make sure to display the users email in the parent page when setting this attribute.
Defaults to false
Use this in conjunction with the
prefill attribute or the setEmail method
to control the email input.disableEmail
Optional - Set to true to disable the email input in the embedded checkout form.
Defaults to false
Use this in conjunction with the
prefill attribute or the setEmail method
to control the email input.hideAddressForm
Optional - Set to true to hide the address form in the embedded checkout form.
Defaults to false
Use this in conjunction with the
setAddress method to control the address
input.setupFutureUsage
Optional - The future usage setting for the checkout. When using the chargeUser API, set this property to off_session. The checkout then filters out unsupported payment methods.
onStateChange
Optional - A callback function that runs when the checkout state changes.
Use this callback when programmatically submitting the checkout embed.
Possible values are loading, ready, disabled.
environment
Optional - The environment to use for the checkout.
Possible values are production or sandbox.
Defaults to production
When using
sandbox, make sure to use a sandbox plan ID. Sandbox plans can be
created in the sandbox dashboard.onAddressValidationError
Optional - A callback function that runs when an address validation error occurs.
This method works only when you hide the address form. You can hide the
address form by setting the
hideAddressForm prop to true.onPaymentError
Optional - A callback function that runs when checkout payment processing fails.
The callback receives an error object with a human-readable message and an optional machine-readable code. It fires for submission declines. It also fires for payment-processing failures from 3D Secure and external redirects.
onPromoCodeChanged
Optional - A callback function that runs when the promo code changes.
The callback receives the full promotion code object when someone applies a code, or null when someone removes it.
styles
Optional - Customize the padding of the checkout embed container.
The styles prop accepts a container object with the following properties:
Individual properties take precedence over their shorthand equivalents.
Full example
Other websites
Step 1: Add the script tag
To embed checkout, you need to add the following script tag into the<head> of your page:
Step 2: Add the checkout element
To create a checkout element, you need to include the following attributes on an element in your page:data-whop-checkout-return-url to handle redirects from external payment providers. After a redirect, check the status query parameter:
- success: The payment succeeded. Use the receipt information to render a success page.
- error: The payment failed, or the customer canceled it. Remount the checkout so your customer can try again.
Step 3: Configure optional programmatic controls
First, attach anid to the checkout container:
submit
To submit checkout programmatically, you can use the submit method on the checkout element.
getEmail
To get the email of the user who is checking out, you can use the getEmail method on the checkout element.
setEmail
To enter the email of the user who is checking out, use the setEmail method on the checkout element.
getAddress
To get the address of the user who is checking out, you can use the getAddress method on the checkout element.
setAddress
To enter the address of the user who is checking out, use the setAddress method on the checkout element.
This method works only when you hide the address form. You can hide the
address form by setting the
data-whop-checkout-hide-address prop to true.Step 4: Configure optional attributes
data-whop-checkout-plan-id
Required - The plan id you want to checkout.
To get your plan id, you need to first create a plan in the Manage Pricing section on your whop page.
data-whop-checkout-theme
Optional - The theme you want to use for the checkout.
Possible values are light, dark or system.
data-whop-checkout-theme-accent-color
Optional - The accent color to apply to the checkout embed.
Accepts any hex color like #7c3aed — the embed derives the full accent palette from it, including a legible button text color. The following named palettes are also supported:
tomatoredrubycrimsonpinkplumpurplevioletiriscyantealjadegreengrassbrownblueorangeindigoskymintyellowamberlimelemonmagentagoldbronzegray
data-whop-checkout-theme-background-color
Optional - The background color to apply to the checkout embed.
Accepts a hex color like #09090b. The embed automatically picks light or dark text and tints its panels and inputs to fit the color, overriding data-whop-checkout-theme.
data-whop-checkout-theme-border-radius
Optional - The corner radius to apply to the checkout embed, in pixels.
Inputs and containers use the value unchanged. Buttons scale proportionally (1.5×). Pass 0 for square corners.
data-whop-checkout-session
Optional - The session id to use for the checkout.
Use this attribute to attach metadata by creating a session through the API and passing its id to the checkout element.
data-whop-checkout-return-url
Optional - The URL to redirect the user to after checkout completes.
data-whop-checkout-affiliate-code
Optional - The affiliate code to use for the checkout.
data-whop-checkout-hide-price
Optional - Set to true to hide the price in the embedded checkout form.
Defaults to false
data-whop-checkout-hide-submit-button
Optional - Set to true to hide the submit button in the embedded checkout form.
Defaults to false
When using this Option, you will need to programmatically submit
the checkout form.
data-whop-checkout-hide-tos
Optional - Set to true to hide the terms and conditions in the embedded checkout form.
Defaults to false
data-whop-checkout-skip-redirect
Optional - Set to true to skip the final redirect and keep the top frame loaded.
Defaults to false
data-whop-checkout-adaptive-pricing
Optional - Set to true to enable adaptive pricing on the embedded checkout. When the plan supports it, the checkout presents prices in the buyer’s local currency.
Defaults to false — embedded checkouts must opt in explicitly. The checkout charges buyers in the plan’s base currency unless you enable this attribute.
See Listening for currency changes to react to currency events from the embed or switch currencies programmatically.
data-whop-checkout-collect-phone-numbers
Optional - Set to true to require a phone number, optional to show a field that buyers may leave blank, or false to disable collection. When omitted, the checkout uses the plan’s feature setting.
data-whop-checkout-collect-shipping
Optional - Set to true to collect a shipping address during checkout, even when the plan doesn’t require one. To hide the shipping address, use shipping.address.hidden.
data-whop-checkout-locale
Optional - The language the checkout renders in, as a locale code (e.g. "es", "fr", "pt"). When omitted, the checkout falls back to the buyer’s browser language preference.
data-whop-checkout-on-complete
Optional - The callback to call when the checkout succeeds
This option will set
data-whop-checkout-skip-redirect to truedata-whop-checkout-on-state-change
Optional - The callback to call when state of the checkout changes
Use this callback when programmatically submitting the checkout embed.
Possible values are loading, ready, disabled.
data-whop-checkout-skip-utm
By default, the checkout forwards marketing attribution parameters from the main page to the embed.
Optional - Set to true to prevent automatic forwarding of marketing attribution parameters
Defaults to false
data-whop-checkout-prefill-*
Use these attributes to prefill the email or address in the embedded checkout form. They can help with a funnel that collects the email before payment.
data-whop-checkout-hide-email
Optional - Set to true to hide the email input in the embedded checkout form. Make sure to display the users email in the parent page when setting this attribute.
Defaults to false
Use this in conjunction with the
data-whop-checkout-prefill-email attribute
or the setEmail method to control the email input.data-whop-checkout-disable-email
Optional - Set to true to disable the email input in the embedded checkout form.
Defaults to false
Use this in conjunction with the
data-whop-checkout-prefill-email attribute
or the setEmail method to control the email input.data-whop-checkout-hide-address
Optional - Set to true to hide the address form in the embedded checkout form.
Defaults to false
This method works only when you hide the address form. You can hide the
address form by setting the
data-whop-checkout-hide-address prop to true.data-whop-checkout-setup-future-usage
Optional - The future usage setting for the checkout. When using the chargeUser API, set this attribute to off_session. The checkout then filters out unsupported payment methods.
data-whop-checkout-environment
Optional - The environment to use for the checkout.
Possible values are production or sandbox.
Defaults to production
When using
sandbox, make sure to use a sandbox plan ID. Sandbox plans can be
created in the sandbox dashboard.data-whop-checkout-on-address-validation-error
Optional - The callback to call when the address validation error occurs.
This method works only when you hide the address form. You can hide the
address form by setting the
data-whop-checkout-hide-address prop to true.data-whop-checkout-on-payment-error
Optional - The callback to call when checkout payment processing fails.
The callback receives an error object with a human-readable message and an optional machine-readable code. It fires for submission declines. It also fires for payment-processing failures from 3D Secure and external redirects.
data-whop-checkout-on-promo-code-changed
Optional - The callback to call when the promo code changes.
The callback receives the full promotion code object when someone applies a code, or null when someone removes it.
data-whop-checkout-style-*
Optional - Customize the padding of the checkout embed container.
The attribute pattern is data-whop-checkout-style-container-{property} where {property} is a kebab-case padding property.
Individual properties take precedence over their shorthand equivalents.
Full example
Listening for currency changes
When you enableadaptivePricing, the embedded checkout exposes available and active currencies through callbacks, a programmatic getter, and a setter.
The currency snapshot has the following shape:
React
Use theonCurrenciesAvailable and onCurrencyChanged props to react to currency events. You can also read the latest snapshot from the embed reference with getAvailableCurrencies(). Switch to another supported currency with setDisplayCurrency().
HTML and JavaScript
Set callbacks via data attributes pointing to functions onwindow. Use wco.getAvailableCurrencies(identifier) to read the latest snapshot and wco.setDisplayCurrency(identifier, currency) to switch.
setDisplayCurrency only accepts currencies present in the most recent
onCurrenciesAvailable snapshot. The method rejects any other currency with
WhopCheckoutSetDisplayCurrencyError.Apple Pay
Apple Pay lets customers pay using their Apple Wallet, providing a seamless checkout experience on Safari and iOS devices. To enable Apple Pay on your embedded checkout, you need to verify ownership of your domain.Set up Apple Pay
Learn how to verify your domain and enable Apple Pay for embedded checkout
When using the
hideSubmitButton option in React, use
@whop/checkout@0.0.43 or later to display Apple Pay in the embed.Platform-specific guides
GoHighLevel
Process GoHighLevel payments through Whop
Frequently asked questions
Why is my checkout not loading?
Why is my checkout not loading?
Make sure you’ve replaced
plan_XXXXXXXXX or PLAN_ID_HERE in the code snippets with your actual Plan ID from the Whop dashboard. If you’re using HTML/JS, also verify that the browser loads the script tag from the <head> section.Where do I find my Plan ID?
Where do I find my Plan ID?
Go to your Dashboard > Checkout links > Click the three dots (⋮) on your pricing option > Hover over Details > Click the ID (starts with
plan_) to copy it.Can I embed multiple checkouts on the same page?
Can I embed multiple checkouts on the same page?
Yes, you can add multiple checkout embeds with different Plan IDs. Each embed operates independently.
How do I change the checkout theme?
How do I change the checkout theme?
For React: add
theme="dark" or theme="light" as a property. For HTML: add data-whop-checkout-theme="dark" to your div element.Can I hide the price in the embedded checkout?
Can I hide the price in the embedded checkout?
Yes, add
hidePrice={true} in React or data-whop-checkout-hide-price="true" in HTML to hide the price display.What happens after a customer completes checkout?
What happens after a customer completes checkout?
By default, Whop redirects customers to your whop. You can customize this by setting a custom redirect URL or skipping the redirect entirely.
How do I prevent the redirect after checkout?
How do I prevent the redirect after checkout?
Use
skipRedirect={true} in React or data-whop-checkout-skip-redirect="true" in HTML to keep users on the same page.Is the embedded checkout mobile-responsive?
Is the embedded checkout mobile-responsive?
Yes, the checkout automatically adapts to different screen sizes and devices.
Can I customize the checkout's appearance with CSS?
Can I customize the checkout's appearance with CSS?
You can style the wrapper using the
.whop-checkout-wrapper iframe CSS class, but you can’t modify the checkout content for security reasons.Can I pre-fill customer information?
Can I pre-fill customer information?
Yes, use
prefill={{ email: "customer@example.com" }} in React or data-whop-checkout-prefill-email="customer@example.com" in HTML.
