Skip to main content
POST
JavaScript
Use it in a checkout preview to show the buyer their subtotal, tax, and total. The request is read-only — it doesn’t create a checkout, reserve inventory, or charge the buyer.

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Headers

Idempotency-Key
string

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

Maximum string length: 255
Example:

"d9105228-4a08-46b1-8b91-42fed586d383"

Path Parameters

id
string
required

Plan ID, prefixed plan_.

Body

application/json
address
object | null

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.

ip_address
string

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

tax_ids
object[] | null

Optional buyer tax ID for B2B exemptions. At most one entry is supported.

Maximum array length: 1

Response

tax calculated

currency
string
required

Three-letter ISO 4217 currency code for the returned amounts.

status
enum<string>
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.

Available options:
calculated,
not_calculated
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
enum<string>
required

Whether tax is added on top of the plan price or already included in it for this buyer's location.

Available options:
exclusive,
inclusive
total
integer
required

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