# CreateUPCs

Create a new UPC

`POST /api/v2/companies/{companyId}/upcs`

**API:** AvaTax API
**Tag:** Upcs
**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/Upcs/CreateUPCs/

## Description

Create one or more new UPC objects attached to this company.
A UPC represents a single UPC code in your catalog and matches this product to the tax code identified by this UPC.

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AvaTaxOnlyAccountAdmin, AvaTaxOnlyCompanyAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
* This API depends on the following active services:*Required* (all):  AvaUpc.

## Parameters

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

One Universal Product Code object as defined for your company.

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | The unique ID number for this UPC. Example: `123456789`. |
| `companyId` | integer | No | The unique ID number of the company to which this UPC belongs. Example: `1234567`. |
| `upc` | string | **Yes** | The 12-14 character Universal Product Code, European Article Number, or Global Trade Identification Number. Example: `023032550992`. |
| `legacyTaxCode` | string | No | Legacy Tax Code applied to any product sold with this UPC. Example: `PS081282`. |
| `description` | string | **Yes** | Description of the product to which this UPC applies. Example: `Yarn`. |
| `effectiveDate` | string | No | If this UPC became effective on a certain date, this contains the first date on which the UPC was effective. |
| `endDate` | string | No | If this UPC expired or will expire on a certain date, this contains the last date on which the UPC was effective. |
| `usage` | integer | No | A usage identifier for this UPC code. |
| `isSystem` | integer | No | A flag indicating whether this UPC code is attached to the AvaTax system or to a company. |
| `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. |

## Responses

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

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/companies/{companyId}/upcs" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '[
  {
    "id": 123456789,
    "companyId": 1234567,
    "upc": "023032550992",
    "legacyTaxCode": "PS081282",
    "description": "Yarn"
  }
]'
```