> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fynn.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# Add a cost centre

> Add a cost centre. A cost centre can be of type KOST1 or KOST2 and must have a unique code.

<sup>Required permissions: `cost-centre:write`</sup>



## OpenAPI

````yaml post /accounting/cost-centres
openapi: 3.1.0
info:
  title: Fynn API
  description: ''
  termsOfService: https://www.fynn.eu/tos
  contact:
    name: Fynn UG (haftungsbeschränkt)
    url: https://www.fynn.eu
    email: hi@fynn.eu
  license:
    name: Proprietary
    url: https://www.fynn.eu/license
  version: 0.0.0
servers:
  - url: https://coreapi.io
    description: Production
  - url: https://preview.coreapi.io
    description: Sandbox
security:
  - JWT: []
tags: []
paths:
  /accounting/cost-centres:
    parameters: []
    post:
      tags:
        - CostCentre
      summary: Add a cost centre
      description: >-
        Add a cost centre. A cost centre can be of type KOST1 or KOST2 and must
        have a unique code.


        <sup>Required permissions: `cost-centre:write`</sup>
      operationId: addCostCentre
      parameters: []
      requestBody:
        description: The new CostCentre resource
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/CostCentre-cost-centre.create_cost-centre.write
          text/html:
            schema:
              $ref: >-
                #/components/schemas/CostCentre-cost-centre.create_cost-centre.write
        required: true
      responses:
        '201':
          description: CostCentre resource created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CostCentre-CostCentreRead'
            text/html:
              schema:
                $ref: '#/components/schemas/CostCentre-CostCentreRead'
          links: {}
        '400':
          description: Invalid input
        '422':
          description: Unprocessable entity
      deprecated: false
      security:
        - JWT:
            - cost-centre:write
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X POST \
             /accounting/cost-centres \
             --header "Content-Type: application/json" \
             --header "Authorization: Bearer <token>" \
             --data '{
                "name": "Cost Centre",
                "code": "CC",
                "type": "KOST1"
            }'
components:
  schemas:
    CostCentre-cost-centre.create_cost-centre.write:
      type: object
      description: ''
      deprecated: false
      required:
        - name
        - code
        - type
        - status
      properties:
        name:
          maxLength: 255
          description: The name of the cost centre, which is displayed in the UI
          example: Cost Centre
          type: string
        code:
          maxLength: 255
          description: The code of the cost centre, which is used for exports
          example: CC
          type: string
        type:
          description: The type of the cost centre, which is used for exports
          example: KOST1
          type: string
          enum:
            - KOST1
            - KOST2
        status:
          description: |-
            The status of the cost centre

            Possible values:
             * `active`: The cost centre is active and can be used and referenced
             * `archived`: The cost centre is archived and cannot be referenced anymore. It also disappears from the UI.
          default: active
          example: active
    CostCentre-CostCentreRead:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          readOnly: true
          example: ad8f1c9c-4f0a-4e1a-8b1a-9c4d9c4d9c4d
          type: string
        name:
          maxLength: 255
          description: The name of the cost centre, which is displayed in the UI
          example: Cost Centre
          type: string
        code:
          description: The code of the cost centre, which is used for exports
          example: CC
          type: string
        type:
          description: The type of the cost centre, which is used for exports
          example: KOST1
          type: string
          enum:
            - KOST1
            - KOST2
        status:
          description: |-
            The status of the cost centre

            Possible values:
             * `active`: The cost centre is active and can be used and referenced
             * `archived`: The cost centre is archived and cannot be referenced anymore. It also disappears from the UI.
          default: active
          example: active
        createdAt:
          readOnly: true
          description: The date and time when the cost centre was created
          example: '2021-01-01T00:00:00+00:00'
          type: string
          format: date-time
        updatedAt:
          readOnly: true
          description: The date and time when the cost centre was last updated
          example: '2021-01-01T00:00:00+00:00'
          type: string
          format: date-time
      required:
        - name
        - type
        - status
  securitySchemes:
    JWT:
      type: http
      scheme: bearer

````