# CreateCompanies

Create new companies

`POST /api/v2/companies`

**API:** AvaTax API
**Tag:** Companies
**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/Companies/CreateCompanies/

## Description

Create one or more new company objects.
A 'company' represents a single corporation or individual that is registered to handle transactional taxes.
You may attach nested data objects such as contacts, locations, and nexus with this CREATE call, and those objects will be created with the company.
            
NOTE: Please do not use these blacklisted characters in company name and code: ';', '\', '|'.

### Security Policies

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

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `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:** `CompanyModel[]`

A company or business entity.

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | **Yes** | The unique ID number of this company. Example: `12345`. |
| `accountId` | integer | **Yes** | The unique ID number of the account this company belongs to. Example: `123456789`. |
| `parentCompanyId` | integer | No | If this company is fully owned by another company, this is the unique identity of the parent company. |
| `sstPid` | string | No | If this company files Streamlined Sales Tax, this is the PID of this company as defined by the Streamlined Sales Tax governing board. |
| `companyCode` | string | No | A unique code that references this company within your account. Example: `DEFAULT`. |
| `name` | string | **Yes** | The name of this company, as shown to customers. Example: `Default Company`. |
| `isDefault` | boolean | No | This flag is true if this company is the default company for this account.  Only one company may be set as the default. Example: `false`. |
| `defaultLocationId` | integer | No | If set, this is the unique ID number of the default location for this company. |
| `isActive` | boolean | No | This flag indicates whether tax activity can occur for this company.  Set this flag to true to permit the company to process transactions. Example: `true`. |
| `taxpayerIdNumber` | string | No | For United States companies, this field contains your Taxpayer Identification Number.
This is a nine digit number that is usually called an EIN for an Employer Identification Number if this company is a corporation,
or SSN for a Social Security Number if this company is a person.
This value is required if the address provided is inside the US and if you subscribed to the Avalara Managed Returns or SST Certified Service Provider service. Otherwise it is optional. Example: `123456789`. |
| `isFein` | boolean | No | Set this field to true if the taxPayerIdNumber is a FEIN. |
| `hasProfile` | boolean | No | Set this flag to true to give this company its own unique tax profile.
If this flag is true, this company will have its own Nexus, TaxRule, TaxCode, and Item definitions.
If this flag is false, this company will inherit all profile values from its parent. Example: `true`. |
| `isReportingEntity` | boolean | No | Set this flag to true if this company must file its own tax returns.
For users who have Returns enabled, this flag turns on monthly Worksheet generation for the company. Example: `false`. |
| `sstEffectiveDate` | string | No | If this company participates in Streamlined Sales Tax, this is the date when the company joined the SST program. |
| `defaultCountry` | string | **Yes** | The two character ISO-3166 country code of the default country for this company. Example: `US`. |
| `baseCurrencyCode` | string | No | This is the three character ISO-4217 currency code of the default currency used by this company. Example: `USD`. |
| `roundingLevelId` | string | No | Indicates whether this company prefers to round amounts at the document level or line level. Values: `Line`, `Document`. Example: `Line`. |
| `warningsEnabled` | boolean | No | Set this value to true to receive warnings in API calls via SOAP. |
| `isTest` | boolean | No | Set this flag to true to indicate that this company is a test company.
If you have Returns enabled, Test companies will not file tax returns and can be used for validation purposes. Example: `true`. |
| `taxDependencyLevelId` | string | No | Used to apply tax detail dependency at a jurisdiction level. Values: `Document`, `State`, `TaxRegion`, `Address`. Example: `Document`. |
| `inProgress` | boolean | No | Set this value to true to indicate that you are still working to finish configuring this company.
While this value is true, no tax reporting will occur and the company will not be usable for transactions. Example: `false`. |
| `businessIdentificationNo` | string | No | Business Identification No |
| `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. |
| `contacts` | ContactModel[] | No | Optional: A list of contacts defined for this company.  To fetch this list, add the query string `?$include=Contacts` to your URL.
            
When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company.
The `UpdateCompany` API does not permit updating nested objects. |
| `items` | ItemModel[] | No | Optional: A list of items defined for this company.  To fetch this list, add the query string `?$include=Items` to your URL.
            
When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company.
The `UpdateCompany` API does not permit updating nested objects. |
| `locations` | LocationModel[] | No | Optional: A list of locations defined for this company.  To fetch this list, add the query string `?$include=Locations` to your URL.
            
When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company.
The `UpdateCompany` API does not permit updating nested objects. |
| `nexus` | NexusModel[] | No | Optional: A list of nexus defined for this company.  To fetch this list, add the query string `?$include=Nexus` to your URL.
            
When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company.
The `UpdateCompany` API does not permit updating nested objects. |
| `settings` | SettingModel[] | No | Optional: A list of settings defined for this company.  To fetch this list, add the query string `?$include=Settings` to your URL.
            
When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company.
The `UpdateCompany` API does not permit updating nested objects. |
| `taxCodes` | TaxCodeModel[] | No | Optional: A list of tax codes defined for this company.  To fetch this list, add the query string `?$include=TaxCodes` to your URL.
            
When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company.
The `UpdateCompany` API does not permit updating nested objects. |
| `taxRules` | TaxRuleModel[] | No | Optional: A list of tax rules defined for this company.  To fetch this list, add the query string `?$include=TaxRules` to your URL.
            
When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company.
The `UpdateCompany` API does not permit updating nested objects. |
| `upcs` | UPCModel[] | No | Optional: A list of UPCs defined for this company.  To fetch this list, add the query string `?$include=UPCs` to your URL.
            
When calling `CreateCompany`, you may provide a list of objects in this element and they will be created alongside the company.
The `UpdateCompany` API does not permit updating nested objects. |
| `nonReportingChildCompanies` | CompanyModel[] | No | Optional: A list of non reporting child companies associated with this company.  To fetch this list, add the query string `?$include=NonReportingChildren` to your URL. |
| `exemptCerts` | EcmsModel[] | No | DEPRECATED - Date: 9/15/2017, Version: 17.10, Message: Please use the `ListCertificates` API. |
| `mossId` | string | No | The unique identifier of the mini-one-stop-shop used for Value Added Tax (VAT) processing. |
| `mossCountry` | string | No | The country code of the mini-one-stop-shop used for Value Added Tax (VAT) processing. |
| `parameters` | CompanyParameterDetailModel[] | No | The parameters of a company |
| `supplierandcustomers` | CustomerSupplierModel[] | No | The customers and suppliers of a company |
| `isDeleted` | boolean | No | A boolean flag to identify if the company is deleted |
| `isAdvSave` | boolean | No | A boolean flag to identify if the company saves advanced rules after calculation. Example: `false`. |
| `companyUrl` | string | No | The url of the company. |
| `companyDescription` | string | No | The description of the company. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success |  |
| 400 | Bad Request | `ProblemDetails` |
| 401 | Unauthorized | `ProblemDetails` |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/companies" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '[
  {
    "id": 12345,
    "accountId": 123456789,
    "companyCode": "DEFAULT",
    "name": "Default Company",
    "isDefault": false,
    "isActive": true,
    "taxpayerIdNumber": "123456789",
    "isFein": false,
    "hasProfile": true,
    "isReportingEntity": false,
    "defaultCountry": "US",
    "baseCurrencyCode": "USD",
    "roundingLevelId": "Document",
    "isTest": true,
    "taxDependencyLevelId": "Document",
    "inProgress": false,
    "isDeleted": false,
    "isAdvSave": false
  }
]'
```