# ListCostCentersByCompany

Retrieve cost centers for this company

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

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

## Description

Retrieves a list of cost centers attached to this company. You can apply filters to retrieve specific records.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyid` | integer | path | Yes | The ID of the company that defined these cost centers |
| `$filter` | string | query | No | A filter statement to identify specific records to retrieve.  For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).*Not filterable:* companyId, meta, defaultItem |
| `$include` | string | query | No | A comma separated list of objects to fetch underneath this company. Any object with a URL path underneath this company can be fetched by specifying its name. |
| `$top` | integer | query | No | If nonzero, return no more than this number of results.  Used with `$skip` to provide pagination for large datasets.  Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. |
| `$skip` | integer | query | No | If nonzero, skip this number of results before returning data.  Used with `$top` to provide pagination for large datasets. |
| `$orderBy` | string | query | No | A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. |
| `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 | `CostCenterSuccessResponseModelFetchResult` |
| 400 | Bad Request | `TaxProfileErrorResponseModel` |
| 401 | Unauthorized | `TaxProfileErrorResponseModel` |
| 403 | Forbidden | `TaxProfileErrorResponseModel` |
| 404 | Not Found | `TaxProfileErrorResponseModel` |
| 409 | Conflict | `TaxProfileErrorResponseModel` |
| 500 | Server Error | `TaxProfileErrorResponseModel` |

### 200 Response: `CostCenterSuccessResponseModelFetchResult`

| Property | Type | Required | Description |
|---|---|---|---|
| `@recordsetCount` | integer | No |  |
| `value` | CostCenterSuccessResponseModel[] | No |  |
| `@nextLink` | string | No |  |
| `pageKey` | string | No |  |

## Example Request

```bash
curl -X GET "https://sandbox-rest.avatax.com/api/v2/companies/{companyid}/costcenters" \
  -H "Authorization: Basic <credentials>" \
  -H "Accept: application/json"
```