> This page is for For Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://whop.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://whop.ferndocs.com/_mcp/server.

# Add funds to your balance

> Top up your platform balance to pay out connected accounts

#### Create your first top up in the dashboard

Before using the API, you need to create a top up from the [Dashboard](https://whop.com/dashboard/balance/). This saves a payment method that you can reuse programmatically.

#### Get payment methods

List saved payment methods for your company:

**`TypeScript`**

```typescript TypeScript
const paymentMethods = await client.paymentMethods.list({
  company_id: "biz_xxxxxxxxxxxxx",
});

const paymentMethod = paymentMethods.data[0];
```

**`Python`**

```python Python
payment_methods = client.payment_methods.list(
    company_id="biz_xxxxxxxxxxxxx",
)

payment_method = payment_methods.data[0]
```

#### Create a top up

**`TypeScript`**

```typescript TypeScript
const topup = await client.topups.create({
  company_id: "biz_xxxxxxxxxxxxx",
  amount: 1000.0,
  currency: "usd",
  payment_method_id: paymentMethod.id,
});

console.log(topup.id);
```

**`Python`**

```python Python
topup = client.topups.create(
    company_id="biz_xxxxxxxxxxxxx",
    amount=1000.0,
    currency="usd",
    payment_method_id=payment_method.id,
)

print(topup.id)
```

In this example:

* `company_id` is your platform's company ID
* `amount` is the amount to add to your balance
* `currency` is the currency of the top up
* `payment_method_id` is the saved payment method to charge

#### Handle payment events

Listen for payment webhooks to confirm the top up was successful:

```typescript
if (webhookData.type === "payment.succeeded") {
  const payment = webhookData.data;
  console.log("Top up successful:", payment.id);
}

if (webhookData.type === "payment.failed") {
  const payment = webhookData.data;
  console.log("Top up failed:", payment.failure_message);
}
```

## Related resources

#### [Collect payments for connected accounts](/developer/platforms/collect-payments-for-connected-accounts)

Transfer funds to connected accounts

#### [Render payout portal](/developer/platforms/render-payout-portal)

Let users withdraw their funds