POST
/
tax
/
calculations
curl --request POST \
  --url https://api.numeralhq.com/tax/calculations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "customer": {
    "id": "cus_123456789",
    "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"
    }
  },
  "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",
    "tax_included_in_amount": false,
    "line_items": [
      {
        "reference_line_item_id": "line_123456789",
        "reference_product_id": "p-1233543",
        "product_category": "GENERAL_MERCHANDISE",
        "amount": 200,
        "quantity": 2
      }
    ]
  },
  "metadata": {
    "example_key": "example_value"
  }
}'
{
  "id": "calc_123456789",
  "object": "tax.calculation",
  "customer_currency_code": "USD",
  "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,
          "rate_type": "STATE SALES TAX",
          "jurisdiction_name": "Indiana",
          "fee_amount": 0
        }
      ],
      "quantity": 2,
      "tax_amount": 14,
      "amount_excluding_tax": 200,
      "amount_including_tax": 214
    }
  ],
  "tax_included_in_amount": false,
  "total_tax_amount": 14,
  "total_amount_excluding_tax": 200,
  "total_amount_including_tax": 214,
  "expires_at": 1714787673,
  "testmode": "false",
  "metadata": {
    "example_key": "example_value"
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
customer
object
required

Customer details. Address is required. Optionally accepts a customer ID for order tracking and exemptions.

order_details
object
required
origin_address
object

Optional, but relevant for tax collection in certain states. The address that a product is shipped from.

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

200
application/json
Calculate response
id
string

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

object
string

The type of object: tax.calculation.

customer_currency_code
string

The ISO-4217 currency code of the transaction.

line_items
object[]
tax_included_in_amount
boolean
total_tax_amount
number

Total tax to charge on this calculation.

total_amount_excluding_tax
number

Total sale charge, excluding tax.

total_amount_including_tax
number

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

expires_at
number

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

testmode
boolean

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

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.