You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the customer doesn't provide the full address then the Avalara API returns the error message.
Tax.Avalara error. InvalidAddress - The address value was incomplete.
Details: The address value ShipTo was incomplete. You must provide either a valid postal code, line1 + city + region, or line1 + postal code.
Could you add this checking in the method?
I added checking "line1 + postal code + city".
The Postal code is mandatory, when I provided the city without line 1 then I got error message.
public async Task<TaxRateResult> GetTaxRateAsync(TaxRateRequest taxRateRequest)
{
if (taxRateRequest.Address == null)
return new TaxRateResult { Errors = new List<string> { "Address is not set" } };
//You must provide either a valid postal code, line1 + city + region, or line1 + postal code.
if (string.IsNullOrWhiteSpace(taxRateRequest.Address.ZipPostalCode)
|| string.IsNullOrWhiteSpace(taxRateRequest.Address.City)
|| string.IsNullOrWhiteSpace(taxRateRequest.Address.Address1)
)
return new TaxRateResult { Errors = new List<string> { "Address is not set" } };
//get tax rate
var taxRate = await _avalaraTaxManager.GetTaxRateAsync(taxRateRequest);
if (!taxRate.HasValue)
return new TaxRateResult { Errors = new List<string> { "No response from the service" } };
return new TaxRateResult { TaxRate = taxRate.Value };
}
Source: https://www.nopcommerce.com/boards/topic/101847/avalara-tax-provider
The text was updated successfully, but these errors were encountered: