Setup guide

Running Whop as the checkout on a Shopify store

Shopify stays your storefront, catalog and order system. Whop takes the payment. A small Cloudflare Worker sits in between and connects the two. Plan about a day for the first store.

How it fits together

Whop cannot be added as a payment gateway inside Shopify's own checkout, so the checkout button is pointed at your own pay page instead.

1. Shopper taps Checkout on the Shopify storeA small script in the theme catches the tap and sends the cart to your Worker instead of Shopify checkout.
2. Worker prices the cartIt asks Shopify for the real prices, discounts and shipping, then saves a short-lived checkout session.
3. Shopper lands on your pay pageA page on your own subdomain, for example checkout.yourstore.com, showing the order summary and Whop's payment form.
4. Whop takes the paymentCard, Apple Pay and Google Pay, processed on your Whop business.
5. Whop tells the Worker the payment succeededA signed webhook, sent server to server.
6. Worker creates a paid order in ShopifyWith customer, address, line items and shipping. From here fulfilment works exactly as it does today.

What you need before starting

Shopify storeAdmin access, and the ability to create an app for your own store.
Whop businessVerified, with a payout method set. One business per store.
Cloudflare accountOn the Workers Paid plan ($5 a month). The free plan's storage limits run out on a busy day and checkout stops.
A subdomaincheckout. on the store's domain, or on a second domain you own.
Someone to build itA developer or an AI coding tool. There is a ready build brief at the bottom of this page.

Setup steps

Do them in this order. Each one depends on the one before.

1

Set up the Whop business

2

Create a Whop API key

In the Whop dashboard under Developer, create a company API key with these permissions:

Note your company id (it starts with biz_). The API lives at https://api.whop.com/api/v1. Check the key works by calling the account endpoint and confirming it returns your business.

3

Create a Shopify app for your store

Create an app for your own store (Shopify Dev Dashboard, or a custom app in the admin) and install it. It needs two things:

4

Build and deploy the Worker

One Cloudflare Worker with one KV namespace for storage. It needs these routes:

RouteWhat it does
POST /checkoutReceives the cart (variant ids and quantities) from the store. Builds a cart through Shopify's Storefront API to get real prices, discounts and currency. Saves a session and returns the pay page link.
GET /pay/:idThe pay page: logo, order summary, shipping cost, total, email and address fields, and Whop's embedded checkout.
POST /pay/:id/confirmCreates a Whop checkout configuration for the exact session total (one-time price, your company id, the session id in metadata, a redirect back to the thanks page) and hands its id to the page.
POST /webhooks/whopReceives payment events from Whop and creates the Shopify order.
GET /thanks/:idOrder confirmation page.
GET /.well-known/apple-developer-merchantid-domain-associationServes the Apple Pay file (step 7).

Rules the Worker has to follow or orders will go wrong:

Store the Whop API key, Whop webhook secret and Shopify credentials as Worker secrets, not in the code.

5

Put the Worker on your subdomain

Add the domain to Cloudflare and attach checkout.yourstore.com to the Worker as a custom domain. Wait until it loads over HTTPS before going further, since Whop and Apple both check it.

6

Create the Whop webhook

Deploy the Worker first, because Whop tests the address. Then create a webhook pointing at https://checkout.yourstore.com/webhooks/whop and subscribe it to:

Save the webhook's signing secret as a Worker secret.

7

Turn on Apple Pay

8

How the Shopify order is created

When the payment succeeded event arrives, the Worker loads the session named in the payment's metadata and creates the order through the Shopify Admin API with:

For refund and dispute events, tag the Shopify order so you see it in the admin. Refunds themselves are issued in Whop.

9

Add the checkout script to the theme

Work on a duplicate of your live theme first. Add one small script, loaded on every page, that:

Hide Shopify's own express buttons (Shop Pay, PayPal and so on) in the theme, or shoppers will slip past into the native checkout.
10

Test with a real payment

11

Go live

Publish the theme with the script. Keep a backup of the old theme so you can switch back in one click. Watch the first real orders arrive in Shopify, and for the first days compare Whop's payments list against Shopify orders to confirm every payment has an order.

Good to know

Build brief

Paste this to your developer or AI coding tool along with your own keys.

Build a Cloudflare Worker (with one KV namespace) that lets my Shopify store take payment through Whop instead of Shopify checkout. Read the current Whop API docs (docs.whop.com) and Shopify Admin and Storefront API docs before writing code.

Inputs I will provide as Worker secrets and vars:
- Shopify store domain, Admin API credentials (scopes: read_products, read_orders, write_orders, read_customers, write_customers, read_themes, write_themes), Storefront API token
- Whop company API key, Whop company id (biz_...), Whop webhook secret
- Store name, logo URL, store URL, support email, checkout hostname

Routes:
1. POST /checkout: accept {items:[{variant_id, quantity}], discount_code?} only from my store's origin. Create a cart with Shopify's Storefront API to get authoritative prices, discounts and currency. Read shipping rates from my Shopify shipping zones. Save a session in KV. Return the pay page URL.
2. GET /pay/:id: render a mobile-first branded page with order summary, shipping, total, email field, shipping address fields and Whop's embedded checkout.
3. POST /pay/:id/confirm: save the email and address to the session, then create a Whop checkout configuration with a one-time plan priced at the exact session total in the session currency, my company id, metadata containing the session id, and a redirect URL to /thanks/:id. Return the configuration id for the embed.
4. POST /webhooks/whop: verify the signature. On payment succeeded, load the session from the payment metadata and create a Shopify order: line items by variant id, customer email, shipping and billing address, phone, shipping line, discount, financial_status paid with a successful sale transaction, inventory decrement, send_receipt true, Whop payment id in note and tags. Be idempotent per payment id. On refund and dispute events, tag the Shopify order.
5. GET /thanks/:id: confirmation page showing the order number once the order exists.
6. GET /.well-known/apple-developer-merchantid-domain-association: serve Whop's platform integrator association file.

Requirements:
- Never trust prices from the browser.
- Email is collected on my page and required before payment, because wallet payments do not return it.
- Guarantee a non-empty last name and strip emoji from names before sending to Shopify.
- If the webhook cannot create the order, store the failure so it can be retried, and never create two orders for one payment.
- Sessions expire after a few days, not hours.

Also deliver:
- A small theme script that intercepts every checkout button (cart page, drawer, buy now), reads /cart.js, calls POST /checkout and redirects, with a fallback to native checkout on error.
- A setup script or steps for: creating the Whop webhook (payment, refund, dispute events), registering and verifying the checkout hostname as a Whop payment method domain for Apple Pay.
- A test plan using a hidden $1 product.