> ## 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.

# 하위 계정을 위한 결제 수금

> 직접 청구와 애플리케이션 수수료 또는 플랫폼 계정에서의 이체로 하위 계정을 위한 결제를 수금하고, 제한 사항과 실패 처리 방법을 알아보세요.

하위 계정을 위한 결제를 수금하는 방법은 두 가지입니다:

1. **직접 청구**: 하위 계정에 대한 체크아웃을 생성하고 애플리케이션 수수료를 수금합니다.
2. **이체**: 플랫폼 계정으로 결제를 수금하고 나중에 하위 계정으로 자금을 이체합니다.

## 직접 청구

하위 계정의 ID로 체크아웃 구성을 생성하여 하위 계정에서 직접 고객에게 청구하세요. 하위 계정이 Whop 수수료, 환불, 분쟁을 책임집니다.

### 작동 방식

1. `application_fee_amount`를 포함하여 하위 계정에 대한 체크아웃 구성을 생성합니다
2. 고객이 구매하면 Whop이 하위 계정에서 직접 청구를 생성합니다
3. 플랫폼이 애플리케이션 수수료를 수금하고, 나머지 금액은 하위 계정으로 갑니다
4. 하위 계정이 해당 거래의 분쟁이나 환불을 처리합니다

### 예시

`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)
```

이 예시에서:

* `account_id`는 Whop이 청구를 생성할 하위 계정의 ID입니다
* `variant.initial_price`는 변형의 총 결제 금액입니다(10.00 미국 달러)
* `variant.application_fee_amount`는 플랫폼이 수금하는 수수료입니다(1.23 미국 달러)
* 하위 계정은 8.77 미국 달러(10.00 - 1.23)를 받습니다

### 제한 사항

* `application_fee_amount`는 양수여야 하며 총 결제 금액보다 작아야 합니다
* 애플리케이션 수수료는 캡처된 결제 금액을 초과할 수 없습니다

## 이체

플랫폼이 먼저 결제를 수금하거나, 백엔드에서 각 하위 계정에 얼마를 언제 지급할지 결정하는 경우 이체를 사용하세요.

### 이체하기 전에

* **출발 계정**: 자금을 보내는 계정은 고객 확인(KYC) 인증을 완료해야 하며 이체에 충분한 잔액이 있어야 합니다. 대시보드에서 또는 [잔액에 자금 추가](https://docs.whop.com/ko/developer/platforms/add-funds-to-your-balance.md)를 통해 잔액을 충전할 수 있습니다.
* **도착 계정**: 수신자는 이미 Whop 계정이 있어야 합니다. 없다면 먼저 [하위 계정 등록](https://docs.whop.com/ko/developer/platforms/enroll-subaccounts.md)으로 온보딩하세요.
* **정산 책임**: 이체를 사용하면 플랫폼이 원래 결제의 판매 주체(merchant of record)가 됩니다. 플랫폼이 해당 결제의 수수료, 분쟁, 환불을 처리합니다.

### 예시

플랫폼 계정으로 결제를 수금한 다음, 하위 계정의 몫을 이체하세요:

```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)
}
```

이 예시에서:

* `origin_id`는 플랫폼의 계정 ID입니다(Whop이 자금을 차감하는 곳)
* `destination_id`는 하위 계정의 ID입니다(Whop이 자금을 입금하는 곳)
* `amount`는 이체할 금액입니다
* `metadata`는 참조용 사용자 지정 데이터를 저장합니다

### 이체 실패 처리

출발 계정이 인증되지 않았거나, 출발 계정의 잔액이 너무 적거나, 도착 계정이 아직 자금을 받을 수 없는 경우 이체가 실패합니다. 재시도하기 전에 근본 원인을 해결하세요. 원인을 검토하지 않고 실패한 이체를 재시도하지 마세요.

### 일반적인 용도

* 예약된 크리에이터 지급
* 제휴사 지급
* 주문 정산 후 마켓플레이스 분배

## 결제 흐름 선택

| | 직접 청구 | 이체 |
| - | - | - |
| **수수료** | 하위 계정이 Whop 수수료 부담 | 플랫폼이 Whop 수수료 부담 |
| **분쟁** | 하위 계정이 분쟁 처리 | 플랫폼이 분쟁 처리 |
| **환불** | 하위 계정이 환불 처리 | 플랫폼이 환불 처리 |

백엔드가 지급 시점과 금액을 제어하는 경우 이체를 사용하세요. 하위 계정이 원래 구매의 수수료, 분쟁, 환불을 책임져야 하는 경우 직접 청구를 사용하세요.

## API 레퍼런스

> [card] [Create Checkout Configuration](https://docs.whop.com/ko/api-reference/legacy/checkout-configurations/create-checkout-configuration.md)
>
> 애플리케이션 수수료가 포함된 체크아웃 구성 생성

> [card] [Create Transfer](https://docs.whop.com/ko/api-reference/transfers/create-transfer.md)
>
> 계정 간 자금 이체

## 관련 리소스

> [card] [결제 받기](https://docs.whop.com/ko/developer/guides/accept-payments.md)
>
> 체크아웃 링크와 Checkout 엘리먼트에 대해 알아보기

> [card] [하위 계정 등록](https://docs.whop.com/ko/developer/platforms/enroll-subaccounts.md)
>
> 수신자 계정을 생성하고 지급 전에 온보딩 완료하기


## Related topics

- [잔액에 자금 추가](https://docs.whop.com/ko/developer/platforms/add-funds-to-your-balance.md)
- [하위 계정 등록](https://docs.whop.com/ko/developer/platforms/enroll-subaccounts.md)
- [Whop API 개요](https://docs.whop.com/ko/api-reference/overview.md)
