Skip to main content
GET
/
v1
/
cost-center
Get cost centers
curl --request GET \
  --url http://localhost:3001/v1/cost-center \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "code": "<string>",
      "name": "<string>",
      "type": "<string>",
      "id": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "meta": {
    "page": 123,
    "take": 123,
    "itemCount": 123,
    "pageCount": 123,
    "hasPreviousPage": true,
    "hasNextPage": true
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

order
enum<string>
default:ASC

Choose between ascending and descending order.

Available options:
ASC,
DESC
page
number
default:1

Specify the number of the page you want to retrieve.

Required range: x >= 1
take
number
default:10

Specify the number of items you want to retrieve per page.

Required range: 1 <= x <= 100
searchTerm
string

The search term to look for in the cost center list (searches code and name).

type
enum<string>

Filter by cost center type.

Available options:
KOST1,
KOST2,
KOST3,
KOST4
orderField
string

Specify the field you want to order by.

orderDir
string

Choose between ascending and descending order.

Response

200 - application/json
data
object[]
required

Paginated items.

meta
object
required

Additional information about the page.