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

# Calculate Tax

> Calculates the tax owed on a plan based on the buyer's location.



## OpenAPI

````yaml /openapi/api-v1-native.yml post /plans/{id}/calculate_tax
openapi: 3.1.0
info:
  title: Whop API
  description: >-
    Hand-written V1 endpoints. Merged into the GraphqlRestProxy-generated schema
    at build time.
  version: v1
servers:
  - url: https://{defaultHost}
    variables:
      defaultHost:
        default: api.whop.com/api/v1
security: []
paths:
  /plans/{id}/calculate_tax:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Plan ID, prefixed `plan_`.
    post:
      tags:
        - Plans
      summary: Calculate Tax
      description: Calculates the tax owed on a plan based on the buyer's location.
      operationId: calculatePlanTax
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  type:
                    - object
                    - 'null'
                  description: The buyer's billing address. Provide this or ip_address.
                  properties:
                    country:
                      type: string
                      description: >-
                        The two-letter ISO 3166-1 country code, for example
                        `US`, `DE`, or `GB`.
                    state:
                      type:
                        - string
                        - 'null'
                      description: The state, province, or region code, for example `CA`.
                    postal_code:
                      type:
                        - string
                        - 'null'
                      description: The postal or ZIP code.
                    city:
                      type:
                        - string
                        - 'null'
                      description: The city name.
                    line1:
                      type:
                        - string
                        - 'null'
                      description: The first line of the street address.
                    line2:
                      type:
                        - string
                        - 'null'
                      description: The second line of the street address.
                  required:
                    - country
                ip_address:
                  type: string
                  description: >-
                    The buyer's IP address, used to resolve their location when
                    no address is provided.
                tax_ids:
                  type:
                    - array
                    - 'null'
                  maxItems: 1
                  description: >-
                    The buyer's tax IDs, such as a VAT number, used to apply B2B
                    reverse-charge exemptions.
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - 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
                        description: Tax ID type, for example `eu_vat`.
                      value:
                        type: string
                        description: Tax ID number, for example `DE123456789`.
        required: true
      responses:
        '200':
          description: tax calculated
          content:
            application/json:
              schema:
                type: object
                properties:
                  currency:
                    type: string
                    description: The three-letter ISO 4217 currency code of the amounts.
                  tax_behavior:
                    type: string
                    enum:
                      - exclusive
                      - inclusive
                    description: >-
                      Whether tax is added on top of the price (exclusive) or
                      already included in it (inclusive).
                  subtotal:
                    type: integer
                    description: >-
                      The 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 contains the tax and
                      equals the total.
                  tax_amount:
                    type: integer
                    description: >-
                      The tax owed, in the currency's smallest unit. For
                      exclusive tax it is added on top of the subtotal; for
                      inclusive tax it is the portion already contained in the
                      subtotal.
                  total:
                    type: integer
                    description: >-
                      The total amount the buyer pays, in the currency's
                      smallest unit.
                  status:
                    type: string
                    enum:
                      - calculated
                      - not_calculated
                    description: >-
                      Whether tax was successfully calculated. Returns
                      not_calculated when tax could not be determined.
                required:
                  - currency
                  - tax_behavior
                  - subtotal
                  - tax_amount
                  - total
                  - status
        '400':
          $ref: '#/components/responses/InvalidParameters'
          description: request is invalid
        '401':
          $ref: '#/components/responses/Unauthorized'
          description: missing or invalid authentication
        '403':
          $ref: '#/components/responses/Forbidden'
          description: credential lacks the plan read scope
        '404':
          $ref: '#/components/responses/NotFound'
          description: plan not found
      security:
        - bearerAuth:
            - plan:basic:read
components:
  responses:
    InvalidParameters:
      description: Invalid Parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V1ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V1ErrorResponse'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V1ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V1ErrorResponse'
  schemas:
    V1ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              description: Machine-readable error code.
            message:
              type: string
              description: Human-readable error message.
          required:
            - type
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: auth-scheme
      description: >-
        An account API key, account scoped JWT, app API key, or user OAuth
        token.

````