API Details
This API allows you to calculate sales tax rates and amounts for your sales transactions. You can pass in the details of a transaction, including the shipping origin and destination (street, city, state, country), the products sold, and the quantities. The API will then return the appropriate sales tax rates and amounts based on the provided information. This can be particularly useful for e-commerce platforms where sales tax needs to be calculated in real-time during the checkout process.
Request Schema
| Property | Type | Required | Description |
|---|---|---|---|
products | object[] | optional | - |
name | string | optional | The name of the product |
price | number | optional | The price of the product |
quantity | number | optional | The quantity of the product sold |
shipping_origin | object | optional | - |
city | string | optional | The city of the shipping origin |
state | string | optional | The state of the shipping origin |
street | string | optional | The street address of the shipping origin |
country | string | optional | The country of the shipping origin |
shipping_destination | object | optional | - |
city | string | optional | The city of the shipping destination |
state | string | optional | The state of the shipping destination |
street | string | optional | The street address of the shipping destination |
country | string | optional | The country of the shipping destination |
Response Schema
| Property | Type | Required | Description |
|---|---|---|---|
tax_rates | object[] | optional | - |
rate | number | optional | The sales tax rate for the jurisdiction |
amount | number | optional | The sales tax amount for the jurisdiction |
jurisdiction | string | optional | The name of the tax jurisdiction (e.g., state, county, city) |
total_tax_amount | number | optional | The total sales tax amount for the transaction |
API Metadata
ID381
Version
v1
Method
post
Endpoint
/sales-tax-calculator/v1
Tags
sales tax
tax calculation
tax rates
e-commerce
transaction processing
API Examples
Example Request
{
"products": [
{
"name": "Widget",
"price": 9.99,
"quantity": 2
},
{
"name": "Gadget",
"price": 19.99,
"quantity": 1
}
],
"shipping_origin": {
"city": "Anytown",
"state": "CA",
"street": "123 Main St",
"country": "USA"
},
"shipping_destination": {
"city": "Somewhere",
"state": "TX",
"street": "456 Oak Rd",
"country": "USA"
}
}Example Response
{
"tax_rates": [
{
"rate": 0.0775,
"amount": 1.55,
"jurisdiction": "State of CA"
},
{
"rate": 0.01,
"amount": 0.2,
"jurisdiction": "City of Anytown"
},
{
"rate": 0.0112,
"amount": 2.23,
"jurisdiction": "County of Somewhere"
}
],
"total_tax_amount": 3.98
}