Module: AvaTax::Client::Locations

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

Instance Method Summary collapse

Instance Method Details

#create_location_parameters(companyId, locationId, model) ⇒ LocationParameterModel[]

Add parameters to a location.

Add parameters to a location.

Some locations can be taxed differently depending on the properties of that location. In AvaTax, these tax-affecting properties are called "parameters".

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

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

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

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, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The ID of the company that owns this location parameter.

  • locationId (Integer)

    The location id.

  • model (LocationParameterModel[])

    The location parameters you wish to create.

Returns:

  • (LocationParameterModel[])


28
29
# File 'lib/avatax/client/locations.rb', line 28

def create_location_parameters(companyId, locationId, model)        path = "/api/v2/companies/#{companyId}/locations/#{locationId}/parameters"
post(path, model, {}, AvaTax::VERSION)      end

#create_locations(companyId, model) ⇒ LocationModel[]

Create a new location

Create one or more new location objects attached to this company.

Security Policies

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

Parameters:

  • companyId (Integer)

    The ID of the company that owns this location.

  • model (LocationModel[])

    The location you wish to create.

Returns:

  • (LocationModel[])


42
43
# File 'lib/avatax/client/locations.rb', line 42

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

#delete_location(companyId, id) ⇒ ErrorDetail[]

Delete a single location

Mark the location object at this URL as deleted.

Security Policies

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

Parameters:

  • companyId (Integer)

    The ID of the company that owns this location.

  • id (Integer)

    The ID of the location you wish to delete.

Returns:

  • (ErrorDetail[])


56
57
# File 'lib/avatax/client/locations.rb', line 56

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

#delete_location_parameter(companyId, locationId, id) ⇒ ErrorDetail[]

Delete a single location parameter

Delete a single location parameter.

Some locations can be taxed differently depending on the properties of that location. In AvaTax, these tax-affecting properties are called "parameters".

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

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

Security Policies

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

Parameters:

  • companyId (Integer)

    The company id

  • locationId (Integer)

    The location id

  • id (Integer)

    The parameter id

Returns:

  • (ErrorDetail[])


77
78
# File 'lib/avatax/client/locations.rb', line 77

def delete_location_parameter(companyId, locationId, id)        path = "/api/v2/companies/#{companyId}/locations/#{locationId}/parameters/#{id}"
delete(path, {}, AvaTax::VERSION)      end

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

Retrieve a single location

Get the location object identified by this URL. An 'Location' represents a physical address where a company does business. Many taxing authorities require that you define a list of all locations where your company does business. These locations may require additional custom configuration or tax registration with these authorities. For more information on metadata requirements, see the '/api/v2/definitions/locationquestions' API.

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:

  • LocationSettings
  • parameters

Security Policies

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

Parameters:

  • companyId (Integer)

    The ID of the company that owns this location

  • id (Integer)

    The primary key of this location

  • include (String)

    A comma separated list of additional data to retrieve.

Returns:

  • (Object)


101
102
# File 'lib/avatax/client/locations.rb', line 101

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

#get_location_parameter(companyId, locationId, id) ⇒ Object

Retrieve a single company location parameter

Retrieve a single location parameter.

Some locations can be taxed differently depending on the properties of that location. In AvaTax, these tax-affecting properties are called "parameters".

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

A parameter specified on a transaction line will override a location 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, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The company id

  • locationId (Integer)

    The location id

  • id (Integer)

    The parameter id

Returns:

  • (Object)


122
123
# File 'lib/avatax/client/locations.rb', line 122

def get_location_parameter(companyId, locationId, id)        path = "/api/v2/companies/#{companyId}/locations/#{locationId}/parameters/#{id}"
get(path, {}, AvaTax::VERSION)      end

#list_location_parameters(companyId, locationId, options = {}) ⇒ FetchResult

Retrieve parameters for a location

List parameters for a location.

Some locations can be taxed differently depending on the properties of that location. In AvaTax, these tax-affecting properties are called "parameters".

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

A parameter specified on a transaction line will override a location 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, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The company id

  • locationId (Integer)

    The ID of the location

  • filter (String)

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

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


149
150
# File 'lib/avatax/client/locations.rb', line 149

def list_location_parameters(companyId, locationId, options={})        path = "/api/v2/companies/#{companyId}/locations/#{locationId}/parameters"
get(path, options, AvaTax::VERSION)      end

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

Retrieve locations for this company

List all location objects defined for this company. An 'Location' represents a physical address where a company does business. Many taxing authorities require that you define a list of all locations where your company does business. These locations may require additional custom configuration or tax registration with these authorities. For more information on metadata requirements, see the '/api/v2/definitions/locationquestions' API.

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 one or more of the following values in the $include parameter to fetch additional nested data, using commas to separate multiple values:

  • LocationSettings
  • parameters

Security Policies

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

Parameters:

  • companyId (Integer)

    The ID of the company that owns these locations

  • filter (String)

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

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


178
179
# File 'lib/avatax/client/locations.rb', line 178

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

#query_locations(options = {}) ⇒ FetchResult

Retrieve all locations

Get multiple location objects across all companies. An 'Location' represents a physical address where a company does business. Many taxing authorities require that you define a list of all locations where your company does business. These locations may require additional custom configuration or tax registration with these authorities. For more information on metadata requirements, see the '/api/v2/definitions/locationquestions' API.

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 one or more of the following values in the $include parameter to fetch additional nested data, using commas to separate multiple values:

  • LocationSettings
  • parameters

Security Policies

  • This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. 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: isMarketplaceOutsideUsa, settings, parameters

  • include (String)

    A comma separated list of additional data to retrieve. You may specify LocationSettings to retrieve location settings.

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


207
208
# File 'lib/avatax/client/locations.rb', line 207

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

#update_location(companyId, id, model) ⇒ Object

Update a single location

Replace the existing location object at this URL with an updated object. 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, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The ID of the company that this location belongs to.

  • id (Integer)

    The ID of the location you wish to update

  • model (Object)

    The location you wish to update.

Returns:

  • (Object)


224
225
# File 'lib/avatax/client/locations.rb', line 224

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

#update_location_parameter(companyId, locationId, id, model) ⇒ Object

Update a location parameter

Update a location parameter.

Some locations can be taxed differently depending on the properties of that location. In AvaTax, these tax-affecting properties are called "parameters".

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

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

Security Policies

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

Parameters:

  • companyId (Integer)

    The company id.

  • locationId (Integer)

    The location id

  • id (Integer)

    The location parameter id

  • model (Object)

    The location parameter object you wish to update.

Returns:

  • (Object)


246
247
# File 'lib/avatax/client/locations.rb', line 246

def update_location_parameter(companyId, locationId, id, model)        path = "/api/v2/companies/#{companyId}/locations/#{locationId}/parameters/#{id}"
put(path, model, {}, AvaTax::VERSION)      end

#validate_location(companyId, id) ⇒ Object

Validate the location against local requirements

Returns validation information for this location. This API call is intended to compare this location against the currently known taxing authority rules and regulations, and provide information about what additional work is required to completely setup this location.

Security Policies

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

Parameters:

  • companyId (Integer)

    The ID of the company that owns this location

  • id (Integer)

    The primary key of this location

Returns:

  • (Object)


262
263
# File 'lib/avatax/client/locations.rb', line 262

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