diff --git a/setup.py b/setup.py index 21b34f9..a27b63a 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name='Avalara', - version='19.8.0', + version='19.9.0', url='https://github.com/avadev/AvaTax-REST-V2-Python-SDK', package_dir={'': 'src'}, py_modules=[ diff --git a/src/client_methods.py b/src/client_methods.py index 9f68e8a..5f4b03e 100644 --- a/src/client_methods.py +++ b/src/client_methods.py @@ -1294,7 +1294,7 @@ def list_mrs_companies(self): * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. :param include [string] A comma separated list of objects to fetch underneath this company. Any object with a URL path underneath this company can be fetched by specifying its name. - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* contacts, items, locations, nexus, settings, taxCodes, taxRules, upcs, nonReportingChildCompanies, exemptCerts + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* IsFein, contacts, items, locations, nexus, settings, taxCodes, taxRules, upcs, nonReportingChildCompanies, exemptCerts :param top [int] 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. :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. @@ -1708,7 +1708,7 @@ def list_certificates_for_customer(self, companyId, customerCode, include=None): timeout=self.timeout_limit if self.timeout_limit else 10) r""" - List active certificates for a location + List valid certificates for a location List valid certificates linked to a customer in a particular country and region. This API is intended to help identify whether a customer has already provided a certificate that @@ -3159,3112 +3159,1503 @@ def update_distance_threshold(self, companyId, id_, model): timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Checks to see if the company has a valid POA for a tax form code + Delete a batch of error transactions - This API is available by invitation only. - This API fetches valid POA's for a company by TaxFormCode or by country/region + Delete a batch of error transactions attached to a company. + If any of the provided error transaction isn't found then it'll be treated as a success. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. + * This API depends on the following active services
*Required* (all): AvaTaxPro. - :param companyId [int] The company id that we are checking about - :param taxFormCode [string] The tax form code that we are checking - :param country [string] The country we are fetching POAs for - :param region [string] The region we are fetching POAs for - :return PowerOfAttorneyCheckModel + :param model [DeleteErrorTransactionsRequestModel] The request that contains error transactions to be deleted + :return DeleteErrorTransactionsResponseModel """ - def active_power_of_attorney(self, companyId, include=None): - return requests.get('{}/api/v2/companies/{}/filingcalendars/powerofattorney'.format(self.base_url, companyId), - auth=self.auth, headers=self.client_header, params=include, + def delete_error_transactions(self, model): + return requests.delete('{}/api/v2/errortransactions'.format(self.base_url), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Approve existing Filing Request + Retrieve list of error transactions - This API is available by invitation only. - A "filing request" represents a request to change an existing filing calendar. Filing requests - are reviewed and validated by Avalara Compliance before being implemented. - The filing request must be in the "ChangeRequest" status to be approved. + List error transactions attached to this company. Results are dependent on `$filter` if provided. + This endpoint is limited to returning 250 error transactions at a time maximum. + Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/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, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. + * This API depends on the following active services
*Required* (all): AvaTaxPro. - :param companyId [int] The unique ID of the company that owns the filing request object - :param id_ [int] The unique ID of the filing request object - :return FilingRequestModel + :param companyCode [string] The company code to filter on. This query parameter is required. + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* companyId, avataxErrorJson, avataxCreateTransactionJson + :param top [int] 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. + :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + :return FetchResult """ - def approve_filing_request(self, companyId, id_): - return requests.post('{}/api/v2/companies/{}/filingrequests/{}/approve'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=None, + def list_error_transactions(self, include=None): + return requests.get('{}/api/v2/errortransactions'.format(self.base_url), + auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Cancel existing Filing Request + Approves linkage to a firm for a client account - This API is available by invitation only. - A "filing request" represents a request to change an existing filing calendar. Filing requests - are reviewed and validated by Avalara Compliance before being implemented. + This API enables the account admin of a client account to approve linkage request by a firm. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - :param companyId [int] The unique ID of the company that owns the filing request object - :param id_ [int] The unique ID of the filing request object - :return FilingRequestModel + :param id_ [int] + :return FirmClientLinkageOutputModel """ - def cancel_filing_request(self, companyId, id_): - return requests.post('{}/api/v2/companies/{}/filingrequests/{}/cancel'.format(self.base_url, companyId, id_), + def approve_firm_client_linkage(self, id_): + return requests.post('{}/api/v2/firmclientlinkages/{}/approve'.format(self.base_url, id_), auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Create a new filing request to cancel a filing calendar + Request a new FirmClient account and create an approved linkage to it - This API is available by invitation only. - A "filing request" represents a request to change an existing filing calendar. Filing requests - are reviewed and validated by Avalara Compliance before being implemented. + This API is for use by Firms only. + Avalara allows firms to manage returns for clients without the clients needing to use AvaTax service. + Firms can create accounts of FirmClient for customers they are managing using this API. + Calling this API creates an account with the specified product subscriptions, but without a new user for account. + Account is then linked to the Firm so they can managed their returns. + You should call this API when a customer does not have an AvaTax account and is to be managed only by the firm. + The created account will be created in `Active` status but there will be no user or license key associated with account. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: FirmAdmin, Registrar, SiteAdmin, SystemAdmin. - :param companyId [int] The unique ID of the company that owns the filing calendar object - :param id_ [int] The unique ID number of the filing calendar to cancel - :param model [FilingRequestModel] The cancellation request for this filing calendar - :return FilingRequestModel + :param model [NewFirmClientAccountRequestModel] Information about the account you wish to create. + :return FirmClientLinkageOutputModel """ - def cancel_filing_requests(self, companyId, id_, model): - return requests.post('{}/api/v2/companies/{}/filingcalendars/{}/cancel/request'.format(self.base_url, companyId, id_), + def create_and_link_new_firm_client_account(self, model): + return requests.post('{}/api/v2/firmclientlinkages/createandlinkclient'.format(self.base_url), auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Create a filing calendar + Links a firm account with the client account - This API is available by invitation only and only available for users with Compliance access - A "filing request" represents information that compliance uses to file a return + This API enables the firm admins/firm users to request the linkage of a firm account and a client account. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - :param companyId [int] The unique ID of the company that will add the new filing calendar - :param model [FilingCalendarModel] Filing calendars that will be added - :return FilingCalendarModel + :param model [FirmClientLinkageInputModel] FirmClientLinkageInputModel + :return FirmClientLinkageOutputModel """ - def create_filing_calendars(self, companyId, model): - return requests.post('{}/api/v2/companies/{}/filingcalendars'.format(self.base_url, companyId), + def create_firm_client_linkage(self, model): + return requests.post('{}/api/v2/firmclientlinkages'.format(self.base_url), auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Create a new filing request to create a filing calendar + Delete a linkage - This API is available by invitation only. - A "filing request" represents a request to change an existing filing calendar. Filing requests - are reviewed and validated by Avalara Compliance before being implemented. + This API marks a linkage between a firm and client as deleted. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - :param companyId [int] The unique ID of the company that will add the new filing calendar - :param model [FilingRequestModel] Information about the proposed new filing calendar - :return FilingRequestModel + :param id_ [int] + :return ErrorDetail """ - def create_filing_requests(self, companyId, model): - return requests.post('{}/api/v2/companies/{}/filingcalendars/add/request'.format(self.base_url, companyId), - auth=self.auth, headers=self.client_header, json=model, + def delete_firm_client_linkage(self, id_): + return requests.delete('{}/api/v2/firmclientlinkages/{}'.format(self.base_url, id_), + auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Create a company return setting + Get linkage between a firm and client by id - This API is available by invitation only and only available for users with Compliance access + This API enables the firm admins/firm users to request the linkage of a firm account and a client account. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - :param companyId [int] The unique ID of the company that will add the new filing calendar - :param filingCalendarId [int] The unique ID of the filing calendar that will add the new filing calendar setting - :param model [CompanyReturnSettingModel] CompanyReturnSettings that will be added - :return CompanyReturnSettingModel + :param id_ [int] + :return FirmClientLinkageOutputModel """ - def create_update_company_return_settings(self, companyId, filingCalendarId, model): - return requests.post('{}/api/v2/companies/{}/filingcalendars/{}/settings'.format(self.base_url, companyId, filingCalendarId), - auth=self.auth, headers=self.client_header, json=model, + def get_firm_client_linkage(self, id_): + return requests.get('{}/api/v2/firmclientlinkages/{}'.format(self.base_url, id_), + auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Returns a list of options for adding the specified form. + List client linkages for a firm or client - This API is available by invitation only. + This API enables the firm or account users to request the associated linkages to the account. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - :param companyId [int] The unique ID of the company that owns the filing calendar object - :param formCode [string] The unique code of the form - :return CycleAddOptionModel + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* firmAccountName, clientAccountName + :return FetchResult """ - def cycle_safe_add(self, companyId, include=None): - return requests.get('{}/api/v2/companies/{}/filingcalendars/add/options'.format(self.base_url, companyId), + def list_firm_client_linkage(self, include=None): + return requests.get('{}/api/v2/firmclientlinkages'.format(self.base_url), auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Indicates when changes are allowed to be made to a filing calendar. + Rejects linkage to a firm for a client account - This API is available by invitation only. + This API enables the account admin of a client account to reject linkage request by a firm. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - :param companyId [int] The unique ID of the company that owns the filing calendar object - :param id_ [int] The unique ID of the filing calendar object - :param model [FilingCalendarEditModel] A list of filing calendar edits to be made - :return CycleEditOptionModel + :param id_ [int] + :return FirmClientLinkageOutputModel """ - def cycle_safe_edit(self, companyId, id_, model): - return requests.post('{}/api/v2/companies/{}/filingcalendars/{}/edit/options'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, json=model, + def reject_firm_client_linkage(self, id_): + return requests.post('{}/api/v2/firmclientlinkages/{}/reject'.format(self.base_url, id_), + auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Returns a list of options for expiring a filing calendar + Reset linkage status between a client and firm back to requested - This API is available by invitation only. + This API enables the firm admin of a client account to reset a previously created linkage request by a firm. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - :param companyId [int] The unique ID of the company that owns the filing calendar object - :param id_ [int] The unique ID of the filing calendar object - :return CycleExpireModel + :param id_ [int] + :return FirmClientLinkageOutputModel """ - def cycle_safe_expiration(self, companyId, id_): - return requests.get('{}/api/v2/companies/{}/filingcalendars/{}/cancel/options'.format(self.base_url, companyId, id_), + def reset_firm_client_linkage(self, id_): + return requests.post('{}/api/v2/firmclientlinkages/{}/reset'.format(self.base_url, id_), auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Delete a single filing calendar. + Revokes previously approved linkage to a firm for a client account - This API is available by invitation only. - Mark the existing notice object at this URL as deleted. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. + This API enables the account admin of a client account to revoke a previously approved linkage request by a firm. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - :param companyId [int] The ID of the company that owns this filing calendar. - :param id_ [int] The ID of the filing calendar you wish to delete. - :return ErrorDetail + :param id_ [int] + :return FirmClientLinkageOutputModel """ - def delete_filing_calendar(self, companyId, id_): - return requests.delete('{}/api/v2/companies/{}/filingcalendars/{}'.format(self.base_url, companyId, id_), + def revoke_firm_client_linkage(self, id_): + return requests.post('{}/api/v2/firmclientlinkages/{}/revoke'.format(self.base_url, id_), auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a single filing calendar + FREE API - Request a free trial of AvaTax - This API is available by invitation only. + Call this API to obtain a free AvaTax account. + This API is free to use. No authentication credentials are required to call this API. You must read and + accept [Avalara's terms and conditions](https://www1.avalara.com/us/en/legal/terms.html) for the account to be + created. + If all conditions are met, this API will grant a free trial version of AvaTax. For a list of functionality + available in the free trial and its limitations, please see the [AvaTax Developer Website Free Trial page](https://developer.avalara.com/avatax/signup/). + After your free trial concludes, you will still be able to use the [Free AvaTax API Suite](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Free/). ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API may be called without providing authentication credentials. - :param companyId [int] The ID of the company that owns this filing calendar - :param id_ [int] The primary key of this filing calendar - :return FilingCalendarModel + :param model [FreeTrialRequestModel] Required information to provision a free trial account. + :return NewAccountModel """ - def get_filing_calendar(self, companyId, id_): - return requests.get('{}/api/v2/companies/{}/filingcalendars/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=None, + def request_free_trial(self, model): + return requests.post('{}/api/v2/accounts/freetrials/request'.format(self.base_url), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a single filing request + FREE API - Sales tax rates for a specified address - This API is available by invitation only. - A "filing request" represents a request to change an existing filing calendar. Filing requests - are reviewed and validated by Avalara Compliance before being implemented. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + # Free-To-Use + The TaxRates API is a free-to-use, no cost option for estimating sales tax rates. + Any customer can request a free AvaTax account and make use of the TaxRates API. + Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP + response code 429 - `Too Many Requests`. + This API assumes that you are selling general tangible personal property at a retail point-of-sale + location in the United States only. + For more powerful tax calculation, please consider upgrading to the `CreateTransaction` API, + which supports features including, but not limited to: + * Nexus declarations + * Taxability based on product/service type + * Sourcing rules affecting origin/destination states + * Customers who are exempt from certain taxes + * States that have dollar value thresholds for tax amounts + * Refunds for products purchased on a different date + * Detailed jurisdiction names and state assigned codes + * And more! + Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/) + for information on how to upgrade to the full AvaTax CreateTransaction API. - :param companyId [int] The ID of the company that owns this filing calendar - :param id_ [int] The primary key of this filing calendar - :return FilingRequestModel + :param line1 [string] The street address of the location. + :param line2 [string] The street address of the location. + :param line3 [string] The street address of the location. + :param city [string] The city name of the location. + :param region [string] Name or ISO 3166 code identifying the region within the country. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`. + :param postalCode [string] The postal code of the location. + :param country [string] Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. + :return TaxRateModel """ - def get_filing_request(self, companyId, id_): - return requests.get('{}/api/v2/companies/{}/filingrequests/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=None, + def tax_rates_by_address(self, include=None): + return requests.get('{}/api/v2/taxrates/byaddress'.format(self.base_url), + auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve all filing calendars for this company + FREE API - Sales tax rates for a specified country and postal code. This API is only available for US postal codes. - This API is available by invitation only. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + # Free-To-Use + This API is only available for a US postal codes. + The TaxRates API is a free-to-use, no cost option for estimating sales tax rates. + Any customer can request a free AvaTax account and make use of the TaxRates API. + Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP + response code 429 - `Too Many Requests`. + This API assumes that you are selling general tangible personal property at a retail point-of-sale + location in the United States only. + For more powerful tax calculation, please consider upgrading to the `CreateTransaction` API, + which supports features including, but not limited to: + * Nexus declarations + * Taxability based on product/service type + * Sourcing rules affecting origin/destination states + * Customers who are exempt from certain taxes + * States that have dollar value thresholds for tax amounts + * Refunds for products purchased on a different date + * Detailed jurisdiction names and state assigned codes + * And more! + Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/) + for information on how to upgrade to the full AvaTax CreateTransaction API. - :param companyId [int] The ID of the company that owns these batches - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* taxAuthorityId, taxAuthorityName, taxAuthorityType, settings - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :param returnCountry [string] A comma separated list of countries - :param returnRegion [string] A comma separated list of regions - :return FetchResult + :param country [string] Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. + :param postalCode [string] The postal code of the location. + :return TaxRateModel """ - def list_filing_calendars(self, companyId, include=None): - return requests.get('{}/api/v2/companies/{}/filingcalendars'.format(self.base_url, companyId), + def tax_rates_by_postal_code(self, include=None): + return requests.get('{}/api/v2/taxrates/bypostalcode'.format(self.base_url), auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve all filing requests for this company + Request the javascript for a funding setup widget This API is available by invitation only. - A "filing request" represents a request to change an existing filing calendar. Filing requests - are reviewed and validated by Avalara Compliance before being implemented. + Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are + required to setup their funding configuration before Avalara can begin filing tax returns on their + behalf. + Funding configuration for each company is set up by submitting a funding setup request, which can + be sent either via email or via an embedded HTML widget. + When the funding configuration is submitted to Avalara, it will be reviewed by treasury team members + before approval. + This API returns back the actual javascript code to insert into your application to render the + JavaScript funding setup widget inline. + Use the 'methodReturn.javaScript' return value to insert this widget into your HTML page. + This API requires a subscription to Avalara Managed Returns or SST Certified Service Provider. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. + * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - :param companyId [int] The ID of the company that owns these batches - :param filingCalendarId [int] Specific filing calendar id for the request - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/). - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :return FetchResult + :param id_ [int] The unique ID number of this funding request + :return FundingStatusModel """ - def list_filing_requests(self, companyId, include=None): - return requests.get('{}/api/v2/companies/{}/filingrequests'.format(self.base_url, companyId), - auth=self.auth, headers=self.client_header, params=include, + def activate_funding_request(self, id_): + return requests.get('{}/api/v2/fundingrequests/{}/widget'.format(self.base_url, id_), + auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - New request for getting for validating customer's login credentials + Retrieve status about a funding setup request This API is available by invitation only. - This API verifies that a customer has submitted correct login credentials for a tax authority's online filing system. + Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are + required to setup their funding configuration before Avalara can begin filing tax returns on their + behalf. + Funding configuration for each company is set up by submitting a funding setup request, which can + be sent either via email or via an embedded HTML widget. + When the funding configuration is submitted to Avalara, it will be reviewed by treasury team members + before approval. + This API checks the status on an existing funding request. + This API requires a subscription to Avalara Managed Returns or SST Certified Service Provider. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - :param model [LoginVerificationInputModel] The model of the login information we are verifying - :return LoginVerificationOutputModel + :param id_ [int] The unique ID number of this funding request + :return FundingStatusModel """ - def login_verification_request(self, model): - return requests.post('{}/api/v2/filingcalendars/credentials/verify'.format(self.base_url), - auth=self.auth, headers=self.client_header, json=model, + def funding_request_status(self, id_): + return requests.get('{}/api/v2/fundingrequests/{}'.format(self.base_url, id_), + auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Gets the request status and Login Result + Delete all classifications for an item - This API is available by invitation only. - This API checks the status of a login verification request. It may only be called by authorized users from the account - that initially requested the login verification. + 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, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param jobId [int] The unique ID number of this login request - :return LoginVerificationOutputModel + :param companyId [int] The ID of the company that owns this item. + :param itemId [int] The ID of the item you wish to delete the classifications. + :return ErrorDetail """ - def login_verification_status(self, jobId): - return requests.get('{}/api/v2/filingcalendars/credentials/{}'.format(self.base_url, jobId), + def batch_delete_item_classifications(self, companyId, itemId): + return requests.delete('{}/api/v2/companies/{}/items/{}/classifications'.format(self.base_url, companyId, itemId), auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve all filing calendars - - This API is available by invitation only. - This API is deprecated - please use POST `/api/v2/filingrequests/query` API. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* taxAuthorityId, taxAuthorityName, taxAuthorityType, settings - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :param returnCountry [string] If specified, fetches only filing calendars that apply to tax filings in this specific country. Uses ISO 3166 country codes. - :param returnRegion [string] If specified, fetches only filing calendars that apply to tax filings in this specific region. Uses ISO 3166 region codes. - :return FetchResult - """ - def query_filing_calendars(self, include=None): - return requests.get('{}/api/v2/filingcalendars'.format(self.base_url), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Retrieve all filing calendars + Delete all parameters for an item - This API is available by invitation only. - This API is intended to replace the GET `/api/v2/filingcalendars` API. The fetch request object is posted on the body of the request instead of the URI, so it's not limited by a set number of characters. - The documentation of the GET API shows how filtering, sorting and pagination works. + 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, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param returnCountry [string] If specified, fetches only filing calendars that apply to tax filings in this specific country. Uses ISO 3166 country codes. - :param returnRegion [string] If specified, fetches only filing calendars that apply to tax filings in this specific region. Uses ISO 3166 region codes. - :param model [QueryRequestModel] Query object to filter, sort and paginate the filing calendars. - :return FetchResult + :param companyId [int] The ID of the company that owns this item. + :param itemId [int] The ID of the item you wish to delete the parameters. + :return ErrorDetail """ - def query_filing_calendars_post(self, model, include=None): - return requests.post('{}/api/v2/filingcalendars/query'.format(self.base_url), - auth=self.auth, headers=self.client_header, params=include, json=model, + def batch_delete_item_parameters(self, companyId, itemId): + return requests.delete('{}/api/v2/companies/{}/items/{}/parameters'.format(self.base_url, companyId, itemId), + auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve all filing requests + Add classifications to an item. - This API is available by invitation only. - This API is deprecated - please use POST `/api/v2/filingrequests/query` API. - A "filing request" represents a request to change an existing filing calendar. Filing requests - are reviewed and validated by Avalara Compliance before being implemented. - Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . - Paginate your results using the `$top`, `$skip`, and `$orderby` parameters. + 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, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param filingCalendarId [int] Specific filing calendar id for the request - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/). - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :return FetchResult + :param companyId [int] The company id. + :param itemId [int] The item id. + :param model [ItemClassificationInputModel] The item classifications you wish to create. + :return ItemClassificationOutputModel """ - def query_filing_requests(self, include=None): - return requests.get('{}/api/v2/filingrequests'.format(self.base_url), - auth=self.auth, headers=self.client_header, params=include, + def create_item_classifications(self, companyId, itemId, model): + return requests.post('{}/api/v2/companies/{}/items/{}/classifications'.format(self.base_url, companyId, itemId), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve all filing requests + Add parameters to an item. - This API is available by invitation only. - This API is intended to replace the GET `/api/v2/filingrequests` API. The fetch request object is posted on the body of the request instead of the URI, so it's not limited by a set number of characters. - The documentation of the GET API shows how filtering, sorting and pagination works. + 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, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param filingCalendarId [int] Specific filing calendar id for the request - :param model [QueryRequestModel] Query object to filter, sort and paginate the filing calendars. - :return FetchResult + :param companyId [int] The ID of the company that owns this item parameter. + :param itemId [int] The item id. + :param model [ItemParameterModel] The item parameters you wish to create. + :return ItemParameterModel """ - def query_filing_requests_post(self, model, include=None): - return requests.post('{}/api/v2/filingrequests/query'.format(self.base_url), - auth=self.auth, headers=self.client_header, params=include, json=model, + def create_item_parameters(self, companyId, itemId, model): + return requests.post('{}/api/v2/companies/{}/items/{}/parameters'.format(self.base_url, companyId, itemId), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Create a new filing request to edit a filing calendar + Create a new item - This API is available by invitation only. - A "filing request" represents a request to change an existing filing calendar. Filing requests - are reviewed and validated by Avalara Compliance before being implemented. - Certain users may not update filing calendars directly. Instead, they may submit an edit request - to modify the value of a filing calendar using this API. + 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, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param companyId [int] The unique ID of the company that owns the filing calendar object - :param id_ [int] The unique ID number of the filing calendar to edit - :param model [FilingRequestModel] A list of filing calendar edits to be made - :return FilingRequestModel + :param companyId [int] The ID of the company that owns this item. + :param model [ItemModel] The item you wish to create. + :return ItemModel """ - def request_filing_calendar_update(self, companyId, id_, model): - return requests.post('{}/api/v2/companies/{}/filingcalendars/{}/edit/request'.format(self.base_url, companyId, id_), + def create_items(self, companyId, model): + return requests.post('{}/api/v2/companies/{}/items'.format(self.base_url, companyId), auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Edit existing Filing Calendar + Delete a single item - This API is available by invitation only. + 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, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param companyId [int] The unique ID of the company that owns the filing calendar object - :param id_ [int] The unique ID of the filing calendar object - :param model [FilingCalendarModel] The filing calendar model you are wishing to update with. - :return FilingCalendarModel + :param companyId [int] The ID of the company that owns this item. + :param id_ [int] The ID of the item you wish to delete. + :return ErrorDetail """ - def update_filing_calendar(self, companyId, id_, model): - return requests.put('{}/api/v2/companies/{}/filingcalendars/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, json=model, + def delete_item(self, companyId, id_): + return requests.delete('{}/api/v2/companies/{}/items/{}'.format(self.base_url, companyId, id_), + auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Edit existing Filing Request + Delete a single item classification. - This API is available by invitation only. - A "filing request" represents a request to change an existing filing calendar. Filing requests - are reviewed and validated by Avalara Compliance before being implemented. + 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, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param companyId [int] The unique ID of the company that owns the filing request object - :param id_ [int] The unique ID of the filing request object - :param model [FilingRequestModel] A list of filing calendar edits to be made - :return FilingRequestModel + :param companyId [int] The company id. + :param itemId [int] The item id. + :param id_ [int] The item classification id. + :return ErrorDetail """ - def update_filing_request(self, companyId, id_, model): - return requests.put('{}/api/v2/companies/{}/filingrequests/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, json=model, + def delete_item_classification(self, companyId, itemId, id_): + return requests.delete('{}/api/v2/companies/{}/items/{}/classifications/{}'.format(self.base_url, companyId, itemId, id_), + auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Approve all filings for the specified company in the given filing period. + Delete a single item parameter - This API is available by invitation only. - Approving a return means the customer is ready to let Avalara file that return. - Customer either approves themselves from admin console, - else system auto-approves the night before the filing cycle. - Sometimes Compliance has to manually unapprove and reapprove to modify liability or filing for the customer. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param companyId [int] The ID of the company that owns the filings. - :param year [int] The year of the filing period to approve. - :param month [int] The month of the filing period to approve. - :param model [ApproveFilingsModel] The approve request you wish to execute. - :return FilingModel + :param companyId [int] The company id + :param itemId [int] The item id + :param id_ [int] The parameter id + :return ErrorDetail """ - def approve_filings(self, companyId, year, month, model): - return requests.post('{}/api/v2/companies/{}/filings/{}/{}/approve'.format(self.base_url, companyId, year, month), - auth=self.auth, headers=self.client_header, json=model, + def delete_item_parameter(self, companyId, itemId, id_): + return requests.delete('{}/api/v2/companies/{}/items/{}/parameters/{}'.format(self.base_url, companyId, itemId, id_), + auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Approve all filings for the specified company in the given filing period and country. + Retrieve a single item - This API is available by invitation only. - Approving a return means the customer is ready to let Avalara file that return. - Customer either approves themselves from admin console, - else system auto-approves the night before the filing cycle. - Sometimes Compliance has to manually unapprove and reapprove to modify liability or filing for the customer. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + 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, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param companyId [int] The ID of the company that owns the filings. - :param year [int] The year of the filing period to approve. - :param month [int] The month of the filing period to approve. - :param country [string] The two-character ISO-3166 code for the country. - :param model [ApproveFilingsModel] The approve request you wish to execute. - :return FilingModel + :param companyId [int] The ID of the company that owns this item object + :param id_ [int] The primary key of this item + :param include [string] A comma separated list of additional data to retrieve. + :return ItemModel """ - def approve_filings_country(self, companyId, year, month, country, model): - return requests.post('{}/api/v2/companies/{}/filings/{}/{}/{}/approve'.format(self.base_url, companyId, year, month, country), - auth=self.auth, headers=self.client_header, json=model, + def get_item(self, companyId, id_, include=None): + return requests.get('{}/api/v2/companies/{}/items/{}'.format(self.base_url, companyId, id_), + auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Approve all filings for the specified company in the given filing period, country and region. + Retrieve a single item classification. - This API is available by invitation only. - Approving a return means the customer is ready to let Avalara file that return. - Customer either approves themselves from admin console, - else system auto-approves the night before the filing cycle - Sometimes Compliance has to manually unapprove and reapprove to modify liability or filing for the customer. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + 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, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param companyId [int] The ID of the company that owns the filings. - :param year [int] The year of the filing period to approve. - :param month [int] The month of the filing period to approve. - :param country [string] The two-character ISO-3166 code for the country. - :param region [string] The two or three character region code for the region. - :param model [ApproveFilingsModel] The approve request you wish to execute. - :return FilingModel + :param companyId [int] The company id. + :param itemId [int] The item id. + :param id_ [int] The item classification id. + :return ItemClassificationOutputModel """ - def approve_filings_country_region(self, companyId, year, month, country, region, model): - return requests.post('{}/api/v2/companies/{}/filings/{}/{}/{}/{}/approve'.format(self.base_url, companyId, year, month, country, region), - auth=self.auth, headers=self.client_header, json=model, + def get_item_classification(self, companyId, itemId, id_): + return requests.get('{}/api/v2/companies/{}/items/{}/classifications/{}'.format(self.base_url, companyId, itemId, id_), + auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Add an adjustment to a given filing. + Retrieve a single item parameter - This API is available by invitation only. - An "Adjustment" is usually an increase or decrease to customer funding to Avalara, - such as early filer discount amounts that are refunded to the customer, or efile fees from websites. - Sometimes may be a manual change in tax liability similar to an augmentation. - This API creates a new adjustment for an existing tax filing. - This API can only be used when the filing has not yet been approved. + 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, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param companyId [int] The ID of the company that owns the filing being adjusted. - :param year [int] The year of the filing's filing period being adjusted. - :param month [int] The month of the filing's filing period being adjusted. - :param country [string] The two-character ISO-3166 code for the country of the filing being adjusted. - :param region [string] The two or three character region code for the region. - :param formCode [string] The unique code of the form being adjusted. - :param model [FilingAdjustmentModel] A list of Adjustments to be created for the specified filing. - :return FilingAdjustmentModel + :param companyId [int] The company id + :param itemId [int] The item id + :param id_ [int] The parameter id + :return ItemParameterModel """ - def create_return_adjustment(self, companyId, year, month, country, region, formCode, model): - return requests.post('{}/api/v2/companies/{}/filings/{}/{}/{}/{}/{}/adjust'.format(self.base_url, companyId, year, month, country, region, formCode), - auth=self.auth, headers=self.client_header, json=model, + def get_item_parameter(self, companyId, itemId, id_): + return requests.get('{}/api/v2/companies/{}/items/{}/parameters/{}'.format(self.base_url, companyId, itemId, id_), + auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Add an augmentation for a given filing. + Retrieve classifications for an item. - This API is available by invitation only. - An "Augmentation" is a manually added increase or decrease in tax liability, by either customer or Avalara - usually due to customer wanting to report tax Avatax does not support, e.g. bad debts, rental tax. - This API creates a new augmentation for an existing tax filing. - This API can only be used when the filing has not been approved. + 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](http://developer.avalara.com/avatax/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, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param companyId [int] The ID of the company that owns the filing being changed. - :param year [int] The month of the filing's filing period being changed. - :param month [int] The month of the filing's filing period being changed. - :param country [string] The two-character ISO-3166 code for the country of the filing being changed. - :param region [string] The two or three character region code for the region of the filing being changed. - :param formCode [string] The unique code of the form being changed. - :param model [FilingAugmentationModel] A list of augmentations to be created for the specified filing. - :return FilingAugmentationModel - """ - def create_return_augmentation(self, companyId, year, month, country, region, formCode, model): - return requests.post('{}/api/v2/companies/{}/filings/{}/{}/{}/{}/{}/augment'.format(self.base_url, companyId, year, month, country, region, formCode), - auth=self.auth, headers=self.client_header, json=model, + :param companyId [int] The company id. + :param itemId [int] The item id. + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* productCode, systemCode + :param top [int] 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. + :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + :return FetchResult + """ + def list_item_classifications(self, companyId, itemId, include=None): + return requests.get('{}/api/v2/companies/{}/items/{}/classifications'.format(self.base_url, companyId, itemId), + auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Add an payment to a given filing. + Retrieve parameters for an item - This API is available by invitation only. - An "Payment" is usually an increase or decrease to customer funding to Avalara, - such as early filer discount amounts that are refunded to the customer, or efile fees from websites. - Sometimes may be a manual change in tax liability similar to an augmentation. - This API creates a new payment for an existing tax filing. - This API can only be used when the filing has not yet been approved. + 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](http://developer.avalara.com/avatax/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, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param companyId [int] The ID of the company that owns the filing being adjusted. - :param year [int] The year of the filing's filing period being adjusted. - :param month [int] The month of the filing's filing period being adjusted. - :param country [string] The two-character ISO-3166 code for the country of the filing being adjusted. - :param region [string] The two or three character region code for the region. - :param formCode [string] The unique code of the form being adjusted. - :param model [FilingPaymentModel] A list of Payments to be created for the specified filing. - :return FilingPaymentModel + :param companyId [int] The company id + :param itemId [int] The item id + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* name, unit + :param top [int] 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. + :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + :return FetchResult """ - def create_return_payment(self, companyId, year, month, country, region, formCode, model): - return requests.post('{}/api/v2/companies/{}/filings/{}/{}/{}/{}/{}/payment'.format(self.base_url, companyId, year, month, country, region, formCode), - auth=self.auth, headers=self.client_header, json=model, + def list_item_parameters(self, companyId, itemId, include=None): + return requests.get('{}/api/v2/companies/{}/items/{}/parameters'.format(self.base_url, companyId, itemId), + auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Delete an adjustment for a given filing. + Retrieve items for this company - This API is available by invitation only. - An "Adjustment" is usually an increase or decrease to customer funding to Avalara, - such as early filer discount amounts that are refunded to the customer, or efile fees from websites. - Sometimes may be a manual change in tax liability similar to an augmentation. - This API deletes an adjustment for an existing tax filing. - This API can only be used when the filing has been unapproved. + 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](http://developer.avalara.com/avatax/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 + * Classifications ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param companyId [int] The ID of the company that owns the filing being adjusted. - :param id_ [int] The ID of the adjustment being deleted. - :param type [string] The type of adjustment that you are trying to delete. - :return ErrorDetail + :param companyId [int] The ID of the company that defined these items + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* taxCode, classifications, parameters + :param include [string] A comma separated list of additional data to retrieve. + :param top [int] 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. + :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + :return FetchResult """ - def delete_return_adjustment(self, companyId, id_, include=None): - return requests.delete('{}/api/v2/companies/{}/filings/adjust/{}'.format(self.base_url, companyId, id_), + def list_items_by_company(self, companyId, include=None): + return requests.get('{}/api/v2/companies/{}/items'.format(self.base_url, companyId), auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Delete an augmentation for a given filing. + Retrieve all items - This API is available by invitation only. - An "Augmentation" is a manually added increase or decrease in tax liability, by either customer or Avalara - usually due to customer wanting to report tax Avatax does not support, e.g. bad debts, rental tax. - This API deletes an augmentation for an existing tax filing. - This API can only be used when the filing has been unapproved. + 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](http://developer.avalara.com/avatax/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, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param companyId [int] The ID of the company that owns the filing being changed. - :param id_ [int] The ID of the augmentation being added. - :return ErrorDetail + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* taxCode, classifications, parameters + :param include [string] A comma separated list of additional data to retrieve. + :param top [int] 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. + :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + :return FetchResult """ - def delete_return_augmentation(self, companyId, id_): - return requests.delete('{}/api/v2/companies/{}/filings/augment/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=None, + def query_items(self, include=None): + return requests.get('{}/api/v2/items'.format(self.base_url), + auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Delete an payment for a given filing. + Sync items from a product catalog - This API is available by invitation only. - An "Payment" is usually an increase or decrease to customer funding to Avalara, - such as early filer discount amounts that are refunded to the customer, or efile fees from websites. - Sometimes may be a manual change in tax liability similar to an augmentation. - This API deletes an payment for an existing tax filing. - This API can only be used when the filing has been unapproved. + 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, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param companyId [int] The ID of the company that owns the filing being adjusted. - :param id_ [int] The ID of the payment being deleted. - :return ErrorDetail + :param companyId [int] The ID of the company that owns this item. + :param model [SyncItemsRequestModel] The request object. + :return SyncItemsResponseModel """ - def delete_return_payment(self, companyId, id_): - return requests.delete('{}/api/v2/companies/{}/filings/payment/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=None, + def sync_items(self, companyId, model): + return requests.post('{}/api/v2/companies/{}/items/sync'.format(self.base_url, companyId), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve worksheet checkup report for company and filing period. + Update a single item - This API is available by invitation only. + 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, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param filingsId [int] The unique id of the worksheet. - :param companyId [int] The unique ID of the company that owns the worksheet. - :return FilingsCheckupModel + :param companyId [int] The ID of the company that this item belongs to. + :param id_ [int] The ID of the item you wish to update + :param model [ItemModel] The item object you wish to update. + :return ItemModel """ - def filings_checkup_report(self, filingsId, companyId): - return requests.get('{}/api/v2/companies/{}/filings/{}/checkup'.format(self.base_url, filingsId, companyId), - auth=self.auth, headers=self.client_header, params=None, + def update_item(self, companyId, id_, model): + return requests.put('{}/api/v2/companies/{}/items/{}'.format(self.base_url, companyId, id_), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve worksheet checkup report for company and filing period. + Update an item classification. - This API is available by invitation only. + 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, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param companyId [int] The unique ID of the company that owns the worksheets object. - :param year [int] The year of the filing period. - :param month [int] The month of the filing period. - :return FilingsCheckupModel + :param companyId [int] The company id. + :param itemId [int] The item id. + :param id_ [int] The item classification id. + :param model [ItemClassificationInputModel] The item object you wish to update. + :return ItemClassificationOutputModel """ - def filings_checkup_reports(self, companyId, year, month): - return requests.get('{}/api/v2/companies/{}/filings/{}/{}/checkup'.format(self.base_url, companyId, year, month), - auth=self.auth, headers=self.client_header, params=None, + def update_item_classification(self, companyId, itemId, id_, model): + return requests.put('{}/api/v2/companies/{}/items/{}/classifications/{}'.format(self.base_url, companyId, itemId, id_), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a list of filings for the specified accrual return. + Update an item parameter - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. + 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param companyId [int] The ID of the company that owns these batches - :param filingReturnId [int] The ID of the accrual return - :return FetchResult + :param companyId [int] The company id. + :param itemId [int] The item id + :param id_ [int] The item parameter id + :param model [ItemParameterModel] The item object you wish to update. + :return ItemParameterModel """ - def get_accrual_fillings(self, companyId, filingReturnId): - return requests.get('{}/api/v2/companies/{}/filings/accrual/{}'.format(self.base_url, companyId, filingReturnId), - auth=self.auth, headers=self.client_header, params=None, + def update_item_parameter(self, companyId, itemId, id_, model): + return requests.put('{}/api/v2/companies/{}/items/{}/parameters/{}'.format(self.base_url, companyId, itemId, id_), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a single attachment for a filing + Create one or more overrides - This API is available by invitation only. + Creates one or more jurisdiction override objects for this account. + A Jurisdiction Override is a configuration setting that allows you to select the taxing + jurisdiction for a specific address. If you encounter an address that is on the boundary + between two different jurisdictions, you can choose to set up a jurisdiction override + to switch this address to use different taxing jurisdictions. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param companyId [int] The ID of the company that owns the filings. - :param filingReturnId [int] The unique id of the worksheet return. - :param fileId [int] The unique id of the document you are downloading - :return String + :param accountId [int] The ID of the account that owns this override + :param model [JurisdictionOverrideModel] The jurisdiction override objects to create + :return JurisdictionOverrideModel """ - def get_filing_attachment(self, companyId, filingReturnId, include=None): - return requests.get('{}/api/v2/companies/{}/filings/{}/attachment'.format(self.base_url, companyId, filingReturnId), - auth=self.auth, headers=self.client_header, params=include, + def create_jurisdiction_overrides(self, accountId, model): + return requests.post('{}/api/v2/accounts/{}/jurisdictionoverrides'.format(self.base_url, accountId), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a list of filings for the specified company in the year and month of a given filing period. + Delete a single override - This API is available by invitation only. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. + Marks the item object at this URL as deleted. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param companyId [int] The ID of the company that owns the filings. - :param year [int] The year of the filing period. - :param month [int] The two digit month of the filing period. - :return String + :param accountId [int] The ID of the account that owns this override + :param id_ [int] The ID of the override you wish to delete + :return ErrorDetail """ - def get_filing_attachments(self, companyId, year, month): - return requests.get('{}/api/v2/companies/{}/filings/{}/{}/attachments'.format(self.base_url, companyId, year, month), + def delete_jurisdiction_override(self, accountId, id_): + return requests.delete('{}/api/v2/accounts/{}/jurisdictionoverrides/{}'.format(self.base_url, accountId, id_), auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a single trace file for a company filing period + Retrieve a single override - This API is available by invitation only. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. + Get the item object identified by this URL. + A Jurisdiction Override is a configuration setting that allows you to select the taxing + jurisdiction for a specific address. If you encounter an address that is on the boundary + between two different jurisdictions, you can choose to set up a jurisdiction override + to switch this address to use different taxing jurisdictions. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param companyId [int] The ID of the company that owns the filings. - :param year [int] The year of the filing period. - :param month [int] The two digit month of the filing period. - :return String + :param accountId [int] The ID of the account that owns this override + :param id_ [int] The primary key of this override + :return JurisdictionOverrideModel """ - def get_filing_attachments_trace_file(self, companyId, year, month): - return requests.get('{}/api/v2/companies/{}/filings/{}/{}/attachments/tracefile'.format(self.base_url, companyId, year, month), + def get_jurisdiction_override(self, accountId, id_): + return requests.get('{}/api/v2/accounts/{}/jurisdictionoverrides/{}'.format(self.base_url, accountId, id_), auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a filing for the specified company and id. + Retrieve overrides for this account - This API is available by invitation only. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. + List all jurisdiction override objects defined for this account. + A Jurisdiction Override is a configuration setting that allows you to select the taxing + jurisdiction for a specific address. If you encounter an address that is on the boundary + between two different jurisdictions, you can choose to set up a jurisdiction override + to switch this address to use different taxing jurisdictions. + Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/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, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param companyId [int] The ID of the company that owns the filings. - :param id_ [int] The id of the filing return your retrieving - :param details [boolean] Indicates if you would like the credit details returned - :return FilingReturnModel + :param accountId [int] The ID of the account that owns this override + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* country, Jurisdictions + :param include [string] A comma separated list of additional data to retrieve. + :param top [int] 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. + :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. + :return FetchResult """ - def get_filing_return(self, companyId, id_, include=None): - return requests.get('{}/api/v2/companies/{}/filings/returns/{}'.format(self.base_url, companyId, id_), + def list_jurisdiction_overrides_by_account(self, accountId, include=None): + return requests.get('{}/api/v2/accounts/{}/jurisdictionoverrides'.format(self.base_url, accountId), auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a list of filings for the specified company in the year and month of a given filing period. + Retrieve all overrides - This API is available by invitation only. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. + Get multiple jurisdiction override objects across all companies. + A Jurisdiction Override is a configuration setting that allows you to select the taxing + jurisdiction for a specific address. If you encounter an address that is on the boundary + between two different jurisdictions, you can choose to set up a jurisdiction override + to switch this address to use different taxing jurisdictions. + Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/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, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param companyId [int] The ID of the company that owns the filings. - :param year [int] The year of the filing period. - :param month [int] The two digit month of the filing period. + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* country, Jurisdictions + :param include [string] A comma separated list of additional data to retrieve. + :param top [int] 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. + :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. :return FetchResult """ - def get_filings(self, companyId, year, month): - return requests.get('{}/api/v2/companies/{}/filings/{}/{}'.format(self.base_url, companyId, year, month), - auth=self.auth, headers=self.client_header, params=None, + def query_jurisdiction_overrides(self, include=None): + return requests.get('{}/api/v2/jurisdictionoverrides'.format(self.base_url), + auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a list of filings for the specified company in the given filing period and country. + Update a single jurisdictionoverride - This API is available by invitation only. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. + Replace the existing jurisdictionoverride object at this URL with an updated object. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. + * This API requires one of the following user roles: AccountAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param companyId [int] The ID of the company that owns the filings. - :param year [int] The year of the filing period. - :param month [int] The two digit month of the filing period. - :param country [string] The two-character ISO-3166 code for the country. - :return FetchResult + :param accountId [int] The ID of the account that this jurisdictionoverride belongs to. + :param id_ [int] The ID of the jurisdictionoverride you wish to update + :param model [JurisdictionOverrideModel] The jurisdictionoverride object you wish to update. + :return JurisdictionOverrideModel """ - def get_filings_by_country(self, companyId, year, month, country): - return requests.get('{}/api/v2/companies/{}/filings/{}/{}/{}'.format(self.base_url, companyId, year, month, country), - auth=self.auth, headers=self.client_header, params=None, + def update_jurisdiction_override(self, accountId, id_, model): + return requests.put('{}/api/v2/accounts/{}/jurisdictionoverrides/{}'.format(self.base_url, accountId, id_), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a list of filings for the specified company in the filing period, country and region. + Create a new location - This API is available by invitation only. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. + Create one or more new location objects attached to this company. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - :param companyId [int] The ID of the company that owns the filings. - :param year [int] The year of the filing period. - :param month [int] The two digit month of the filing period. - :param country [string] The two-character ISO-3166 code for the country. - :param region [string] The two or three character region code for the region. - :return FetchResult - """ - def get_filings_by_country_region(self, companyId, year, month, country, region): - return requests.get('{}/api/v2/companies/{}/filings/{}/{}/{}/{}'.format(self.base_url, companyId, year, month, country, region), - auth=self.auth, headers=self.client_header, params=None, + :param companyId [int] The ID of the company that owns this location. + :param model [LocationModel] The location you wish to create. + :return LocationModel + """ + def create_locations(self, companyId, model): + return requests.post('{}/api/v2/companies/{}/locations'.format(self.base_url, companyId), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a list of filings for the specified company in the given filing period, country, region and form. + Delete a single location - This API is available by invitation only. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. + Mark the location object at this URL as deleted. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - :param companyId [int] The ID of the company that owns the filings. - :param year [int] The year of the filing period. - :param month [int] The two digit month of the filing period. - :param country [string] The two-character ISO-3166 code for the country. - :param region [string] The two or three character region code for the region. - :param formCode [string] The unique code of the form. - :return FetchResult + :param companyId [int] The ID of the company that owns this location. + :param id_ [int] The ID of the location you wish to delete. + :return ErrorDetail """ - def get_filings_by_return_name(self, companyId, year, month, country, region, formCode): - return requests.get('{}/api/v2/companies/{}/filings/{}/{}/{}/{}/{}'.format(self.base_url, companyId, year, month, country, region, formCode), + def delete_location(self, companyId, id_): + return requests.delete('{}/api/v2/companies/{}/locations/{}'.format(self.base_url, companyId, id_), auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a list of filings for the specified company in the year and month of a given filing period. - This gets the basic information from the filings and doesn't include anything extra. + Retrieve a single location - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. + 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 + ### Security Policies + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - :param companyId [int] The ID of the company that owns these batches - :param endPeriodMonth [int] The month of the period you are trying to retrieve - :param endPeriodYear [int] The year of the period you are trying to retrieve - :param frequency [FilingFrequencyId] The frequency of the return you are trying to retrieve (See FilingFrequencyId::* for a list of allowable values) - :param status [FilingStatusId] The status of the return(s) you are trying to retrieve (See FilingStatusId::* for a list of allowable values) - :param country [string] The country of the return(s) you are trying to retrieve - :param region [string] The region of the return(s) you are trying to retrieve - :param filingCalendarId [int] The filing calendar id of the return you are trying to retrieve - :return FetchResult + :param companyId [int] The ID of the company that owns this location + :param id_ [int] The primary key of this location + :param include [string] A comma separated list of additional data to retrieve. You may specify `LocationSettings` to retrieve location settings. + :return LocationModel """ - def get_filings_returns(self, companyId, include=None): - return requests.get('{}/api/v2/companies/{}/filings/returns'.format(self.base_url, companyId), + def get_location(self, companyId, id_, include=None): + return requests.get('{}/api/v2/companies/{}/locations/{}'.format(self.base_url, companyId, id_), auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a list of filings for the specified company in the year and month of a given filing period. + Retrieve locations for this company - This API is available by invitation only. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. + 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](http://developer.avalara.com/avatax/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 ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - :param companyId [int] The ID of the company that owns the filings. - :param year [int] The year of the filing period. - :param month [int] The two digit month of the filing period. - :param country [string] The two-character ISO-3166 code for the country. - :param region [string] The two or three character region code for the region. - :param formCode [string] The unique code of the form. + :param companyId [int] The ID of the company that owns these locations + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* settings + :param include [string] A comma separated list of additional data to retrieve. You may specify `LocationSettings` to retrieve location settings. + :param top [int] 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. + :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. :return FetchResult """ - def get_tax_filings(self, companyId, include=None): - return requests.get('{}/api/v2/companies/{}/filings'.format(self.base_url, companyId), + def list_locations_by_company(self, companyId, include=None): + return requests.get('{}/api/v2/companies/{}/locations'.format(self.base_url, companyId), auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Rebuild a set of filings for the specified company in the given filing period. + Retrieve all locations - This API is available by invitation only. - Rebuilding a return means re-creating or updating the amounts to be filed (worksheet) for a filing. - Rebuilding has to be done whenever a customer adds transactions to a filing. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. - This API requires filing to be unapproved. + 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](http://developer.avalara.com/avatax/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 ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - :param companyId [int] The ID of the company that owns the filings. - :param year [int] The year of the filing period to be rebuilt. - :param month [int] The month of the filing period to be rebuilt. - :param model [RebuildFilingsModel] The rebuild request you wish to execute. + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* settings + :param include [string] A comma separated list of additional data to retrieve. You may specify `LocationSettings` to retrieve location settings. + :param top [int] 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. + :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. + :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. :return FetchResult """ - def rebuild_filings(self, companyId, year, month, model): - return requests.post('{}/api/v2/companies/{}/filings/{}/{}/rebuild'.format(self.base_url, companyId, year, month), - auth=self.auth, headers=self.client_header, json=model, + def query_locations(self, include=None): + return requests.get('{}/api/v2/locations'.format(self.base_url), + auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Rebuild a set of filings for the specified company in the given filing period and country. + Update a single location - This API is available by invitation only. - Rebuilding a return means re-creating or updating the amounts to be filed (worksheet) for a filing. - Rebuilding has to be done whenever a customer adds transactions to a filing. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. - This API requires filing to be unapproved. + 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, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - :param companyId [int] The ID of the company that owns the filings. - :param year [int] The year of the filing period to be rebuilt. - :param month [int] The month of the filing period to be rebuilt. - :param country [string] The two-character ISO-3166 code for the country. - :param model [RebuildFilingsModel] The rebuild request you wish to execute. - :return FetchResult + :param companyId [int] The ID of the company that this location belongs to. + :param id_ [int] The ID of the location you wish to update + :param model [LocationModel] The location you wish to update. + :return LocationModel """ - def rebuild_filings_by_country(self, companyId, year, month, country, model): - return requests.post('{}/api/v2/companies/{}/filings/{}/{}/{}/rebuild'.format(self.base_url, companyId, year, month, country), + def update_location(self, companyId, id_, model): + return requests.put('{}/api/v2/companies/{}/locations/{}'.format(self.base_url, companyId, id_), auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Rebuild a set of filings for the specified company in the given filing period, country and region. + Validate the location against local requirements - This API is available by invitation only.audit.CheckAuthorizationReturns(null, companyId); - Rebuilding a return means re-creating or updating the amounts to be filed for a filing. - Rebuilding has to be done whenever a customer adds transactions to a filing. - A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing, - based on filing frequency of filing. - This API requires filing to be unapproved. + 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, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - :param companyId [int] The ID of the company that owns the filings. - :param year [int] The year of the filing period to be rebuilt. - :param month [int] The month of the filing period to be rebuilt. - :param country [string] The two-character ISO-3166 code for the country. - :param region [string] The two or three character region code for the region. - :param model [RebuildFilingsModel] The rebuild request you wish to execute. - :return FetchResult + :param companyId [int] The ID of the company that owns this location + :param id_ [int] The primary key of this location + :return LocationValidationModel """ - def rebuild_filings_by_country_region(self, companyId, year, month, country, region, model): - return requests.post('{}/api/v2/companies/{}/filings/{}/{}/{}/{}/rebuild'.format(self.base_url, companyId, year, month, country, region), - auth=self.auth, headers=self.client_header, json=model, + def validate_location(self, companyId, id_): + return requests.get('{}/api/v2/companies/{}/locations/{}/validate'.format(self.base_url, companyId, id_), + auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Edit an adjustment for a given filing. + Adjust a MultiDocument transaction - This API is available by invitation only. - An "Adjustment" is usually an increase or decrease to customer funding to Avalara, - such as early filer discount amounts that are refunded to the customer, or efile fees from websites. - Sometimes may be a manual change in tax liability similar to an augmentation. - This API modifies an adjustment for an existing tax filing. - This API can only be used when the filing has not yet been approved. + Adjusts the current MultiDocument transaction uniquely identified by this URL. + A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + sales, purchases, inventory transfer, and returns (also called refunds). + When you adjust a transaction, that transaction's status is recorded as `Adjusted`. + Both the revisions will be available for retrieval based on their code and ID numbers. Only transactions in Committed status can be reported on a tax filing by Avalara's Managed Returns Service. + Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered locked and are no longer available for adjustments. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. + * This API depends on the following active services
*Required* (all): AvaTaxPro. - :param companyId [int] The ID of the company that owns the filing being adjusted. - :param id_ [int] The ID of the adjustment being edited. - :param model [FilingAdjustmentModel] The updated Adjustment. - :return FilingAdjustmentModel + :param code [string] The transaction code for this MultiDocument transaction + :param type [DocumentType] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values) + :param include [string] Specifies objects to include in this fetch call + :param model [AdjustMultiDocumentModel] The adjust request you wish to execute + :return MultiDocumentModel """ - def update_return_adjustment(self, companyId, id_, model): - return requests.put('{}/api/v2/companies/{}/filings/adjust/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, json=model, + def adjust_multi_document_transaction(self, code, type, model, include=None): + return requests.post('{}/api/v2/transactions/multidocument/{}/type/{}/adjust'.format(self.base_url, code, type), + auth=self.auth, headers=self.client_header, params=include, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Edit an augmentation for a given filing. + Get audit information about a MultiDocument transaction - This API is available by invitation only. - An "Augmentation" is a manually added increase or decrease in tax liability, by either customer or Avalara - usually due to customer wanting to report tax Avatax does not support, e.g. bad debts, rental tax. - This API modifies an augmentation for an existing tax filing. - This API can only be used when the filing has not been approved. + Retrieve audit information about a MultiDocument transaction stored in AvaTax. + The audit API retrieves audit information related to a specific MultiDocument transaction. This audit + information includes the following: + * The `code` of the MultiDocument transaction + * The `type` of the MultiDocument transaction + * The server timestamp representing the exact server time when the transaction was created + * The server duration - how long it took to process this transaction + * Whether exact API call details were logged + * A reconstructed API call showing what the original create call looked like + A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + sales, purchases, inventory transfer, and returns (also called refunds). ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. + * This API depends on the following active services
*Required* (all): AvaTaxPro. - :param companyId [int] The ID of the company that owns the filing being changed. - :param id_ [int] The ID of the augmentation being edited. - :param model [FilingAugmentationModel] The updated Augmentation. - :return FilingModel + :param code [string] The transaction code for this MultiDocument transaction + :param type [DocumentType] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values) + :return AuditMultiDocumentModel """ - def update_return_augmentation(self, companyId, id_, model): - return requests.put('{}/api/v2/companies/{}/filings/augment/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, json=model, + def audit_multi_document_transaction(self, code, type): + return requests.get('{}/api/v2/transactions/multidocument/{}/type/{}/audit'.format(self.base_url, code, type), + auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Edit an payment for a given filing. + Commit a MultiDocument transaction - This API is available by invitation only. - An "Payment" is usually an increase or decrease to customer funding to Avalara, - such as early filer discount amounts that are refunded to the customer, or efile fees from websites. - Sometimes may be a manual change in tax liability similar to an augmentation. - This API modifies an payment for an existing tax filing. - This API can only be used when the filing has not yet been approved. + Marks a list of transactions by changing its status to `Committed`. + Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns. + A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + sales, purchases, inventory transfer, and returns (also called refunds). + Any changes made to a committed transaction will generate a transaction history. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, ComplianceAdmin, CSPTester, FirmUser, SSTAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin. + * This API depends on the following active services
*Required* (all): AvaTaxPro. - :param companyId [int] The ID of the company that owns the filing being adjusted. - :param id_ [int] The ID of the payment being edited. - :param model [FilingPaymentModel] The updated Payment. - :return FilingPaymentModel + :param model [CommitMultiDocumentModel] The commit request you wish to execute + :return MultiDocumentModel """ - def update_return_payment(self, companyId, id_, model): - return requests.put('{}/api/v2/companies/{}/filings/payment/{}'.format(self.base_url, companyId, id_), + def commit_multi_document_transaction(self, model): + return requests.post('{}/api/v2/transactions/multidocument/commit'.format(self.base_url), auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Approves linkage to a firm for a client account + Create a new MultiDocument transaction - This API enables the account admin of a client account to approve linkage request by a firm. + Records a new MultiDocument transaction in AvaTax. + A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + document. This separation of documents allows each seller to file their taxes separately. + This API will report an error if you attempt to create a transaction when one already exists with the specified `code`. + If you would like the API to automatically update the transaction when it already exists, please set the `allowAdjust` + value to `true`. + To generate a refund for a transaction, use the `RefundTransaction` API. + The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify + a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded. + The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please + provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode + information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated + using the best available address location information. + 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: + * Lines + * Details (implies lines) + * Summary (implies details) + * Addresses + * SummaryOnly (omit lines and details - reduces API response size) + * LinesOnly (omit details - reduces API response size) + * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection. + If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. + * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. + * This API depends on the following active services
*Required* (all): AvaTaxPro. - :param id_ [int] - :return FirmClientLinkageOutputModel + :param include [string] Specifies objects to include in the response after transaction is created + :param model [CreateMultiDocumentModel] the multi document transaction model + :return MultiDocumentModel """ - def approve_firm_client_linkage(self, id_): - return requests.post('{}/api/v2/firmclientlinkages/{}/approve'.format(self.base_url, id_), - auth=self.auth, headers=self.client_header, params=None, + def create_multi_document_transaction(self, model, include=None): + return requests.post('{}/api/v2/transactions/multidocument'.format(self.base_url), + auth=self.auth, headers=self.client_header, params=include, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Request a new FirmClient account and create an approved linkage to it + Retrieve a MultiDocument transaction - This API is for use by Firms only. - Avalara allows firms to manage returns for clients without the clients needing to use AvaTax service. - Firms can create accounts of FirmClient for customers they are managing using this API. - Calling this API creates an account with the specified product subscriptions, but without a new user for account. - Account is then linked to the Firm so they can managed their returns. - You should call this API when a customer does not have an AvaTax account and is to be managed only by the firm. - The created account will be created in `Active` status but there will be no user or license key associated with account. + Get the current MultiDocument transaction identified by this URL. + If this transaction was adjusted, the return value of this API will be the current transaction with this code. + 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: + * Lines + * Details (implies lines) + * Summary (implies details) + * Addresses + * SummaryOnly (omit lines and details - reduces API response size) + * LinesOnly (omit details - reduces API response size) ### Security Policies - * This API requires one of the following user roles: FirmAdmin, Registrar, SiteAdmin, SystemAdmin. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. + * This API depends on the following active services
*Required* (all): AvaTaxPro. - :param model [NewFirmClientAccountRequestModel] Information about the account you wish to create. - :return FirmClientLinkageOutputModel + :param code [string] + :param type [DocumentType] (See DocumentType::* for a list of allowable values) + :param include [string] Specifies objects to include in the response after transaction is created + :return MultiDocumentModel """ - def create_and_link_new_firm_client_account(self, model): - return requests.post('{}/api/v2/firmclientlinkages/createandlinkclient'.format(self.base_url), - auth=self.auth, headers=self.client_header, json=model, + def get_multi_document_transaction_by_code_and_type(self, code, type, include=None): + return requests.get('{}/api/v2/transactions/multidocument/{}/type/{}'.format(self.base_url, code, type), + auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Links a firm account with the client account - - This API enables the firm admins/firm users to request the linkage of a firm account and a client account. - ### Security Policies - * This API requires one of the following user roles: FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - - :param model [FirmClientLinkageInputModel] FirmClientLinkageInputModel - :return FirmClientLinkageOutputModel - """ - def create_firm_client_linkage(self, model): - return requests.post('{}/api/v2/firmclientlinkages'.format(self.base_url), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Delete a linkage - - This API marks a linkage between a firm and client as deleted. - ### Security Policies - * This API requires one of the following user roles: FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - - :param id_ [int] - :return ErrorDetail - """ - def delete_firm_client_linkage(self, id_): - return requests.delete('{}/api/v2/firmclientlinkages/{}'.format(self.base_url, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Get linkage between a firm and client by id - - This API enables the firm admins/firm users to request the linkage of a firm account and a client account. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - - :param id_ [int] - :return FirmClientLinkageOutputModel - """ - def get_firm_client_linkage(self, id_): - return requests.get('{}/api/v2/firmclientlinkages/{}'.format(self.base_url, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - List client linkages for a firm or client - - This API enables the firm or account users to request the associated linkages to the account. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* firmAccountName, clientAccountName - :return FetchResult - """ - def list_firm_client_linkage(self, include=None): - return requests.get('{}/api/v2/firmclientlinkages'.format(self.base_url), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Rejects linkage to a firm for a client account - - This API enables the account admin of a client account to reject linkage request by a firm. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - - :param id_ [int] - :return FirmClientLinkageOutputModel - """ - def reject_firm_client_linkage(self, id_): - return requests.post('{}/api/v2/firmclientlinkages/{}/reject'.format(self.base_url, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Reset linkage status between a client and firm back to requested - - This API enables the firm admin of a client account to reset a previously created linkage request by a firm. - ### Security Policies - * This API requires one of the following user roles: FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - - :param id_ [int] - :return FirmClientLinkageOutputModel - """ - def reset_firm_client_linkage(self, id_): - return requests.post('{}/api/v2/firmclientlinkages/{}/reset'.format(self.base_url, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Revokes previously approved linkage to a firm for a client account - - This API enables the account admin of a client account to revoke a previously approved linkage request by a firm. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - - :param id_ [int] - :return FirmClientLinkageOutputModel - """ - def revoke_firm_client_linkage(self, id_): - return requests.post('{}/api/v2/firmclientlinkages/{}/revoke'.format(self.base_url, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - FREE API - Request a free trial of AvaTax - - Call this API to obtain a free AvaTax account. - This API is free to use. No authentication credentials are required to call this API. You must read and - accept [Avalara's terms and conditions](https://www1.avalara.com/us/en/legal/terms.html) for the account to be - created. - If all conditions are met, this API will grant a free trial version of AvaTax. For a list of functionality - available in the free trial and its limitations, please see the [AvaTax Developer Website Free Trial page](https://developer.avalara.com/avatax/signup/). - After your free trial concludes, you will still be able to use the [Free AvaTax API Suite](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Free/). - ### Security Policies - * This API may be called without providing authentication credentials. - - :param model [FreeTrialRequestModel] Required information to provision a free trial account. - :return NewAccountModel - """ - def request_free_trial(self, model): - return requests.post('{}/api/v2/accounts/freetrials/request'.format(self.base_url), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - FREE API - Sales tax rates for a specified address - - # Free-To-Use - The TaxRates API is a free-to-use, no cost option for estimating sales tax rates. - Any customer can request a free AvaTax account and make use of the TaxRates API. - Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP - response code 429 - `Too Many Requests`. - This API assumes that you are selling general tangible personal property at a retail point-of-sale - location in the United States only. - For more powerful tax calculation, please consider upgrading to the `CreateTransaction` API, - which supports features including, but not limited to: - * Nexus declarations - * Taxability based on product/service type - * Sourcing rules affecting origin/destination states - * Customers who are exempt from certain taxes - * States that have dollar value thresholds for tax amounts - * Refunds for products purchased on a different date - * Detailed jurisdiction names and state assigned codes - * And more! - Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/) - for information on how to upgrade to the full AvaTax CreateTransaction API. - - :param line1 [string] The street address of the location. - :param line2 [string] The street address of the location. - :param line3 [string] The street address of the location. - :param city [string] The city name of the location. - :param region [string] Name or ISO 3166 code identifying the region within the country. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`. - :param postalCode [string] The postal code of the location. - :param country [string] Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. - :return TaxRateModel - """ - def tax_rates_by_address(self, include=None): - return requests.get('{}/api/v2/taxrates/byaddress'.format(self.base_url), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - FREE API - Sales tax rates for a specified country and postal code. This API is only available for US postal codes. - - # Free-To-Use - This API is only available for a US postal codes. - The TaxRates API is a free-to-use, no cost option for estimating sales tax rates. - Any customer can request a free AvaTax account and make use of the TaxRates API. - Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP - response code 429 - `Too Many Requests`. - This API assumes that you are selling general tangible personal property at a retail point-of-sale - location in the United States only. - For more powerful tax calculation, please consider upgrading to the `CreateTransaction` API, - which supports features including, but not limited to: - * Nexus declarations - * Taxability based on product/service type - * Sourcing rules affecting origin/destination states - * Customers who are exempt from certain taxes - * States that have dollar value thresholds for tax amounts - * Refunds for products purchased on a different date - * Detailed jurisdiction names and state assigned codes - * And more! - Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/) - for information on how to upgrade to the full AvaTax CreateTransaction API. - - :param country [string] Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`. - :param postalCode [string] The postal code of the location. - :return TaxRateModel - """ - def tax_rates_by_postal_code(self, include=None): - return requests.get('{}/api/v2/taxrates/bypostalcode'.format(self.base_url), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Request the javascript for a funding setup widget - - This API is available by invitation only. - Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are - required to setup their funding configuration before Avalara can begin filing tax returns on their - behalf. - Funding configuration for each company is set up by submitting a funding setup request, which can - be sent either via email or via an embedded HTML widget. - When the funding configuration is submitted to Avalara, it will be reviewed by treasury team members - before approval. - This API returns back the actual javascript code to insert into your application to render the - JavaScript funding setup widget inline. - Use the 'methodReturn.javaScript' return value to insert this widget into your HTML page. - This API requires a subscription to Avalara Managed Returns or SST Certified Service Provider. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param id_ [int] The unique ID number of this funding request - :return FundingStatusModel - """ - def activate_funding_request(self, id_): - return requests.get('{}/api/v2/fundingrequests/{}/widget'.format(self.base_url, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Retrieve status about a funding setup request - - This API is available by invitation only. - Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are - required to setup their funding configuration before Avalara can begin filing tax returns on their - behalf. - Funding configuration for each company is set up by submitting a funding setup request, which can - be sent either via email or via an embedded HTML widget. - When the funding configuration is submitted to Avalara, it will be reviewed by treasury team members - before approval. - This API checks the status on an existing funding request. - This API requires a subscription to Avalara Managed Returns or SST Certified Service Provider. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param id_ [int] The unique ID number of this funding request - :return FundingStatusModel - """ - def funding_request_status(self, id_): - return requests.get('{}/api/v2/fundingrequests/{}'.format(self.base_url, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that owns this item. - :param itemId [int] The ID of the item you wish to delete the classifications. - :return ErrorDetail - """ - def batch_delete_item_classifications(self, companyId, itemId): - return requests.delete('{}/api/v2/companies/{}/items/{}/classifications'.format(self.base_url, companyId, itemId), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that owns this item. - :param itemId [int] The ID of the item you wish to delete the parameters. - :return ErrorDetail - """ - def batch_delete_item_parameters(self, companyId, itemId): - return requests.delete('{}/api/v2/companies/{}/items/{}/parameters'.format(self.base_url, companyId, itemId), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The company id. - :param itemId [int] The item id. - :param model [ItemClassificationInputModel] The item classifications you wish to create. - :return ItemClassificationOutputModel - """ - def create_item_classifications(self, companyId, itemId, model): - return requests.post('{}/api/v2/companies/{}/items/{}/classifications'.format(self.base_url, companyId, itemId), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that owns this item parameter. - :param itemId [int] The item id. - :param model [ItemParameterModel] The item parameters you wish to create. - :return ItemParameterModel - """ - def create_item_parameters(self, companyId, itemId, model): - return requests.post('{}/api/v2/companies/{}/items/{}/parameters'.format(self.base_url, companyId, itemId), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that owns this item. - :param model [ItemModel] The item you wish to create. - :return ItemModel - """ - def create_items(self, companyId, model): - return requests.post('{}/api/v2/companies/{}/items'.format(self.base_url, companyId), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that owns this item. - :param id_ [int] The ID of the item you wish to delete. - :return ErrorDetail - """ - def delete_item(self, companyId, id_): - return requests.delete('{}/api/v2/companies/{}/items/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The company id. - :param itemId [int] The item id. - :param id_ [int] The item classification id. - :return ErrorDetail - """ - def delete_item_classification(self, companyId, itemId, id_): - return requests.delete('{}/api/v2/companies/{}/items/{}/classifications/{}'.format(self.base_url, companyId, itemId, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The company id - :param itemId [int] The item id - :param id_ [int] The parameter id - :return ErrorDetail - """ - def delete_item_parameter(self, companyId, itemId, id_): - return requests.delete('{}/api/v2/companies/{}/items/{}/parameters/{}'.format(self.base_url, companyId, itemId, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that owns this item object - :param id_ [int] The primary key of this item - :param include [string] A comma separated list of additional data to retrieve. - :return ItemModel - """ - def get_item(self, companyId, id_, include=None): - return requests.get('{}/api/v2/companies/{}/items/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The company id. - :param itemId [int] The item id. - :param id_ [int] The item classification id. - :return ItemClassificationOutputModel - """ - def get_item_classification(self, companyId, itemId, id_): - return requests.get('{}/api/v2/companies/{}/items/{}/classifications/{}'.format(self.base_url, companyId, itemId, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The company id - :param itemId [int] The item id - :param id_ [int] The parameter id - :return ItemParameterModel - """ - def get_item_parameter(self, companyId, itemId, id_): - return requests.get('{}/api/v2/companies/{}/items/{}/parameters/{}'.format(self.base_url, companyId, itemId, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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](http://developer.avalara.com/avatax/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, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The company id. - :param itemId [int] The item id. - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* productCode, systemCode - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :return FetchResult - """ - def list_item_classifications(self, companyId, itemId, include=None): - return requests.get('{}/api/v2/companies/{}/items/{}/classifications'.format(self.base_url, companyId, itemId), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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](http://developer.avalara.com/avatax/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, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The company id - :param itemId [int] The item id - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* name, unit - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :return FetchResult - """ - def list_item_parameters(self, companyId, itemId, include=None): - return requests.get('{}/api/v2/companies/{}/items/{}/parameters'.format(self.base_url, companyId, itemId), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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](http://developer.avalara.com/avatax/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 - * Classifications - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that defined these items - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* taxCode, classifications, parameters - :param include [string] A comma separated list of additional data to retrieve. - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :return FetchResult - """ - def list_items_by_company(self, companyId, include=None): - return requests.get('{}/api/v2/companies/{}/items'.format(self.base_url, companyId), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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](http://developer.avalara.com/avatax/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, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* taxCode, classifications, parameters - :param include [string] A comma separated list of additional data to retrieve. - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :return FetchResult - """ - def query_items(self, include=None): - return requests.get('{}/api/v2/items'.format(self.base_url), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that owns this item. - :param model [SyncItemsRequestModel] The request object. - :return SyncItemsResponseModel - """ - def sync_items(self, companyId, model): - return requests.post('{}/api/v2/companies/{}/items/sync'.format(self.base_url, companyId), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that this item belongs to. - :param id_ [int] The ID of the item you wish to update - :param model [ItemModel] The item object you wish to update. - :return ItemModel - """ - def update_item(self, companyId, id_, model): - return requests.put('{}/api/v2/companies/{}/items/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The company id. - :param itemId [int] The item id. - :param id_ [int] The item classification id. - :param model [ItemClassificationInputModel] The item object you wish to update. - :return ItemClassificationOutputModel - """ - def update_item_classification(self, companyId, itemId, id_, model): - return requests.put('{}/api/v2/companies/{}/items/{}/classifications/{}'.format(self.base_url, companyId, itemId, id_), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The company id. - :param itemId [int] The item id - :param id_ [int] The item parameter id - :param model [ItemParameterModel] The item object you wish to update. - :return ItemParameterModel - """ - def update_item_parameter(self, companyId, itemId, id_, model): - return requests.put('{}/api/v2/companies/{}/items/{}/parameters/{}'.format(self.base_url, companyId, itemId, id_), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Create one or more overrides - - Creates one or more jurisdiction override objects for this account. - A Jurisdiction Override is a configuration setting that allows you to select the taxing - jurisdiction for a specific address. If you encounter an address that is on the boundary - between two different jurisdictions, you can choose to set up a jurisdiction override - to switch this address to use different taxing jurisdictions. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param accountId [int] The ID of the account that owns this override - :param model [JurisdictionOverrideModel] The jurisdiction override objects to create - :return JurisdictionOverrideModel - """ - def create_jurisdiction_overrides(self, accountId, model): - return requests.post('{}/api/v2/accounts/{}/jurisdictionoverrides'.format(self.base_url, accountId), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Delete a single override - - Marks the item object at this URL as deleted. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param accountId [int] The ID of the account that owns this override - :param id_ [int] The ID of the override you wish to delete - :return ErrorDetail - """ - def delete_jurisdiction_override(self, accountId, id_): - return requests.delete('{}/api/v2/accounts/{}/jurisdictionoverrides/{}'.format(self.base_url, accountId, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Retrieve a single override - - Get the item object identified by this URL. - A Jurisdiction Override is a configuration setting that allows you to select the taxing - jurisdiction for a specific address. If you encounter an address that is on the boundary - between two different jurisdictions, you can choose to set up a jurisdiction override - to switch this address to use different taxing jurisdictions. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - - :param accountId [int] The ID of the account that owns this override - :param id_ [int] The primary key of this override - :return JurisdictionOverrideModel - """ - def get_jurisdiction_override(self, accountId, id_): - return requests.get('{}/api/v2/accounts/{}/jurisdictionoverrides/{}'.format(self.base_url, accountId, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Retrieve overrides for this account - - List all jurisdiction override objects defined for this account. - A Jurisdiction Override is a configuration setting that allows you to select the taxing - jurisdiction for a specific address. If you encounter an address that is on the boundary - between two different jurisdictions, you can choose to set up a jurisdiction override - to switch this address to use different taxing jurisdictions. - Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/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, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - - :param accountId [int] The ID of the account that owns this override - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* country, Jurisdictions - :param include [string] A comma separated list of additional data to retrieve. - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :return FetchResult - """ - def list_jurisdiction_overrides_by_account(self, accountId, include=None): - return requests.get('{}/api/v2/accounts/{}/jurisdictionoverrides'.format(self.base_url, accountId), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Retrieve all overrides - - Get multiple jurisdiction override objects across all companies. - A Jurisdiction Override is a configuration setting that allows you to select the taxing - jurisdiction for a specific address. If you encounter an address that is on the boundary - between two different jurisdictions, you can choose to set up a jurisdiction override - to switch this address to use different taxing jurisdictions. - Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/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, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* country, Jurisdictions - :param include [string] A comma separated list of additional data to retrieve. - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :return FetchResult - """ - def query_jurisdiction_overrides(self, include=None): - return requests.get('{}/api/v2/jurisdictionoverrides'.format(self.base_url), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Update a single jurisdictionoverride - - Replace the existing jurisdictionoverride object at this URL with an updated object. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param accountId [int] The ID of the account that this jurisdictionoverride belongs to. - :param id_ [int] The ID of the jurisdictionoverride you wish to update - :param model [JurisdictionOverrideModel] The jurisdictionoverride object you wish to update. - :return JurisdictionOverrideModel - """ - def update_jurisdiction_override(self, accountId, id_, model): - return requests.put('{}/api/v2/accounts/{}/jurisdictionoverrides/{}'.format(self.base_url, accountId, id_), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that owns this location. - :param model [LocationModel] The location you wish to create. - :return LocationModel - """ - def create_locations(self, companyId, model): - return requests.post('{}/api/v2/companies/{}/locations'.format(self.base_url, companyId), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that owns this location. - :param id_ [int] The ID of the location you wish to delete. - :return ErrorDetail - """ - def delete_location(self, companyId, id_): - return requests.delete('{}/api/v2/companies/{}/locations/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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 - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - - :param companyId [int] The ID of the company that owns this location - :param id_ [int] The primary key of this location - :param include [string] A comma separated list of additional data to retrieve. You may specify `LocationSettings` to retrieve location settings. - :return LocationModel - """ - def get_location(self, companyId, id_, include=None): - return requests.get('{}/api/v2/companies/{}/locations/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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](http://developer.avalara.com/avatax/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 - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - - :param companyId [int] The ID of the company that owns these locations - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* settings - :param include [string] A comma separated list of additional data to retrieve. You may specify `LocationSettings` to retrieve location settings. - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :return FetchResult - """ - def list_locations_by_company(self, companyId, include=None): - return requests.get('{}/api/v2/companies/{}/locations'.format(self.base_url, companyId), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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](http://developer.avalara.com/avatax/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 - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* settings - :param include [string] A comma separated list of additional data to retrieve. You may specify `LocationSettings` to retrieve location settings. - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :return FetchResult - """ - def query_locations(self, include=None): - return requests.get('{}/api/v2/locations'.format(self.base_url), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that this location belongs to. - :param id_ [int] The ID of the location you wish to update - :param model [LocationModel] The location you wish to update. - :return LocationModel - """ - def update_location(self, companyId, id_, model): - return requests.put('{}/api/v2/companies/{}/locations/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - - :param companyId [int] The ID of the company that owns this location - :param id_ [int] The primary key of this location - :return LocationValidationModel - """ - def validate_location(self, companyId, id_): - return requests.get('{}/api/v2/companies/{}/locations/{}/validate'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Adjust a MultiDocument transaction - - Adjusts the current MultiDocument transaction uniquely identified by this URL. - A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like - sales, purchases, inventory transfer, and returns (also called refunds). - When you adjust a transaction, that transaction's status is recorded as `Adjusted`. - Both the revisions will be available for retrieval based on their code and ID numbers. Only transactions in Committed status can be reported on a tax filing by Avalara's Managed Returns Service. - Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered locked and are no longer available for adjustments. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Required* (all): AvaTaxPro. - - :param code [string] The transaction code for this MultiDocument transaction - :param type [DocumentType] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values) - :param include [string] Specifies objects to include in this fetch call - :param model [AdjustMultiDocumentModel] The adjust request you wish to execute - :return MultiDocumentModel - """ - def adjust_multi_document_transaction(self, code, type, model, include=None): - return requests.post('{}/api/v2/transactions/multidocument/{}/type/{}/adjust'.format(self.base_url, code, type), - auth=self.auth, headers=self.client_header, params=include, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Get audit information about a MultiDocument transaction - - Retrieve audit information about a MultiDocument transaction stored in AvaTax. - The audit API retrieves audit information related to a specific MultiDocument transaction. This audit - information includes the following: - * The `code` of the MultiDocument transaction - * The `type` of the MultiDocument transaction - * The server timestamp representing the exact server time when the transaction was created - * The server duration - how long it took to process this transaction - * Whether exact API call details were logged - * A reconstructed API call showing what the original create call looked like - A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like - sales, purchases, inventory transfer, and returns (also called refunds). - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Required* (all): AvaTaxPro. - - :param code [string] The transaction code for this MultiDocument transaction - :param type [DocumentType] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values) - :return AuditMultiDocumentModel - """ - def audit_multi_document_transaction(self, code, type): - return requests.get('{}/api/v2/transactions/multidocument/{}/type/{}/audit'.format(self.base_url, code, type), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Commit a MultiDocument transaction - - Marks a list of transactions by changing its status to `Committed`. - Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns. - A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like - sales, purchases, inventory transfer, and returns (also called refunds). - Any changes made to a committed transaction will generate a transaction history. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Required* (all): AvaTaxPro. - - :param model [CommitMultiDocumentModel] The commit request you wish to execute - :return MultiDocumentModel - """ - def commit_multi_document_transaction(self, model): - return requests.post('{}/api/v2/transactions/multidocument/commit'.format(self.base_url), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Create a new MultiDocument transaction - - Records a new MultiDocument transaction in AvaTax. - A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can - involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within - a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate - document. This separation of documents allows each seller to file their taxes separately. - This API will report an error if you attempt to create a transaction when one already exists with the specified `code`. - If you would like the API to automatically update the transaction when it already exists, please set the `allowAdjust` - value to `true`. - To generate a refund for a transaction, use the `RefundTransaction` API. - The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify - a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded. - The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please - provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode - information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated - using the best available address location information. - 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: - * Lines - * Details (implies lines) - * Summary (implies details) - * Addresses - * SummaryOnly (omit lines and details - reduces API response size) - * LinesOnly (omit details - reduces API response size) - * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection. - If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Required* (all): AvaTaxPro. - - :param include [string] Specifies objects to include in the response after transaction is created - :param model [CreateMultiDocumentModel] the multi document transaction model - :return MultiDocumentModel - """ - def create_multi_document_transaction(self, model, include=None): - return requests.post('{}/api/v2/transactions/multidocument'.format(self.base_url), - auth=self.auth, headers=self.client_header, params=include, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Retrieve a MultiDocument transaction - - Get the current MultiDocument transaction identified by this URL. - If this transaction was adjusted, the return value of this API will be the current transaction with this code. - 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: - * Lines - * Details (implies lines) - * Summary (implies details) - * Addresses - * SummaryOnly (omit lines and details - reduces API response size) - * LinesOnly (omit details - reduces API response size) - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Required* (all): AvaTaxPro. - - :param code [string] - :param type [DocumentType] (See DocumentType::* for a list of allowable values) - :param include [string] Specifies objects to include in the response after transaction is created - :return MultiDocumentModel - """ - def get_multi_document_transaction_by_code_and_type(self, code, type, include=None): - return requests.get('{}/api/v2/transactions/multidocument/{}/type/{}'.format(self.base_url, code, type), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Retrieve a MultiDocument transaction by ID - - Get the unique MultiDocument transaction identified by this URL. - A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can - involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within - a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate - document. This separation of documents allows each seller to file their taxes separately. - This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted - by using the `AdjustTransaction` endpoint. - A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like - sales, purchases, inventory transfer, and returns (also called refunds). - 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: - * Lines - * Details (implies lines) - * Summary (implies details) - * Addresses - * SummaryOnly (omit lines and details - reduces API response size) - * LinesOnly (omit details - reduces API response size) - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Required* (all): AvaTaxPro. - - :param id_ [int] The unique ID number of the MultiDocument transaction to retrieve - :param include [string] Specifies objects to include in the response after transaction is created - :return MultiDocumentModel - """ - def get_multi_document_transaction_by_id(self, id_, include=None): - return requests.get('{}/api/v2/transactions/multidocument/{}'.format(self.base_url, id_), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Retrieve all MultiDocument transactions - - List all MultiDocument transactions within this account. - This endpoint is limited to returning 1,000 MultiDocument transactions at a time. To retrieve more than 1,000 MultiDocument - transactions, please use the pagination features of the API. - A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like - sales, purchases, inventory transfer, and returns (also called refunds). - Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/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: - * Lines - * Details (implies lines) - * Summary (implies details) - * Addresses - * SummaryOnly (omit lines and details - reduces API response size) - * LinesOnly (omit details - reduces API response size) - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Required* (all): AvaTaxPro. - - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* documents - :param include [string] Specifies objects to include in the response after transaction is created - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :return FetchResult - """ - def list_multi_document_transactions(self, include=None): - return requests.get('{}/api/v2/transactions/multidocument'.format(self.base_url), - auth=self.auth, headers=self.client_header, params=include, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Create a refund for a MultiDocument transaction - - Create a refund for a MultiDocument transaction. - A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can - involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within - a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate - document. This separation of documents allows each seller to file their taxes separately. - The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund - for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and - specify individual line items from the original sale for refund. - The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that - was calculated during the original transaction, regardless of any changes to your company's configuration, rules, - nexus, or any other setting. - This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following - common refund scenarios: - * A full refund of a previous sale - * Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase - * Refunding one or more items (lines) from a previous sale - * Granting a customer a percentage refund of a previous sale - For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to - create a custom refund transaction. - 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: - * Lines - * Details (implies lines) - * Summary (implies details) - * Addresses - * SummaryOnly (omit lines and details - reduces API response size) - * LinesOnly (omit details - reduces API response size) - If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Required* (all): AvaTaxPro. - - :param code [string] The code of this MultiDocument transaction - :param type [DocumentType] The type of this MultiDocument transaction (See DocumentType::* for a list of allowable values) - :param include [string] Specifies objects to include in the response after transaction is created - :param model [RefundTransactionModel] Information about the refund to create - :return MultiDocumentModel - """ - def refund_multi_document_transaction(self, code, type, model, include=None): - return requests.post('{}/api/v2/transactions/multidocument/{}/type/{}/refund'.format(self.base_url, code, type), - auth=self.auth, headers=self.client_header, params=include, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Verify a MultiDocument transaction - - Verifies that the MultiDocument transaction uniquely identified by this URL matches certain expected values. - If the transaction does not match these expected values, this API will return an error code indicating which value did not match. - A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like - sales, purchases, inventory transfer, and returns (also called refunds). - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - * This API depends on the following active services
*Required* (all): AvaTaxPro. - - :param model [VerifyMultiDocumentModel] Information from your accounting system to verify against this MultiDocument transaction as it is stored in AvaTax - :return MultiDocumentModel - """ - def verify_multi_document_transaction(self, model): - return requests.post('{}/api/v2/transactions/multidocument/verify'.format(self.base_url), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Void a MultiDocument transaction - - Voids the current transaction uniquely identified by this URL. - A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like - sales, purchases, inventory transfer, and returns (also called refunds). - When you void a transaction, that transaction's status is recorded as `DocVoided`. - Transactions that have been previously reported to a tax authority by Avalara Managed Returns Service are considered `locked`, - and they are no longer available to be voided. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin. - * This API depends on the following active services
*Required* (all): AvaTaxPro. - - :param code [string] The transaction code for this MultiDocument transaction - :param type [DocumentType] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values) - :param model [VoidTransactionModel] The void request you wish to execute - :return MultiDocumentModel - """ - def void_multi_document_transaction(self, code, type, model): - return requests.post('{}/api/v2/transactions/multidocument/{}/type/{}/void'.format(self.base_url, code, type), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that owns this nexus. - :param model [NexusModel] The nexus you wish to create. - :return NexusModel - """ - def create_nexus(self, companyId, model): - return requests.post('{}/api/v2/companies/{}/nexus'.format(self.base_url, companyId), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that will own this nexus. - :param model [DeclareNexusByAddressModel] The nexus you wish to create. - :return NexusByAddressModel - """ - def declare_nexus_by_address(self, companyId, model): - return requests.post('{}/api/v2/companies/{}/nexus/byaddress'.format(self.base_url, companyId), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that owns this nexus. - :param id_ [int] The ID of the nexus you wish to delete. - :return ErrorDetail - """ - def delete_nexus(self, companyId, id_): - return requests.delete('{}/api/v2/companies/{}/nexus/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that owns this nexus object - :param id_ [int] The primary key of this nexus - :return NexusModel - """ - def get_nexus(self, companyId, id_): - return requests.get('{}/api/v2/companies/{}/nexus/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - 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. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that owns this nexus object - :param formCode [string] The form code that we are looking up the nexus for - :return NexusByTaxFormModel - """ - def get_nexus_by_form_code(self, companyId, formCode): - return requests.get('{}/api/v2/companies/{}/nexus/byform/{}'.format(self.base_url, companyId, formCode), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Retrieve nexus for this company + Retrieve a MultiDocument transaction by ID - 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](http://developer.avalara.com/avatax/filtering-in-rest/) . - Paginate your results using the `$top`, `$skip`, and `$orderby` parameters. + Get the unique MultiDocument transaction identified by this URL. + A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + document. This separation of documents allows each seller to file their taxes separately. + This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted + by using the `AdjustTransaction` endpoint. + A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + sales, purchases, inventory transfer, and returns (also called refunds). + 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: + * Lines + * Details (implies lines) + * Summary (implies details) + * Addresses + * SummaryOnly (omit lines and details - reduces API response size) + * LinesOnly (omit details - reduces API response size) ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. + * This API depends on the following active services
*Required* (all): AvaTaxPro. - :param companyId [int] The ID of the company that owns these nexus objects - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId - :param include [string] A comma separated list of additional data to retrieve. - :param top [int] 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. - :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - :return FetchResult + :param id_ [int] The unique ID number of the MultiDocument transaction to retrieve + :param include [string] Specifies objects to include in the response after transaction is created + :return MultiDocumentModel """ - def list_nexus_by_company(self, companyId, include=None): - return requests.get('{}/api/v2/companies/{}/nexus'.format(self.base_url, companyId), + def get_multi_document_transaction_by_id(self, id_, include=None): + return requests.get('{}/api/v2/transactions/multidocument/{}'.format(self.base_url, id_), auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve all nexus + Retrieve all MultiDocument transactions - 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. + List all MultiDocument transactions within this account. + This endpoint is limited to returning 1,000 MultiDocument transactions at a time. To retrieve more than 1,000 MultiDocument + transactions, please use the pagination features of the API. + A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + sales, purchases, inventory transfer, and returns (also called refunds). Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/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: + * Lines + * Details (implies lines) + * Summary (implies details) + * Addresses + * SummaryOnly (omit lines and details - reduces API response size) + * LinesOnly (omit details - reduces API response size) ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. + * This API depends on the following active services
*Required* (all): AvaTaxPro. - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId - :param include [string] A comma separated list of additional data to retrieve. + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* documents + :param include [string] Specifies objects to include in the response after transaction is created :param top [int] 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. :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. :return FetchResult """ - def query_nexus(self, include=None): - return requests.get('{}/api/v2/nexus'.format(self.base_url), + def list_multi_document_transactions(self, include=None): + return requests.get('{}/api/v2/transactions/multidocument'.format(self.base_url), auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - 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, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - - :param companyId [int] The ID of the company that this nexus belongs to. - :param id_ [int] The ID of the nexus you wish to update - :param model [NexusModel] The nexus object you wish to update. - :return NexusModel - """ - def update_nexus(self, companyId, id_, model): - return requests.put('{}/api/v2/companies/{}/nexus/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Create a new notice comment. - - This API is available by invitation only. - 'Notice comments' are updates by the notice team on the work to be done and that has been done so far on a notice. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that owns this notice. - :param id_ [int] The ID of the tax notice we are adding the comment for. - :param model [NoticeCommentModel] The notice comments you wish to create. - :return NoticeCommentModel - """ - def create_notice_comment(self, companyId, id_, model): - return requests.post('{}/api/v2/companies/{}/notices/{}/comments'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Create a new notice finance details. - - This API is available by invitation only. - 'Notice finance details' is the categorical breakdown of the total charge levied by the tax authority on our customer, - as broken down in our "notice log" found in Workflow. Main examples of the categories are 'Tax Due', 'Interest', 'Penalty', 'Total Abated'. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that owns this notice. - :param id_ [int] The ID of the notice added to the finance details. - :param model [NoticeFinanceModel] The notice finance details you wish to create. - :return NoticeFinanceModel - """ - def create_notice_finance_details(self, companyId, id_, model): - return requests.post('{}/api/v2/companies/{}/notices/{}/financedetails'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Create a new notice responsibility. - - This API is available by invitation only. - 'Notice comments' are updates by the notice team on the work to be done and that has been done so far on a notice. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that owns this notice. - :param id_ [int] The ID of the tax notice we are adding the responsibility for. - :param model [NoticeResponsibilityDetailModel] The notice responsibilities you wish to create. - :return NoticeResponsibilityDetailModel - """ - def create_notice_responsibilities(self, companyId, id_, model): - return requests.post('{}/api/v2/companies/{}/notices/{}/responsibilities'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Create a new notice root cause. - - This API is available by invitation only. - 'Notice root causes' are are those who are responsible for the notice. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that owns this notice. - :param id_ [int] The ID of the tax notice we are adding the responsibility for. - :param model [NoticeRootCauseDetailModel] The notice root causes you wish to create. - :return NoticeRootCauseDetailModel - """ - def create_notice_root_causes(self, companyId, id_, model): - return requests.post('{}/api/v2/companies/{}/notices/{}/rootcauses'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Create a new notice. - - This API is available by invitation only. - Create one or more new notice objects. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that owns this notice. - :param model [NoticeModel] The notice object you wish to create. - :return NoticeModel - """ - def create_notices(self, companyId, model): - return requests.post('{}/api/v2/companies/{}/notices'.format(self.base_url, companyId), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Delete a single notice. - - This API is available by invitation only. - 'Notice comments' are updates by the notice team on the work to be done and that has been done so far on a notice. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that owns this notice. - :param id_ [int] The ID of the notice you wish to delete the finance detail from. - :param commentDetailsId [int] The ID of the comment you wish to delete. - :return ErrorDetail - """ - def delete_comment_details(self, companyId, id_, commentDetailsId): - return requests.delete('{}/api/v2/companies/{}/notices/{}/commentdetails/{}'.format(self.base_url, companyId, id_, commentDetailsId), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Delete a single notice. - - This API is available by invitation only. - 'Notice finance details' is the categorical breakdown of the total charge levied by the tax authority on our customer, - as broken down in our "notice log" found in Workflow. Main examples of the categories are 'Tax Due', 'Interest', 'Penalty', 'Total Abated'. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that owns this notice. - :param id_ [int] The ID of the notice you wish to delete the finance detail from. - :param financeDetailsId [int] The ID of the finance detail you wish to delete. - :return ErrorDetail - """ - def delete_finance_details(self, companyId, id_, financeDetailsId): - return requests.delete('{}/api/v2/companies/{}/notices/{}/financedetails/{}'.format(self.base_url, companyId, id_, financeDetailsId), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Delete a single notice. - - This API is available by invitation only. - Mark the existing notice object at this URL as deleted. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that owns this notice. - :param id_ [int] The ID of the notice you wish to delete. - :return ErrorDetail - """ - def delete_notice(self, companyId, id_): - return requests.delete('{}/api/v2/companies/{}/notices/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=None, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Delete a single responsibility + Create a refund for a MultiDocument transaction - This API is available by invitation only. - Mark the existing notice object at this URL as deleted. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. + Create a refund for a MultiDocument transaction. + A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can + involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within + a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate + document. This separation of documents allows each seller to file their taxes separately. + The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund + for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and + specify individual line items from the original sale for refund. + The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that + was calculated during the original transaction, regardless of any changes to your company's configuration, rules, + nexus, or any other setting. + This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following + common refund scenarios: + * A full refund of a previous sale + * Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase + * Refunding one or more items (lines) from a previous sale + * Granting a customer a percentage refund of a previous sale + For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to + create a custom refund transaction. + 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: + * Lines + * Details (implies lines) + * Summary (implies details) + * Addresses + * SummaryOnly (omit lines and details - reduces API response size) + * LinesOnly (omit details - reduces API response size) + If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. + * This API depends on the following active services
*Required* (all): AvaTaxPro. - :param companyId [int] The ID of the company that owns this notice. - :param noticeId [int] The ID of the notice you wish to delete. - :param id_ [int] The ID of the responsibility you wish to delete. - :return ErrorDetail + :param code [string] The code of this MultiDocument transaction + :param type [DocumentType] The type of this MultiDocument transaction (See DocumentType::* for a list of allowable values) + :param include [string] Specifies objects to include in the response after transaction is created + :param model [RefundTransactionModel] Information about the refund to create + :return MultiDocumentModel """ - def delete_responsibilities(self, companyId, noticeId, id_): - return requests.delete('{}/api/v2/companies/{}/notices/{}/responsibilities/{}'.format(self.base_url, companyId, noticeId, id_), - auth=self.auth, headers=self.client_header, params=None, + def refund_multi_document_transaction(self, code, type, model, include=None): + return requests.post('{}/api/v2/transactions/multidocument/{}/type/{}/refund'.format(self.base_url, code, type), + auth=self.auth, headers=self.client_header, params=include, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Delete a single root cause. + Verify a MultiDocument transaction - This API is available by invitation only. - Mark the existing notice object at this URL as deleted. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. + Verifies that the MultiDocument transaction uniquely identified by this URL matches certain expected values. + If the transaction does not match these expected values, this API will return an error code indicating which value did not match. + A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + sales, purchases, inventory transfer, and returns (also called refunds). ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. + * This API depends on the following active services
*Required* (all): AvaTaxPro. - :param companyId [int] The ID of the company that owns this notice. - :param noticeId [int] The ID of the notice you wish to delete. - :param id_ [int] The ID of the root cause you wish to delete. - :return ErrorDetail + :param model [VerifyMultiDocumentModel] Information from your accounting system to verify against this MultiDocument transaction as it is stored in AvaTax + :return MultiDocumentModel """ - def delete_root_causes(self, companyId, noticeId, id_): - return requests.delete('{}/api/v2/companies/{}/notices/{}/rootcauses/{}'.format(self.base_url, companyId, noticeId, id_), - auth=self.auth, headers=self.client_header, params=None, + def verify_multi_document_transaction(self, model): + return requests.post('{}/api/v2/transactions/multidocument/verify'.format(self.base_url), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a single attachment + Void a MultiDocument transaction - This API is available by invitation only. - Get the file attachment identified by this URL. + Voids the current transaction uniquely identified by this URL. + A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like + sales, purchases, inventory transfer, and returns (also called refunds). + When you void a transaction, that transaction's status is recorded as `DocVoided`. + Transactions that have been previously reported to a tax authority by Avalara Managed Returns Service are considered `locked`, + and they are no longer available to be voided. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin. + * This API depends on the following active services
*Required* (all): AvaTaxPro. - :param companyId [int] The ID of the company for this attachment. - :param id_ [int] The ResourceFileId of the attachment to download. - :return String + :param code [string] The transaction code for this MultiDocument transaction + :param type [DocumentType] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values) + :param model [VoidTransactionModel] The void request you wish to execute + :return MultiDocumentModel """ - def download_notice_attachment(self, companyId, id_): - return requests.get('{}/api/v2/companies/{}/notices/files/{}/attachment'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=None, + def void_multi_document_transaction(self, code, type, model): + return requests.post('{}/api/v2/transactions/multidocument/{}/type/{}/void'.format(self.base_url, code, type), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve a single notice. + Create a new nexus - This API is available by invitation only. - Get the tax notice object identified by this URL. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. + 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, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param companyId [int] The ID of the company for this notice. - :param id_ [int] The ID of this notice. - :return NoticeModel + :param companyId [int] The ID of the company that owns this nexus. + :param model [NexusModel] The nexus you wish to create. + :return NexusModel """ - def get_notice(self, companyId, id_): - return requests.get('{}/api/v2/companies/{}/notices/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, params=None, + def create_nexus(self, companyId, model): + return requests.post('{}/api/v2/companies/{}/nexus'.format(self.base_url, companyId), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve notice comments for a specific notice. + Creates nexus for a list of addresses. - This API is available by invitation only. - 'Notice comments' are updates by the notice team on the work to be done and that has been done so far on a notice. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. + 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, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param id_ [int] The ID of the notice. - :param companyId [int] The ID of the company that owns these notices. - :return FetchResult + :param companyId [int] The ID of the company that will own this nexus. + :param model [DeclareNexusByAddressModel] The nexus you wish to create. + :return NexusByAddressModel """ - def get_notice_comments(self, id_, companyId): - return requests.get('{}/api/v2/companies/{}/notices/{}/comments'.format(self.base_url, id_, companyId), - auth=self.auth, headers=self.client_header, params=None, + def declare_nexus_by_address(self, companyId, model): + return requests.post('{}/api/v2/companies/{}/nexus/byaddress'.format(self.base_url, companyId), + auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve notice finance details for a specific notice. + Delete a single nexus - This API is available by invitation only. - 'Notice finance details' is the categorical breakdown of the total charge levied by the tax authority on our customer, - as broken down in our "notice log" found in Workflow. Main examples of the categories are 'Tax Due', 'Interest', 'Penalty', 'Total Abated'. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. + 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, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param id_ [int] The ID of the company that owns these notices. - :param companyId [int] The ID of the company that owns these notices. - :return FetchResult + :param companyId [int] The ID of the company that owns this nexus. + :param id_ [int] The ID of the nexus you wish to delete. + :return ErrorDetail """ - def get_notice_finance_details(self, id_, companyId): - return requests.get('{}/api/v2/companies/{}/notices/{}/financedetails'.format(self.base_url, id_, companyId), + def delete_nexus(self, companyId, id_): + return requests.delete('{}/api/v2/companies/{}/nexus/{}'.format(self.base_url, companyId, id_), auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve notice responsibilities for a specific notice. + Retrieve a single nexus - This API is available by invitation only. - 'Notice responsibilities' are are those who are responsible for the notice. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. + 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. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param id_ [int] The ID of the notice. - :param companyId [int] The ID of the company that owns these notices. - :return FetchResult + :param companyId [int] The ID of the company that owns this nexus object + :param id_ [int] The primary key of this nexus + :return NexusModel """ - def get_notice_responsibilities(self, id_, companyId): - return requests.get('{}/api/v2/companies/{}/notices/{}/responsibilities'.format(self.base_url, id_, companyId), + def get_nexus(self, companyId, id_): + return requests.get('{}/api/v2/companies/{}/nexus/{}'.format(self.base_url, companyId, id_), auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve notice root causes for a specific notice. + List company nexus related to a tax form - This API is available by invitation only. - 'Notice root causes' are are those who are responsible for the notice. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. + 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. ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param id_ [int] The ID of the notice. - :param companyId [int] The ID of the company that owns these notices. - :return FetchResult + :param companyId [int] The ID of the company that owns this nexus object + :param formCode [string] The form code that we are looking up the nexus for + :return NexusByTaxFormModel """ - def get_notice_root_causes(self, id_, companyId): - return requests.get('{}/api/v2/companies/{}/notices/{}/rootcauses'.format(self.base_url, id_, companyId), + def get_nexus_by_form_code(self, companyId, formCode): + return requests.get('{}/api/v2/companies/{}/nexus/byform/{}'.format(self.base_url, companyId, formCode), auth=self.auth, headers=self.client_header, params=None, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve notices for a company. + Retrieve nexus for this company - This API is available by invitation only. - List all tax notice objects assigned to this company. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. + 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](http://developer.avalara.com/avatax/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, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param companyId [int] The ID of the company that owns these notices. - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* status, totalRemit, ticketReferenceNo, ticketReferenceUrl, reason, type, createdByUserName, documentReference, jurisdictionName, jurisdictionType, comments, finances, responsibility, rootCause + :param companyId [int] The ID of the company that owns these nexus objects + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId :param include [string] A comma separated list of additional data to retrieve. :param top [int] 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. :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. :return FetchResult """ - def list_notices_by_company(self, companyId, include=None): - return requests.get('{}/api/v2/companies/{}/notices'.format(self.base_url, companyId), + def list_nexus_by_company(self, companyId, include=None): + return requests.get('{}/api/v2/companies/{}/nexus'.format(self.base_url, companyId), auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve all notices. + Retrieve all nexus - This API is available by invitation only. - This API is deprecated - please use POST `/api/v2/notices/query` API. - Get multiple notice objects across all companies. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. + 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](http://developer.avalara.com/avatax/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, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* status, totalRemit, ticketReferenceNo, ticketReferenceUrl, reason, type, createdByUserName, documentReference, jurisdictionName, jurisdictionType, comments, finances, responsibility, rootCause + :param filter [string] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId :param include [string] A comma separated list of additional data to retrieve. :param top [int] 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. :param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. :param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. :return FetchResult """ - def query_notices(self, include=None): - return requests.get('{}/api/v2/notices'.format(self.base_url), + def query_nexus(self, include=None): + return requests.get('{}/api/v2/nexus'.format(self.base_url), auth=self.auth, headers=self.client_header, params=include, timeout=self.timeout_limit if self.timeout_limit else 10) r""" - Retrieve all notices. - - This API is available by invitation only. - This API is intended to replace the GET `/api/v2/notices` API. The fetch request object is posted on the body of the request instead of the URI, so it's not limited by a set number of characters. - The documentation of the GET API shows how filtering, sorting and pagination works. - ### Security Policies - * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param model [QueryRequestModel] Query object to filter, sort and paginate the filing calendars. - :return FetchResult - """ - def query_notices_post(self, model): - return requests.post('{}/api/v2/notices/query'.format(self.base_url), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Update a single notice finance detail. - - This API is available by invitation only. - 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, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that this notice finance detail belongs to. - :param noticeid [int] The ID of the notice finance detail you wish to update. - :param financeDetailsId [int] The ID of the finance detail you wish to delete. - :param model [NoticeFinanceModel] The notice finance detail object you wish to update. - :return NoticeFinanceModel - """ - def update_finance_details(self, companyId, noticeid, financeDetailsId, model): - return requests.put('{}/api/v2/companies/{}/notices/{}/financedetails/{}'.format(self.base_url, companyId, noticeid, financeDetailsId), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Update a single notice. - - This API is available by invitation only. - Replace the existing notice object at this URL with an updated object. - A 'notice' represents a letter sent to a business by a tax authority regarding tax filing issues. Avalara - Returns customers often receive support and assistance from the Compliance Notices team in handling notices received by taxing authorities. - 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, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that this notice belongs to. - :param id_ [int] The ID of the notice you wish to update. - :param model [NoticeModel] The notice object you wish to update. - :return NoticeModel - """ - def update_notice(self, companyId, id_, model): - return requests.put('{}/api/v2/companies/{}/notices/{}'.format(self.base_url, companyId, id_), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Update a single notice comment. - - This API is available by invitation only. - 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, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. - - :param companyId [int] The ID of the company that this notice comment belongs to. - :param noticeid [int] The ID of the notice you wish to update. - :param commentDetailsId [int] The ID of the comment you wish to update. - :param model [NoticeCommentModel] The notice comment object you wish to update. - :return NoticeCommentModel - """ - def update_notice_comments(self, companyId, noticeid, commentDetailsId, model): - return requests.put('{}/api/v2/companies/{}/notices/{}/commentdetails/{}'.format(self.base_url, companyId, noticeid, commentDetailsId), - auth=self.auth, headers=self.client_header, json=model, - timeout=self.timeout_limit if self.timeout_limit else 10) - - r""" - Retrieve a single attachment + Update a single nexus - This API is available by invitation only. - Uploads a file attachment for a tax notice. + 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, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Operator, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. - * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. - * This API is available by invitation only.
*Exempt security roles*: ComplianceRootUser, ComplianceAdmin, ComplianceUser, TechnicalSupportAdmin, TechnicalSupportUser. + * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin. - :param companyId [int] The ID of the company for this attachment. - :param model [ResourceFileUploadRequestModel] The upload request. - :return ResourceFileUploadResultModel + :param companyId [int] The ID of the company that this nexus belongs to. + :param id_ [int] The ID of the nexus you wish to update + :param model [NexusModel] The nexus object you wish to update. + :return NexusModel """ - def upload_attachment(self, companyId, model): - return requests.post('{}/api/v2/companies/{}/notices/files/attachment'.format(self.base_url, companyId), + def update_nexus(self, companyId, id_, model): + return requests.put('{}/api/v2/companies/{}/nexus/{}'.format(self.base_url, companyId, id_), auth=self.auth, headers=self.client_header, json=model, timeout=self.timeout_limit if self.timeout_limit else 10) @@ -7134,7 +5525,7 @@ def build_tax_content_file_for_location(self, companyId, id_, include=None): * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser. :param date [datetime] The date for which point-of-sale data would be calculated (today by default). Example input: 2016-12-31 - :param region [string] If the region is provided, this API is going to generate the tax rate per zipcode for only the region specified. + :param region [string] A two character region code which limits results to a specific region. :return String """ def download_tax_rates_by_zip_code(self, date, include=None): @@ -7355,6 +5746,10 @@ def add_lines(self, model, include=None): * SummaryOnly (omit lines and details - reduces API response size) * LinesOnly (omit details - reduces API response size) * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary. + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. * This API depends on the following active services
*Required* (all): AvaTaxPro. @@ -7385,6 +5780,10 @@ def adjust_transaction(self, companyCode, transactionCode, model, include=None): This API can be used to examine information about a previously created transaction. A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like sales, purchases, inventory transfer, and returns (also called refunds). + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. * This API depends on the following active services
*Required* (all): AvaTaxPro. @@ -7412,6 +5811,10 @@ def audit_transaction(self, companyCode, transactionCode): This API can be used to examine information about a previously created transaction. A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like sales, purchases, inventory transfer, and returns (also called refunds). + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. * This API depends on the following active services
*Required* (all): AvaTaxPro. @@ -7465,6 +5868,10 @@ def bulk_lock_transaction(self, model): * SummaryOnly (omit lines and details - reduces API response size) * LinesOnly (omit details - reduces API response size) * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary. + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin. * This API depends on the following active services
*Required* (all): AvaTaxPro, AvaTaxST. @@ -7498,6 +5905,10 @@ def change_transaction_code(self, companyCode, transactionCode, model, include=N * SummaryOnly (omit lines and details - reduces API response size) * LinesOnly (omit details - reduces API response size) * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary. + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin. @@ -7537,6 +5948,10 @@ def commit_transaction(self, companyCode, transactionCode, model, include=None): * LinesOnly (omit details - reduces API response size) * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection. If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`. + NOTE: Avoid using the following strings in your transaction codes as they are encoding strings and will be interpreted differently: + * \_-ava2f-\_ + * \_-ava2b-\_ + * \_-ava3f-\_ ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. * This API depends on the following active services
*Required* (all): AvaTaxPro. @@ -7579,6 +5994,10 @@ def create_or_adjust_transaction(self, model, include=None): * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection. * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary. If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`. + NOTE: Avoid using the following strings in your transaction codes as they are encoding strings and will be interpreted differently: + * \_-ava2f-\_ + * \_-ava2b-\_ + * \_-ava3f-\_ ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. * This API depends on the following active services
*Required* (all): AvaTaxPro. @@ -7637,6 +6056,10 @@ def delete_lines(self, model, include=None): * Addresses * SummaryOnly (omit lines and details - reduces API response size) * LinesOnly (omit details - reduces API response size) + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. * This API depends on the following active services
*Required* (all): AvaTaxPro. @@ -7656,6 +6079,10 @@ def get_transaction_by_code(self, companyCode, transactionCode, include=None): Retrieve a single transaction by code DEPRECATED: Please use the `GetTransactionByCode` API instead. + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. * This API depends on the following active services
*Required* (all): AvaTaxPro. @@ -7718,6 +6145,10 @@ def get_transaction_by_id(self, id_, include=None): * Addresses * SummaryOnly (omit lines and details - reduces API response size) * LinesOnly (omit details - reduces API response size) + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. * This API depends on the following active services
*Required* (all): AvaTaxPro. @@ -7754,6 +6185,10 @@ def list_transactions_by_company(self, companyCode, include=None): * SummaryOnly (omit lines and details - reduces API response size) * LinesOnly (omit details - reduces API response size) * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary. + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. * This API depends on the following active services
*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.
*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged. @@ -7797,6 +6232,10 @@ def lock_transaction(self, companyCode, transactionCode, model, include=None): * LinesOnly (omit details - reduces API response size) * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary. If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`. + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. * This API depends on the following active services
*Required* (all): AvaTaxPro. @@ -7831,6 +6270,10 @@ def refund_transaction(self, companyCode, transactionCode, model, include=None): * SummaryOnly (omit lines and details - reduces API response size) * LinesOnly (omit details - reduces API response size) * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary. + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin. @@ -7860,13 +6303,17 @@ def settle_transaction(self, companyCode, transactionCode, model, include=None): * SummaryOnly (omit lines and details - reduces API response size) * LinesOnly (omit details - reduces API response size) * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary. + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. * This API depends on the following active services
*Required* (all): AvaTaxPro. :param companyCode [string] The company code of the company that recorded this transaction - :param transactionCode [string] The transaction code to commit - :param documentType [DocumentType] (Optional): The document type of the transaction to commit. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values) + :param transactionCode [string] The transaction code to Uncommit + :param documentType [DocumentType] (Optional): The document type of the transaction to Uncommit. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values) :param include [string] Specifies objects to include in this fetch call :return TransactionModel """ @@ -7887,6 +6334,10 @@ def uncommit_transaction(self, companyCode, transactionCode, include=None): * SummaryOnly (omit lines and details - reduces API response size) * LinesOnly (omit details - reduces API response size) * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary. + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. * This API depends on the following active services
*Required* (all): AvaTaxPro. @@ -7918,6 +6369,10 @@ def unvoid_transaction(self, companyCode, transactionCode, include=None): * SummaryOnly (omit lines and details - reduces API response size) * LinesOnly (omit details - reduces API response size) * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary. + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin. * This API depends on the following active services
*Required* (all): AvaTaxPro. @@ -7951,6 +6406,10 @@ def verify_transaction(self, companyCode, transactionCode, model, include=None): * SummaryOnly (omit lines and details - reduces API response size) * LinesOnly (omit details - reduces API response size) * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary. + NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request: + * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code + * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code + * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code ### Security Policies * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin. * This API depends on the following active services
*Required* (all): AvaTaxPro.