Skip to main content
You can create payouts programmatically to send funds from your platform or connected account balance to any payout method.

Add a payout method

Before creating a payout, the account needs a payout method. Use the embedded component to let users add a payout method:
"use client";

import {
  Elements,
  PayoutsSession,
  PayoutMethodElement,
} from "@whop/embedded-components-react-js";
import { loadWhopElements } from "@whop/embedded-components-vanilla-js";

const elements = loadWhopElements();

export function AddPayoutMethod({ companyId }: { companyId: string }) {
  return (
    <Elements elements={elements}>
      <PayoutsSession
        token={() =>
          fetch(`/api/token?companyId=${companyId}`)
            .then((res) => res.json())
            .then((data) => data.token)
        }
        companyId={companyId}
        redirectUrl="https://yourapp.com/verification-complete"
      >
        <PayoutMethodElement fallback={<div>Loading...</div>} />
      </PayoutsSession>
    </Elements>
  );
}

Create a payout

import Whop from "@whop/sdk";

const client = new Whop({
  apiKey: "Company API Key",
});

const withdrawal = await client.withdrawals.create({
  company_id: "biz_xxxxxxxxxxxxx",
  amount: 100.0,
  currency: "usd",
  payout_method_id: "pm_xxxxxxxxxxxxx",
});

console.log(withdrawal.id);
In this example:
  • company_id is the platform or connected account to pay out
  • amount is the payout amount (100.00 USD) - fees will be deducted from this amount
  • currency is the ISO currency code
  • payout_method_id is the ID of the payout method to use. If not specified, the default payout method is used.
The request will return an error if the amount exceeds the available balance.

API Reference

Create Withdrawal API

See the full API reference for creating withdrawals