Module: AvaTax::Client::Locations
- Included in:
- AvaTax::Client
- Defined in:
- lib/avatax/client/locations.rb
Instance Method Summary collapse
-
#create_location_parameters(companyId, locationId, model) ⇒ LocationParameterModel[]
Add parameters to a location.
-
#create_locations(companyId, model) ⇒ LocationModel[]
Create a new location.
-
#delete_location(companyId, id) ⇒ ErrorDetail[]
Delete a single location.
-
#delete_location_parameter(companyId, locationId, id) ⇒ ErrorDetail[]
Delete a single location parameter.
-
#get_location(companyId, id, options = {}) ⇒ Object
Retrieve a single location.
-
#get_location_parameter(companyId, locationId, id) ⇒ Object
Retrieve a single company location parameter.
-
#list_location_parameters(companyId, locationId, options = {}) ⇒ FetchResult
Retrieve parameters for a location.
-
#list_locations_by_company(companyId, options = {}) ⇒ FetchResult
Retrieve locations for this company.
-
#query_locations(options = {}) ⇒ FetchResult
Retrieve all locations.
-
#update_location(companyId, id, model) ⇒ Object
Update a single location.
-
#update_location_parameter(companyId, locationId, id, model) ⇒ Object
Update a location parameter.
-
#validate_location(companyId, id) ⇒ Object
Validate the location against local requirements.
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
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
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
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
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
101 102 |
# File 'lib/avatax/client/locations.rb', line 101 def get_location(companyId, id, ={}) path = "/api/v2/companies/#{companyId}/locations/#{id}" get(path, , 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
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
149 150 |
# File 'lib/avatax/client/locations.rb', line 149 def list_location_parameters(companyId, locationId, ={}) path = "/api/v2/companies/#{companyId}/locations/#{locationId}/parameters" get(path, , 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
178 179 |
# File 'lib/avatax/client/locations.rb', line 178 def list_locations_by_company(companyId, ={}) path = "/api/v2/companies/#{companyId}/locations" get(path, , 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
207 208 |
# File 'lib/avatax/client/locations.rb', line 207 def query_locations(={}) path = "/api/v2/locations" get(path, , 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
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
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
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 |