Avalara plugin making too many GetTax API Calls

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Hello-

I have two sites... one that runs on nopCommerce 4.30, and the other runs on ASPDOTNET Storefront.
We went LIVE with the Avalara plugin last month on both sites and it has been working perfectly.
The nopCommerce site and ASPDOTNET Storefront both do about 60-100 orders per day.

Avalara monthly rates are based on the number of GetTax API calls made that month.
I got my first month's usage report from Avalara today and am freaking all the way out...it was just two weeks of usage.
The ASPDOTNET Storefront site had 458 "GetTax API calls"
The nopCommerce site had 809,303 "GetTax API calls" !!!!!!!!!
I see nothing in the log to indicate there's a problem.

HELP!!!
3 years ago
Hi.
We'll check this, here is a work item.
3 years ago
RomanovM wrote:
Hi.
We'll check this, here is a work item.

Thank you.
3 years ago
Maybe it's a caching problem.  The code uses the 'short term cache'.  Try changing the value of the setting
  cachingsettings.shorttermcachetime
Its defaults is 5 (seconds)
3 years ago
embryo,
In the current version of the plugin tax rates are requested for each customer and product, that gives the most accurate results, but as you noted above leads to a large number of API calls.

We have now added a setting to make this approach configurable and you can get tax rates by the address only. This may lead to not entirely accurate results (for example, when a customer is exempt to tax, or the product belongs to a tax category that has a specific rate), but it will significantly reduce the number of API calls. Note, this applies only to tax rates on the catalog, on the checkout full information is always used in requests.
You can upgrade to the upcoming release 4.40 and use the latest version of the plugin or apply the changes from this commit by yourself.

In next versions we plan to revise the checkout process, that should also lead to a decrease in the number of tax provider requests.
3 years ago
Ok, thanks.

Still....800,000+ in 2 weeks...
Every unique visitor we had in those two weeks would have needed to view many hundreds(maybe thousands) of pages each in order for us to have that many API calls....
We just don't have that much traffic...

Is it possible that the plugin is making API calls when bots view pages?
Our PCI scan was during those weeks (twice), and we always have many "[email protected]" visits...


And, please clarify for me...does the API call happen on catalog pages for each product returned in results if configured to allow products to be purchased on the catalog pages?
3 years ago
@RomanovM

RE: "... leads to a large number of API calls."
Why should it have, if you're caching?


Is it a typo that the cacheKey param still includes "Nop.avalara.taxrate.{0} "

    public static CacheKey TaxRateCacheKey => new CacheKey("Nop.avalara.taxrate.{0}-{1}-{2}-{3}-{4}-{5}-{6}", TaxRateCacheKeyByCustomerPrefix);

considering that the TaxRateCacheKeyByCustomerPrefix has that value?

Also, this comment seems confusing to me.  "remove..."?
        /// <param name="prefixes">Prefixes to remove by prefix functionality</param>
        protected void Init(string cacheKey, int? cacheTime = null, params string[] prefixes)
3 years ago
I just want to say that we had the same issue 2 -3 years ago when trying to make Avalara work with my store - the bill would have been enormous - luckily for me Avalara forgave me as they were the ones working on the plugin... ("goldencom" I think was the developer)

Maybe they will forgive you too......  I am now using TaxJar instead.

Kenny
3 years ago
I implemented the nop team fix in the plugin for nop 4.30.
3 years ago
embryo wrote:


And, please clarify for me...does the API call happen on catalog pages for each product returned in results if configured to allow products to be purchased on the catalog pages?


Maybe I wasn't clear....
In the catalog settings, it is possible to configure catalog pages to allow buying products from them without going to product detail page. I have my store set to allow purchase from catalog pages.

My question is....if I have 100 products in a category, and that category page is loaded in a browser by a customer...will there be 100 separate API calls each time that this page loads?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.