v1

latestOpenAPI 3.0.1MIT2026-07-13153492.5 KB

Get tax information for a given product and address

post/tax/calculations

Headers

X-API-Version'2026-03-01' | '2026-01-01' | '2025-05-12' | '2024-09-01' required

API version to use.

Request body

OR
OR
OR

Example request

{
  "customer": {
    "id": "cus_123456789",
    "type": "CONSUMER",
    "tax_ids": [
      {
        "type": "us_ein"
      }
    ],
    "address": {
      "address_line_1": "3990 N County Rd 300 E",
      "address_line_2": "Unit 2",
      "address_city": "Danville",
      "address_province": "IN",
      "address_postal_code": "46122",
      "address_country": "US",
      "address_type": "shipping"
    },
    "ip": {
      "value": "217.217.113.167"
    }
  },
  "origin_address": {
    "address_line_1": "3990 N County Rd 300 E",
    "address_line_2": "Unit 2",
    "address_city": "Danville",
    "address_province": "IN",
    "address_postal_code": "46122",
    "address_country": "US"
  },
  "order_details": {
    "customer_currency_code": "USD",
    "automatic_tax": "auto",
    "line_items": [
      {
        "reference_line_item_id": "line_123456789",
        "reference_product_id": "p-1233543",
        "product_category": "GENERAL_MERCHANDISE",
        "fallback_product_category": "GENERAL_MERCHANDISE",
        "amount": 200,
        "quantity": 2
      }
    ]
  },
  "metadata": {
    "example_key": "example_value"
  },
  "default_customer_type": "CONSUMER"
}

Response

Calculate response

idstring

The ID of the calculation. You will use this to create a transaction.

objectstring

The type of object: tax.calculation.

customer_currency_codestring

The ISO-4217 currency code of the transaction.

automatic_tax'auto' | 'disabled'

The automatic tax setting for this calculation.

tax_included_in_amountboolean
total_tax_amountnumber

Total tax to charge on this calculation.

total_amount_excluding_taxnumber

Total sale charge, excluding tax.

total_amount_including_taxnumber

Total sale charge plus tax. What you should charge your customer.

expires_atnumber

Epoch datetime representing the date and time the tax rates are valid until.

testmodeboolean

True if using a production API key. False if using a test API key.

address_resolution_status'EXACT' | 'POSTAL_FALLBACK_1' | 'POSTAL_ONLY'

Status of address resolution for the customer address. EXACT: exact address match found, POSTAL_FALLBACK_1: used postal code fallback, POSTAL_ONLY: only postal code was used for tax calculation.

location_source'address' | 'ip'

Which input was used for tax determination.

resolution_precision'STREET' | 'POSTAL_PLUS' | 'POSTAL' | 'PROVINCE' | 'COUNTRY' | 'APPROXIMATED'

The precision level of the resolved location.

Example response

{
  "id": "calc_123456789",
  "object": "tax.calculation",
  "customer_currency_code": "USD",
  "customer": {
    "type": "CONSUMER"
  },
  "automatic_tax": "auto",
  "line_items": [
    {
      "product": {
        "reference_product_name": "Widget",
        "reference_line_item_id": "line_987654321",
        "reference_product_id": "p-1233543",
        "product_tax_code": "GENERAL_MERCHANDISE"
      },
      "tax_jurisdictions": [
        {
          "tax_rate": 0.07,
          "tax_due_decimal": 700,
          "rate_type": "GENERAL STATE SALES TAX",
          "tax_authority_name": "Tennessee",
          "tax_type": "SALES"
        }
      ],
      "quantity": 2,
      "tax_amount": 14,
      "amount_excluding_tax": 200,
      "amount_including_tax": 214
    }
  ],
  "total_tax_amount": 14,
  "total_amount_excluding_tax": 200,
  "total_amount_including_tax": 214,
  "expires_at": 1714787673,
  "address_resolution_status": "EXACT",
  "address_used": {
    "address_line_1": "4 Privet Drive",
    "address_line_2": "Unit 2",
    "address_city": "Little Whinging",
    "address_province": "CA",
    "address_postal_code": "90210",
    "address_country": "US"
  },
  "metadata": {
    "example_key": "example_value"
  },
  "location_source": "address",
  "resolution_precision": "POSTAL"
}
All 15 operations