# CreateSettings

Create a new setting

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

**API:** AvaTax API
**Tag:** Settings
**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/Settings/CreateSettings/

## Description

Create one or more new setting objects attached to this company.
            
The company settings system is a metadata system that you can use to store extra information
about a company.  Your integration or connector could use this data storage to keep track of
preference information, reminders, or any other storage that would need to persist even if
the customer uninstalls your application.
            
A setting can refer to any type of data you need to remember about this company object.
When creating this object, you may define your own `set`, `name`, and `value` parameters.
To define your own values, please choose a `set` name that begins with `X-` to indicate an extension.
            
Use Set = Transactions, Name = TaxCodePrioritization/HSCodePrioritization and Value = Transaction/ItemMaster for prioritizing which TaxCodes/HsCodes should be used for calculating taxes.
            
Example: To prioritize TaxCodes passed in a Transaction over values stored with Items when calculating tax, use
Set = Transactions, Name = TaxCodePrioritization, Value = Transaction

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AvaTaxOnlyAccountAdmin, AvaTaxOnlyCompanyAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, ProStoresOperator, Registrar, ReturnsOnlyAccountAdmin, ReturnsOnlyCompanyAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.

## Parameters

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

This object is used to keep track of custom information about a company.
            
The company settings system is a metadata system that you can use to store extra information
about a company.  Your integration or connector could use this data storage to keep track of
preference information, reminders, or any other storage that would need to persist even if
the customer uninstalls your application.
            
A setting can refer to any type of data you need to remember about this company object.
When creating this object, you may define your own `set`, `name`, and `value` parameters.
To define your own values, please choose a `set` name that begins with `X-` to indicate an extension.

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | **Yes** | The unique ID number of this setting. Example: `56789`. |
| `companyId` | integer | No | The unique ID number of the company this setting refers to. Example: `12345`. |
| `set` | string | **Yes** | A user-defined "set" containing this setting.
            
Avalara defines some sets that cannot be changed.  To create your own set, choose a set
name that begins with `X-` to indicate that this is an extension value.
            
We recommend that you choose a set name that clearly identifies your application, and then
store data within name/value pairs within that set.  For example, if you were creating an
application called MyApp, you might choose to create a set named `X-MyCompany-MyApp`. Example: `ItemsToRemember`. |
| `name` | string | **Yes** | A user-defined "name" for this name-value pair. Example: `Texas`. |
| `value` | string | No | The value of this name-value pair. Example: `Alamo`. |
| `modifiedDate` | string | No | The value when the entry was last modified. |
| `modifiedUserId` | integer | No | The value identifying who last modified the entry. |

## 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}/settings" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '[
  {
    "id": 56789,
    "companyId": 12345,
    "set": "ItemsToRemember",
    "name": "Texas",
    "value": "Alamo"
  }
]'
```