Module: AvaTax::Client::TaxRules

Included in:
AvaTax::Client
Defined in:
lib/avatax/client/taxrules.rb

Instance Method Summary collapse

Instance Method Details

#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

Parameters:

  • companyId (Integer)

    The ID of the company that owns this tax rule.

  • model (TaxRuleModel[])

    The tax rule you wish to create.

Returns:

  • (TaxRuleModel[])


29
30
# File 'lib/avatax/client/taxrules.rb', line 29

def create_tax_rules(companyId, model)        path = "/api/v2/companies/#{companyId}/taxrules"
post(path, model, {}, "22.7.0")      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

Parameters:

  • companyId (Integer)

    The ID of the company that owns this tax rule.

  • id (Integer)

    The ID of the tax rule you wish to delete.

Returns:

  • (ErrorDetail[])


55
56
# File 'lib/avatax/client/taxrules.rb', line 55

def delete_tax_rule(companyId, id)        path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
delete(path, {}, "22.7.0")      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

Parameters:

  • companyId (Integer)

    The ID of the company that owns this tax rule

  • id (Integer)

    The primary key of this tax rule

Returns:

  • (Object)


81
82
# File 'lib/avatax/client/taxrules.rb', line 81

def get_tax_rule(companyId, id)        path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
get(path, {}, "22.7.0")      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

Parameters:

  • companyId (Integer)

    The ID of the company that owns these tax rules

  • filter (String)

    A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST.
    Not filterable: taxCode, taxTypeCode, taxRuleProductDetail, rateTypeCode, taxTypeGroup, taxSubType, unitOfBasis

  • include (String)

    A comma separated list of additional data to retrieve.

  • top (Integer)

    If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.

  • skip (Integer)

    If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.

  • orderBy (String)

    A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC.

Returns:

  • (FetchResult)


114
115
# File 'lib/avatax/client/taxrules.rb', line 114

def list_tax_rules(companyId, options={})        path = "/api/v2/companies/#{companyId}/taxrules"
get(path, options, "22.7.0")      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

Parameters:

  • filter (String)

    A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST.
    Not filterable: taxCode, taxTypeCode, taxRuleProductDetail, rateTypeCode, taxTypeGroup, taxSubType, unitOfBasis

  • include (String)

    A comma separated list of additional data to retrieve.

  • top (Integer)

    If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.

  • skip (Integer)

    If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.

  • orderBy (String)

    A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC.

Returns:

  • (FetchResult)


146
147
# File 'lib/avatax/client/taxrules.rb', line 146

def query_tax_rules(options={})        path = "/api/v2/taxrules"
get(path, options, "22.7.0")      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

Parameters:

  • companyId (Integer)

    The ID of the company that this tax rule belongs to.

  • id (Integer)

    The ID of the tax rule you wish to update

  • model (Object)

    The tax rule you wish to update.

Returns:

  • (Object)


173
174
# File 'lib/avatax/client/taxrules.rb', line 173

def update_tax_rule(companyId, id, model)        path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
put(path, model, {}, "22.7.0")      end