Skip to main content
This guide shows how to recreate the core of the Mercor Clone demo using Whop Rails. You’ll build the key pages, wire up payments with the Checkout element, and pay subaccounts at scale. To see the example repository, visit the Mercor clone repository. Otherwise, follow the tutorial below to get started:
Set environment variables
Install dependencies
Create one Whop client for your server routes. The SDK sends the API version it was generated from on every request.

1) Project structure and pages

Create an App Router structure (Next.js) that mirrors the marketplace flows. Add recruiter pages for funding and managing gigs, earner pages for payouts and submissions, and an admin surface if needed. Folder structure
Example minimal recruiter balance page
Example minimal earner payouts page

2) Payment flow with the checkout element

Server: create a Whop checkout configuration with an inline one-time variant and your own metadata to link payments back to the recruiter account.
Client: open an “Add Funds” modal and mount the Whop Elements checkout with @whop/elements-react.
A finished checkout redirects the tab to returnUrl, so the modal needs no completion callback. Credit the recruiter’s balance from the webhook below and render it on the page returnUrl points to. Webhook: verify the signature, receive Whop payment events, and credit the recruiter balance on payment.succeeded. Pin the webhook’s api_version_date when you create it so data is the current Payment object, where total is a money object with a decimal-string amount.

3) Subaccount payouts (account setup + payout portal)

Create a Whop subaccount (earner account) under your platform account. Passing your user ID as external_id makes a retried create return the same subaccount. Store the returned ID as whopId to route transfers. To find the account by your user ID later, call whop.accounts.list({ external_id }).
Embed a payout portal with Whop Elements Mint an access token for the earner’s account on your server (see Enable Subaccount Payouts), then mount the wallet surfaces with it:
Gig completion: transfer funds from platform to earner subaccount using the earner’s whopAccountId and an idempotency key per submission.
That’s the core of the Mercor-style marketplace. Recruiters fund balances through payments, earners set up payout accounts (subaccounts), and completed gigs transfer money to earners minus your platform fee. Reference repository: Mercor clone