# CreateCompanies

Create a company

`POST /companies`

**API:** Shared Company Service API
**Tag:** Companies
**API Version:** 1.2
**Base URL:** https://api.avalara.com/scs

Source: https://developer.avalara.com/products/shared-services/api/methods/Companies/CreateCompanies/

## Description

Use this endpoint to create a company. Company identifiers support is available in version 1.2+.

## 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/). |
| `X-Correlation-Id` | string | header | No | Use the X-Correlation-ID header to support request correlation through requests. This header should be present on all requests and responses. |
| `avalara-version` | string | header | No | The HTTP Header meant to specify the version of the API intended to be used |

## Request Body

**Content-Type:** `application/json`
**Schema:** `CompanyRequest`

Object for storing company information

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | string | **Yes** | Unique identifier for the given user. Example: `c2c60111-25f2-43cf-8243-9de94bc4f980`. |
| `companyName` | string | **Yes** | The name of the company Example: `ABC Corp`. |
| `defaultCountry` | string | **Yes** | The two character ISO-3166 country code for this company Example: `US`. |
| `tenant` | Reference | **Yes** |  |
| `companyCode` | string | No | A unique code that references this company within your account Example: `DEFAULT`. |
| `isActive` | boolean | No | Specifies whether this is an active company |
| `hasDirectoryConsent` | boolean | No | Indicates whether the user has provided consent to include this company in the directory. This field is available starting from API version 1.1. |
| `aspects` | Aspect[] | No |  |
| `tags` | Tags[] | No |  |
| `parent` | CompanyParent | No |  |
| `companyIdentifiers` | CompanyIdentifierRequest[] | No | Company identifiers following international standards. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 201 | Created | `Company` |
| 400 | Bad Request | `ErrorInfo` |
| 401 | Unauthorized | `ErrorInfo` |
| 403 | Forbidden | `ErrorInfo` |
| 409 | Conflict | `ErrorInfo` |
| 500 | Internal Server Error | `ErrorInfo` |

### 201 Response: `Company`

Company model object used to create a company

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | string | **Yes** | Unique identifier for the given user. Example: `c2c60111-25f2-43cf-8243-9de94bc4f980`. |
| `companyName` | string | **Yes** | The company name Example: `ABC Corp`. |
| `defaultCountry` | string | **Yes** | The two character ISO-3166 country code for this company. Example: `US`. |
| `tenant` | Reference | **Yes** |  |
| `companyCode` | string | No | A unique code that references this company within your account Example: `DEFAULT`. |
| `isActive` | boolean | No | Specifies whether this company is active |
| `hasDirectoryConsent` | boolean | No | Indicates whether the user has provided consent to include this company in the directory. This field is available starting from API version 1.1. |
| `aspects` | Aspect[] | No |  |
| `tags` | Tags[] | No |  |
| `parent` | Reference | No |  |
| `children` | Reference[] | No | The child companies within this parent company |
| `meta` | Meta | No |  |
| `ani` | string | No | Avalara Network Identifier (ANI) - a unique 15-character identifier automatically generated at company creation. Example: `9IN0W8N6S2L4A22`. |
| `companyIdentifiers` | CompanyIdentifier[] | No | Company identifiers following international standards. |

## Example Request

```bash
curl -X POST "https://api.avalara.com/scs/companies" \
  -H "Authorization: Basic <credentials>" \
  -H "Accept: application/json" \
  -d '{
  "id": "c2c60111-25f2-43cf-8243-9de94bc4f980",
  "companyName": "ABC Corp",
  "defaultCountry": "US",
  "tenant": {
    "identifier": "e53e9fc9-d1c6-465c-aeff-faa4d88af348",
    "displayName": "ABC Corp",
    "location": "/reference/id"
  },
  "companyCode": "DEFAULT",
  "isActive": "",
  "hasDirectoryConsent": "",
  "aspects": [
    {
      "identifier": "ca5a1aff-187e-4285-858c-fa43ee587cbf",
      "displayName": "ABC Corp",
      "location": "/iam/systems/626a9303fa6495f5742fdd6d",
      "namespace": "urn:avalara:systems:avatax",
      "isDeleted": "",
      "meta": {
        "createdBy": "32ec41da-c69f-4db4-9b77-424eab75edae",
        "created": "2023-03-31T13:18:12",
        "modifiedBy": "32ec41da-c69f-4db4-9b77-424eab75edae",
        "lastModified": "2023-03-31T13:18:12",
        "location": "/companies/32ec41da-c69f-4db4-9b77-424eab75edae",
        "version": "1.0"
      }
    }
  ],
  "tags": [
    {
      "name": "scs-avatax",
      "value": "scs-2023"
    }
  ],
  "parent": {
    "identifier": "e53e9fc9-d1c6-465c-aeff-faa4d88af348"
  },
  "companyIdentifiers": [
    {
      "companyServiceId": "c2c60111-25f2-43cf-8243-9de94bc4f980",
      "identifierType": "urn:avalara:company:identifier:global:gs1:gln",
      "identifierValue": "1234567890123"
    }
  ]
}'
```