v8

OpenAPI 3.1.02026-08-033623795.0 MB
Plans

Calculate Tax

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

post/plans/{id}/calculate_tax

Headers

Idempotency-Keystring
Example:d9105228-4a08-46b1-8b91-42fed586d383

A unique key that makes this request safe to retry. See Idempotent requests.

Request body

ip_addressstring

Buyer IP address used to infer location when no billing address is provided.

Example request

{
  "address": {
    "country": "DE",
    "postal_code": "10115"
  }
}

Response

tax calculated

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

subtotalinteger 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_amountinteger 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.

totalinteger required

Amount the buyer would pay in the currency's smallest unit.

Example response

{
  "currency": "usd",
  "status": "calculated",
  "subtotal": 1000,
  "tax_amount": 70,
  "tax_behavior": "exclusive",
  "total": 1070
}