# CreateItemImportBatch

Create item import batch.

`POST /api/v2/companies/{companyId}/batches/items`

**API:** AvaTax API
**Tag:** Batches
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Content-Type:** `application/json`
**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/CreateItemImportBatch/

## Description

Create a new item import batch objects attached to this company.
            
When an item import batch is created, it is added to the AvaTax Batch v2 Queue and will be
processed in the order it was received. To check the
status of a batch, fetch the batch and retrieve the results of the batch
operation.
            
The maximum content length of the request body is limited to 28.6 MB. If this limit
exceeds then a 404 Not Found status is returned (possibly with a CORS error if
the API is called from a browser). In this situation, please split the request into
smaller batches.

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AccountOperator, AvaTaxOnlyAccountAdmin, AvaTaxOnlyCompanyAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, FirmAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | integer | path | Yes | The ID of the company that owns 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/) . |

## Request Body

**Schema:** `CreateItemImportBatchRequestModel`

Represents a create item import batch request model.

| Property | Type | Required | Description |
|---|---|---|---|
| `name` | string | **Yes** | The user-friendly readable name for this batch |
| `items` | ItemModel[] | **Yes** | List of items to import |

## Responses

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

### 200 Response: `CreateItemImportBatchResponseModel`

Represents a create item import batch response model.

| Property | Type | Required | Description |
|---|---|---|---|
| `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: `ItemImportDemo`. |
| `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 POST "https://sandbox-rest.avatax.com/api/v2/companies/{companyId}/batches/items" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "name": "ItemImportDemo",
  "items": [
    {
      "id": 0,
      "companyId": 0,
      "itemCode": "CERMUG",
      "taxCode": "P0000000",
      "description": "Ceramic Mug",
      "itemGroup": "Mugs",
      "category": "Home > Kitchen > Mugs",
      "source": "MTCC",
      "classifications": [
        {
          "id": 12212,
          "productCode": "9011900000",
          "systemCode": "TARIC",
          "country": "DE",
          "isPremium": false
        }
      ],
      "parameters": [
        {
          "id": 0,
          "name": "ScreenSize",
          "value": "24",
          "unit": "inch"
        },
        {
          "id": 0,
          "name": "UPC",
          "value": "123456789012"
        },
        {
          "id": 0,
          "name": "Summary",
          "value": "Ceramic mugs are popular vessels for enjoying hot beverages like coffee, tea, or hot chocolate. They're made from clay that's fired at high temperatures, which gives them durability and heat retention properties"
        }
      ],
      "customParameters": [
        {
          "id": 0,
          "name": "Material Used",
          "value": "Nylon"
        }
      ],
      "properties": {
        "color": "white"
      }
    }
  ]
}'
```