Skip to main content
POST
/
plans
/
{id}
/
calculate_tax
Calculate Tax
curl --request POST \
  --url https://{defaultHost}/plans/{id}/calculate_tax \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "address": {
    "country": "<string>",
    "state": "<string>",
    "postal_code": "<string>",
    "city": "<string>",
    "line1": "<string>",
    "line2": "<string>"
  },
  "ip_address": "<string>",
  "tax_ids": [
    {
      "type": "<string>",
      "value": "<string>"
    }
  ]
}
'
{
  "currency": "<string>",
  "subtotal": 123,
  "tax_amount": 123,
  "total": 123
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token.

Path Parameters

id
string
required

The unique identifier of the plan, which will look like plan_*************.

Body

application/json
address
object

The buyer's billing address. Provide this or ip_address.

ip_address
string

The buyer's IP address, used to resolve their location when no address is provided.

tax_ids
object[] | null

The buyer's tax IDs, such as a VAT number, used to apply B2B reverse-charge exemptions.

Maximum array length: 1

Response

tax calculated

currency
string
required

The three-letter ISO 4217 currency code of the amounts.

tax_behavior
enum<string>
required

Whether tax is added on top of the price (exclusive) or already included in it (inclusive).

Available options:
exclusive,
inclusive
subtotal
integer
required

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
integer
required

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
integer
required

The total amount the buyer pays, in the currency's smallest unit.

status
enum<string>
required

Whether tax was successfully calculated. Returns not_calculated when tax could not be determined.

Available options:
calculated,
not_calculated