# GetCostCenterById

Retrieve a single cost center

`GET /api/v2/companies/{companyid}/costcenters/{costcenterid}`

**API:** AvaTax API
**Tag:** CostCenter
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**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/GetCostCenterById/

## Description

Retrieves details of a single cost center identified by costcenterId, which is owned by the company.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyid` | integer | path | Yes | The ID of the company that owns this cost center object |
| `costcenterid` | integer | path | Yes | The primary key of this cost center |
| `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/) . |

## Responses

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

### 200 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 GET "https://sandbox-rest.avatax.com/api/v2/companies/{companyid}/costcenters/{costcenterid}" \
  -H "Authorization: Basic <credentials>" \
  -H "Accept: application/json"
```