# GetBatch

Retrieve a single batch

`GET /api/v2/companies/{companyId}/batches/{id}`

**API:** AvaTax API
**Tag:** Batches
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/avatax/api/methods/Batches/GetBatch/

## Description

Get the batch object identified by this URL. A batch object is a large
collection of API calls stored in a compact file.
            
Use this endpoint to retrieve the results or check the status of a batch.
            
When a batch is created, it is added to the AvaTax Batch Queue and will be
processed as quickly as possible in the order it was received. To check the
status of a batch, fetch the batch and retrieve the results of the batch
operation.
            
Because the batch system processes with a degree of concurrency, and
because of batch sizes in the queue vary, AvaTax API is unable to accurately
predict when a batch will complete. If high performance processing is
required, please use the
[CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).

### Security Policies

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

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | integer | path | Yes | The ID of the company that owns this batch |
| `id` | integer | path | Yes | The primary key of this batch |
| `X-Avalara-Client` | string | header | No | 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/) . |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success | `BatchModel` |
| 400 | Bad Request |  |
| 401 | Unauthorized |  |
| 404 | Not Found |  |

### 200 Response: `BatchModel`

Represents a batch of uploaded documents.

| Property | Type | Required | Description |
|---|---|---|---|
| `type` | string | **Yes** | The type of this batch. Values: `AvaCertUpdate`, `AvaCertUpdateAll`, `BatchMaintenance`, `CompanyLocationImport`, `DocumentImport`, `ExemptCertImport`, `ItemImport`, `SalesAuditExport`, `SstpTestDeckImport`, `TaxRuleImport`, `TransactionImport`, `UPCBulkImport`, `UPCValidationImport`, `CustomerSupplierImport`, `VarianceImport`, `CostCenterImport`, `GLAccountImport`, `AdvancedRulesImport`, `ItemImportV2`, `VatValidationImport`, `TxnWithDynamicParamBag`. Example: `AvaCertUpdate`. |
| `batchAgent` | string | No | The agent used to create this batch Example: `manual`. |
| `id` | integer | No | The unique ID number of this batch. |
| `options` | string | No | Any optional flags provided for this batch |
| `name` | string | **Yes** | The user-friendly readable name for this batch. Example: `TestBatch`. |
| `accountId` | integer | No | The Account ID number of the account that owns this batch. |
| `companyId` | integer | No | The Company ID number of the company that owns this batch. |
| `status` | string | No | This batch's current processing status Values: `Waiting`, `SystemErrors`, `Cancelled`, `Completed`, `Creating`, `Deleted`, `Errors`, `Paused`, `Processing`, `Cancelling`. Example: `Waiting`. |
| `startedDate` | string | No | The date/time when this batch started processing |
| `recordCount` | integer | No | The number of records in this batch; determined by the server |
| `currentRecord` | integer | No | The current record being processed |
| `completedDate` | string | No | The date/time when this batch was completely processed |
| `createdDate` | string | No | The date when this record was created. |
| `createdUserId` | integer | No | The User ID of the user who created this record. |
| `modifiedDate` | string | No | The date/time when this record was last modified. |
| `modifiedUserId` | integer | No | The user ID of the user who last modified this record. |
| `files` | BatchFileModel[] | No | The list of files contained in this batch. |

## Example Request

```bash
curl -X GET "https://sandbox-rest.avatax.com/api/v2/companies/{companyId}/batches/{id}" \
  -H "Authorization: Basic <credentials>" \
  -H "Accept: application/json"
```