# CreateTaxCodes

Create a new tax code

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

**API:** AvaTax API
**Tag:** TaxCodes
**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/TaxCodes/CreateTaxCodes/

## Description

Create one or more new taxcode objects attached to this company.
A 'TaxCode' represents a uniquely identified type of product, good, or service.
Avalara supports correct tax rates and taxability rules for all TaxCodes in all supported jurisdictions.
If you identify your products by tax code in your 'Create Transaction' API calls, Avalara will correctly calculate tax rates and
taxability rules for this product in all supported jurisdictions.

### Security Policies

* This API requires one of the following user roles: AccountAdmin, 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 tax code. |
| `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:** `TaxCodeModel[]`

Represents a tax code that can be applied to items on a transaction.
A tax code can have specific rules for specific jurisdictions that change the tax calculation behavior.

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | The unique ID number of this tax code. Example: `56789`. |
| `companyId` | integer | No | The unique ID number of the company that owns this tax code. Example: `12345`. |
| `taxCode` | string | **Yes** | A code string that identifies this tax code. Example: `PS081282`. |
| `taxCodeTypeId` | string | **Yes** | The type of this tax code. Example: `P`. |
| `description` | string | No | A friendly description of this tax code. Example: `Yarn`. |
| `parentTaxCode` | string | No | If this tax code is a subset of a different tax code, this identifies the parent code. Example: `PS080100`. |
| `isPhysical` | boolean | No | True if this tax code type refers to a physical object.  Read only field. Example: `true`. |
| `goodsServiceCode` | integer | No | The Avalara Goods and Service Code represented by this tax code. Example: `0`. |
| `entityUseCode` | string | No | The Avalara Entity Use Code represented by this tax code. Example: ``. |
| `isActive` | boolean | No | True if this tax code is active and can be used in transactions. Example: `true`. |
| `isSSTCertified` | boolean | No | True if this tax code has been certified by the Streamlined Sales Tax governing board.
By default, you should leave this value empty. Example: `false`. |
| `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}/taxcodes" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '[
  {
    "id": 56789,
    "companyId": 12345,
    "taxCode": "PS081282",
    "taxCodeTypeId": "P",
    "description": "Yarn",
    "parentTaxCode": "PS080100",
    "isPhysical": true,
    "goodsServiceCode": 0,
    "entityUseCode": "",
    "isActive": true,
    "isSSTCertified": false
  }
]'
```