Module: AvaTax::Client::Items

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

Instance Method Summary collapse

Instance Method Details

#batch_delete_item_classifications(companyId, itemId) ⇒ ErrorDetail[]

Delete all classifications for an item

Delete all the classifications for a given item.

A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.

When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.

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

  • itemId (Integer)

    The ID of the item you wish to delete the classifications.

Returns:

  • (ErrorDetail[])


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

def batch_delete_item_classifications(companyId, itemId)        path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications"
delete(path, {}, AvaTax::VERSION)      end

#batch_delete_item_parameters(companyId, itemId) ⇒ ErrorDetail[]

Delete all parameters for an item

Delete all the parameters for a given item.

Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".

A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .

A parameter specified on a transaction line will override an item parameter if they share the same parameter name.

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

  • itemId (Integer)

    The ID of the item you wish to delete the parameters.

Returns:

  • (ErrorDetail[])


41
42
# File 'lib/avatax/client/items.rb', line 41

def batch_delete_item_parameters(companyId, itemId)        path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters"
delete(path, {}, AvaTax::VERSION)      end

#bulk_upload_items(companyId, model) ⇒ Object

Bulk upload items from a product catalog

Create/Update one or more item objects attached to this company.

Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you can provide itemCode values for each CreateTransaction() API call rather than specifying tax codes, parameters, descriptions, and other data fields. AvaTax will automatically look up each itemCode and apply the correct tax codes and parameters from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance team can manage your item catalog and adjust the tax behavior of items without having to modify your software.

The tax code takes precedence over the tax code id if both are provided.

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

  • model (Object)

    The items you wish to upload.

Returns:

  • (Object)


63
64
# File 'lib/avatax/client/items.rb', line 63

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

#create_item_classifications(companyId, itemId, model) ⇒ ItemClassificationOutputModel[]

Add classifications to an item.

Add classifications to an item.

A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.

When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.

An item may only have one classification per tax system.

Security Policies

  • This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The company id.

  • itemId (Integer)

    The item id.

  • model (ItemClassificationInputModel[])

    The item classifications you wish to create.

Returns:

  • (ItemClassificationOutputModel[])


84
85
# File 'lib/avatax/client/items.rb', line 84

def create_item_classifications(companyId, itemId, model)        path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications"
post(path, model, {}, AvaTax::VERSION)      end

#create_item_parameters(companyId, itemId, model) ⇒ ItemParameterModel[]

Add parameters to an item.

Add parameters to an item.

Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".

A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .

A parameter specified on a transaction line will override an item parameter if they share the same parameter name.

To see available parameters for this item, call /api/v2/definitions/parameters?$filter=attributeType eq Product

Some parameters are only available for use if you have subscribed to specific AvaTax services. To see which parameters you are able to use, add the query parameter "$showSubscribed=true" to the parameter definition call above.

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 item parameter.

  • itemId (Integer)

    The item id.

  • model (ItemParameterModel[])

    The item parameters you wish to create.

Returns:

  • (ItemParameterModel[])


109
110
# File 'lib/avatax/client/items.rb', line 109

def create_item_parameters(companyId, itemId, model)        path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters"
post(path, model, {}, AvaTax::VERSION)      end

#create_item_tags(companyId, itemId, model) ⇒ ItemTagDetailOutputModel[]

Create tags for a item

Creates one or more new Tag objects attached to this Item.

Item tags puts multiple labels for an item. So that item can be easily grouped by these tags.

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 defined these items

  • itemId (Integer)

    The ID of the item as defined by the company that owns this tag.

  • model (ItemTagDetailInputModel[])

    Tags you wish to associate with the Item

Returns:

  • (ItemTagDetailOutputModel[])


148
149
# File 'lib/avatax/client/items.rb', line 148

def create_item_tags(companyId, itemId, model)        path = "/api/v2/companies/#{companyId}/items/#{itemId}/tags"
post(path, model, {}, AvaTax::VERSION)      end

#create_items(companyId, model) ⇒ ItemModel[]

Create a new item

Creates one or more new item objects attached to this company.

Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you can provide itemCode values for each CreateTransaction() API call rather than specifying tax codes, parameters, descriptions, and other data fields. AvaTax will automatically look up each itemCode and apply the correct tax codes and parameters from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance team can manage your item catalog and adjust the tax behavior of items without having to modify your software.

The tax code takes precedence over the tax code id if both are provided.

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

  • model (ItemModel[])

    The item you wish to create.

Returns:

  • (ItemModel[])


131
132
# File 'lib/avatax/client/items.rb', line 131

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

#create_tax_code_classification_request(companyId, model) ⇒ Object

Create a new tax code classification request

Creates a new tax code classification request.

Avalara AvaTax system tax codes represent various goods and services classified by industry or consumer categories and major physical similarities. Taxability rules are associated with tax codes. Customers can map their Items to tax codes allowing them to take advantage of thousands of tax rules in the AvaTax engine resulting in accurate taxability determinations.

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 creates this request.

  • model (Object)

    The request you wish to create.

Returns:

  • (Object)


166
167
# File 'lib/avatax/client/items.rb', line 166

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

#delete_catalogue_item(companyId, itemCode) ⇒ ErrorDetail[]

Delete a single item

Deletes the item object at this URL.

Items are a way of separating your tax calculation process from your tax configuration details. Use this endpoint to delete an existing item with item code.

Deleting an item will also delete the parameters, classifications, and product categories associated with that item.

NOTE: If your item code contains any of these characters /, +, ? or a space, please use the following encoding before making a request:

  • Replace '/' with '_-ava2f-_' For example: 'Item/Code' becomes 'Item_-ava2f-_Code'
  • Replace '+' with '_-ava2b-_' For example: 'Item+Code' becomes 'Item_-ava2b-_Code'
  • Replace '?' with '_-ava3f-_' For example: 'Item?Code' becomes 'Item_-ava3f-_Code'
  • Replace '%' with '_-ava25-_' For example: 'Item%Code' becomes 'Item_-ava25-_Code'
  • Replace '#' with '_-ava23-_' For example: 'Item#Code' becomes 'Item_-ava23-_Code'
  • Replace ''' with '_-ava27-_' For example: 'Item'Code' becomes 'Item_-ava27-_Code'
  • Replace '"' with '_-ava22-_' For example: 'Item"Code' becomes 'Item_-ava22-_Code'

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

  • itemCode (String)

    The code of the item you want to delete.

Returns:

  • (ErrorDetail[])


194
195
# File 'lib/avatax/client/items.rb', line 194

def delete_catalogue_item(companyId, itemCode)        path = "/api/v2/companies/#{companyId}/itemcatalogue/#{itemCode}"
delete(path, {}, AvaTax::VERSION)      end

#delete_item(companyId, id) ⇒ ErrorDetail[]

Delete a single item

Deletes the item object at this URL.

Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you can provide itemCode values for each CreateTransaction() API call rather than specifying tax codes, parameters, descriptions, and other data fields. AvaTax will automatically look up each itemCode and apply the correct tax codes and parameters from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance team can manage your item catalog and adjust the tax behavior of items without having to modify your software.

Deleting an item will also delete the parameters and classifications associated with that item.

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

  • id (Integer)

    The ID of the item you wish to delete.

Returns:

  • (ErrorDetail[])


216
217
# File 'lib/avatax/client/items.rb', line 216

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

#delete_item_classification(companyId, itemId, id) ⇒ ErrorDetail[]

Delete a single item classification.

Delete a single item classification.

A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.

When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.

Security Policies

  • This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The company id.

  • itemId (Integer)

    The item id.

  • id (Integer)

    The item classification id.

Returns:

  • (ErrorDetail[])


235
236
# File 'lib/avatax/client/items.rb', line 235

def delete_item_classification(companyId, itemId, id)        path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications/#{id}"
delete(path, {}, AvaTax::VERSION)      end

#delete_item_parameter(companyId, itemId, id) ⇒ ErrorDetail[]

Delete a single item parameter

Delete a single item parameter.

Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".

A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .

A parameter specified on a transaction line will override an item parameter if they share the same parameter name.

Security Policies

  • This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The company id

  • itemId (Integer)

    The item id

  • id (Integer)

    The parameter id

Returns:

  • (ErrorDetail[])


256
257
# File 'lib/avatax/client/items.rb', line 256

def delete_item_parameter(companyId, itemId, id)        path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters/#{id}"
delete(path, {}, AvaTax::VERSION)      end

#delete_item_tag(companyId, itemId, itemTagDetailId) ⇒ ErrorDetail[]

Delete item tag by id

Deletes the Tag object of an Item at this URL.

Item tags puts multiple labels for an item. So that item can be easily grouped by these tags.

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 defined these items

  • itemId (Integer)

    The ID of the item as defined by the company that owns this tag.

  • itemTagDetailId (Integer)

    The ID of the item tag detail you wish to delete.

Returns:

  • (ErrorDetail[])


273
274
# File 'lib/avatax/client/items.rb', line 273

def delete_item_tag(companyId, itemId, itemTagDetailId)        path = "/api/v2/companies/#{companyId}/items/#{itemId}/tags/#{itemTagDetailId}"
delete(path, {}, AvaTax::VERSION)      end

#delete_item_tags(companyId, itemId) ⇒ ErrorDetail[]

Delete all item tags

Deletes all Tags objects of an Item at this URL.

Item tags puts multiple labels for an item. So that item can be easily grouped by these tags.

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 defined these items.

  • itemId (Integer)

    The ID of the item as defined by the company that owns this tag.

Returns:

  • (ErrorDetail[])


289
290
# File 'lib/avatax/client/items.rb', line 289

def delete_item_tags(companyId, itemId)        path = "/api/v2/companies/#{companyId}/items/#{itemId}/tags"
delete(path, {}, AvaTax::VERSION)      end

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

Get status of classification requests of a company

Get status of tax code classification requests of a company.

Avalara AvaTax system tax codes represent various goods and services classified by industry or consumer categories and major physical similarities. Taxability rules are associated with tax codes. Customers can map their Items to tax codes allowing them to take advantage of thousands of tax rules in the AvaTax engine resulting in accurate taxability determinations.

Enable includeClassificationDetails flag to get details of classification request status.

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 defined these items

  • includeClassificationDetails (Boolean)

    A boolean field to get detailed classification status.

  • filter (String)

    A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST.
    Not filterable: classificationDetails, totalItems

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


313
314
# File 'lib/avatax/client/items.rb', line 313

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

#get_item(companyId, id, options = {}) ⇒ Object

Retrieve a single item

Get the Item object identified by this URL.

Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you can provide itemCode values for each CreateTransaction() API call rather than specifying tax codes, parameters, descriptions, and other data fields. AvaTax will automatically look up each itemCode and apply the correct tax codes and parameters from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance team can manage your item catalog and adjust the tax behavior of items without having to modify your software.

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 item object

  • id (Integer)

    The primary key of this item

  • include (String)

    A comma separated list of additional data to retrieve.

Returns:

  • (Object)


334
335
# File 'lib/avatax/client/items.rb', line 334

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

#get_item_classification(companyId, itemId, id) ⇒ Object

Retrieve a single item classification.

Retrieve a single item classification.

A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.

When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.

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 company id.

  • itemId (Integer)

    The item id.

  • id (Integer)

    The item classification id.

Returns:

  • (Object)


353
354
# File 'lib/avatax/client/items.rb', line 353

def get_item_classification(companyId, itemId, id)        path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications/#{id}"
get(path, {}, AvaTax::VERSION)      end

#get_item_parameter(companyId, itemId, id) ⇒ Object

Retrieve a single item parameter

Retrieve a single item parameter.

Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".

A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .

A parameter specified on a transaction line will override an item parameter if they share the same parameter name.

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 company id

  • itemId (Integer)

    The item id

  • id (Integer)

    The parameter id

Returns:

  • (Object)


374
375
# File 'lib/avatax/client/items.rb', line 374

def get_item_parameter(companyId, itemId, id)        path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters/#{id}"
get(path, {}, AvaTax::VERSION)      end

#get_item_tags(companyId, itemId, options = {}) ⇒ FetchResult

Retrieve tags for an item

Get the Tag objects of an Item identified by this URL.

Item tags puts multiple labels for an item. So that item can be easily grouped by these tags.

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 defined these items

  • itemId (Integer)

    The ID of the item as defined by the company that owns this tag.

  • filter (String)

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

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

Returns:

  • (FetchResult)


393
394
# File 'lib/avatax/client/items.rb', line 393

def get_item_tags(companyId, itemId, options={})        path = "/api/v2/companies/#{companyId}/items/#{itemId}/tags"
get(path, options, AvaTax::VERSION)      end

#get_premium_classification(companyId, itemCode, systemCode) ⇒ Object

Retrieve premium classification for a company's item based on its ItemCode and SystemCode.

Retrieves the premium classification for an ItemCode and SystemCode.

NOTE: If your item code contains any of these characters /, +, ?,",' ,% or #, please use the following encoding before making a request:

  • Replace '/' with '_-ava2f-_' For example: 'Item/Code' becomes 'Item_-ava2f-_Code'
  • Replace '+' with '_-ava2b-_' For example: 'Item+Code' becomes 'Item_-ava2b-_Code'
  • Replace '?' with '_-ava3f-_' For example: 'Item?Code' becomes 'Item_-ava3f-_Code'
  • Replace '%' with '_-ava25-_' For example: 'Item%Code' becomes 'Item_-ava25-_Code'
  • Replace '#' with '_-ava23-_' For example: 'Item#Code' becomes 'Item_-ava23-_Code'
  • Replace ''' with '_-ava27-_' For example: 'Item'Code' becomes 'Item_-ava27-_Code'
  • Replace '"' with '_-ava22-_' For example: 'Item"Code' becomes 'Item_-ava22-_Code'

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 item object

  • itemCode (String)

    The ItemCode of the item for which you want to retrieve premium classification

  • systemCode (String)

    The SystemCode for which you want to retrieve premium classification

Returns:

  • (Object)


417
418
# File 'lib/avatax/client/items.rb', line 417

def get_premium_classification(companyId, itemCode, systemCode)        path = "/api/v2/companies/#{companyId}/items/#{itemCode}/premiumClassification/#{systemCode}"
get(path, {}, AvaTax::VERSION)      end

#get_tax_code_recommendations(companyId, requestId, options = {}) ⇒ FetchResult

Get tax code recommendations

Get tax code recommendations.

Avalara AvaTax system tax codes represent various goods and services classified by industry or consumer categories and major physical similarities. Taxability rules are associated with tax codes. Customers can map their Items to tax codes allowing them to take advantage of thousands of tax rules in the AvaTax engine resulting in accurate taxability determinations.

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 defined these items

  • requestId (Integer)

    The ID of the classification request

  • filter (String)

    A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST.
    Not filterable: recommendations, url

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


439
440
# File 'lib/avatax/client/items.rb', line 439

def get_tax_code_recommendations(companyId, requestId, options={})        path = "/api/v2/companies/#{companyId}/classificationrequests/taxcode/#{requestId}/recommendations"
get(path, options, AvaTax::VERSION)      end

#list_import_restrictions(companyId, itemCode, countryOfImport, options = {}) ⇒ FetchResult

Retrieve Restrictions for Item by CountryOfImport

Retrieve Restrictions for Item by CountryOfImport. This API will only return import restriction for the countryOfImport.

NOTE: If your item code contains any of these characters /, +, ? or a space, please use the following encoding before making a request:

  • Replace '/' with '_-ava2f-_' For example: 'Item/Code' becomes 'Item_-ava2f-_Code'
  • Replace '+' with '_-ava2b-_' For example: 'Item+Code' becomes 'Item_-ava2b-_Code'
  • Replace '?' with '_-ava3f-_' For example: 'Item?Code' becomes 'Item_-ava3f-_Code'
  • Replace '%' with '_-ava25-_' For example: 'Item%Code' becomes 'Item_-ava25-_Code'
  • Replace '#' with '_-ava23-_' For example: 'Item#Code' becomes 'Item_-ava23-_Code'
  • Replace ''' with '_-ava27-_' For example: 'Item'Code' becomes 'Item_-ava27-_Code'
  • Replace '"' with '_-ava22-_' For example: 'Item"Code' becomes 'Item_-ava22-_Code'

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 item object

  • itemCode (String)

    ItemCode for the item

  • countryOfImport (String)

    Country for which you want the restrictions for the Item.

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


466
467
# File 'lib/avatax/client/items.rb', line 466

def list_import_restrictions(companyId, itemCode, countryOfImport, options={})        path = "/api/v2/companies/#{companyId}/items/#{itemCode}/restrictions/import/#{countryOfImport}"
get(path, options, AvaTax::VERSION)      end

#list_item_classifications(companyId, itemId, options = {}) ⇒ FetchResult

Retrieve classifications for an item.

List classifications for an item.

A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.

When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.

Search for specific objects using the criteria in the $filter classification; full documentation is available on Filtering in REST . Paginate your results using the $top, $skip, and $orderby classifications.

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 company id.

  • itemId (Integer)

    The item id.

  • filter (String)

    A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST.
    Not filterable: productCode, systemCode, IsPremium

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


491
492
# File 'lib/avatax/client/items.rb', line 491

def list_item_classifications(companyId, itemId, options={})        path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications"
get(path, options, AvaTax::VERSION)      end

#list_item_parameters(companyId, itemId, options = {}) ⇒ FetchResult

Retrieve parameters for an item

List parameters for an item.

Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".

A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .

A parameter specified on a transaction line will override an item parameter if they share the same parameter name.

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 company id

  • itemId (Integer)

    The item id

  • filter (String)

    A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST.
    Not filterable: name, unit, isNeededForCalculation, isNeededForReturns, isNeededForClassification

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


518
519
# File 'lib/avatax/client/items.rb', line 518

def list_item_parameters(companyId, itemId, options={})        path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters"
get(path, options, AvaTax::VERSION)      end

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

Retrieve items for this company

List all items defined for the current company.

Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you can provide itemCode values for each CreateTransaction() API call rather than specifying tax codes, parameters, descriptions, and other data fields. AvaTax will automatically look up each itemCode and apply the correct tax codes and parameters from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance team can manage your item catalog and adjust the tax behavior of items without having to modify your software.

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.

You may specify Tag Name in the tagName query parameter if you want to filter items on the basis of tagName

You may specify one or more of the following values in the $include parameter to fetch additional nested data, using commas to separate multiple values:

  • Parameters
  • Classifications
  • Tags
  • Properties

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 defined these items

  • filter (String)

    A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST.
    Not filterable: taxCode, source, sourceEntityId, upc, classifications, parameters, tags, properties

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

  • tagName (String)

    Tag Name on the basis of which you want to filter Items

Returns:

  • (FetchResult)


556
557
# File 'lib/avatax/client/items.rb', line 556

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

#query_items(options = {}) ⇒ FetchResult

Retrieve all items

Get multiple item objects across all companies.

Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you can provide itemCode values for each CreateTransaction() API call rather than specifying tax codes, parameters, descriptions, and other data fields. AvaTax will automatically look up each itemCode and apply the correct tax codes and parameters from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance team can manage your item catalog and adjust the tax behavior of items without having to modify your software.

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, source, sourceEntityId, upc, classifications, parameters, tags, properties

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


583
584
# File 'lib/avatax/client/items.rb', line 583

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

#query_items_by_tag(companyId, tag, options = {}) ⇒ FetchResult

Retrieve all items associated with given tag

Get multiple item objects associated with given tag.

Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you can provide itemCode values for each CreateTransaction() API call rather than specifying tax codes, parameters, descriptions, and other data fields. AvaTax will automatically look up each itemCode and apply the correct tax codes and parameters from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance team can manage your item catalog and adjust the tax behavior of items without having to modify your software.

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 defined these items.

  • tag (String)

    The master tag to be associated with item.

  • filter (String)

    A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST.
    Not filterable: taxCode, source, sourceEntityId, upc, classifications, parameters, tags, properties

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


612
613
# File 'lib/avatax/client/items.rb', line 612

def query_items_by_tag(companyId, tag, options={})        path = "/api/v2/companies/#{companyId}/items/bytags/#{tag}"
get(path, options, AvaTax::VERSION)      end

#sync_item_catalogue(companyId, model) ⇒ Object

Create or update items from a product catalog.

Creates/updates one or more item objects with additional properties and the AvaTax category attached to this company.

Items are a way of separating your tax calculation process from your tax configuration details. Use this endpoint to create a new or update an existing item. This can be used to sync the items with Avalara. For example, an accounting software system can use this to sync all their items from an ERP with Avalara.

Parameters and Classifications can be added with the Item.

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

  • model (ItemCatalogueInputModel[])

    The items you want to create or update.

Returns:

  • (Object)


632
633
# File 'lib/avatax/client/items.rb', line 632

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

#sync_items(companyId, model) ⇒ Object

Sync items from a product catalog

Syncs a list of items with AvaTax without waiting for them to be created. It is ideal for syncing large product catalogs with AvaTax.

Any invalid or duplicate items will be ignored. To diagnose why an item is not created, use the normal create transaction API to receive validation information.

This API is currently limited to 1000 items per call (the limit is subject to change).

Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you can provide itemCode values for each CreateTransaction() API call rather than specifying tax codes, parameters, descriptions, and other data fields. AvaTax will automatically look up each itemCode and apply the correct tax codes and parameters from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance team can manage your item catalog and adjust the tax behavior of items without having to modify your software.

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

  • model (Object)

    The request object.

Returns:

  • (Object)


657
658
# File 'lib/avatax/client/items.rb', line 657

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

#update_item(companyId, id, model) ⇒ Object

Update a single item

Replace the existing Item object at this URL with an updated object.

Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you can provide itemCode values for each CreateTransaction() API call rather than specifying tax codes, parameters, descriptions, and other data fields. AvaTax will automatically look up each itemCode and apply the correct tax codes and parameters from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance team can manage your item catalog and adjust the tax behavior of items without having to modify your software.

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.

The tax code takes precedence over the tax code id if both are provided.

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

  • id (Integer)

    The ID of the item you wish to update

  • model (Object)

    The item object you wish to update.

Returns:

  • (Object)


683
684
# File 'lib/avatax/client/items.rb', line 683

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

#update_item_classification(companyId, itemId, id, model) ⇒ Object

Update an item classification.

Update an item classification.

A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.

When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.

An item may only have one classification per tax system.

Security Policies

  • This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The company id.

  • itemId (Integer)

    The item id.

  • id (Integer)

    The item classification id.

  • model (Object)

    The item object you wish to update.

Returns:

  • (Object)


705
706
# File 'lib/avatax/client/items.rb', line 705

def update_item_classification(companyId, itemId, id, model)        path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications/#{id}"
put(path, model, {}, AvaTax::VERSION)      end

#update_item_parameter(companyId, itemId, id, model) ⇒ Object

Update an item parameter

Update an item parameter.

Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".

A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .

A parameter specified on a transaction line will override an item parameter if they share the same parameter name.

Security Policies

  • This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The company id.

  • itemId (Integer)

    The item id

  • id (Integer)

    The item parameter id

  • model (Object)

    The item object you wish to update.

Returns:

  • (Object)


727
728
# File 'lib/avatax/client/items.rb', line 727

def update_item_parameter(companyId, itemId, id, model)        path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters/#{id}"
put(path, model, {}, AvaTax::VERSION)      end