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

> Verzamelt een zakelijke belastingregistratie die de API accepteert. Labels gebruiken namen die kopers herkennen. De placeholder past bij het geselecteerde formaat. `country` selecteert vooraf een type. `onChange` geeft bevestigde paren door. De host levert API-validatiefouten aan.

> [!NOTE]
>
> Deze pagina documenteert `@whop/elements@1.10.0` en `@whop/elements-react@1.10.0`.

*Sinds `v1.0.0`.*

Wordt gemount binnen [`Payments`](https://docs.whop.com/nl/elements/latest/payments/overview). Geef props en callbacks mee via de create-opties of als React-props.

Wordt gemount binnen een `WhopPayments`-scope. Een kiezer voor het registratietype naast het waardeveld, vooraf geselecteerd op basis van het land van de koper.

Mount binnen `<Payments>`, dat de afschrijving en het bevestigingstoken beheert. `<Payments>` zelf wordt gemount binnen `<WhopElements>`. Een kiezer voor het registratietype naast een waarde-invoer, zodat een koper die een btw- of CUIT-nummer invoert eerst het juiste soort kiest.

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

Voorbeeldgegevens. [Open de Playground](https://docs.whop.com/nl/elements/latest/payments/overview#playground).

[TaxIdElement draaiend op Android, in de React Native-voorbeeldapp](https://app.revyl.ai/embed/713e08f7-91e6-4449-905b-ceb4c18b83c2?controls=0)

## Props

**disabled** `boolean`

Schakelt beide velden uit terwijl de host de laatst bevestigde registratie opslaat. Standaard `false`.

**country** `string`

ISO 3166-1 alpha-2-land van de koper, gebruikt om het type vooraf te selecteren. `AR` selecteert `ar_cuit`, `LI` selecteert `li_uid`. EU-landen en niet-toegewezen of lege waarden selecteren `eu_vat`. Andere toegewezen landen selecteren hun eigen eerste type. Een handmatige selectie blijft behouden wanneer het land verandert. Standaard `""`.

**defaultValue** `object`

Initiële `type` en `value` uit een hervatte sessie. Een niet-ondersteund `type` valt terug op de standaard van het land.

**eigenschappen**

**type** `string` *required*

**value** `string` *required*

**error** `string`

API-validatiefout die onder de waarde-invoer wordt getoond. Leeg (standaard) toont niets. Standaard `""`.

## Events

Geef callbacks mee in de create-opties of als React-props.

### `onChange`

Wordt geactiveerd bij blur of Enter wanneer de waarde niet leeg is, of wanneer het type verandert terwijl er een waarde is. Identieke opeenvolgende waarden worden één keer geactiveerd. Het wissen van de waarde activeert niets. De host moet opgeslagen registraties zelf wissen.

**payload** `object`

**eigenschappen**

**taxId** `object` *required*

**eigenschappen**

**type** `string` *required*

**waarden**

Een van `"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"`, of `"xi_vat"`.

**value** `string` *required*

### `onLoaderStart`

Wordt uitgevoerd nadat het laadskelet voor het eerst is weergegeven en vóór `onReady`.

### `onReady`

Wordt uitgevoerd na de eerste volledige weergave van het element.

### `onError`

Wordt uitgevoerd wanneer het element niet kan laden of crasht. De fallback blijft zichtbaar. Gebruik `code` voor programmatische afhandeling. `sourceKey` identificeert een mislukte host-state-bron.

**e** `object`

**eigenschappen**

**message** `string` *required*

**code** `string`

**sourceKey** `string`

## Methoden

Roep deze aan op de handle die `create` retourneert, of via een React-`ref`.

### `mount`

Mount het element in `target` en begint met laden. React-componenten mounten zichzelf.

**Parameters**

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

### `destroy`

Verwijdert het element en geeft het frame en de abonnementen vrij. Je kunt het meerdere keren aanroepen. React verwijdert het element automatisch.

### `update`

Voegt nieuwe props samen in het gemounte element. Wijzig in React in plaats daarvan de componentprops.

**Parameters**

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

## Styling

Style deze onderdelen via `appearance.classes`. Gebruik camelCase of kebab-case voor eigenschapsnamen en vermeld eenheden. Stylesheets van de pagina kunnen het frame van het element niet bereiken. Het framework valideert elke declaratie voordat die wordt geïnjecteerd.

| Klasse | Doel |
| - | - |
| `.whop-TaxId` | Root van de belastingregistratie |
| `.whop-TaxIdError` | API-validatiefout |
| `.whop-TaxIdInput` | Invoer voor de registratiewaarde |
| `.whop-TaxIdLabel` | Label van de registratiewaarde |
| `.whop-TaxIdTypeLabel` | Label van het registratietype |
| `.whop-TaxIdTypeSelect` | Kiezer voor het registratietype |

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

Geef in React `appearance` mee aan `<Payments>`. Stel het globaal in met `WhopElements({ appearance })`.

## Parameters

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

Ontvangt elke bevestigde registratie.

**country** `String?`

ISO 3166-1 alpha-2-land van de koper, gebruikt om het type vooraf te selecteren.

**defaultValue** `WhopTaxID?`

Een initieel paar uit een hervatte sessie. Een niet-ondersteund type valt terug.

**isDisabled** `Bool`

Schakelt beide velden uit terwijl je de laatst bevestigde registratie opslaat. Standaard `false`.

**error** `String?`

Een API-validatiefout, getoond onder de waarde-invoer.

## `WhopTaxID`

Wat een selectie teruggeeft:

* `type: WhopTaxIDType`: het registratietype, `eu_vat`, `ar_cuit`, …
* `value: String`: de registratie zelf

## Statussen

Wordt direct weergegeven. Een waarde die niet overeenkomt met het formaat van het geselecteerde type toont de bijbehorende fout. `error` toont een mislukte API-validatie onder het waardeveld.

## Goed om te weten

* `AR` selecteert vooraf `ar_cuit`; EU-lidstaten en alles wat niet is toegewezen selecteren vooraf `eu_vat`. Een handmatige keuze blijft behouden wanneer het land verandert.
* Geef het land van het adreselement door, zodat de twee gelijk blijven lopen.
* De binding wordt geactiveerd bij elke bevestigde registratie, niet bij elke toetsaanslag.

## Installatie

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

> [!NOTE]
>
> Mount het binnen een `WhopPayments(accountID:charge:)`-scope, die de controller aanmaakt en aan de inhoud doorgeeft. `payments.buyer` is de ingelogde koper zodra een inlog via e-mail er een heeft bevestigd. `WhopBrandingElement` moet ook op het scherm staan, omdat Whop merchant of record is bij deze verkopen en `createConfirmationToken` zonder dit element weigert. Style met `.whopElementsAppearance(_:)`. De module is `Elements`, niet `WhopElements` van de wallet-SDK. Zie [Aan de slag](https://docs.whop.com/nl/elements/latest/getting-started.md) en [Appearance](https://docs.whop.com/nl/elements/latest/appearance.md).

## Props

**country** `string`

ISO 3166-1 alpha-2-land van de koper, gebruikt om het type vooraf te selecteren. `AR` selecteert `ar_cuit`; EU-landen en niet-toegewezen waarden selecteren `eu_vat`.

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

Initieel paar uit een hervatte sessie. Een niet-ondersteund type valt terug.

**disabled** `boolean`

Schakelt beide velden uit, voor terwijl je de laatst bevestigde registratie opslaat.

**error** `string`

Een validatiemelding van je API, getoond onder de waarde-invoer.

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

Wordt geactiveerd bij elke wijziging van type of waarde.

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

Toegepast op de buitenste `View` van het element. Gebruik voor thema's bij voorkeur `appearance.parts` op de provider, dat elk element op dit oppervlak dekt. Let op: de namen van React Native-onderdelen vormen momenteel een eigen set, niet de `whop-*`-klassenamen van het web, dus een appearance-object voor het web is niet ongewijzigd over te zetten.

**fallback** `ReactNode`

Wordt weergegeven in plaats van het ingebouwde skelet terwijl het element laadt.

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

Wordt eenmaal geactiveerd zodra het element interactief is. `<Payments>` groepeert deze, dus de eigen `onLoadingChange` daarvan is meestal wat je nodig hebt.

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

Een laad- of configuratiefout voor dit element. Het element geeft in beide gevallen zijn eigen foutscherm weer.

## `TaxIdChangePayload`

Wat `onChange` teruggeeft:

* `taxId: { type: TaxIdType; value: string }`: het geselecteerde registratietype en wat de koper heeft getypt

## Statussen

Wordt direct weergegeven. Het type wordt vooraf geselecteerd op basis van `country` en de waarde-invoer valideert tegen het formaat van dat type. `onChange` wordt geactiveerd met het huidige paar.

## Goed om te weten

* `country` selecteert alleen vooraf. Een koper die handmatig een type kiest, houdt dat wanneer het land verandert.
* Geef `error` mee om een melding uit je eigen API-validatie onder de waarde-invoer te tonen.
* Het element rapporteert het paar. Het versturen ervan is aan jou: koppel het aan je eigen bestelling of klantrecord.

> [!NOTE]
>
> Wikkel je app eenmaal in `<WhopElements getToken={…}>` en mount daarna `<Payments>` rond de elementen. Zie [Aan de slag](https://docs.whop.com/nl/elements/latest/getting-started.md) en [Appearance](https://docs.whop.com/nl/elements/latest/appearance.md).


## Related topics

- [Aan de slag met Elements](https://docs.whop.com/nl/elements/latest/getting-started.md)
- [BrandingElement](https://docs.whop.com/nl/elements/latest/payments/branding.md)
- [Payments](https://docs.whop.com/nl/elements/latest/payments/overview.md)
