Module: AvaTax::Client::DataSources

Defined in:
lib/avatax/client/datasources.rb

Instance Method Summary collapse

Instance Method Details

#create_data_sources(companyId, model) ⇒ DataSourceModel[]

Create and store new datasources for the respective companies.

Create one or more datasource objects.

Security Policies

  • This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
  • This API depends on the following active services:Required (all): AvaTaxPro, BasicReturns. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The id of the company you which to create the datasources

  • model (DataSourceModel[])

Returns:

  • (DataSourceModel[])


18
19
# File 'lib/avatax/client/datasources.rb', line 18

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

#delete_data_source(companyId, id) ⇒ ErrorDetail[]

Delete a datasource by datasource id for a company.

Marks the existing datasource for a company as deleted.

Security Policies

  • This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
  • This API depends on the following active services:Required (all): AvaTaxPro, BasicReturns. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The id of the company the datasource belongs to.

  • id (Integer)

    The id of the datasource you wish to delete.

Returns:

  • (ErrorDetail[])


33
34
# File 'lib/avatax/client/datasources.rb', line 33

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

#get_data_source_by_id(companyId, id) ⇒ Object

Get data source by data source id

Retrieve the data source by its unique ID number.

Security Policies

  • This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
  • This API depends on the following active services:Required (all): AvaTaxPro, BasicReturns. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)
  • id (Integer)

    data source id

Returns:

  • (Object)


48
49
# File 'lib/avatax/client/datasources.rb', line 48

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

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

Retrieve all datasources for this company

Gets multiple datasource objects for a given company.

Security Policies

  • This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
  • This API depends on the following active services:Required (all): AvaTaxPro, BasicReturns. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The id of the company you wish to retrieve the datasources.

  • filter (String)

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

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


66
67
# File 'lib/avatax/client/datasources.rb', line 66

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

#query_data_sources(options = {}) ⇒ FetchResult

Retrieve all datasources

Get multiple datasource objects across all companies.

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, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
  • This API depends on the following active services:Required (all): AvaTaxPro, BasicReturns. 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: isEnabled, isSynced, isAuthorized, name, externalState

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


86
87
# File 'lib/avatax/client/datasources.rb', line 86

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

#update_data_source(companyId, id, model) ⇒ Object

Update a datasource identified by id for a company

Updates a datasource for a company.

Security Policies

  • This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
  • This API depends on the following active services:Required (all): AvaTaxPro, BasicReturns. Swagger Name: AvaTaxClient

Parameters:

  • companyId (Integer)

    The id of the company the datasource belongs to.

  • id (Integer)

    The id of the datasource you wish to delete.

  • model (Object)

Returns:

  • (Object)


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

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