> ## 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.

# Create a unit

> Create a unit. Units will be used to define the unit of measure for products or invoice positions.

<sup>Required permissions: `unit:write`</sup>



## OpenAPI

````yaml post /units
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:
  /units:
    parameters: []
    post:
      tags:
        - Unit
      summary: Create a unit
      description: >-
        Create a unit. Units will be used to define the unit of measure for
        products or invoice positions.


        <sup>Required permissions: `unit:write`</sup>
      operationId: createUnit
      parameters: []
      requestBody:
        description: The new Unit resource
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Unit-UnitCreate'
          text/html:
            schema:
              $ref: '#/components/schemas/Unit-UnitCreate'
        required: true
      responses:
        '201':
          description: Unit resource created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit-UnitRead'
            text/html:
              schema:
                $ref: '#/components/schemas/Unit-UnitRead'
          links: {}
        '400':
          description: Invalid input
        '422':
          description: Unprocessable entity
      deprecated: false
      security:
        - JWT:
            - unit:write
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X POST \
             /units \
             --header "Content-Type: application/json" \
             --header "Authorization: Bearer <token>" \
             --data '{
                "translations": []
            }'
components:
  schemas:
    Unit-UnitCreate:
      type: object
      description: ''
      deprecated: false
      properties:
        translations:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/UnitTranslation-UnitCreate'
    Unit-UnitRead:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          $ref: '#/components/schemas/UnitId-UnitRead'
          readOnly: true
        name:
          example: Stück
          type: string
        translations:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/UnitTranslation-UnitRead'
        createdAt:
          readOnly: true
          description: The date and time when the resource 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 resource was last updated.
          example: '2021-01-01T00:00:00+00:00'
          type: string
          format: date-time
    UnitTranslation-UnitCreate:
      type: object
      description: ''
      deprecated: false
      required:
        - name
        - locale
      properties:
        name:
          maxLength: 255
          example: Stück
          type: string
        locale:
          example: de
          type: string
    UnitId-UnitRead:
      type: object
      description: ''
      deprecated: false
    UnitTranslation-UnitRead:
      type: object
      description: ''
      deprecated: false
      required:
        - name
        - locale
      properties:
        name:
          maxLength: 255
          example: Stück
          type: string
        locale:
          example: de
          type: string
  securitySchemes:
    JWT:
      type: http
      scheme: bearer

````