Skip to main content
POST
/
tax
/
calculations
curl --request POST \
  --url https://api.numeralhq.com/tax/calculations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Version: <x-api-version>' \
  --data '
{
  "customer": {
    "address": {
      "address_line_1": "4 Privet Drive",
      "address_city": "Little Whining",
      "address_province": "CA",
      "address_postal_code": "90210",
      "address_country": "US",
      "address_type": "shipping"
    }
  },
  "order_details": {
    "customer_currency_code": "USD",
    "tax_included_in_amount": false,
    "line_items": [
      {
        "reference_product_id": "wand_elder_12",
        "amount": 10000,
        "quantity": 1
      }
    ]
  }
}
'
{
  "id": "calc_1726683504829b84b2ad6-a4c9-4e0e-986f-7bb3d1fb17c9",
  "object": "tax.calculation",
  "customer_currency_code": "USD",
  "line_items": [
    {
      "product": {
        "reference_product_name": "Elder Wand",
        "reference_product_id": "wand_elder_12",
        "product_tax_code": "GENERAL_MERCHANDISE"
      },
      "tax_jurisdictions": [
        {
          "tax_rate": 0.1,
          "rate_type": "SALES TAX",
          "jurisdiction_name": "California",
          "fee_amount": 0
        }
      ],
      "quantity": 1,
      "tax_amount": 1000,
      "amount_excluding_tax": 10000,
      "amount_including_tax": 11000
    }
  ],
  "tax_included_in_amount": false,
  "total_tax_amount": 1000,
  "total_amount_excluding_tax": 10000,
  "total_amount_including_tax": 11000,
  "expires_at": 1726683511,
  "testmode": true,
  "address_resolution_status": "EXACT",
  "address_used": {
    "address_line_1": "4 Privet Drive",
    "address_city": "Little Whinging",
    "address_province": "CA",
    "address_postal_code": "90210",
    "address_country": "US"
  }
}
Get tax information for a given product and address or IP.
Required from 2025-05-12+:
  • The origin_address field is required for all calculations starting from API version 2025-05-12. Ensure you provide an origin address or have a default address configured.
  • The automatic_tax field in order_details is required starting from API version 2025-05-12. Use "auto" to enable automatic tax calculation or "disabled" to return zero tax rates.
Note: The address_type field is only valid on customer.address and will be silently rejected if used on origin_address.

cURL Header Example

Use X-API-Version explicitly in requests:
curl --request POST \
  --url https://api.numeralhq.com/tax/calculations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Version: 2026-03-01' \
  --data '{ ... }'
New in 2026-03-01: You can now provide customer.ip instead of (or in addition to) customer.address for IP-based tax resolution.
Inherited from 2026-01-01: The amount field on line items is per-unit price (taxable base = amount x quantity). Responses include address_resolution_status, address_used, and enhanced tax_jurisdictions fields (tax_authority_name, tax_authority_type, tax_type, tax_due_decimal).

IP-Based Resolution

Instead of providing a full customer address, you can pass an IP address and we’ll resolve it to a taxable location:
{
  "customer": {
    "type": "CONSUMER",
    "ip": {
      "value": "217.217.113.167",
      "resolution": "strict"
    }
  }
}
At least one of customer.address or customer.ip must be provided. If both are given, the address is used first with IP as a fallback.

Resolution Modes

ModeBehavior
strict (default)Error if IP cannot resolve to sufficient detail for tax calculation
zeroReturn zero-rate response if resolution is insufficient
approximateAttempts to resolve the IP to an address using heuristics
best_effortTry approximate first, fall back to zero rates
Numeral strongly recommends using strict mode to stay as compliant as possible.

New Response Fields

FieldDescription
location_source"address" or "ip" — which input was used
resolution_precisionSTREET, POSTAL_PLUS, POSTAL, PROVINCE, COUNTRY, or APPROXIMATED
address_usedThe resolved address used for tax calculation

IP Resolution Errors

Error TypeHTTP CodeDescription
INVALID_IP_FORMAT400ip.value is not a valid IPv4 or IPv6 address
IP_RESOLUTION_FAILED422IP could not be resolved to any country
IP_RESOLUTION_INSUFFICIENT_US422IP resolved to a US state but no postal code could be determined
IP_RESOLUTION_INSUFFICIENT_CA422IP resolved to Canada but no province could be determined

Error Codes Reference

See the complete list of error types and their meanings.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-API-Version
enum<string>
required

API version to use.

Available options:
2026-03-01,
2026-01-01,
2025-05-12,
2024-09-01

Body

application/json
customer
object
required

Customer details. At least one of address or ip must be provided.

origin_address
object
required

Required from API version 2025-05-12+. The address that a product is shipped from.

order_details
object
required
metadata
object

You can store arbitrary keys and values in the metadata. Any valid JSON object whose values are less than 255 characters long is accepted.

Response

Calculate response

id
string

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

Example:

"calc_123456789"

object
string

The type of object: tax.calculation.

Example:

"tax.calculation"

customer_currency_code
string

The ISO-4217 currency code of the transaction.

Example:

"USD"

customer
object

Customer information returned in the response.

automatic_tax
enum<string>

The automatic tax setting for this calculation.

Available options:
auto,
disabled
Example:

"auto"

line_items
object[]
tax_included_in_amount
boolean
Example:

false

total_tax_amount
number

Total tax to charge on this calculation.

Example:

14

total_amount_excluding_tax
number

Total sale charge, excluding tax.

Example:

200

total_amount_including_tax
number

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

Example:

214

expires_at
number

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

Example:

1714787673

testmode
boolean

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

Example:

"false"

address_resolution_status
enum<string>

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.

Available options:
EXACT,
POSTAL_FALLBACK_1,
POSTAL_ONLY
Example:

"EXACT"

address_used
object

The actual address used for tax calculation after resolution.

metadata
object

You can store arbitrary keys and values in the metadata. Any valid JSON object whose values are less than 255 characters long is accepted.

location_source
enum<string>

Which input was used for tax determination.

Available options:
address,
ip
Example:

"address"

resolution_precision
enum<string>

The precision level of the resolved location.

Available options:
STREET,
POSTAL_PLUS,
POSTAL,
PROVINCE,
COUNTRY,
APPROXIMATED
Example:

"POSTAL"