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

# TaxIdElement

> API에서 허용하는 사업자 세금 등록 정보를 수집합니다. 레이블에는 구매자에게 익숙한 이름이 사용됩니다. 플레이스홀더는 선택한 형식과 일치합니다. `country`로 유형을 미리 선택합니다. `onChange`는 확정된 쌍을 내보냅니다. API 유효성 검사 오류는 호스트가 제공합니다.

> [!NOTE]
>
> 이 페이지는 `@whop/elements@1.10.0` 및 `@whop/elements-react@1.10.0`을 다룹니다.

*`v1.0.0`부터 지원.*

[`Payments`](https://docs.whop.com/ko/elements/latest/payments/overview) 안에 마운트됩니다. props와 콜백은 생성 옵션 또는 React props로 전달합니다.

`WhopPayments` 스코프 안에 마운트됩니다. 값 필드 옆에 등록 유형 선택기가 있으며, 구매자의 국가에 따라 미리 선택됩니다.

청구와 확인 토큰을 소유하는 `<Payments>` 안에 마운트합니다. `<Payments>` 자체는 `<WhopElements>` 안에 마운트됩니다. 값 입력란 옆에 등록 유형 선택기가 있어, VAT 또는 CUIT 번호를 입력하는 구매자가 먼저 올바른 유형을 고를 수 있습니다.

```tsx React theme={null}
import { WhopElements, Payments, TaxIdElement } from "@whop/elements-react";
import { loadWhop } from "@whop/elements";

function Example() {
  return (
    <WhopElements elements={loadWhop()}>
      <Payments /* options */>
        <TaxIdElement onChange={(e) => console.log(e)} />
      </Payments>
    </WhopElements>
  );
}
```

```tsx React Native theme={null}
import { Payments, TaxIdElement } from '@whop/elements-react-native';

export function TaxStep({ country }: { country: string }) {
  return (
    <Payments accountId="biz_xxxxxxxx" plan="plan_xxxxxxxx">
      <TaxIdElement country={country} onChange={({ taxId }) => console.log(taxId.type, taxId.value)} />
    </Payments>
  );
}
```

```html JavaScript theme={null}
<script src="https://cdn.whop.com/elements/amber/elements.js" data-whop-elements></script>
<script type="module">
  const payments = window.WhopElements().payments.create({ /* options */ });
  payments.create('taxId', { onChange: (e) => console.log(e) }).mount('#payments-taxId');
</script>
```

```swift Swift theme={null}
import Elements
import SwiftUI

// .whopElements(environment:) runs once at the app root. See Getting started.
struct CheckoutScreen: View {
    @State private var address = PostalAddress()
    @State private var taxID: WhopTaxID?

    var body: some View {
        WhopPayments(accountID: "biz_xxxx", charge: .plan(id: "plan_xxxx")) { payments in
            ScrollView {
                VStack(alignment: .leading, spacing: 20) {
                WhopAddressElement(address: $address)
                WhopTaxIDElement(taxID: $taxID, country: address.country)
                    WhopBrandingElement()
                }
                .padding()
            }
        }
    }
}
```

예시 데이터입니다. [Playground 열기](https://docs.whop.com/ko/elements/latest/payments/overview#playground).

[React Native 예제 앱의 Android에서 실행 중인 TaxIdElement](https://app.revyl.ai/embed/713e08f7-91e6-4449-905b-ceb4c18b83c2?controls=0)

## Props

**disabled** `boolean`

호스트가 마지막으로 확정된 등록 정보를 저장하는 동안 두 필드를 모두 비활성화합니다. 기본값은 `false`입니다.

**country** `string`

유형을 미리 선택하는 데 사용되는 ISO 3166-1 alpha-2 구매자 국가입니다. `AR`은 `ar_cuit`, `LI`는 `li_uid`를 선택합니다. EU 국가와 매핑되지 않았거나 비어 있는 값은 `eu_vat`를 선택합니다. 그 외 매핑된 국가는 해당 국가의 첫 번째 유형을 선택합니다. 수동으로 선택한 유형은 국가가 바뀌어도 유지됩니다. 기본값은 `""`입니다.

**defaultValue** `object`

재개된 세션의 초기 `type`과 `value`입니다. 지원되지 않는 `type`은 국가 기본값으로 대체됩니다.

**속성**

**type** `string` *required*

**value** `string` *required*

**error** `string`

값 입력란 아래에 표시되는 API 유효성 검사 오류입니다. 비어 있으면(기본값) 아무것도 표시하지 않습니다. 기본값은 `""`입니다.

## 이벤트

생성 옵션 또는 React props로 콜백을 전달합니다.

### `onChange`

값이 비어 있지 않을 때 포커스를 잃거나 Enter를 누르면 실행되며, 값이 있는 상태에서 유형이 바뀔 때도 실행됩니다. 동일한 값이 연속되면 한 번만 실행됩니다. 값을 지워도 실행되지 않습니다. 저장된 등록 정보는 호스트가 지워야 합니다.

**payload** `object`

**속성**

**taxId** `object` *required*

**속성**

**type** `string` *required*

**값**

`"ad_nrt"`, `"ao_tin"`, `"ar_cuit"`, `"al_tin"`, `"am_tin"`, `"aw_tin"`, `"au_abn"`, `"au_arn"`, `"eu_vat"`, `"az_tin"`, `"bs_tin"`, `"bh_vat"`, `"bd_bin"`, `"bb_tin"`, `"by_tin"`, `"bj_ifu"`, `"bo_tin"`, `"ba_tin"`, `"br_cnpj"`, `"br_cpf"`, `"bg_uic"`, `"bf_ifu"`, `"kh_tin"`, `"cm_niu"`, `"ca_bn"`, `"ca_gst_hst"`, `"ca_pst_bc"`, `"ca_pst_mb"`, `"ca_pst_sk"`, `"ca_qst"`, `"cv_nif"`, `"cl_tin"`, `"cn_tin"`, `"co_nit"`, `"cd_nif"`, `"cr_tin"`, `"hr_oib"`, `"do_rcn"`, `"ec_ruc"`, `"eg_tin"`, `"sv_nit"`, `"et_tin"`, `"eu_oss_vat"`, `"ge_vat"`, `"gh_tin"`, `"de_stn"`, `"gb_vat"`, `"gn_nif"`, `"hk_br"`, `"hu_tin"`, `"is_vat"`, `"in_gst"`, `"id_npwp"`, `"il_vat"`, `"jp_cn"`, `"jp_rn"`, `"jp_trn"`, `"kz_bin"`, `"ke_pin"`, `"kg_tin"`, `"la_tin"`, `"li_uid"`, `"li_vat"`, `"my_frp"`, `"my_itn"`, `"my_sst"`, `"mr_nif"`, `"mx_rfc"`, `"md_vat"`, `"me_pib"`, `"ma_vat"`, `"np_pan"`, `"nz_gst"`, `"ng_tin"`, `"mk_vat"`, `"no_vat"`, `"no_voec"`, `"om_vat"`, `"pe_ruc"`, `"ph_tin"`, `"pl_nip"`, `"ro_tin"`, `"ru_inn"`, `"ru_kpp"`, `"sa_vat"`, `"sn_ninea"`, `"rs_pib"`, `"sg_gst"`, `"sg_uen"`, `"si_tin"`, `"za_vat"`, `"kr_brn"`, `"es_cif"`, `"ch_uid"`, `"ch_vat"`, `"tw_vat"`, `"tj_tin"`, `"tz_vat"`, `"th_vat"`, `"tr_tin"`, `"ug_tin"`, `"ua_vat"`, `"ae_trn"`, `"us_ein"`, `"uy_ruc"`, `"uz_tin"`, `"uz_vat"`, `"ve_rif"`, `"vn_tin"`, `"zm_tin"`, `"zw_tin"`, `"sr_fin"`, `"xi_vat"` 중 하나입니다.

**value** `string` *required*

### `onLoaderStart`

로딩 스켈레톤이 처음 그려진 후, `onReady` 전에 실행됩니다.

### `onReady`

엘리먼트가 처음으로 완전히 그려진 후 실행됩니다.

### `onError`

엘리먼트가 로드에 실패하거나 충돌할 때 실행됩니다. 대체 화면은 계속 표시됩니다. 프로그래밍 방식으로 처리하려면 `code`를 사용하세요. `sourceKey`는 실패한 호스트 상태 소스를 식별합니다.

**e** `object`

**속성**

**message** `string` *required*

**code** `string`

**sourceKey** `string`

## 메서드

`create`가 반환한 핸들에서, 또는 React `ref`를 통해 호출합니다.

### `mount`

`target`에 엘리먼트를 마운트하고 로딩을 시작합니다. React 컴포넌트는 자동으로 마운트됩니다.

**매개변수**

**target** `string | HTMLElement` *required*

### `destroy`

엘리먼트를 제거하고 프레임과 구독을 해제합니다. 여러 번 호출해도 됩니다. React는 엘리먼트를 자동으로 제거합니다.

### `update`

마운트된 엘리먼트에 새 props를 병합합니다. React에서는 대신 컴포넌트 props를 변경하세요.

**매개변수**

**options** `Partial\<TaxIdElementProps\>` *required*

## 스타일링

`appearance.classes`를 통해 다음 부분의 스타일을 지정합니다. 속성 이름은 카멜 케이스 또는 케밥 케이스를 사용하고 단위를 포함하세요. 페이지 스타일시트는 엘리먼트의 프레임에 적용되지 않습니다. 프레임워크는 각 선언을 삽입하기 전에 유효성을 검사합니다.

| 클래스 | 대상 |
| - | - |
| `.whop-TaxId` | 세금 등록 루트 |
| `.whop-TaxIdError` | API 유효성 검사 오류 |
| `.whop-TaxIdInput` | 등록 값 입력란 |
| `.whop-TaxIdLabel` | 등록 값 레이블 |
| `.whop-TaxIdTypeLabel` | 등록 유형 레이블 |
| `.whop-TaxIdTypeSelect` | 등록 유형 선택기 |

```ts theme={null}
const payments = whop.payments.create({
  appearance: {
    classes: {
      'whop-TaxId': { borderRadius: '8px', fontWeight: '600' },
      'whop-TaxIdError': { borderRadius: '8px', fontWeight: '600' },
      'whop-TaxIdInput': { borderRadius: '8px', fontWeight: '600' }
    }
  }
});

// 6 classes use this shape
payments.update({
  appearance: { classes: { 'whop-TaxId': { fontWeight: '700' } } }
});
```

React에서는 `appearance`를 `<Payments>`에 전달합니다. 전역으로 설정하려면 `WhopElements({ appearance })`를 사용하세요.

## 매개변수

**taxID** `Binding\<WhopTaxID?\>?`

확정된 각 등록 정보를 받습니다.

**country** `String?`

유형을 미리 선택하는 데 사용되는 ISO 3166-1 alpha-2 구매자 국가입니다.

**defaultValue** `WhopTaxID?`

재개된 세션의 초기 쌍입니다. 지원되지 않는 유형은 기본값으로 대체됩니다.

**isDisabled** `Bool`

마지막으로 확정된 등록 정보를 저장하는 동안 두 필드를 모두 비활성화합니다. 기본값은 `false`입니다.

**error** `String?`

값 입력란 아래에 표시되는 API 유효성 검사 오류입니다.

## `WhopTaxID`

선택 시 반환되는 값:

* `type: WhopTaxIDType`: 등록 유형(`eu_vat`, `ar_cuit`, …)
* `value: String`: 등록 정보 자체

## 상태

즉시 렌더링됩니다. 선택한 유형의 형식과 일치하지 않는 값은 해당 오류를 표시합니다. `error`는 값 필드 아래에 API 유효성 검사 실패를 렌더링합니다.

## 알아두면 좋은 점

* `AR`은 `ar_cuit`를 미리 선택하고, EU 회원국과 매핑되지 않은 모든 값은 `eu_vat`를 미리 선택합니다. 수동으로 선택한 유형은 국가가 바뀌어도 유지됩니다.
* 두 엘리먼트가 서로 맞춰지도록 주소 엘리먼트의 국가를 전달하세요.
* 바인딩은 키 입력마다가 아니라 등록 정보가 확정될 때마다 실행됩니다.

## 설치

```swift theme={null}
dependencies: [
    .package(url: "https://github.com/whopio/elements-swift.git", from: "0.1.0")
]
```

> [!NOTE]
>
> 컨트롤러를 생성하여 콘텐츠에 전달하는 `WhopPayments(accountID:charge:)` 스코프 안에 마운트하세요. 이메일 로그인으로 구매자가 확인되면 `payments.buyer`는 로그인한 구매자입니다. Whop은 이러한 판매의 판매 대행자이며 `createConfirmationToken`은 `WhopBrandingElement` 없이는 거부되므로, 이 엘리먼트도 화면에 있어야 합니다. 스타일은 `.whopElementsAppearance(_:)`로 지정합니다. 모듈은 지갑 SDK의 `WhopElements`가 아니라 `Elements`입니다. [시작하기](https://docs.whop.com/ko/elements/latest/getting-started.md) 및 [Appearance](https://docs.whop.com/ko/elements/latest/appearance.md)를 참고하세요.

## Props

**country** `string`

유형을 미리 선택하는 데 사용되는 ISO 3166-1 alpha-2 구매자 국가입니다. `AR`은 `ar_cuit`를 선택하고, EU 및 매핑되지 않은 값은 `eu_vat`를 선택합니다.

**defaultValue** `\{ type: string; value: string \}`

재개된 세션의 초기 쌍입니다. 지원되지 않는 유형은 기본값으로 대체됩니다.

**disabled** `boolean`

마지막으로 확정된 등록 정보를 저장하는 동안 두 필드를 모두 비활성화합니다.

**error** `string`

값 입력란 아래에 표시되는 API의 유효성 검사 메시지입니다.

**onChange** `(payload: TaxIdChangePayload) =\> void`

유형이나 값이 바뀔 때마다 실행됩니다.

**style** `StyleProp\<ViewStyle\>`

엘리먼트의 외부 `View`에 적용됩니다. 테마 지정에는 이 화면의 모든 엘리먼트에 적용되는 프로바이더의 `appearance.parts`를 사용하는 것이 좋습니다. 현재 React Native 파트 이름은 웹의 `whop-*` 클래스 이름과 별개의 체계이므로, 웹 appearance 객체를 그대로 옮겨 쓸 수 없습니다.

**fallback** `ReactNode`

엘리먼트가 로드되는 동안 기본 스켈레톤 대신 렌더링됩니다.

**onReady** `() =\> void`

엘리먼트가 상호작용 가능해지면 한 번 실행됩니다. `<Payments>`가 이를 그룹화하므로 보통은 `<Payments>` 자체의 `onLoadingChange`를 사용하는 것이 좋습니다.

**onError** `(error: \{ message: string; code?: string \}) =\> void`

이 엘리먼트의 로드 또는 구성 실패입니다. 어떤 경우든 엘리먼트는 자체 오류 화면을 렌더링합니다.

## `TaxIdChangePayload`

`onChange`가 반환하는 값:

* `taxId: { type: TaxIdType; value: string }`: 선택한 등록 유형과 구매자가 입력한 내용

## 상태

즉시 렌더링됩니다. 유형은 `country`에 따라 미리 선택되며, 값 입력란은 해당 유형의 형식에 맞는지 검사합니다. `onChange`는 현재 쌍과 함께 실행됩니다.

## 알아두면 좋은 점

* `country`는 미리 선택만 합니다. 구매자가 유형을 직접 선택하면 국가가 바뀌어도 그 선택이 유지됩니다.
* 자체 API 유효성 검사 메시지를 값 입력란 아래에 표시하려면 `error`를 전달하세요.
* 엘리먼트는 쌍을 보고할 뿐이며, 전송은 직접 처리해야 합니다. 자체 주문 또는 고객 레코드에 첨부하세요.

> [!NOTE]
>
> 앱을 `<WhopElements getToken={…}>`로 한 번 감싼 다음, 엘리먼트를 `<Payments>`로 감싸 마운트하세요. [시작하기](https://docs.whop.com/ko/elements/latest/getting-started.md) 및 [Appearance](https://docs.whop.com/ko/elements/latest/appearance.md)를 참고하세요.
