# CreateCostCenter

Create new cost center

`POST /api/v2/companies/{companyid}/costcenters`

**API:** AvaTax API
**Tag:** CostCenter
**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/CostCenter/CreateCostCenter/

## Description

Creates one or more new item objects attached to this company.

Costcenter is defined as  function or department within a company which is not directly going to generate revenues and profits to the company but is still incurring expenses to the company for its operations.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyid` | integer | path | Yes | The ID of the company that owns this cost center object |
| `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:** `CostCenterRequestModel`

Cost Center Request Model

| Property | Type | Required | Description |
|---|---|---|---|
| `entityUseCode` | string | No | The Entity Use Code Example: `G`. |
| `effectiveDate` | string | No | Effective from Date Example: `2026-07-02T04:05:06.044865+00:00`. |
| `endDate` | string | No | End Date Example: `2026-07-02T04:05:06.0449149+00:00`. |
| `defaultItem` | Int64TaxProfileObjectReferenceModel | No | Default Item for this Cost Center |
| `costCenterCode` | string | **Yes** | The Cost center Name Example: `CostCenter1`. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 201 | Created | `CostCenterSuccessResponseModel` |
| 400 | Bad Request | `TaxProfileErrorResponseModel` |
| 401 | Unauthorized | `TaxProfileErrorResponseModel` |
| 403 | Forbidden | `TaxProfileErrorResponseModel` |
| 404 | Not Found | `TaxProfileErrorResponseModel` |
| 409 | Conflict | `TaxProfileErrorResponseModel` |
| 500 | Server Error | `TaxProfileErrorResponseModel` |

### 201 Response: `CostCenterSuccessResponseModel`

Cost Center Response Model

| Property | Type | Required | Description |
|---|---|---|---|
| `costCenterId` | integer | No | The Cost center Id Example: `0`. |
| `companyId` | integer | No | CompanyId to which the cost center belongs Example: `1`. |
| `meta` | TaxProfileMetaDataModel | No | Meta data of this Cost Center |
| `entityUseCode` | string | No | The Entity Use Code Example: `G`. |
| `effectiveDate` | string | No | Effective from Date Example: `2026-07-02T04:05:06.0609198+00:00`. |
| `endDate` | string | No | End Date Example: `2026-07-02T04:05:06.0609207+00:00`. |
| `defaultItem` | Int64TaxProfileObjectReferenceModel | No | Default Item for this Cost Center |
| `costCenterCode` | string | **Yes** | The Cost center Name Example: `CostCenter1`. |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/companies/{companyid}/costcenters" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "entityUseCode": "G",
  "effectiveDate": "2026-07-02",
  "endDate": "2026-07-02",
  "defaultItem": {
    "identifier": 0
  },
  "costCenterCode": "CostCenter1"
}'
```