Sales Tax API
Core Concepts
Corporations
Calculate
Transactions
- Tax Transactions
- POSTCreate a transaction
- GETGet transaction
- GETList transactions
- DELDelete transaction
- Refund Transactions
- Bulk Transaction Import
Nexus
Registrations
Products
Customers
Exemption Certificates
Calculate tax
curl --request POST \
--url https://base_url/api/v1/calculate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"corporation_id": "b6d009b0-d174-463f-b030-94643c28e209",
"transacted_at": "2023-12-25",
"customer_details": {
"shipping_address": {
"address_line_1": "1776 Main St",
"address_line_2": "Apt. #123",
"address_line_3": "<string>",
"postal_code": "90401",
"city": "Santa Monica",
"state": "CA",
"country": "US"
},
"customer_id": "<string>"
},
"invoice_currency": "USD",
"subtotal": 10.99,
"discount": 0.99,
"shipping_and_handling": 0,
"total": 10.99,
"line_items": {
"items": [
{
"amount": 123,
"quantity": 123,
"tax_code": "TPP",
"product_id": "<string>",
"external_id": "<string>"
}
]
}
}'
{
"data": {
"corporation_id": "b6d009b0-d174-463f-b030-94643c28e209",
"transacted_at": "2023-12-25",
"customer_details": {
"shipping_address": {
"address_line_1": "1776 Main St",
"address_line_2": "Apt. #123",
"address_line_3": "<string>",
"postal_code": "90401",
"city": "Santa Monica",
"state": "CA",
"country": "US"
},
"customer_id": "<string>"
},
"invoice_currency": "USD",
"subtotal": 10.99,
"discount": 0.99,
"shipping_and_handling": 0,
"line_items": [
{
"raw_amount": 99.99,
"taxable_amount": 89.99,
"quantity": 123,
"tax_code": "TPP",
"product_id": "<string>",
"external_id": "1",
"total_tax_due": 1.03,
"total_tax_rate": 6.3500004,
"tax_breakdown": {
"rates": [
{
"jurisdiction_name": "CT",
"jurisdiction_type": "STATE",
"rate": 6.3500004
}
]
}
}
],
"tax_currency": "USD",
"total_tax_due": 11.06,
"validation_results": [
{}
]
},
"message": "Successfully calculated tax."
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
The unique identifier for the corporation associated with this transaction.
"b6d009b0-d174-463f-b030-94643c28e209"
ISO 8601 formatted date string indicating date on which the transaction took place. If tax calculations need to be based on a different date, please contact our team for assistance.
Customer details for this transaction.
Either 5-digit ZIP code or 9-digit ZIP+4 code is accepted.
"90401"
2-letter code for each state. Suffix of the ISO 3166-2 code. Ex: CA, NY, TX.
"CA"
ISO 3166 2-letter country code. Ex: US, IN, GB.
"US"
"1776 Main St"
"Apt. #123"
"Santa Monica"
Optional unique identifier for the customer. If provided, it may be used to retrieve defaults configured for the customers. Any explicitly provided customer details will take precedence over stored defaults.
ISO 4217 alpha-3 currency code for the transaction.
"USD"
Total amount before tax, shipping, handling, and discounts.
10.99
Array of line items representing individual products or services in the transaction. For each line item either pass the tax_code or the product_id. If the product_id is passed the tax_code will be fetched from the product itself.
Total price for the line item, including any discounts and shipping and handling costs.
Quantity of units purchased.
Code passed by the caller to determine taxability for this product. Default value, TPP, will be taxable in every jurisdiction. Reach out to the Commenda team for alternative product codes.
"TPP"
The unique identifier for the product getting sold in this line item. Not required if tax code is passed.
An external ID that may be applied to the line item.
Total discount amount applied to the subtotal.
0.99
Total shipping and handling charges.
0
Total amount after tax, shipping, handling, and discounts.
10.99
Response
The unique identifier for the corporation associated with this transaction.
"b6d009b0-d174-463f-b030-94643c28e209"
ISO 8601 formatted date string indicating date on which the transaction took place. If tax calculations need to be based on a different date, please contact our team for assistance.
Customer details for this transaction.
Either 5-digit ZIP code or 9-digit ZIP+4 code is accepted.
"90401"
2-letter code for each state. Suffix of the ISO 3166-2 code. Ex: CA, NY, TX.
"CA"
ISO 3166 2-letter country code. Ex: US, IN, GB.
"US"
"1776 Main St"
"Apt. #123"
"Santa Monica"
Optional unique identifier for the customer. If provided, it may be used to retrieve defaults configured for the customers. Any explicitly provided customer details will take precedence over stored defaults.
ISO 4217 alpha-3 currency code for the transaction.
"USD"
Total amount before tax, shipping, handling, and discounts.
10.99
Total discount amount applied to the subtotal.
0.99
Total shipping and handling charges.
0
Total price for the line item including discounts, before tax. Represented as a positive decimal number with up to 2 decimal places.
99.99
Net amount subject to tax calculation for this line item, after applying all discounts and deductions. Represented as a positive decimal number with up to 2 decimal places.
89.99
Quantity of units purchased.
Code passed by the caller to determine taxability for this product. Default value, TPP, will be taxable in every jurisdiction. Reach out to the Commenda team for alternative product codes.
"TPP"
The unique identifier for the product getting sold in this line item.
External identifier for the line item.
"1"
Numeric value representing the total amount of sales tax to be remitted for this particular line item.
1.03
Numeric value representing the tax rate as a percentage.
6.3500004
Breakdown of tax rates by jurisdiction.
Name of the taxing jurisdiction (e.g., "CT", "Broad Brook").
"CT"
Type of taxing jurisdiction. This list is not exhaustive.
STATE
, COUNTY
, CITY
, SPECIAL_DISTRICT
Numeric value representing the tax rate for this jurisdiction as a percentage.
6.3500004
ISO 4217 alpha-3 currency code representing the currency in which tax details are reported.
"USD"
Numeric value representing the total amount of sales tax to be remitted to tax authorities.
11.06
Array containing any validation messages or warnings
"Successfully calculated tax."
curl --request POST \
--url https://base_url/api/v1/calculate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"corporation_id": "b6d009b0-d174-463f-b030-94643c28e209",
"transacted_at": "2023-12-25",
"customer_details": {
"shipping_address": {
"address_line_1": "1776 Main St",
"address_line_2": "Apt. #123",
"address_line_3": "<string>",
"postal_code": "90401",
"city": "Santa Monica",
"state": "CA",
"country": "US"
},
"customer_id": "<string>"
},
"invoice_currency": "USD",
"subtotal": 10.99,
"discount": 0.99,
"shipping_and_handling": 0,
"total": 10.99,
"line_items": {
"items": [
{
"amount": 123,
"quantity": 123,
"tax_code": "TPP",
"product_id": "<string>",
"external_id": "<string>"
}
]
}
}'
{
"data": {
"corporation_id": "b6d009b0-d174-463f-b030-94643c28e209",
"transacted_at": "2023-12-25",
"customer_details": {
"shipping_address": {
"address_line_1": "1776 Main St",
"address_line_2": "Apt. #123",
"address_line_3": "<string>",
"postal_code": "90401",
"city": "Santa Monica",
"state": "CA",
"country": "US"
},
"customer_id": "<string>"
},
"invoice_currency": "USD",
"subtotal": 10.99,
"discount": 0.99,
"shipping_and_handling": 0,
"line_items": [
{
"raw_amount": 99.99,
"taxable_amount": 89.99,
"quantity": 123,
"tax_code": "TPP",
"product_id": "<string>",
"external_id": "1",
"total_tax_due": 1.03,
"total_tax_rate": 6.3500004,
"tax_breakdown": {
"rates": [
{
"jurisdiction_name": "CT",
"jurisdiction_type": "STATE",
"rate": 6.3500004
}
]
}
}
],
"tax_currency": "USD",
"total_tax_due": 11.06,
"validation_results": [
{}
]
},
"message": "Successfully calculated tax."
}