OfficeGest
Accounting/Cost centers

List cost centers

Returns a paginated list of cost centers with optional filtering.

GET
/accounting/cost-centers
AuthorizationBearer <token>

In: header

Query Parameters

search?string
code?string
active?boolean
name?stringDeprecated
start_date?stringDeprecated
Formatdate
end_date?stringDeprecated
Formatdate
created_at?stringDeprecated
Formatdate
updated_at?stringDeprecated
Formatdate
filter[name][operator]?string

Operators: sw, ew, ct, eq. Example: filter[name][sw]=value

filter[start_date][operator]?string

Operators: gte, lte, eq. Example: filter[start_date][gte]=value

Formatdate
filter[end_date][operator]?string

Operators: gte, lte, eq. Example: filter[end_date][gte]=value

Formatdate
filter[created_at][operator]?string

Operators: gte, lte, eq. Example: filter[created_at][gte]=value

Formatdate
filter[updated_at][operator]?string

Operators: gte, lte, eq. Example: filter[updated_at][gte]=value

Formatdate
page?integer

Page number. Default 1; a value below 1 counts as 1.

Default1
Range1 <= value
limit?integer

Items per page. Default 50, maximum 250; a larger value is truncated to 250.

Default50
Range1 <= value <= 250

Response Body

curl -X GET "https://og-tenant1.test:8003/api/v2/accounting/cost-centers?search=string&code=string&active=true&name=string&start_date=2019-08-24&end_date=2019-08-24&created_at=2019-08-24&updated_at=2019-08-24&filter%5Bname%5D%5Boperator%5D=string&filter%5Bstart_date%5D%5Boperator%5D=2019-08-24&filter%5Bend_date%5D%5Boperator%5D=2019-08-24&filter%5Bcreated_at%5D%5Boperator%5D=2019-08-24&filter%5Bupdated_at%5D%5Boperator%5D=2019-08-24&page=1&limit=50"
{
  "data": [
    {
      "code": "string",
      "name": "string",
      "active": true,
      "start_date": "2019-08-24",
      "end_date": "2019-08-24",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "meta": {
    "per_page": 50,
    "current_page": 1,
    "has_more": true
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}