Module: AvaTax::Client::TaxCodes

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

Instance Method Summary collapse

Instance Method Details

#create_tax_codes(companyId, model) ⇒ TaxCodeModel[]

Create a new tax code

Create one or more new taxcode objects attached to this company. A 'TaxCode' represents a uniquely identified type of product, good, or service. Avalara supports correct tax rates and taxability rules for all TaxCodes in all supported jurisdictions. If you identify your products by tax code in your 'Create Transacion' API calls, Avalara will correctly calculate tax rates and taxability rules for this product in all supported jurisdictions.

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 code.

  • model (TaxCodeModel[])

    The tax code you wish to create.

Returns:

  • (TaxCodeModel[])


21
22
# File 'lib/avatax/client/taxcodes.rb', line 21

def create_tax_codes(companyId, model)        path = "/api/v2/companies/#{companyId}/taxcodes"
post(path, model, {}, AvaTax::VERSION)      end

#delete_tax_code(companyId, id) ⇒ ErrorDetail[]

Delete a single tax code

Marks the existing TaxCode object at this URL as deleted.

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 code.

  • id (Integer)

    The ID of the tax code you wish to delete.

Returns:

  • (ErrorDetail[])


35
36
# File 'lib/avatax/client/taxcodes.rb', line 35

def delete_tax_code(companyId, id)        path = "/api/v2/companies/#{companyId}/taxcodes/#{id}"
delete(path, {}, AvaTax::VERSION)      end

#get_tax_code(companyId, id) ⇒ Object

Retrieve a single tax code

Get the taxcode object identified by this URL. A 'TaxCode' represents a uniquely identified type of product, good, or service. Avalara supports correct tax rates and taxability rules for all TaxCodes in all supported jurisdictions. If you identify your products by tax code in your 'Create Transacion' API calls, Avalara will correctly calculate tax rates and taxability rules for this product in all supported jurisdictions.

Security Policies

  • This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The ID of the company that owns this tax code

  • id (Integer)

    The primary key of this tax code

Returns:

  • (Object)


53
54
# File 'lib/avatax/client/taxcodes.rb', line 53

def get_tax_code(companyId, id)        path = "/api/v2/companies/#{companyId}/taxcodes/#{id}"
get(path, {}, AvaTax::VERSION)      end

#list_tax_codes_by_company(companyId, options = {}) ⇒ FetchResult

Retrieve tax codes for this company

List all taxcode objects attached to this company. A 'TaxCode' represents a uniquely identified type of product, good, or service. Avalara supports correct tax rates and taxability rules for all TaxCodes in all supported jurisdictions. If you identify your products by tax code in your 'Create Transacion' API calls, Avalara will correctly calculate tax rates and taxability rules for this product in all supported jurisdictions.

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, ECMAccountUser, ECMCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The ID of the company that owns these tax codes

  • filter (String)

    A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST.

  • 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)


78
79
# File 'lib/avatax/client/taxcodes.rb', line 78

def list_tax_codes_by_company(companyId, options={})        path = "/api/v2/companies/#{companyId}/taxcodes"
get(path, options, AvaTax::VERSION)      end

#query_tax_codes(options = {}) ⇒ FetchResult

Retrieve all tax codes

Get multiple taxcode objects across all companies. A 'TaxCode' represents a uniquely identified type of product, good, or service. Avalara supports correct tax rates and taxability rules for all TaxCodes in all supported jurisdictions. If you identify your products by tax code in your 'Create Transacion' API calls, Avalara will correctly calculate tax rates and taxability rules for this product in all supported jurisdictions.

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, ECMAccountUser, ECMCompanyUser, 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.

  • 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)


102
103
# File 'lib/avatax/client/taxcodes.rb', line 102

def query_tax_codes(options={})        path = "/api/v2/taxcodes"
get(path, options, AvaTax::VERSION)      end

#update_tax_code(companyId, id, model) ⇒ Object

Update a single tax code

Replace the existing taxcode object at this URL with an updated object. A 'TaxCode' represents a uniquely identified type of product, good, or service. Avalara supports correct tax rates and taxability rules for all TaxCodes in all supported jurisdictions. If you identify your products by tax code in your 'Create Transacion' API calls, Avalara will correctly calculate tax rates and taxability rules for this product in all supported jurisdictions. All data from the existing object will be replaced with data in the object you PUT. To set a field's value to null, you may either set its value to null or omit that field from the object you post.

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 code belongs to.

  • id (Integer)

    The ID of the tax code you wish to update

  • model (Object)

    The tax code you wish to update.

Returns:

  • (Object)


123
124
# File 'lib/avatax/client/taxcodes.rb', line 123

def update_tax_code(companyId, id, model)        path = "/api/v2/companies/#{companyId}/taxcodes/#{id}"
put(path, model, {}, AvaTax::VERSION)      end