# BulkUploadItems

Bulk upload items from a product catalog

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

**API:** AvaTax API
**Tag:** Items
**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/crossborder/api/methods/Items/BulkUploadItems/

## Description

Create/Update one or more item objects attached to this company.
            
Recommended number of items to create/update in a single call is upto 100.
            
Currently, the maximum number of items that can be created/updated in a single call is 500 (This limit is subject to change).
            
Items are a way of separating your tax calculation process from your tax configuration details.  If you choose, you
can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
and other data fields.  AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
from the item table instead.  This allows your CreateTransaction call to be as simple as possible, and your tax compliance
team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
            
The tax code takes precedence over the tax code id if both are provided.
            
Please provide all the countries of destination values as a valid two letter ISO-3166 country code.
Refer to 'ListCountries' api to get valid country code for any country if needed.

### Security Policies

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

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | integer | path | Yes | The ID of the company that owns this items. |
| `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:** `ItemBulkUploadInputModel`

Represents a bulk upload input model.

| Property | Type | Required | Description |
|---|---|---|---|
| `items` | ItemModel[] | No | List of items |

## Responses

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

### 200 Response: `ItemBulkUploadOutputModel`

Represents a bulk upload response model.

| Property | Type | Required | Description |
|---|---|---|---|
| `total` | integer | No | Count of processed objects Example: `35`. |
| `failed` | ItemUploadErrorModel[] | No | Dictionary of object and respective list of errors |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/companies/{companyId}/items/upload" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "items": [
    {
      "id": 0,
      "companyId": 0,
      "itemCode": "CHIP1041",
      "taxCode": "PF051578",
      "description": "Potato Chips",
      "itemGroup": "Packaged Food",
      "classifications": [
        {
          "id": 12212,
          "productCode": "9011900000",
          "systemCode": "TARIC",
          "country": "DE",
          "isPremium": false
        }
      ],
      "parameters": [
        {
          "id": 0,
          "name": "ScreenSize",
          "value": "24",
          "unit": "inch"
        }
      ],
      "customParameters": [
        {
          "id": 0,
          "name": "Material Used",
          "value": "Nylon"
        }
      ]
    }
  ]
}'
```