Calculate transaction tax
curl --request POST \
--url https://api.yondatax.com/v1/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction_type": "sale",
"reference_id": "order-example-001",
"transaction_date": "2026-09-24T12:00:00Z",
"currency": "usd",
"customer": {
"customer_code": "customer-example-001",
"address_source": "billing",
"billing_address": {
"line1": "350 5th Ave",
"city": "New York",
"state": "NY",
"postal_code": "10118",
"country": "US"
}
},
"line_items": [
{
"number": 1,
"description": "Example item",
"quantity": 1,
"unit_price": 1000,
"amount": 1000
}
],
"shipping": {
"cost": 200
}
}
'import requests
url = "https://api.yondatax.com/v1/transactions"
payload = {
"transaction_type": "sale",
"reference_id": "order-example-001",
"transaction_date": "2026-09-24T12:00:00Z",
"currency": "usd",
"customer": {
"customer_code": "customer-example-001",
"address_source": "billing",
"billing_address": {
"line1": "350 5th Ave",
"city": "New York",
"state": "NY",
"postal_code": "10118",
"country": "US"
}
},
"line_items": [
{
"number": 1,
"description": "Example item",
"quantity": 1,
"unit_price": 1000,
"amount": 1000
}
],
"shipping": { "cost": 200 }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_type: 'sale',
reference_id: 'order-example-001',
transaction_date: '2026-09-24T12:00:00Z',
currency: 'usd',
customer: {
customer_code: 'customer-example-001',
address_source: 'billing',
billing_address: {
line1: '350 5th Ave',
city: 'New York',
state: 'NY',
postal_code: '10118',
country: 'US'
}
},
line_items: [
{
number: 1,
description: 'Example item',
quantity: 1,
unit_price: 1000,
amount: 1000
}
],
shipping: {cost: 200}
})
};
fetch('https://api.yondatax.com/v1/transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"transaction_type": "sale",
"reference_id": "order-example-001",
"transaction_date": "2026-09-24T12:00:00Z",
"currency": "usd",
"customer": {
"customer_code": "customer-example-001",
"name": null,
"email": null
},
"address_used_for_tax": {
"address": {
"line1": "350 5th Ave",
"line2": null,
"line3": null,
"city": "New York",
"state": "NY",
"postal_code": "10118",
"country": "US"
},
"sourcing": "destination"
},
"line_items": [
{
"number": 1,
"product_code": null,
"description": "Example item",
"quantity": 1,
"unit_price": 1000,
"amount": 1000,
"discount_amount": 0,
"tax_inclusive": false,
"taxable_amount": 1000,
"tax_amount": 89,
"total": 1089,
"taxability_reason": "standard_rated",
"tax_details": {
"taxable_amount": 1000,
"nontaxable_amount": 0,
"tax_due": 89,
"jurisdictions": [
{
"name": "New York",
"division": "state",
"tax_type": "sales_tax",
"rate_type": "fixed",
"rate": 4,
"taxable_amount": 1000,
"nontaxable_amount": 0,
"tax_due": 40,
"taxability_reason": "standard_rated",
"pricing_status": "taxed"
},
{
"name": "New York",
"division": "city",
"tax_type": "sales_tax",
"rate_type": "fixed",
"rate": 4.5,
"taxable_amount": 1000,
"nontaxable_amount": 0,
"tax_due": 45,
"taxability_reason": "standard_rated",
"pricing_status": "taxed"
},
{
"name": "New York City MCTD",
"division": "district",
"tax_type": "sales_tax",
"rate_type": "fixed",
"rate": 0.375,
"taxable_amount": 1000,
"nontaxable_amount": 0,
"tax_due": 4,
"taxability_reason": "standard_rated",
"pricing_status": "taxed"
}
]
},
"classification": {
"category": "TPP",
"tags": [],
"source": "general"
}
}
],
"subtotal": 1200,
"total_discount": 0,
"total_tax": 107,
"total_shipping_tax": 18,
"amount_total": 1307,
"shipping": {
"cost": 200,
"taxable_amount": 200,
"tax_amount": 18,
"total": 218,
"taxability_reason": "standard_rated",
"jurisdictions": [
{
"name": "New York",
"division": "state",
"tax_type": "sales_tax",
"rate_type": "fixed",
"rate": 4,
"taxable_amount": 200,
"nontaxable_amount": 0,
"tax_due": 8,
"taxability_reason": "standard_rated",
"pricing_status": "taxed"
},
{
"name": "New York",
"division": "city",
"tax_type": "sales_tax",
"rate_type": "fixed",
"rate": 4.5,
"taxable_amount": 200,
"nontaxable_amount": 0,
"tax_due": 9,
"taxability_reason": "standard_rated",
"pricing_status": "taxed"
},
{
"name": "New York City MCTD",
"division": "district",
"tax_type": "sales_tax",
"rate_type": "fixed",
"rate": 0.375,
"taxable_amount": 200,
"nontaxable_amount": 0,
"tax_due": 1,
"taxability_reason": "standard_rated",
"pricing_status": "taxed"
}
]
}
}API reference
Calculate transaction tax
Calculate item and shipping tax for a sale.
POST
/
v1
/
transactions
Calculate transaction tax
curl --request POST \
--url https://api.yondatax.com/v1/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction_type": "sale",
"reference_id": "order-example-001",
"transaction_date": "2026-09-24T12:00:00Z",
"currency": "usd",
"customer": {
"customer_code": "customer-example-001",
"address_source": "billing",
"billing_address": {
"line1": "350 5th Ave",
"city": "New York",
"state": "NY",
"postal_code": "10118",
"country": "US"
}
},
"line_items": [
{
"number": 1,
"description": "Example item",
"quantity": 1,
"unit_price": 1000,
"amount": 1000
}
],
"shipping": {
"cost": 200
}
}
'import requests
url = "https://api.yondatax.com/v1/transactions"
payload = {
"transaction_type": "sale",
"reference_id": "order-example-001",
"transaction_date": "2026-09-24T12:00:00Z",
"currency": "usd",
"customer": {
"customer_code": "customer-example-001",
"address_source": "billing",
"billing_address": {
"line1": "350 5th Ave",
"city": "New York",
"state": "NY",
"postal_code": "10118",
"country": "US"
}
},
"line_items": [
{
"number": 1,
"description": "Example item",
"quantity": 1,
"unit_price": 1000,
"amount": 1000
}
],
"shipping": { "cost": 200 }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_type: 'sale',
reference_id: 'order-example-001',
transaction_date: '2026-09-24T12:00:00Z',
currency: 'usd',
customer: {
customer_code: 'customer-example-001',
address_source: 'billing',
billing_address: {
line1: '350 5th Ave',
city: 'New York',
state: 'NY',
postal_code: '10118',
country: 'US'
}
},
line_items: [
{
number: 1,
description: 'Example item',
quantity: 1,
unit_price: 1000,
amount: 1000
}
],
shipping: {cost: 200}
})
};
fetch('https://api.yondatax.com/v1/transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"transaction_type": "sale",
"reference_id": "order-example-001",
"transaction_date": "2026-09-24T12:00:00Z",
"currency": "usd",
"customer": {
"customer_code": "customer-example-001",
"name": null,
"email": null
},
"address_used_for_tax": {
"address": {
"line1": "350 5th Ave",
"line2": null,
"line3": null,
"city": "New York",
"state": "NY",
"postal_code": "10118",
"country": "US"
},
"sourcing": "destination"
},
"line_items": [
{
"number": 1,
"product_code": null,
"description": "Example item",
"quantity": 1,
"unit_price": 1000,
"amount": 1000,
"discount_amount": 0,
"tax_inclusive": false,
"taxable_amount": 1000,
"tax_amount": 89,
"total": 1089,
"taxability_reason": "standard_rated",
"tax_details": {
"taxable_amount": 1000,
"nontaxable_amount": 0,
"tax_due": 89,
"jurisdictions": [
{
"name": "New York",
"division": "state",
"tax_type": "sales_tax",
"rate_type": "fixed",
"rate": 4,
"taxable_amount": 1000,
"nontaxable_amount": 0,
"tax_due": 40,
"taxability_reason": "standard_rated",
"pricing_status": "taxed"
},
{
"name": "New York",
"division": "city",
"tax_type": "sales_tax",
"rate_type": "fixed",
"rate": 4.5,
"taxable_amount": 1000,
"nontaxable_amount": 0,
"tax_due": 45,
"taxability_reason": "standard_rated",
"pricing_status": "taxed"
},
{
"name": "New York City MCTD",
"division": "district",
"tax_type": "sales_tax",
"rate_type": "fixed",
"rate": 0.375,
"taxable_amount": 1000,
"nontaxable_amount": 0,
"tax_due": 4,
"taxability_reason": "standard_rated",
"pricing_status": "taxed"
}
]
},
"classification": {
"category": "TPP",
"tags": [],
"source": "general"
}
}
],
"subtotal": 1200,
"total_discount": 0,
"total_tax": 107,
"total_shipping_tax": 18,
"amount_total": 1307,
"shipping": {
"cost": 200,
"taxable_amount": 200,
"tax_amount": 18,
"total": 218,
"taxability_reason": "standard_rated",
"jurisdictions": [
{
"name": "New York",
"division": "state",
"tax_type": "sales_tax",
"rate_type": "fixed",
"rate": 4,
"taxable_amount": 200,
"nontaxable_amount": 0,
"tax_due": 8,
"taxability_reason": "standard_rated",
"pricing_status": "taxed"
},
{
"name": "New York",
"division": "city",
"tax_type": "sales_tax",
"rate_type": "fixed",
"rate": 4.5,
"taxable_amount": 200,
"nontaxable_amount": 0,
"tax_due": 9,
"taxability_reason": "standard_rated",
"pricing_status": "taxed"
},
{
"name": "New York City MCTD",
"division": "district",
"tax_type": "sales_tax",
"rate_type": "fixed",
"rate": 0.375,
"taxable_amount": 200,
"nontaxable_amount": 0,
"tax_due": 1,
"taxability_reason": "standard_rated",
"pricing_status": "taxed"
}
]
}
}Calculate tax at checkout using your customer’s selected billing or shipping address. The response includes item-level tax, jurisdiction details, and a separate shipping breakdown when you provide a delivery charge.
For a complete request, start with the quickstart. See the calculation guide for minor units, discounts, and shipping totals.
Authorizations
Body
application/json
Calculate item and shipping tax for a sale. Send amounts before tax.
Response
Successful Response
Sale calculation. subtotal includes products and shipping after discounts, before tax. total_tax includes product and shipping tax. amount_total = subtotal + total_tax. total_shipping_tax is already included in total_tax.
Was this page helpful?