> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whop.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# Betalingen innen voor subaccounts

> Int betalingen voor subaccounts met directe afschrijvingen en een applicatievergoeding, of met overboekingen vanaf je platformaccount, plus beperkingen en mislukkingen.

Er zijn twee manieren om betalingen voor subaccounts te innen:

1. **Directe afschrijvingen**: maak een checkout aan voor het subaccount en int een applicatievergoeding.
2. **Overboekingen**: int de betaling op je platformaccount en maak later geld over naar subaccounts.

## Directe afschrijvingen

Maak een checkoutconfiguratie aan met het ID van een subaccount om klanten rechtstreeks op het subaccount te belasten. Het subaccount is verantwoordelijk voor de kosten van Whop, terugbetalingen en geschillen.

### Hoe het werkt

1. Maak een checkoutconfiguratie aan voor je subaccount met een `application_fee_amount`
2. Wanneer een klant koopt, maakt Whop de afschrijving rechtstreeks op het subaccount aan
3. Je platform int de applicatievergoeding en het resterende bedrag gaat naar het subaccount
4. Het subaccount handelt eventuele geschillen of terugbetalingen voor de transactie af

### Voorbeeld

Maak een inline variant aan met de compatibiliteitsinput `plan`.

```typescript TypeScript theme={null}
import { WhopClient } from "@whop/sdk";

const client = new WhopClient({
	token: "Account API Key",
});

const checkoutConfig = await client.checkoutConfigurations.create({
	account_id: "biz_xxxxxxxxxxxxx", // Subaccount's ID
	variant: {
		initial_price: 10.0,
		billing_type: "one_time",
		application_fee_amount: 1.23,
	},
});

console.log(checkoutConfig.purchase_url);
```

```python Python theme={null}
from whop_sdk import Whop

client = Whop(
    token="Account API Key",
)

checkout_config = client.checkout_configurations.create(
    account_id="biz_xxxxxxxxxxxxx",  # Subaccount's ID
    variant={
        "initial_price": 10.0,
        "billing_type": "one_time",
        "application_fee_amount": 1.23,
    },
)

print(checkout_config.purchase_url)
```

```rust Rust theme={null}
use whop_sdk::prelude::*;

let config = ClientConfig {
    token: Some("Account API Key".to_string()),
    ..Default::default()
};
let client = Whop::new(config).expect("Failed to build client");

let checkout_config = client
    .checkout_configurations
    .create(
        &CreateCheckoutConfigurationsRequest {
            account_id: Some("biz_xxxxxxxxxxxxx".to_string()), // Subaccount's ID
            variant: Some(CreateCheckoutConfigurationsRequestVariant {
                initial_price: Some(10.0),
                billing_type: Some(CreateCheckoutConfigurationsRequestVariantBillingType::OneTime),
                application_fee_amount: Some(1.23),
                ..Default::default()
            }),
            ..Default::default()
        },
        None,
    )
    .await?;

println!("{}", checkout_config.purchase_url.unwrap());
```

```go Go theme={null}
import (
    "context"
    "fmt"
    "log"

    whopsdk "github.com/whopio/whopsdk-go/v2"
    "github.com/whopio/whopsdk-go/v2/client"
    "github.com/whopio/whopsdk-go/v2/option"
)

client := client.NewWhop(option.WithToken("Account API Key"))

checkoutConfig, err := client.CheckoutConfigurations.Create(context.TODO(), &whopsdk.CreateCheckoutConfigurationsRequest{
    AccountID: whopsdk.String("biz_xxxxxxxxxxxxx"), // Subaccount's ID
    Variant: &whopsdk.CreateCheckoutConfigurationsRequestVariant{
        InitialPrice:         whopsdk.Float64(10.0),
        BillingType:          whopsdk.CreateCheckoutConfigurationsRequestVariantBillingTypeOneTime.Ptr(),
        ApplicationFeeAmount: whopsdk.Float64(1.23),
    },
})
if err != nil {
    log.Fatal(err)
}

fmt.Println(*checkoutConfig.PurchaseURL)
```

In dit voorbeeld:

* `account_id` is het ID van het subaccount waarop Whop de afschrijving aanmaakt
* `variant.initial_price` is het totale betalingsbedrag van de variant (10,00 Amerikaanse dollar)
* `variant.application_fee_amount` is de vergoeding die je platform int (1,23 Amerikaanse dollar)
* Het subaccount ontvangt 8,77 Amerikaanse dollar (10,00 - 1,23)

### Beperkingen

* De `application_fee_amount` moet positief zijn en lager dan het totale betalingsbedrag
* De applicatievergoeding kan het geïnde betalingsbedrag niet overschrijden

## Overboekingen

Gebruik overboekingen wanneer je platform eerst de betaling int, of wanneer je backend bepaalt hoeveel en wanneer elk subaccount wordt betaald.

### Voordat je overboekt

* **Bronaccount**: het account dat geld verstuurt, moet de Know Your Customer-verificatie (KYC) hebben voltooid en voldoende saldo hebben voor de overboeking. Je kunt het saldo opwaarderen vanuit het dashboard of via [Geld toevoegen aan je saldo](https://docs.whop.com/nl/developer/platforms/add-funds-to-your-balance.md).
* **Bestemmingsaccount**: de ontvanger moet al een Whop-account hebben. Als dat niet zo is, onboard die dan eerst met [Subaccounts inschrijven](https://docs.whop.com/nl/developer/platforms/enroll-subaccounts.md).
* **Verantwoordelijkheid voor verrekening**: bij overboekingen is je platform de merchant of record voor de oorspronkelijke betaling. Je platform handelt kosten, geschillen en terugbetalingen op die betaling af.

### Voorbeeld

Int de betaling op je platformaccount en maak daarna het aandeel van het subaccount over:

```typescript TypeScript theme={null}
import { WhopClient } from "@whop/sdk";

const client = new WhopClient({
	token: "Account API Key",
});

const transfer = await client.transfers.create({
	type: "balance",
	amount: 90.0,
	currency: "usd",
	origin_id: "biz_yyyyyyyyyyyyy", // Platform's account ID
	destination_id: "biz_xxxxxxxxxxxxx", // Subaccount's ID
	metadata: {
		order_id: "order_12345",
	},
});

if (transfer.object === "transfer") {
	console.log(transfer.id);
}
```

```python Python theme={null}
from whop_sdk import Whop

client = Whop(
    token="Account API Key",
)

transfer = client.transfers.create(
    type="balance",
    amount=90.0,
    currency="usd",
    origin_id="biz_yyyyyyyyyyyyy",  # Platform's account ID
    destination_id="biz_xxxxxxxxxxxxx",  # Subaccount's ID
    metadata={
        "order_id": "order_12345",
    },
)

if transfer.object == "transfer":
    print(transfer.id)
```

```rust Rust theme={null}
use whop_sdk::prelude::*;

let config = ClientConfig {
    token: Some("Account API Key".to_string()),
    ..Default::default()
};
let client = Whop::new(config).expect("Failed to build client");

let transfer = client
    .transfers
    .create(
        &CreateTransfersRequest {
            amount: 90.0,
            currency: Some("usd".to_string()),
            origin_id: "biz_yyyyyyyyyyyyy".to_string(), // Platform's account ID
            destination_id: Some("biz_xxxxxxxxxxxxx".to_string()), // Subaccount's ID
            metadata: Some(HashMap::from([("order_id".to_string(), json!("order_12345"))])),
            ..Default::default()
        },
        None,
    )
    .await?;

if let CreateTransfersResponse::Transfer { id, .. } = &transfer {
    println!("{id}");
}
```

```go Go theme={null}
import (
    "context"
    "fmt"
    "log"

    whopsdk "github.com/whopio/whopsdk-go/v2"
    "github.com/whopio/whopsdk-go/v2/client"
    "github.com/whopio/whopsdk-go/v2/option"
)

client := client.NewWhop(option.WithToken("Account API Key"))

transfer, err := client.Transfers.Create(context.TODO(), &whopsdk.CreateTransfersRequest{
    Amount:        90.0,
    Currency:      whopsdk.String("usd"),
    OriginID:      "biz_yyyyyyyyyyyyy",                 // Platform's account ID
    DestinationID: whopsdk.String("biz_xxxxxxxxxxxxx"), // Subaccount's ID
    Metadata:      map[string]any{"order_id": "order_12345"},
})
if err != nil {
    log.Fatal(err)
}

if transfer.Object == "transfer" {
    fmt.Println(transfer.Transfer.ID)
}
```

In dit voorbeeld:

* `origin_id` is het account-ID van je platform (waar Whop het geld afschrijft)
* `destination_id` is het ID van het subaccount (waar Whop het geld bijschrijft)
* `amount` is het over te maken bedrag
* `metadata` slaat aangepaste gegevens op ter referentie

### Mislukte overboekingen afhandelen

Overboekingen mislukken als het bronaccount niet is geverifieerd, het bronsaldo te laag is of het bestemmingsaccount nog geen geld kan ontvangen. Los de onderliggende oorzaak op voordat je het opnieuw probeert. Probeer mislukte overboekingen niet opnieuw zonder de oorzaak te bekijken.

### Veelvoorkomende toepassingen

* Geplande uitbetalingen aan creators
* Uitbetalingen aan affiliates
* Marketplace-verdelingen nadat een order is verrekend

## Een betalingsflow kiezen

| | Directe afschrijvingen | Overboekingen |
| - | - | - |
| **Kosten** | Subaccount betaalt Whop-kosten | Platform betaalt Whop-kosten |
| **Geschillen** | Subaccount handelt geschillen af | Platform handelt geschillen af |
| **Terugbetalingen** | Subaccount handelt terugbetalingen af | Platform handelt terugbetalingen af |

Gebruik overboekingen wanneer je backend het tijdstip en het bedrag van uitbetalingen bepaalt. Gebruik directe afschrijvingen wanneer het subaccount verantwoordelijk moet zijn voor kosten, geschillen en terugbetalingen van de oorspronkelijke aankoop.

## API-referentie

> [card] [Checkoutconfiguratie aanmaken](https://docs.whop.com/nl/api-reference/legacy/checkout-configurations/create-checkout-configuration.md)
>
> Maak checkoutconfiguraties aan met applicatievergoedingen

> [card] [Overboeking aanmaken](https://docs.whop.com/nl/api-reference/transfers/create-transfer.md)
>
> Maak geld over tussen accounts

## Gerelateerde bronnen

> [card] [Betalingen accepteren](https://docs.whop.com/nl/developer/guides/accept-payments.md)
>
> Leer meer over checkoutlinks en het Checkout-element

> [card] [Subaccounts inschrijven](https://docs.whop.com/nl/developer/platforms/enroll-subaccounts.md)
>
> Maak ontvangeraccounts aan en rond de onboarding af voordat je ze betaalt


## Related topics

- [Geld toevoegen aan je saldo](https://docs.whop.com/nl/developer/platforms/add-funds-to-your-balance.md)
- [Subaccounts inschrijven](https://docs.whop.com/nl/developer/platforms/enroll-subaccounts.md)
- [Voorbeeldintegratie](https://docs.whop.com/nl/developer/guides/example-integration.md)
