---
title: "Calculate Tax"
method: POST
path: "/plans/{id}/calculate_tax"
tags: ["Plans"]
---

# Calculate Tax

`POST /plans/{id}/calculate_tax`

Previews tax for a plan before checkout, based on the buyer's location.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `address` object, nullable — Buyer billing address used for tax calculation. Provide either `address.country` or `ip_address`; include state and postal code when available for more accurate results.
    - `city` string, nullable — City name.
    - `country` string, required — ISO 3166-1 alpha-2 country code, such as `US`, `DE`, or `GB`.
    - `line1` string, nullable — First line of the street address.
    - `line2` string, nullable — Second line of the street address.
    - `postal_code` string, nullable — Postal or ZIP code.
    - `state` string, nullable — State, province, or region code, such as `CA`.
  - `ip_address` string — Buyer IP address used to infer location when no billing address is provided.
  - `tax_ids` object[], nullable — Optional buyer tax ID for B2B exemptions. At most one entry is supported.
    - `type` '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' | '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' — Tax ID type, such as `eu_vat` for an EU VAT number.
    - `value` string — Tax ID value, for example `DE123456789`.

## Response `200`

tax calculated

- object
  - `currency` string, required — Three-letter ISO 4217 currency code for the returned amounts.
  - `status` 'calculated' | 'not_calculated', required — Whether Whop calculated tax for this preview. `not_calculated` means no tax could be determined, so `tax_amount` is 0 and `total` equals `subtotal`.
  - `subtotal` integer, required — Plan price in the currency's smallest unit, for example cents. For exclusive tax, this is the pre-tax amount; for inclusive tax, it already includes tax and equals the total.
  - `tax_amount` integer, required — Calculated tax amount in the currency's smallest unit. For exclusive tax, this is added on top of the subtotal; for inclusive tax, it is the portion of the subtotal that is tax.
  - `tax_behavior` 'exclusive' | 'inclusive', required — Whether tax is added on top of the plan price or already included in it for this buyer's location.
  - `total` integer, required — Amount the buyer would pay in the currency's smallest unit.

## Other responses

- `400` — Invalid Parameters
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Resource not found
- `409` — Conflict

---

[API](https://skmtc.net/whop/apis/whop-api.md) · [All operations](https://skmtc.net/whop/apis/whop-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/whop/whop-api/revisions/c363cb2feb95/schema)
