> This page is for APIs, version Calculations.
> For other versions, use one of these documentation indexes:
> - Overview (default): https://avalara.ferndocs.com/api-reference/overview/llms.txt
> - Calculations: https://avalara.ferndocs.com/api-reference/calculations/llms.txt
> - E-invoicing: https://avalara.ferndocs.com/api-reference/e-invoicing/llms.txt
> - Brazil: https://avalara.ferndocs.com/api-reference/brazil/llms.txt
> - Returns: https://avalara.ferndocs.com/api-reference/returns/llms.txt
> - Shared service: https://avalara.ferndocs.com/api-reference/shared-service/llms.txt
> - 1099 & W-9: https://avalara.ferndocs.com/api-reference/1099-w9/llms.txt
> - Tax registrations & business licenses: https://avalara.ferndocs.com/api-reference/tax-registrations/llms.txt
> - ECM: https://avalara.ferndocs.com/api-reference/ecm/llms.txt
> - Cross-Border: https://avalara.ferndocs.com/api-reference/cross-border/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://avalara.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://avalara.ferndocs.com/_mcp/server.

# Get Batch Tax Code Recommendations

GET https://rest.avatax.com/api/v2/companies/{companyId}/taxcode-recommendations/batches/{batchId}

> **Access control:** this endpoint is available to users with the `everyone` role.

Retrieves the status and results of a tax code recommendation batch for the specified company.
If the batch status is "Completed", the response includes the tax code recommendations for all items in the batch.
If the batch status is "Waiting", "Processing", or any other non-complete status, only the status information is returned.
Returns '404 Not Found' if the batch has been deleted or does not exist.
            
Batches are automatically deleted after 1 day.

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ReturnsOnlyAccountAdmin, ReturnsOnlyAccountUser, ReturnsOnlyCompanyAdmin, ReturnsOnlyCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.


Reference: https://avalara.ferndocs.com/api-reference/calculations/ava-tax/public-reference/get-batch-tax-code-recommendations

## Authentication

- `Authorization` header (required) — API Key authentication via header

## Request

### Path parameters

- `companyId` (integer, required) — The unique ID of the company.
- `batchId` (long, required) — The unique ID of the recommendation batch.

### Headers

- `X-Avalara-Client` (string, optional, default: Swagger UI; 26.7.0; Custom; 1.0) — Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) .

## Response

### 200

Success

- `batchId` (long, optional) — The unique ID of the batch.
- `batchStatus` (string, optional) — The current processing status of the batch. Possible values: "Pending", "Processing", "Completed", "Failed", "Deleted"
- `value` (list of ItemTaxcodeRecommendationBatchesOutputModel, optional) — The list of items with their tax code recommendations. This property is populated only when the batch status is "Completed".
- `message` (string, optional) — An optional message providing additional information about the batch.

## Errors

### 400 Bad Request Error

Bad Request

- `type` (string, optional)
- `title` (string, optional)
- `status` (integer, optional)
- `detail` (string, optional)
- `instance` (string, optional)

### 401 Unauthorized Error

Unauthorized

- `type` (string, optional)
- `title` (string, optional)
- `status` (integer, optional)
- `detail` (string, optional)
- `instance` (string, optional)

### 404 Not Found Error

Not Found

- `type` (string, optional)
- `title` (string, optional)
- `status` (integer, optional)
- `detail` (string, optional)
- `instance` (string, optional)

### 500 Internal Server Error

Server Error

- `any`

## Types

### ItemTaxcodeRecommendationBatchesOutputModel

Represents the output model for tax code recommendation batches (both synchronous and asynchronous).

- `description` (string, optional) — A brief description of the item.
- `category` (string, optional) — The category of the item.
- `itemType` (string, optional) — The type of item. Examples: "Physical", "Digital", "Service", "Freight"
- `upc` (string, optional) — The Universal Product Code (UPC) associated with the item.
- `summary` (string, optional) — A summary or detailed description of the item.
- `taxCodeRecommendations` (list of ItemTaxcodeRecommendationBaseBatchOutputModel, optional) — The list of generated tax code recommendations for this item.

### ItemTaxcodeRecommendationBaseBatchOutputModel

One recommended tax code (code, level, and Indix description) for bulk tax code recommendation responses.

- `taxCode` (string, optional) — Recommended TaxCode
- `level` (string, optional) — Recommended TaxCode Level
- `taxCodeDescription` (string, optional) — Recommended TaxCode description (from Indix)

## Examples

**Response**

```json
{
  "batchId": 105,
  "batchStatus": "Completed",
  "value": [
    {
      "description": "Ceramic Mug",
      "category": "Home > Kitchen > Mugs",
      "taxCodeRecommendations": [
        {
          "taxCode": "SW110000",
          "level": "H"
        },
        {
          "taxCode": "SW117202",
          "level": "H"
        },
        {
          "taxCode": "SW117210",
          "level": "L"
        }
      ]
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://rest.avatax.com/api/v2/companies/1/taxcode-recommendations/batches/1"

headers = {"Authorization": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://rest.avatax.com/api/v2/companies/1/taxcode-recommendations/batches/1';
const options = {method: 'GET', headers: {Authorization: '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.avatax.com/api/v2/companies/1/taxcode-recommendations/batches/1"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://rest.avatax.com/api/v2/companies/1/taxcode-recommendations/batches/1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://rest.avatax.com/api/v2/companies/1/taxcode-recommendations/batches/1")
  .header("Authorization", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://rest.avatax.com/api/v2/companies/1/taxcode-recommendations/batches/1', [
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://rest.avatax.com/api/v2/companies/1/taxcode-recommendations/batches/1");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.avatax.com/api/v2/companies/1/taxcode-recommendations/batches/1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```