Quick triage
API request errors
Whop returns standard HTTP status codes. When a request fails, the response body tells you why. Most errors include a code and a message:error and error_description fields instead. See OAuth errors for those cases.
Rate limits
For/api/v1 requests, Whop tracks request volume per API operation and API credential. The default limit is 600 requests per minute.
When you exceed the limit, the API returns 429 with:
API authentication
Use the credential that matches where the code runs.
If an API request fails:
- Confirm the environment matches the key: the SDK’s
Productionenvironment (the default) for production keys andSandboxfor sandbox keys, orhttps://api.whop.com/api/v1andhttps://sandbox-api.whop.com/api/v1when you call the API directly. - Confirm IDs use Whop tag prefixes like
biz_,user_,mem_,plan_,prod_,app_,pay_, orch_, not internal numeric IDs. - Log the HTTP status, response body, endpoint, and request ID if Whop returns one.
- Retry only when the error is transient or rate-limited. Don’t retry
401,403, or validation errors without changing the request.
Permissions and scopes
403 and insufficient_scope errors usually mean the credential is valid but can’t perform that action.
- For Whop apps, confirm the app requests the required permissions in Permissions, then save the app settings and reinstall or reauthorize when needed.
- For OAuth, request only the scopes your feature needs, then make sure the user completed the OAuth flow after you added those scopes.
- For dashboard-created API keys, confirm the key belongs to the account whose ID you pass (
company_idoraccount_id, depending on the endpoint). - For connected accounts, confirm whether the parent or child account should own the action before choosing the account you pass.
OAuth errors
OAuth errors return a standard payload or redirect query string witherror and error_description.
Checkout errors
The Checkout element and iOS checkout can fail for different reasons. Debug them the same way: check the variant or checkout configuration, inspect the error callback, and confirm fulfillment on your server.Checkout element
- Attach
onError. It runs when the element fails to load or crashes, with amessageand acodefor programmatic handling. - If you pass the compatibility property
plan, confirm the variant exists, is active, and belongs to the account you expect. - If you pass
checkoutConfiguration, confirm your server created it and that you passed itsch_ID. - Every option is set at creation. To change the order, mount a new checkout instead of calling
update(). - A failed payment reopens the same checkout with the reason shown, so the buyer can pay again without a remount.
- Provide a
returnUrlon a route that can render success and retry states. An off-site step such as 3DS or a bank page returns the buyer there. - Use webhooks for fulfillment. The redirect is useful for UI, but your server should rely on
payment.succeeded.
iOS checkout
Handle expected and unexpected failures with different paths:
Webhook delivery
Common webhook issues:- No event received: confirm the webhook URL is publicly reachable, uses
https, and belongs to the right account and environment. - Signature verification fails: pass the raw request body to
unwrapWebhook. Don’t parse JSON before verification. - Retries keep happening: return a
2xxresponse quickly after verification, before starting long-running work in a background job. - Duplicate fulfillment: Whop delivers webhooks at least once. Store
webhook-idor another event identifier and make the handler idempotent. - Unexpected order: don’t assume events arrive in chronological order. Fetch the current resource state when ordering matters.
Element errors
Every Whop Element accepts anonError callback. It runs when the element fails to load or crashes, and the value carries a message, an optional code for programmatic handling, and a sourceKey when a host-state source failed.
Always attach it while developing:
- Confirm the access token was minted for the account you expect and carries the scopes the element’s reference page lists.
- On your own domain, always pass an
accessToken. The viewer’s session only works on whop.com. - Confirm the container exists before calling
mount. React components mount themselves. - Listen for
onReadyso you know whether the element initialized. - If the element enters an unrecoverable state, call
destroy()and create a new one.
Sandbox and production
Sandbox data and production data are separate.
When switching from sandbox to production:
- Create new production API keys.
- Switch the SDK environment from
SandboxtoProduction, or remove a 1.xbaseUrl/base_url/WithBaseURLsandbox override. - Recreate sandbox-only products, checkout links, webhooks, and connected-account records in production.
- Confirm webhook URLs point to production infrastructure, not a local tunnel.
What to include when asking for help
Include as much of the following as you can:- The endpoint, SDK method, or element name that failed.
- The environment: sandbox or production.
- The status code, error body, OAuth
error_description, or elementonErrorvalue. - The Whop IDs involved, with secrets removed.
- The webhook event ID or
webhook-idheader for webhook issues. - A short code snippet showing how you create the client, checkout, OAuth URL, webhook handler, or element.
OAuth
Build the OAuth 2.1 + PKCE flow and handle token refresh.
Webhooks
Verify signatures before processing events, and handle retries.
Permissions
Choose app permissions and explain them to creators.
Test in sandbox
Test API calls and checkout flows without touching production.

