POST
/
v1
/
tax
/
calculate
curl --location --request POST 'https://api.stateset.com/v1/tax/calculate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
    "from_address": {
        "line1": "100 Commerce Way",
        "city": "Los Angeles",
        "state": "CA",
        "postal_code": "90001",
        "country": "US"
    },
    "to_address": {
        "line1": "123 Main St",
        "city": "San Francisco",
        "state": "CA",
        "postal_code": "94105",
        "country": "US"
    },
    "line_items": [
        {
            "id": "item_1",
            "quantity": 2,
            "unit_price": 2999,
            "product_category": "clothing"
        },
        {
            "id": "item_2",
            "quantity": 1,
            "unit_price": 999,
            "product_category": "food_grocery"
        }
    ],
    "shipping": {
        "amount": 1000
    },
    "customer": {
        "id": "cust_abc123",
        "type": "retail"
    }
}'
{
  "object": "tax_calculation",
  "order_total": 7997,
  "taxable_amount": 6998,
  "tax_amount": 613,
  "effective_rate": 0.0876,
  "line_items": [
    {
      "id": "item_1",
      "amount": 5998,
      "taxable_amount": 5998,
      "tax_amount": 540,
      "tax_breakdown": [
        {
          "name": "California State Sales Tax",
          "rate": 0.0725,
          "amount": 435,
          "taxable_amount": 5998
        },
        {
          "name": "San Francisco County Tax",
          "rate": 0.0175,
          "amount": 105,
          "taxable_amount": 5998
        }
      ]
    },
    {
      "id": "item_2",
      "amount": 999,
      "taxable_amount": 0,
      "tax_amount": 0,
      "exemption_reason": "food_grocery_exempt"
    }
  ],
  "shipping": {
    "amount": 1000,
    "taxable_amount": 1000,
    "tax_amount": 73,
    "tax_breakdown": [
      {
        "name": "California State Sales Tax",
        "rate": 0.0725,
        "amount": 73
      }
    ]
  },
  "jurisdictions": [
    {
      "name": "California",
      "type": "state",
      "rate": 0.0725,
      "tax_amount": 508
    },
    {
      "name": "San Francisco County",
      "type": "county",
      "rate": 0.0175,
      "tax_amount": 105
    }
  ],
  "has_nexus": true,
  "tax_registration": {
    "state": "CA",
    "registration_number": "CA-123456789"
  },
  "warnings": [],
  "metadata": {
    "calculation_timestamp": "2024-01-20T11:30:00Z",
    "tax_engine_version": "2024.1"
  }
}
This endpoint calculates applicable taxes for a given order, considering all active tax rates, exemptions, and nexus rules. It returns a detailed breakdown of all taxes to be collected.

Authentication

This endpoint requires a valid API key with tax:read permissions.
Authorization: Bearer YOUR_API_KEY

Request Body

from_address
object
required
Origin address (seller location)
to_address
object
required
Destination address (buyer location)
line_items
array
required
Items to calculate tax for
shipping
object
Shipping details
customer
object
Customer details for exemptions
transaction_date
string
Transaction date for rate determination (ISO 8601)
currency
string
ISO 4217 currency code (default: USD)

Response

Returns detailed tax calculation breakdown.
curl --location --request POST 'https://api.stateset.com/v1/tax/calculate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
    "from_address": {
        "line1": "100 Commerce Way",
        "city": "Los Angeles",
        "state": "CA",
        "postal_code": "90001",
        "country": "US"
    },
    "to_address": {
        "line1": "123 Main St",
        "city": "San Francisco",
        "state": "CA",
        "postal_code": "94105",
        "country": "US"
    },
    "line_items": [
        {
            "id": "item_1",
            "quantity": 2,
            "unit_price": 2999,
            "product_category": "clothing"
        },
        {
            "id": "item_2",
            "quantity": 1,
            "unit_price": 999,
            "product_category": "food_grocery"
        }
    ],
    "shipping": {
        "amount": 1000
    },
    "customer": {
        "id": "cust_abc123",
        "type": "retail"
    }
}'
{
  "object": "tax_calculation",
  "order_total": 7997,
  "taxable_amount": 6998,
  "tax_amount": 613,
  "effective_rate": 0.0876,
  "line_items": [
    {
      "id": "item_1",
      "amount": 5998,
      "taxable_amount": 5998,
      "tax_amount": 540,
      "tax_breakdown": [
        {
          "name": "California State Sales Tax",
          "rate": 0.0725,
          "amount": 435,
          "taxable_amount": 5998
        },
        {
          "name": "San Francisco County Tax",
          "rate": 0.0175,
          "amount": 105,
          "taxable_amount": 5998
        }
      ]
    },
    {
      "id": "item_2",
      "amount": 999,
      "taxable_amount": 0,
      "tax_amount": 0,
      "exemption_reason": "food_grocery_exempt"
    }
  ],
  "shipping": {
    "amount": 1000,
    "taxable_amount": 1000,
    "tax_amount": 73,
    "tax_breakdown": [
      {
        "name": "California State Sales Tax",
        "rate": 0.0725,
        "amount": 73
      }
    ]
  },
  "jurisdictions": [
    {
      "name": "California",
      "type": "state",
      "rate": 0.0725,
      "tax_amount": 508
    },
    {
      "name": "San Francisco County",
      "type": "county",
      "rate": 0.0175,
      "tax_amount": 105
    }
  ],
  "has_nexus": true,
  "tax_registration": {
    "state": "CA",
    "registration_number": "CA-123456789"
  },
  "warnings": [],
  "metadata": {
    "calculation_timestamp": "2024-01-20T11:30:00Z",
    "tax_engine_version": "2024.1"
  }
}