API Reference
- Partner SPI
- Tax SPI
- Overview
- Authorization
- Address
- TaxEstimate
- Invoice
- CreditNote
- Authentication
- Health
- Testing with Postman
- Tax Registration Number Validation SPI
- Troubleshooting
TaxEstimate
Estimate tax
This endpoint is used to estimate taxes for a set of line items being sold by the Merchant to a Customer and is mandatory to integrate for the tax provider.
POST
/
tax-estimate
curl --request POST \
--url https://rest.taxes.provider.com/api/v1/tax-estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"seller": {
"address": {
"line1": "412 63rd South Avenue",
"city": "Baltimore",
"state": "MD",
"country": "US",
"postalCode": "21230"
}
},
"customer": {
"name": "John Doe",
"customerCode": "customer_test",
"address": {
"line1": "59, Starlight Avenue",
"city": "Newark",
"state": "NJ",
"country": "US",
"postalCode": "98712"
}
},
"estimateDateTime": "2022-11-01T05:12:08.131Z",
"currency": "USD",
"lineItems": [
{
"number": 1,
"itemCode": "cbWatch",
"description": "A winding watch.",
"quantity": 1,
"amount": 100,
"isTaxInclusive": false,
"taxIdentifiers": [
{
"id": "taxCode",
"value": "PT12312"
}
]
}
]
}'
{
"seller": {
"address": {
"line1": "412 63rd South Avenue",
"city": "Baltimore",
"state": "MD",
"country": "US",
"postalCode": "21230"
},
"hasNexus": true
},
"customer": {
"customerCode": "customer_test",
"address": {
"line1": "59, Starlight Avenue",
"city": "Newark",
"state": "NJ",
"country": "US",
"postalCode": "98712"
}
},
"estimateDateTime": "2022-11-01T05:12:08.131Z",
"currency": "USD",
"discountAmount": 0,
"subtotal": 100,
"exemptAmount": 0,
"taxableAmount": 100,
"taxAmount": 15,
"total": 115,
"lineItems": [
{
"number": 1,
"itemCode": "cbWatch",
"description": "A winding watch.",
"quantity": 1,
"amount": 100,
"isTaxInclusive": false,
"isTaxable": true,
"taxIdentifiers": [
{
"id": "taxCode",
"value": "PT12312"
}
],
"discountAmount": 0,
"subtotal": 100,
"exemptAmount": 0,
"taxableAmount": 100,
"taxAmount": 15,
"total": 115,
"taxes": [
{
"number": 1,
"jurisdiction": {
"code": "48",
"type": "STATE",
"name": "CALIFORNIA"
},
"name": "SALE",
"rate": 5,
"taxableAmount": 100,
"taxAmount": 5
},
{
"number": 2,
"jurisdiction": {
"code": "27000",
"type": "CITY",
"name": "SAN FRANCISCO"
},
"name": "SALE",
"rate": 10,
"taxableAmount": 100,
"taxAmount": 10
}
]
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Defines the parameters of a tax estimation request. This is sent to the Tax Service Adapter by Chargebee to estimate taxes for one or more line items.
Response
200
application/json
Tax estimated successfully for given line items.
The response sent by the Tax Service Adapter to Chargebee for a tax estimation request.
curl --request POST \
--url https://rest.taxes.provider.com/api/v1/tax-estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"seller": {
"address": {
"line1": "412 63rd South Avenue",
"city": "Baltimore",
"state": "MD",
"country": "US",
"postalCode": "21230"
}
},
"customer": {
"name": "John Doe",
"customerCode": "customer_test",
"address": {
"line1": "59, Starlight Avenue",
"city": "Newark",
"state": "NJ",
"country": "US",
"postalCode": "98712"
}
},
"estimateDateTime": "2022-11-01T05:12:08.131Z",
"currency": "USD",
"lineItems": [
{
"number": 1,
"itemCode": "cbWatch",
"description": "A winding watch.",
"quantity": 1,
"amount": 100,
"isTaxInclusive": false,
"taxIdentifiers": [
{
"id": "taxCode",
"value": "PT12312"
}
]
}
]
}'
{
"seller": {
"address": {
"line1": "412 63rd South Avenue",
"city": "Baltimore",
"state": "MD",
"country": "US",
"postalCode": "21230"
},
"hasNexus": true
},
"customer": {
"customerCode": "customer_test",
"address": {
"line1": "59, Starlight Avenue",
"city": "Newark",
"state": "NJ",
"country": "US",
"postalCode": "98712"
}
},
"estimateDateTime": "2022-11-01T05:12:08.131Z",
"currency": "USD",
"discountAmount": 0,
"subtotal": 100,
"exemptAmount": 0,
"taxableAmount": 100,
"taxAmount": 15,
"total": 115,
"lineItems": [
{
"number": 1,
"itemCode": "cbWatch",
"description": "A winding watch.",
"quantity": 1,
"amount": 100,
"isTaxInclusive": false,
"isTaxable": true,
"taxIdentifiers": [
{
"id": "taxCode",
"value": "PT12312"
}
],
"discountAmount": 0,
"subtotal": 100,
"exemptAmount": 0,
"taxableAmount": 100,
"taxAmount": 15,
"total": 115,
"taxes": [
{
"number": 1,
"jurisdiction": {
"code": "48",
"type": "STATE",
"name": "CALIFORNIA"
},
"name": "SALE",
"rate": 5,
"taxableAmount": 100,
"taxAmount": 5
},
{
"number": 2,
"jurisdiction": {
"code": "27000",
"type": "CITY",
"name": "SAN FRANCISCO"
},
"name": "SALE",
"rate": 10,
"taxableAmount": 100,
"taxAmount": 10
}
]
}
]
}
Assistant
Responses are generated using AI and may contain mistakes.