OfficeGest
Accounting/Cost centers

Create cost center

Creates a new cost center with the provided data.

POST
/accounting/cost-centers
AuthorizationBearer <token>

In: header

code?string

Cost center code (max 15 chars). Required on creation.

Lengthlength <= 15
namestring

Cost center name.

active?boolean

Whether the cost center is active.

start_date?string | null

Validity start date.

Formatdate
end_date?string | null

Validity end date (must be >= start_date).

Formatdate

Response Body

curl -X POST "https://og-tenant1.test:8003/api/v2/accounting/cost-centers" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string"
  }'
{
  "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"
  }
}
{
  "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"
  }
}