I am trying to use an external system to post in line items onto a Deal record with tax calculated by a 3rd party tax engine, in this case Avalara.
I don’t want to have to create a HubSpot Tax item for every different sales tax % as there are over 11,000 jurisdictions in the US alone. I would like to pass in a tax rate as a % or an amount on the line item.
In the line item properties response ({{base-url}}/crm/v3/properties/line_item/) there is a property for "
hs_auto_tax_amount" with the description "
“The amount of tax automatically calculated for this line item by an external system”.
However, it looks like this is a read only field and if I post a line item via API it always remains null.
Has anyone managed to find a way to use a custom/variable tax rate on line items? Or any workarounds?
Hey, @rncmarques Thanks for the great question. Have you looked at using `hs_tax_rate` along with `hs_tax_amount`? Looking at the response from the Properties API for Line Items, I noticed the calculation used for `hs_tax_amount` requires `hs_auto_tax_amount` OR `hs_tax_rate` along with `amount`. And we can set the value for `hs_tax_rate` using the API
Response from Properties API
name": "hs_tax_rate",
"label": "Resolved Tax Rate",
"type": "number",
"fieldType": "number",
"description": "Represents tax rate as percent out of 100. Supports up to 4 decimal places",
"name": "hs_tax_amount",
"label": "Tax Amount",
"type": "number",
"fieldType": "calculation_equation",
"description": "Amount of tax calculated based on tax rate for this line item",
"groupName": "price",
"options": [],
"displayOrder": -1,
"calculated": true,
"externalOptions": false,
"hasUniqueValue": false,
"hidden": false,
"hubspotDefined": true,
"showCurrencySymbol": true,
"modificationMetadata": {
"archivable": true,
"readOnlyDefinition": true,
"readOnlyValue": true
},
"formField": false,
"calculationFormula": "round_nearest(if is_present(hs_auto_tax_amount) then hs_auto_tax_amount\nelseif (is_present(amount) and is_present(hs_tax_rate)) then (hs_tax_rate * 0.01 * if is_present(amount) then amount else 0) endif, if is_present(currency_decimal_places(string(hs_line_item_currency_code))) then currency_decimal_places(string(hs_line_item_currency_code))\nelseif is_present(currency_decimal_places(fetch_single_currency_portal_currency)) then currency_decimal_places(fetch_single_currency_portal_currency) else 2)",
"dataSensitivity": "non_sensitive"
@Jaycee_Lewis I appreciate the time taken to respond, however, those fields are Read Only fields as specified in the properties response you’ve shown.
At this stage I believe HubSpot does not handle line item tax via an integrated third party tax engine (Avalara, TaxJar, an ERP) at all. The two practical workarounds I can see are:
1. Use the tax item at quote level to aggregate all tax, this is available via API and can be set to any value
2. Use custom propoerties on the line items and customise the quote template to display appropriately
I’m hopeful that tax handling will mature rapidly in the product to close the gap to other CRM’s on the market in the Quote to Cash process.
Hey there, just came across this thread. I had a similar issue when trying to figure out how to get tax calculation done in HubSpot. Our company just built an integration between Avalara and HubSpot and it will be available in the HubSpot marketplace soon!
It’s called ‘Sales Tax Powered by AvaTax’. It’s under review by HubSpot’s team currently and hopefully will be ready in a few days. I’ll ping this thread when it’s available! Hope that helps save you a bunch of time and effort.
Just wanted to let you know, if you are looking for automated sales tax calculation inside HubSpot, there’s a new app available, Sales Tax Powered by AvaTax, in the HubSpot Marketplace that will accomplish exactly this.
Hope that saves you a bunch of time vs trying to develop this on your own!
Thanks, from the screenshots it looks like it does exactly what I did: ignore the HubSpot native tax fields as they can’t be written to, nor can Tax Rates be created or edited via API, and create your own custom fields to return the result from Avalara.
Exactly. And we added in a few ways to control company/product exemptions as well as accounting for scenarios where more than 1 ship to address is being used.