# Avalara Tax Content - Job and Data Management Service

Use this API to start/cancel ATC job runs. You can also use your runId to check job status, get available downloads and download the files.

Source: https://developer.avalara.com/products/avalara-tax-content/api/

**Version:** v1
**Base URL:** https://rest.avatax.com/api/v2/content/jobs

---

## Endpoints

### Downloads

#### Get a list of paths for downloadable files for a specific run.

`GET /v1/companies/{company}/Runs/{runId}/downloads`

If you have a `company` and an `runId`, you can use this api to get a list of all files that are available for that run.

For example if you get this in the response

{"tte": { "full": "/tte", "delta": "/tte-delta" }} 

you can add the path 
* GET /v1/companies/{company}/Runs/{runId}/downloads/tte -> downloads the full TTE file.
* GET /v1/companies/{company}/Runs/{runId}/downloads/tte-delta -> downloads the delta TTE file.

 You can also use the ATC Jobs api to get a list of recent run ids and their statuses.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `company` | integer | path | Yes | Company ID. |
| `runId` | string | path | Yes | Run ID. |

#### Download file in specified output format.

`GET /v1/companies/{company}/Runs/{runId}/downloads/{path}`

Valid values for path:
            
* `dtt`
* `dtt-delta`
* `tte`
* `tte/*`
* `tte-delta`
* `tte-delta/*`
* `tte-lodging/array`
* `tte-lodging/array/*`
* `tte-lodging-delta/array`
* `tte-lodging-delta/array/*`
* `tte-lodging-udfds`
* `aptos/*`

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `company` | integer | path | Yes | Company ID. |
| `runId` | string | path | Yes | Run ID. |
| `path` | string | path | Yes | Download path provided in the response of /downloads endpoint. |


### Runs

#### List the status of all Transaction Tax Extract pipeline runs or for a single run.

`GET /v1/companies/{companyId}/Runs`

This endpoint implements a subset of OData-style filtering. For general `$filter` syntax (e.g. `eq`, string literals), see
            [Filtering in AvaTax REST](https://developer.avalara.com/avatax/filtering-in-rest/) on Avalara Developer.
            The generated OpenAPI document also includes an external documentation link for the same page.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | integer | path | Yes | Company ID for which to get runs. |
| `jobId` | string | query | No | Job ID for which to get runs. |
| `limit` | integer | query | No | Integer specifying the maximum number of results to retrieve. |
| `nextToken` | string | query | No | URI encoded continuation token from a previous request. |
| `productType` | string | query | No | accepted values ["default","lodging","autorental","atcm", "special"], default is retail. |
| `$filter` | string | query | No | see https://developer.avalara.com/avatax/filtering-in-rest/, currently a subset is supported. (use 'and', use contains for name and eq for started,status fields) |
| `includeDownloads` | boolean | query | No | Include download information in the response. Default is false. |

#### Create a new Transaction Tax Extract (TTE) pipeline job.

`POST /v1/companies/{companyId}/Runs`

Creates a new Transaction Tax Extract pipeline job for a company. Jobs are the way that Avalara Tax Content for Retail delivers tax content to your point of sale system. 
You tell the API how to combine your settings (TTE, notification option, and delivery option), and then run the job when you are ready to receive the tax content.
            
Create a job by entering a unique name and specifying job settings. You can then run the job immediately, or save it
to be run at a later time. If a job is already running, you'll only have the option to save.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | integer | path | Yes | ID of the company to run this job for. Required. |

#### Get the status of a specific Transaction Tax Extract pipeline run based on its Run ID. Note that statuses are not available for run jobs that are queued or still running.

`GET /v1/companies/{companyId}/Runs/{runId}`

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | integer | path | Yes | The Company ID for this run. |
| `runId` | string | path | Yes | The Run ID of the job run that you want to retrieve. |
| `includeDownloads` | boolean | query | No | Include download information in the response. Default is false. |

#### Cancel an in-progress Transaction Tax Extract pipeline run.

`DELETE /v1/companies/{companyId}/Runs/{runId}`

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `runId` | string | path | Yes | Run ID to cancel. |
| `companyId` | integer | path | Yes | Company ID for which to stop run. Required. |

#### Create a new Transaction Tax Extract pipeline run that compares deltas between two past runs.

`POST /v1/companies/{companyId}/Runs/delta`

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | integer | path | Yes | Company ID for this run. |

---

## Models

### Avalara.POS.API.Common.Controllers.Models.ErrorResponse

| Property | Type | Description |
|---|---|---|
| `referenceId` | string |  |
| `error` | object |  |

### Avalara.POS.API.Common.Models.AtcAptos

| Property | Type | Description |
|---|---|---|
| `components` | array |  |

### Avalara.POS.API.Common.Models.Downloads

| Property | Type | Description |
|---|---|---|
| `dtt` | Avalara.POS.API.Common.Models.Dtt |  |
| `tte` | Avalara.POS.API.Common.Models.Tte |  |
| `atcAptos` | Avalara.POS.API.Common.Models.AtcAptos |  |
| `tteLodging` | Avalara.POS.API.Common.Models.TteLodging |  |
| `tteAutoRental` | Avalara.POS.API.Common.Models.TteAutoRental |  |
| `tteSpecial` | Avalara.POS.API.Common.Models.TteSpecial |  |
| `dttMulti` | Avalara.POS.API.Common.Models.DttMulti |  |

### Avalara.POS.API.Common.Models.Dtt

| Property | Type | Description |
|---|---|---|
| `full` | string |  |
| `delta` | string |  |

### Avalara.POS.API.Common.Models.DttMulti

| Property | Type | Description |
|---|---|---|
| `components` | object |  |

### Avalara.POS.API.Common.Models.Tte

| Property | Type | Description |
|---|---|---|
| `full` | string |  |
| `delta` | string |  |
| `fullComponents` | array |  |
| `deltaComponents` | array |  |

### Avalara.POS.API.Common.Models.TteAtcseDelta

| Property | Type | Description |
|---|---|---|
| `data` | string |  |
| `arrayComponents` | array |  |

### Avalara.POS.API.Common.Models.TteAtcseFull

| Property | Type | Description |
|---|---|---|
| `data` | string |  |
| `arrayComponents` | array |  |

### Avalara.POS.API.Common.Models.TteAutoRental

| Property | Type | Description |
|---|---|---|
| `full` | Avalara.POS.API.Common.Models.TteAtcseFull |  |
| `delta` | Avalara.POS.API.Common.Models.TteAtcseDelta |  |
| `authority` | string |  |

### Avalara.POS.API.Common.Models.TteLodging

| Property | Type | Description |
|---|---|---|
| `full` | Avalara.POS.API.Common.Models.TteLodgingFull |  |
| `customerData` | string |  |
| `authority` | string |  |
| `delta` | Avalara.POS.API.Common.Models.TteLodgingDelta |  |

### Avalara.POS.API.Common.Models.TteLodgingDelta

| Property | Type | Description |
|---|---|---|
| `array` | string |  |
| `arrayComponents` | array |  |

### Avalara.POS.API.Common.Models.TteLodgingFull

| Property | Type | Description |
|---|---|---|
| `array` | string |  |
| `arrayComponents` | array |  |
| `expandedComponents` | array |  |

### Avalara.POS.API.Common.Models.TteSpecial

| Property | Type | Description |
|---|---|---|
| `full` | Avalara.POS.API.Common.Models.TteAtcseFull |  |
| `delta` | Avalara.POS.API.Common.Models.TteAtcseDelta |  |
| `authority` | string |  |

### Avalara.POS.API.JMS.Controllers.RunQueryResponse

| Property | Type | Description |
|---|---|---|
| `records` | array | Query result records. |
| `recordCount` | integer | The number of records in this result set. |
| `nextToken` | string | Token for retrieving the next set of results, if any. |
| `nextLink` | string | URI to retrieve the next set of results, if any. |

### Avalara.POS.API.JMS.Models.DeliveryConfigurationDetails

| Property | Type | Description |
|---|---|---|
| `platform` | string | Export Platform Name.
            
Values: `TTE`, `Aptos`, `XStore`. |
| `destination` | string | Export destination. |
| `networkDetails` | object | Network details. |
| `notifyApiDelivery` | boolean | Notify API delivery. |

### Avalara.POS.API.JMS.Models.DeltaRunConfigModel

| Property | Type | Description |
|---|---|---|
| `name` | string | Specify a name for this pipeline run. |
| `base_run_id` | string | The run ID to compare against the `latest_run_id`. |
| `latest_run_id` | string | The latest run ID to compare against the `base_run_id`. |
| `companyId` | integer | Company ID. |
| `accountId` | integer | Account ID. |
| `jobType` | string | Specify the job type.

Values: `Production`, `Test` |
| `configurationName` | string | The configuration name for this pipeline run. |
| `jobId` | string | Specify an ID for this job. This ID can be used to retrieve a run for a specific job. |
| `execution_details` | Avalara.POS.API.JMS.Models.JobExecutionDetails |  |
| `output_type` | string | Specify the output type.

Values: 
- `Full`: Returns full runs for both the base and latest runs.
- `Differences only`: Returns the deltas between the base and latest runs. |
| `tteId` | string | Specify an ID for this TTE Job Configuration. |
| `communicationId` | string | Enter a communication ID for this run. |
| `dttId` | string | Specify an ID for the Data Transport Toolkit (DTT) for this job. |
| `productType` | string | productType used to differenciate between ATC products default(retail), lodging, managers. |
| `deliveryConfigurations` | Avalara.POS.API.JMS.Models.DeliveryConfigurationDetails |  |

### Avalara.POS.API.JMS.Models.JobExecutionDetails

Details describing how the run will be executed.

| Property | Type | Description |
|---|---|---|
| `executionsource` | string | Specify how the execution will run.

Values: `manual`, `scheduled`, `automatic`.
            
- `manual` runs the job when it is created.
- `scheduled` allows you to specify a time and date to run a job.
- `automatic` will run a job whenever new content is published. |
| `notes` | string | Gets or sets release notes. |
| `autoJobRunType` | string | Gets or sets autorunjob type. |
| `VersionName` | string | Gets or sets the release name
March-2023 |
| `ReleaseDate` | string | Gets or sets the actual release data
2023-03-06T10:22:19.431Z |

### Avalara.POS.API.JMS.Models.PrebuiltTemplate

| Property | Type | Description |
|---|---|---|
| `templateType` | string |  |
| `templateName` | string |  |
| `templateTypeLabel` | string |  |
| `internalTemplateName` | string |  |
| `templateTypeIsConfigurable` | boolean |  |

### Avalara.POS.API.JMS.Models.RunConfigModel

Represents a configuration for a new Content Extract Pipeline run.

| Property | Type | Description |
|---|---|---|
| `name` | string | Specify a name for this pipeline run. |
| `jobId` | string | Specify an ID for this job. This ID can be used to retrieve a run for a specific job. |
| `configurationName` | string | The configuration name for this pipeline run. |
| `execution_details` | Avalara.POS.API.JMS.Models.JobExecutionDetails |  |
| `configurations` | array | Run configurations for each company to extract data for.
            
Can either be in the form of a fully explicit run configuration
or a configuration ID representing an existing configuration.
networkDetails only needed in case of destination = exavault |
| `jobType` | string | Specify the job type.

Values: `Production`, `Test` |
| `output_type` | string | Specify the output type.

Values: `Full` for a full run or `Differences only` for changes.

- `Full`: Run a full job. This downloads the all of the associated tax content for use with your point of sale (POS) system.
- `Differences only`: Retrieve just the changes in a job. This creates a file that identifies the differences in tax content between two job runs. 
   You can compare the output between a new and a previous job run or between two previous job runs. Requires `base_run_id` to be set. |
| `base_run_id` | string | When running a `Differences only` job, specify the base run ID for the job you want to compare this to. |
| `productType` | string | productType used to differenciate between ATC products default(retail), lodging, managers. |
| `prebuiltTemplate` | Avalara.POS.API.JMS.Models.PrebuiltTemplate |  |

### Avalara.POS.API.JMS.Models.RunConfigModel+ConfigurationModel

| Property | Type | Description |
|---|---|---|
| `tteId` | string | TTE ID. |
| `tteType` | string | TTE Type. |
| `dttId` | string | Job ID. |
| `prebuiltId` | string | Specify an ID for this prebuiltsettings. This ID can be used to retrieve a prebuiltSettings. |
| `communicationId` | string | Communication ID. |
| `dateRange` | Avalara.POS.API.JMS.Models.RunConfigModel+DateRangeConfiguration |  |
| `deliveryConfigurations` | Avalara.POS.API.JMS.Models.DeliveryConfigurationDetails |  |
| `companyId` | integer | AvaTax Company ID. |
| `accountId` | integer | AvaTax Account ID. |

### Avalara.POS.API.JMS.Models.RunConfigModel+DateRangeConfiguration

| Property | Type | Description |
|---|---|---|
| `relativeStartDays` | integer | Date range start as a relative date.
            
For use only with RelativeEndDays. |
| `relativeEndDays` | integer | Date range end as a relative date.
            
For use only with RelativeStartDays. |

### Avalara.POS.API.JMS.Models.RunStatusModel

Metadata for a new Content Extract Pipeline run.

| Property | Type | Description |
|---|---|---|
| `name` | string | Title of the pipeline run. |
| `jobId` | string | ID for the combined TTE configuration, delivery method, and communication method. |
| `runId` | string | ID for the pipeline run. |
| `dttId` | string | ID for the DTT configuration |
| `status` | string | Status of the pipeline run.
            
Values are: `QUEUED`, `RUNNING`, `FAILURE`, `SUCCESS`. |
| `configurationName` | string | Configuration Name for the pipeline run. |
| `jobType` | string | Job type. |
| `platform` | string | Platform for the pipeline run. |
| `started` | string | When the pipeline run began. |
| `completed` | string | When the pipeline run finished. |
| `execution_details` | Avalara.POS.API.JMS.Models.JobExecutionDetails |  |
| `outputtype` | string | Output type for the pipeline run. |
| `tteType` | string | TTE type for the pipeline run, 'lodging' for lodging runs. |
| `baseRunId` | string | Base run ID. |
| `latestRunId` | string | Latest run ID. |
| `dttPreviewStatus` | string | DTT Preview status.
            
Values are: `enabled`, `disabled`, `warmup`. |
| `productType` | string | Product type for the pipeline run, 'lodging' for lodging runs. |
| `countryCodes` | array | Country codes from the TTE configuration. |
| `detailLevel` | string | Detail level from the TTE configuration. |
| `downloadInformation` | Avalara.POS.API.Common.Models.Downloads |  |

### Microsoft.AspNetCore.Mvc.ProblemDetails

| Property | Type | Description |
|---|---|---|
| `type` | string |  |
| `title` | string |  |
| `status` | integer |  |
| `detail` | string |  |
| `instance` | string |  |
