Module: AvaTax::Client::TaxRules
- Included in:
- AvaTax::Client
- Defined in:
- lib/avatax/client/taxrules.rb
Instance Method Summary collapse
-
#create_country_coefficients(model) ⇒ CountryCoefficientsResponseModel[]
Create new Country Coefficients.
-
#create_tax_rules(companyId, model) ⇒ TaxRuleModel[]
Create a new tax rule.
-
#delete_tax_rule(companyId, id) ⇒ ErrorDetail[]
Delete a single tax rule.
-
#get_tax_rule(companyId, id) ⇒ Object
Retrieve a single tax rule.
-
#list_country_coefficients(country, options = {}) ⇒ FetchResult
Retrieve country coefficients for specific country.
-
#list_tax_rules(companyId, options = {}) ⇒ FetchResult
Retrieve tax rules for this company.
-
#query_tax_rules(options = {}) ⇒ FetchResult
Retrieve all tax rules.
-
#update_tax_rule(companyId, id, model) ⇒ Object
Update a single tax rule.
Instance Method Details
#create_country_coefficients(model) ⇒ CountryCoefficientsResponseModel[]
Create new Country Coefficients. If already exist update them.
Create one or more Country Coefficients for particular country.
We would like to use country coefficients during Cross-Border calculations to slightly increase or decrease a calculation for a line based on the tax-subtype and Country of destination for a transaction.
This will allow AvaTax to minimize the variance caused between actual transaction taken place on ground Vs Tax Calculated by AvaTax.
Make sure to use the same API to update the country coefficients that is already present in the database. This will make existing entry for specific country as ineffective for that date. And new entry created will get applicable to the newer transactions. Swagger Name: AvaTaxClient
22 23 |
# File 'lib/avatax/client/taxrules.rb', line 22 def create_country_coefficients(model) path = "/api/v2/countryCoefficients" put(path, model, {}, AvaTax::VERSION) end |
#create_tax_rules(companyId, model) ⇒ TaxRuleModel[]
Create a new tax rule
Create one or more custom tax rules attached to this company.
A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
charged when selling an item. Tax rules can also change tax behavior depending on the entityUseCode
value submitted
with the transaction.
You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use custom tax rules to redefine the behavior for your company or item.
Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your auditor, legal representative, and accounting team.
Security Policies
- This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient
48 49 |
# File 'lib/avatax/client/taxrules.rb', line 48 def create_tax_rules(companyId, model) path = "/api/v2/companies/#{companyId}/taxrules" post(path, model, {}, AvaTax::VERSION) end |
#delete_tax_rule(companyId, id) ⇒ ErrorDetail[]
Delete a single tax rule
Mark the custom tax rule identified by this URL as deleted.
A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
charged when selling an item. Tax rules can also change tax behavior depending on the entityUseCode
value submitted
with the transaction.
You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use custom tax rules to redefine the behavior for your company or item.
Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your auditor, legal representative, and accounting team.
Security Policies
- This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient
74 75 |
# File 'lib/avatax/client/taxrules.rb', line 74 def delete_tax_rule(companyId, id) path = "/api/v2/companies/#{companyId}/taxrules/#{id}" delete(path, {}, AvaTax::VERSION) end |
#get_tax_rule(companyId, id) ⇒ Object
Retrieve a single tax rule
Get the taxrule object identified by this URL.
A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
charged when selling an item. Tax rules can also change tax behavior depending on the entityUseCode
value submitted
with the transaction.
You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use custom tax rules to redefine the behavior for your company or item.
Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your auditor, legal representative, and accounting team.
Security Policies
- This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient
100 101 |
# File 'lib/avatax/client/taxrules.rb', line 100 def get_tax_rule(companyId, id) path = "/api/v2/companies/#{companyId}/taxrules/#{id}" get(path, {}, AvaTax::VERSION) end |
#list_country_coefficients(country, options = {}) ⇒ FetchResult
Retrieve country coefficients for specific country
Retrieve all or any specific records of Country Coefficients based on the filters(optional) for specific country.
Search for specific objects using the criteria in the $filter
parameter; full documentation is available on Filtering in REST .
Paginate your results using the $top
, $skip
, and $orderby
parameters.
Swagger Name: AvaTaxClient
117 118 |
# File 'lib/avatax/client/taxrules.rb', line 117 def list_country_coefficients(country, ={}) path = "/api/v2/#{country}/CountryCoefficients" get(path, , AvaTax::VERSION) end |
#list_tax_rules(companyId, options = {}) ⇒ FetchResult
Retrieve tax rules for this company
List all taxrule objects attached to this company.
A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
charged when selling an item. Tax rules can also change tax behavior depending on the entityUseCode
value submitted
with the transaction.
You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use custom tax rules to redefine the behavior for your company or item.
Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your auditor, legal representative, and accounting team.
Search for specific objects using the criteria in the $filter
parameter; full documentation is available on Filtering in REST .
Paginate your results using the $top
, $skip
, and $orderby
parameters.
Security Policies
- This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient
150 151 |
# File 'lib/avatax/client/taxrules.rb', line 150 def list_tax_rules(companyId, ={}) path = "/api/v2/companies/#{companyId}/taxrules" get(path, , AvaTax::VERSION) end |
#query_tax_rules(options = {}) ⇒ FetchResult
Retrieve all tax rules
Get multiple taxrule objects across all companies.
A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
charged when selling an item. Tax rules can also change tax behavior depending on the entityUseCode
value submitted
with the transaction.
You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use custom tax rules to redefine the behavior for your company or item.
Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your auditor, legal representative, and accounting team.
Search for specific objects using the criteria in the $filter
parameter; full documentation is available on Filtering in REST .
Paginate your results using the $top
, $skip
, and $orderby
parameters.
Security Policies
- This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient
182 183 |
# File 'lib/avatax/client/taxrules.rb', line 182 def query_tax_rules(={}) path = "/api/v2/taxrules" get(path, , AvaTax::VERSION) end |
#update_tax_rule(companyId, id, model) ⇒ Object
Update a single tax rule
Replace the existing custom tax rule object at this URL with an updated object.
A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
charged when selling an item. Tax rules can also change tax behavior depending on the entityUseCode
value submitted
with the transaction.
You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use custom tax rules to redefine the behavior for your company or item.
Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your auditor, legal representative, and accounting team.
Security Policies
- This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient
209 210 |
# File 'lib/avatax/client/taxrules.rb', line 209 def update_tax_rule(companyId, id, model) path = "/api/v2/companies/#{companyId}/taxrules/#{id}" put(path, model, {}, AvaTax::VERSION) end |