Module: AvaTax::Client::Nexus

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

Instance Method Summary collapse

Instance Method Details

#create_nexus(companyId, model) ⇒ NexusModel[]

Create a new nexus

Creates one or more new nexus declarations attached to this company.

The concept of Nexus indicates a place where your company is legally obligated to collect and remit transactional taxes. The legal requirements for nexus may vary per country and per jurisdiction; please seek advice from your accountant or lawyer prior to declaring nexus.

To create a nexus declaration for your company, you must first call the Definitions API ListNexus to obtain a list of Avalara-defined nexus. Once you have determined which nexus you wish to declare, you should customize only the user-selectable fields in this object.

The user selectable fields for the nexus object are companyId, effectiveDate, endDate, localNexusTypeId, taxId, nexusTypeId, hasPermanentEstablishment, and isSellerImporterOfRecord.

When calling CreateNexus or UpdateNexus, all values in your nexus object except for the user-selectable fields must match an Avalara-defined system nexus object. You can retrieve a list of Avalara-defined system nexus objects by calling ListNexus. If any data does not match, AvaTax may not recognize your nexus declaration.

Please note that nexus changes may not take effect immediately and you should plan to update your nexus settings in advance of calculating tax for a location.

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

  • model (NexusModel[])

    The nexus you wish to create.

Returns:

  • (NexusModel[])


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

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

#create_nexus_parameters(companyId, nexusId, model) ⇒ NexusParameterDetailModel[]

Add parameters to a nexus.

Add parameters to the nexus. Some tax calculation and reporting are different depending on the properties of the nexus, such as isRemoteSeller. In AvaTax, these tax-affecting properties are called "parameters".

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

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

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

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

  • nexusId (Integer)

    The nexus id.

  • model (NexusParameterDetailModel[])

    The nexus parameters you wish to create.

Returns:

  • (NexusParameterDetailModel[])


59
60
# File 'lib/avatax/client/nexus.rb', line 59

def create_nexus_parameters(companyId, nexusId, model)        path = "/api/v2/companies/#{companyId}/nexus/#{nexusId}/parameters"
post(path, model, {}, AvaTax::VERSION)      end

#declare_nexus_by_address(companyId, model) ⇒ NexusByAddressModel[]

Creates nexus for a list of addresses.

This call is intended to simplify adding all applicable nexus to a company, for an address or addresses. Calling this API declares nexus for this company, for the list of addresses provided, for the date range provided. You may also use this API to extend effective date on an already-declared nexus.

The concept of Nexus indicates a place where your company is legally obligated to collect and remit transactional taxes. The legal requirements for nexus may vary per country and per jurisdiction; please seek advice from your accountant or lawyer prior to declaring nexus.

Note that not all fields within a nexus can be updated; Avalara publishes a list of all defined nexus at the '/api/v2/definitions/nexus' endpoint.

You may only define nexus matching the official list of declared nexus.

Please note that nexus changes may not take effect immediately and you should plan to update your nexus settings in advance of calculating tax for a location.

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 will own this nexus.

  • model (DeclareNexusByAddressModel[])

    The nexus you wish to create.

Returns:

  • (NexusByAddressModel[])


87
88
# File 'lib/avatax/client/nexus.rb', line 87

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

#delete_nexus(companyId, id, options = {}) ⇒ ErrorDetail[]

Delete a single nexus

Marks the existing nexus object at this URL as deleted.

The concept of Nexus indicates a place where your company is legally obligated to collect and remit transactional taxes. The legal requirements for nexus may vary per country and per jurisdiction; please seek advice from your accountant or lawyer prior to declaring nexus.

Please note that nexus changes may not take effect immediately and you should plan to update your nexus settings in advance of calculating tax for a location.

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

  • id (Integer)

    The ID of the nexus you wish to delete.

  • cascadeDelete (Boolean)

    If true, deletes all the child nexus if they exist along with parent nexus

Returns:

  • (ErrorDetail[])


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

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

#delete_nexus_parameter(companyId, nexusId, id) ⇒ ErrorDetail[]

Delete a single nexus parameter

Delete a single nexus parameter. Some tax calculation and reporting are different depending on the properties of the nexus, such as isRemoteSeller. In AvaTax, these tax-affecting properties are called "parameters".

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

A parameter specified on a transaction line will override an nexus 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

  • nexusId (Integer)

    The nexus id

  • id (Integer)

    The parameter id

Returns:

  • (ErrorDetail[])


129
130
# File 'lib/avatax/client/nexus.rb', line 129

def delete_nexus_parameter(companyId, nexusId, id)        path = "/api/v2/companies/#{companyId}/nexus/#{nexusId}/parameters/#{id}"
delete(path, {}, AvaTax::VERSION)      end

#delete_nexus_parameters(companyId, nexusId) ⇒ ErrorDetail[]

Delete all parameters for an nexus

Delete all the parameters for a given nexus. Some tax calculation and reporting are different depending on the properties of the nexus, such as isRemoteSeller. In AvaTax, these tax-affecting properties are called "parameters".

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

A parameter specified on a transaction line will override an nexus 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 nexus.

  • nexusId (Integer)

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

Returns:

  • (ErrorDetail[])


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

def delete_nexus_parameters(companyId, nexusId)        path = "/api/v2/companies/#{companyId}/nexus/#{nexusId}/parameters"
delete(path, {}, AvaTax::VERSION)      end

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

Retrieve a single nexus

Get the nexus object identified by this URL.

The concept of Nexus indicates a place where your company is legally obligated to collect and remit transactional taxes. The legal requirements for nexus may vary per country and per jurisdiction; please seek advice from your accountant or lawyer prior to declaring nexus. 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

Security Policies

  • This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The ID of the company that owns this nexus object

  • id (Integer)

    The primary key of this nexus

  • include (String)

Returns:

  • (Object)


170
171
# File 'lib/avatax/client/nexus.rb', line 170

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

#get_nexus_by_form_code(companyId, formCode, options = {}) ⇒ Object

List company nexus related to a tax form

Retrieves a list of nexus related to a tax form.

The concept of Nexus indicates a place where your company is legally obligated to collect and remit transactional taxes. The legal requirements for nexus may vary per country and per jurisdiction; please seek advice from your accountant or lawyer prior to declaring nexus.

This API is intended to provide useful information when examining a tax form. If you are about to begin filing a tax form, you may want to know whether you have declared nexus in all the jurisdictions related to that tax form in order to better understand how the form will be filled out. 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

Security Policies

  • This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The ID of the company that owns this nexus object

  • formCode (String)

    The form code that we are looking up the nexus for

  • include (String)

Returns:

  • (Object)


196
197
# File 'lib/avatax/client/nexus.rb', line 196

def get_nexus_by_form_code(companyId, formCode, options={})        path = "/api/v2/companies/#{companyId}/nexus/byform/#{formCode}"
get(path, options, AvaTax::VERSION)      end

#get_nexus_parameter(companyId, nexusId, id) ⇒ Object

Retrieve a single nexus parameter

Retrieve a single nexus parameter. Some tax calculation and reporting are different depending on the properties of the nexus, such as isRemoteSeller.In AvaTax, these tax-affecting properties are called "parameters".

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

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

Security Policies

  • This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The company id

  • nexusId (Integer)

    The nexus id

  • id (Integer)

    The parameter id

Returns:

  • (Object)


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

def get_nexus_parameter(companyId, nexusId, id)        path = "/api/v2/companies/#{companyId}/nexus/#{nexusId}/parameters/#{id}"
get(path, {}, AvaTax::VERSION)      end

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

Retrieve nexus for this company

List all nexus objects defined for this company.

The concept of Nexus indicates a place where your company is legally obligated to collect and remit transactional taxes. The legal requirements for nexus may vary per country and per jurisdiction; please seek advice from your accountant or lawyer prior to declaring nexus.

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:

  • Parameters

Security Policies

  • This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The ID of the company that owns these nexus objects

  • filter (String)

    A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST.
    Not filterable: streamlinedSalesTax, isSSTActive, taxTypeGroup, taxAuthorityId, taxName, 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)


244
245
# File 'lib/avatax/client/nexus.rb', line 244

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

#list_nexus_by_company_and_tax_type_group(companyId, taxTypeGroup, options = {}) ⇒ FetchResult

Retrieve nexus for this company By TaxTypeGroup

List all nexus objects defined for this company filtered by TaxTypeGroup.

The concept of Nexus indicates a place where your company is legally obligated to collect and remit transactional taxes. The legal requirements for nexus may vary per country and per jurisdiction; please seek advice from your accountant or lawyer prior to declaring nexus.

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:

  • Parameters

Security Policies

  • This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The ID of the company that owns these nexus objects

  • taxTypeGroup (String)

    Name of TaxTypeGroup to filter by

  • filter (String)

    A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST.
    Not filterable: streamlinedSalesTax, isSSTActive, taxTypeGroup, taxAuthorityId, taxName, 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)


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

def list_nexus_by_company_and_tax_type_group(companyId, taxTypeGroup, options={})        path = "/api/v2/companies/#{companyId}/nexus/byTaxTypeGroup/#{taxTypeGroup}"
get(path, options, AvaTax::VERSION)      end

#list_nexus_parameters(companyId, nexusId, options = {}) ⇒ FetchResult

Retrieve parameters for a nexus

List parameters for a nexus. Some tax calculation and reporting are different depending on the properties of the nexus, such as isRemoteSeller. In AvaTax, these tax-affecting properties are called "parameters".

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

A parameter specified on a transaction line will override an nexus 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, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The company id

  • nexusId (Integer)

    The nexus 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

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


299
300
# File 'lib/avatax/client/nexus.rb', line 299

def list_nexus_parameters(companyId, nexusId, options={})        path = "/api/v2/companies/#{companyId}/nexus/#{nexusId}/parameters"
get(path, options, AvaTax::VERSION)      end

#query_nexus(options = {}) ⇒ FetchResult

Retrieve all nexus

Get multiple nexus objects across all companies.

The concept of Nexus indicates a place where your company is legally obligated to collect and remit transactional taxes. The legal requirements for nexus may vary per country and per jurisdiction; please seek advice from your accountant or lawyer prior to declaring nexus.

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:

  • Parameters

Security Policies

  • This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, 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: streamlinedSalesTax, isSSTActive, taxTypeGroup, taxAuthorityId, taxName, 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)


326
327
# File 'lib/avatax/client/nexus.rb', line 326

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

#update_nexus(companyId, id, model) ⇒ Object

Update a single nexus

Replace the existing nexus declaration object at this URL with an updated object.

The concept of Nexus indicates a place where your company is legally obligated to collect and remit transactional taxes. The legal requirements for nexus may vary per country and per jurisdiction; please seek advice from your accountant or lawyer prior to declaring nexus.

To create a nexus declaration for your company, you must first call the Definitions API ListNexus to obtain a list of Avalara-defined nexus. Once you have determined which nexus you wish to declare, you should customize only the user-selectable fields in this object.

The user selectable fields for the nexus object are companyId, effectiveDate, endDate, localNexusTypeId, taxId, nexusTypeId, hasPermanentEstablishment, and isSellerImporterOfRecord.

When calling CreateNexus or UpdateNexus, all values in your nexus object except for the user-selectable fields must match an Avalara-defined system nexus object. You can retrieve a list of Avalara-defined system nexus objects by calling ListNexus. If any data does not match, AvaTax may not recognize your nexus declaration.

Please note that nexus changes may not take effect immediately and you should plan to update your nexus settings in advance of calculating tax for a location.

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

  • id (Integer)

    The ID of the nexus you wish to update

  • model (Object)

    The nexus object you wish to update.

Returns:

  • (Object)


359
360
# File 'lib/avatax/client/nexus.rb', line 359

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

#update_nexus_parameter(companyId, nexusId, id, model) ⇒ Object

Update an nexus parameter

Update an nexus parameter.

Some tax calculation and reporting are different depending on the properties of the nexus, such as isRemoteSeller. In AvaTax, these tax-affecting properties are called "parameters".

A parameter added to a nexus will be used in tax calculation based on the locationcode and parameter value the transaction state line might have lines added.

A parameter specified on a transaction line will override an item parameter if they share the same parameter name.????? I dont know about this?

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.

  • nexusId (Integer)

    The nexus id

  • id (Integer)

    The nexus parameter id

  • model (Object)

    The nexus object you wish to update.

Returns:

  • (Object)


381
382
# File 'lib/avatax/client/nexus.rb', line 381

def update_nexus_parameter(companyId, nexusId, id, model)        path = "/api/v2/companies/#{companyId}/nexus/#{nexusId}/parameters/#{id}"
put(path, model, {}, AvaTax::VERSION)      end