Module: AvaTax::Client::Reports
- Defined in:
- lib/avatax/client/reports.rb
Instance Method Summary collapse
-
#download_audit_log_report(id) ⇒ Object
Download an audit log report.
-
#download_report(id) ⇒ Object
Download a report.
-
#export_audit_logs(model) ⇒ ReportAuditLogResponseModel[]
Initiate an ExportAuditLogs report task.
-
#get_audit_log_report(id) ⇒ Object
Retrieve a single audit log report.
-
#get_report(id) ⇒ Object
Retrieve a single report.
-
#initiate_export_document_line_report(companyId, model) ⇒ ReportModel[]
Initiate an ExportDocumentLine report task.
-
#list_reports(options = {}) ⇒ FetchResult
List all report tasks for account.
Instance Method Details
#download_audit_log_report(id) ⇒ Object
Download an audit log report
This API downloads the file associated with an audit log report.
If the report is not yet complete, you will receive a ReportNotFinished error. To check if a report is complete,
use the GetAuditLogReport API.
Reports are run on the server. When complete, the report file will be available for download for up to 30 days after completion. To run a report, you should follow these steps:
-
Begin a report by calling the report's ExportAuditLogs API.
-
In the result of the ExportAuditLogs API, you receive back a report's
idvalue. -
Check the status of a report by calling
GetAuditLogReportand passing in the report'sidvalue. -
When a report's status is
Completed, callDownloadAuditLogReportto retrieve the file. -
We throttle this API. You can only call this API up to 5 times in a minute.
Security Policies
- This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, ReturnsOnlyAccountAdmin, ReturnsOnlyAccountUser, ReturnsOnlyCompanyAdmin, ReturnsOnlyCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient
29 30 |
# File 'lib/avatax/client/reports.rb', line 29 def download_audit_log_report(id) path = "/api/v2/reports/exportauditlogs/#{id}/attachment" get(path, {}, AvaTax::VERSION) end |
#download_report(id) ⇒ Object
Download a report
This API downloads the file associated with a report.
If the report is not yet complete, you will receive a ReportNotFinished error. To check if a report is complete,
use the GetReport API.
Reports are run as asynchronous report tasks on the server. When complete, the report file will be available for download for up to 30 days after completion. To run an asynchronous report, you should follow these steps:
-
Begin a report by calling the report's Initiate API. There is a separate initiate API call for each report type.
-
In the result of the Initiate API, you receive back a report's
idvalue. -
Check the status of a report by calling
GetReportand passing in the report'sidvalue. -
When a report's status is
Completed, callDownloadReportto retrieve the file. -
We throttle this API. You can only call this API up to 5 times in a minute.
Security Policies
- This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, ReturnsOnlyAccountAdmin, ReturnsOnlyAccountUser, ReturnsOnlyCompanyAdmin, ReturnsOnlyCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient
55 56 |
# File 'lib/avatax/client/reports.rb', line 55 def download_report(id) path = "/api/v2/reports/#{id}/attachment" get(path, {}, AvaTax::VERSION) end |
#export_audit_logs(model) ⇒ ReportAuditLogResponseModel[]
Initiate an ExportAuditLogs report task
Begins running an ExportAuditLogs report task and returns the identity of the report.
Reports are run on the server. When complete, the report file will be available for download for up to 30 days after completion. To run a report, you should follow these steps:
- Begin a report by calling the report's ExportAuditLogs API.
- In the result of the ExportAuditLogs API, you receive a report's
idvalue. - All reports with
InQueuestatus are picked up by the report service and processed in the background. - Reports that are picked up by the report service will have an
InProgressstatus. - Reports will be updated to
Completedstatus when the report is ready for download. - Check the status of a report by calling
GetAuditLogReportand passing in the report'sidvalue. - When a report's status is
Completed, callDownloadAuditLogReportto retrieve the file.
The ExportAuditLogs report produces information about audit records within your account.
The following reportType values are supported:
audit- Exports audit records for configuration changes. RequiresreportSubTypeto specify the table name.audittransactionlogs- Exports transaction audit logs.
When reportType is audit, the reportSubType field supports the following valid table names:
NEXUS, USER, COMPANY, ACCOUNT, COMPANYLOCATION, ACCOUNTSETTING, COMPANYLOCATIONSETTING,
COMPANYSETTING, TAXCODE, TAXRULE, ADDRESSSERVICECONFIG, AUDITADVANCEDRULE, COMPANYCONTACT,
COMPANYLOCATIONPARAMETERDETAIL, COMPANYLOCATIONSETTINGCONFIG, COMPANYPARAMETERDETAIL, COMPANYRETURN,
COMPANYRETURNSETTING, ITEM, SERVICE, EXEMPTCERT, AVACERTSERVICECONFIG, JURISDICTIONOVERRIDE, COSTCENTER.
Set compression to GZIP to reduce the size of the report file and increase download speed.
Security Policies
- This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, ReturnsOnlyAccountAdmin, ReturnsOnlyAccountUser, ReturnsOnlyCompanyAdmin, ReturnsOnlyCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient
93 94 |
# File 'lib/avatax/client/reports.rb', line 93 def export_audit_logs(model) path = "/api/v2/reports/exportauditlogs" post(path, model, {}, AvaTax::VERSION) end |
#get_audit_log_report(id) ⇒ Object
Retrieve a single audit log report
Retrieve a single audit log report by its unique ID number.
Reports are run on the server. When complete, the report file will be available for download for up to 30 days after completion. To run a report, you should follow these steps:
- Begin a report by calling the report's ExportAuditLogs API.
- In the result of the ExportAuditLogs API, you receive back a report's
idvalue. - Check the status of a report by calling
GetAuditLogReportand passing in the report'sidvalue. - When a report's status is
Completed, callDownloadAuditLogReportto retrieve the file.
This API call returns information about audit log report types.
Security Policies
- This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, ReturnsOnlyAccountAdmin, ReturnsOnlyAccountUser, ReturnsOnlyCompanyAdmin, ReturnsOnlyCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient
116 117 |
# File 'lib/avatax/client/reports.rb', line 116 def get_audit_log_report(id) path = "/api/v2/reports/exportauditlogs/#{id}" get(path, {}, AvaTax::VERSION) end |
#get_report(id) ⇒ Object
Retrieve a single report
Retrieve a single report by its unique ID number.
Reports are run as asynchronous report tasks on the server. When complete, the report file will be available for download for up to 30 days after completion. To run an asynchronous report, you should follow these steps:
- Begin a report by calling the report's Initiate API. There is a separate initiate API call for each report type.
- In the result of the Initiate API, you receive back a report's
idvalue. - Check the status of a report by calling
GetReportand passing in the report'sidvalue. - When a report's status is
Completed, callDownloadReportto retrieve the file.
This API call returns information about any report type. Swagger Name: AvaTaxClient
135 136 |
# File 'lib/avatax/client/reports.rb', line 135 def get_report(id) path = "/api/v2/reports/#{id}" get(path, {}, AvaTax::VERSION) end |
#initiate_export_document_line_report(companyId, model) ⇒ ReportModel[]
Initiate an ExportDocumentLine report task
Begins running an ExportDocumentLine report task and returns the identity of the report.
Reports are run as asynchronous report tasks on the server. When complete, the report file will be available for download for up to 30 days after completion. To run an asynchronous report, you should follow these steps:
- Begin a report by calling the report's Initiate API.
- In the result of the Initiate API, you receive back a report's
idvalue. - All reports with
InQueuestatus are picked up by the report service and processed in the background. - Reports that are picked up by the report service will have an
InProgressstatus. - Reports will be updated to
Completedstatus when the report is ready for download. - Check the status of a report by calling
GetReportand passing in the report'sidvalue. - When a report's status is
Completed, callDownloadReportto retrieve the file.
The ExportDocumentLine report produces information about invoice lines recorded within your account.
Set compression to GZIP to reduce the size of the report file and increase download speed.
The currently supported reports are: Document, Document Summary, Document Line, Document Line Detail, Multitax Line Detail, Liability, Tax Region, AP Document, AP Document Detail, and Document Line Detail All Taxes.
Security Policies
- This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, ReturnsOnlyAccountAdmin, ReturnsOnlyCompanyAdmin, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient
166 167 |
# File 'lib/avatax/client/reports.rb', line 166 def initiate_export_document_line_report(companyId, model) path = "/api/v2/companies/#{companyId}/reports/exportdocumentline/initiate" post(path, model, {}, AvaTax::VERSION) end |
#list_reports(options = {}) ⇒ FetchResult
List all report tasks for account
List all report tasks for your account.
Reports are run as asynchronous report tasks on the server. When complete, the report file will be available for download for up to 30 days after completion. To run an asynchronous report, you should follow these steps:
- Begin a report by calling the report's Initiate API. There is a separate initiate API call for each report type.
- In the result of the Initiate API, you receive back a report's
idvalue. - Check the status of a report by calling
GetReportand passing in the report'sidvalue. - When a report's status is
Completed, callDownloadReportto retrieve the file.
This API call returns information about all report types across your entire account.
Audit-log report types (audit, audittransactionlogs) are not included in this list; retrieve those via the
GetAuditLogReport / DownloadAuditLogReport APIs.
Pagination note: when the response includes a non-null pageKey (next link), more results may exist and the
caller should follow it, even if the current page returned fewer than the requested number of records. This can
happen when a $filter is applied, because matches are evaluated server-side across backend pages.
Security Policies
- This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, ReturnsOnlyAccountAdmin, ReturnsOnlyAccountUser, ReturnsOnlyCompanyAdmin, ReturnsOnlyCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. Swagger Name: AvaTaxClient
200 201 |
# File 'lib/avatax/client/reports.rb', line 200 def list_reports(={}) path = "/api/v2/reports" get(path, , AvaTax::VERSION) end |