Calculate Tax
Changed onDeprecated. Quote tax with POST /payment_quotes instead. Previews tax for a variant before checkout, based on the buyer's location.
Request
- Base URLhttps://api.whop.com/api/v1
- AuthHTTP bearer
Path parameters
Variant ID, prefixed plan_.
Headers
A unique key that makes this request safe to retry. See Idempotent requests.
Request body
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.
Buyer IP address used to infer location when no billing address is provided.
Optional buyer tax ID for B2B exemptions. At most one entry is supported.
Example request
{
"address": {
"country": "DE",
"postal_code": "10115"
}
}Response
tax calculated
Three-letter ISO 4217 currency code for the returned amounts.
Whether Whop calculated tax for this preview. not_calculated means no tax could be determined, so tax_amount is 0 and total equals subtotal.
Variant 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.
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.
Whether tax is added on top of the variant price or already included in it for this buyer's location.
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
}Changes
- info
endpoint deprecated
- info
- info
endpoint added
- info