# BulkUploadCostCenters

Bulk upload cost centers

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

**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/avatax/api/methods/CostCenter/BulkUploadCostCenters/

## Description

Allows bulk upload of cost centers for the specified company. Use the companyId path parameter to identify the company for which the cost centers should be uploaded.

## 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:** `CostCenterBulkUploadInputModel`

Represents a bulk upload input model.

| Property | Type | Required | Description |
|---|---|---|---|
| `costCenters` | CostCenterRequestModel[] | No | List of costCenters |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success | `CostCenterBulkUploadOutputModel` |
| 400 | Bad Request | `TaxProfileErrorResponseModel` |
| 401 | Unauthorized | `TaxProfileErrorResponseModel` |
| 403 | Forbidden | `TaxProfileErrorResponseModel` |
| 404 | Not Found | `TaxProfileErrorResponseModel` |
| 409 | Conflict | `TaxProfileErrorResponseModel` |
| 500 | Server Error | `TaxProfileErrorResponseModel` |

### 200 Response: `CostCenterBulkUploadOutputModel`

Represents a bulk upload response model.

| Property | Type | Required | Description |
|---|---|---|---|
| `total` | integer | No | Count of processed objects Example: `35`. |
| `failed` | CostCenterUploadErrorModel[] | No | Dictionary of object and respective list of errors |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/companies/{companyid}/costcenters/$upload" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "costCenters": [
    {
      "entityUseCode": "A",
      "effectiveDate": "1900-01-01",
      "endDate": "9998-12-31",
      "defaultItem": {
        "identifier": 0,
        "displayName": "CHIP1041"
      },
      "costCenterCode": "CC_1"
    }
  ]
}'
```