payment.succeeded webhook on your server. Going live is the last step, and it’s mostly swapping keys.
Sandbox and production
Whop runs two environments that share nothing: not accounts, not keys, not products, not webhooks. You build in the sandbox and launch in production. Every value below changes between them.Get a sandbox API key
1
Sign up for the sandbox
Go to sandbox.whop.com and create an account. It’s separate from any account you have on whop.com. The sign-up flow creates your first business, which is the Account that owns API keys, products, webhooks, and payments.
2
Create an Account API key
Open sandbox.whop.com/dashboard/developer. In Account API Keys, select Create, and name the key something like
Local development.For this quickstart, use the Admin role. Before production, switch to a custom permission set that covers only the endpoints you call.3
Store the key on your server
Copy the key when Whop shows it, and put it in your local 
.env file with the environment it belongs to:
Keep
WHOP_API_KEY on your server. Don’t put API keys in browser code, mobile apps, or public repositories. Sandbox and production keys look identical, so name them so you can tell them apart.Install the SDK
This page needs SDK 2.7.0 or later. Earlier versions don’t accept the inline
variant on checkout configurations.Make your first call
Point the client at the environment named inWHOP_ENVIRONMENT and retrieve the account behind your key. This confirms the key works, and prints your account ID, which starts with biz_.
That’s your sandbox account. The key works.
Create a checkout
One call creates a variant and returns apurchase_url, a checkout page hosted on sandbox.whop.com.
variant_id instead of the inline variant. You can’t send both. Create Checkout Configuration lists every option, including recurring pricing, trials, and redirect URLs.
Listen for the webhook
Set up your endpoint before you pay, so thepayment.succeeded event has somewhere to land.
1
Add an endpoint
Add a While you develop, expose the route over HTTPS with ngrok, Cloudflare Tunnel, or another tunnel.
POST route that verifies the signature and logs the event. Verification needs the raw request body, so read it before any JSON parsing.2
Create the webhook in the sandbox dashboard
Open Developer > Webhooks in the sandbox dashboard, then select Create webhook. Paste the HTTPS address of your endpoint, keep the API version on 
v1, and select payment.succeeded.
3
Store the signing secret
Copy the secret from the webhook’s Secret column and add it to Restart your server so it picks up the new value.
.env exactly as shown, ws_ prefix included:Pay with a test card
Open thepurchase_url from the checkout step and pay with:
Within a few seconds, your server logs
payment.succeeded and the payment ID, which starts with pay_.
You’ve taken a payment and handled its webhook, end to end. Nothing was charged.
Go live
Sandbox and production share nothing, so going live means repeating the setup on whop.com with production credentials. Your code doesn’t change. Only the values in your environment do.1
Create a production key
Sign in at whop.com, open whop.com/dashboard/developer, and create an Account API key with only the permissions your integration uses.
2
Swap every value for its production twin
In your production environment, set all three variables to production values. Never reuse a sandbox key or secret in production, or the reverse.If you call the API directly, switch the base URL to
https://api.whop.com/api/v1.3
Recreate what you made in the sandbox
Products, variants, checkout configurations, and webhooks don’t carry over. Create the production webhook against your production URL and store its new signing secret.
4
Pin your API version
The SDK sends the version it was built against. If you call the API directly, send
Api-Version-Date on every request so later changes don’t alter your responses. See API versioning.Now build what you came for
You sell a subscription or a one-time product
Checkout links, the Checkout element, variants, and trials.
You owe money to people who aren't you
Payouts, transfers, balances, and the payout portal.
You take a cut of what other people sell
Subaccounts, collecting on their behalf, and paying them out.
You want distribution, not just infrastructure
Apps that run inside Whop, with auth, views, and the CLI.
Your product needs people talking to each other
Chat, DMs, and forums you can embed.
You just want to read the reference
Every resource in the Current API, with a playground on each endpoint.

