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

# Creates a contract

> Creates a contract. Required permission: crm:contract:create



## OpenAPI

````yaml /api/core-api/crmiapi.json post /api/v1/crm/contracts
openapi: 3.1.1
info:
  title: chargecloud - Core API
  summary: chargecloud Core API. All around CRM, Asset Management and more.
  version: 1.113.1
  description: chargecloud Core API. All around CRM, Asset Management and more.
servers:
  - url: https://api.chargecloud.dev
    description: Production - chargecloud Core API
  - url: https://demo.chargecloud.de
    description: Sandbox/Dev - chargecloud Core API
security: []
paths:
  /api/v1/crm/contracts:
    post:
      tags:
        - Contracts
      summary: Creates a contract
      description: 'Creates a contract. Required permission: crm:contract:create'
      operationId: /api/v1/crm/contracts_POST
      parameters: []
      requestBody:
        description: 'Creates a contract. Required permission: crm:contract:create'
        content:
          application/json:
            schema:
              type: object
              required:
                - business
                - salutation
                - firstname
                - surname
                - street
                - house_number
                - zip
                - city
                - country_id
                - billing_salutation
                - billing_firstname
                - billing_surname
                - billing_street
                - billing_house_number
                - billing_zip
                - billing_city
                - billing_email
                - billing_phone
              properties:
                ext_contract_id:
                  type: string
                  maxLength: 50
                  description: External contract id
                external_customer_id:
                  type: string
                  maxLength: 15
                  description: External customer ID
                business:
                  type: boolean
                  default: false
                  description: Is business customer
                customer_group_id:
                  type: integer
                  format: int32
                  description: Customer group id
                company_name:
                  type: string
                  maxLength: 255
                  description: Company name
                company_name_addendum:
                  type: string
                  maxLength: 255
                  description: Company name addendum
                title:
                  type: string
                  maxLength: 50
                  description: Title
                salutation:
                  type: integer
                  format: int32
                  description: Salutation
                firstname:
                  type: string
                  maxLength: 70
                  description: Firstname
                surname:
                  type: string
                  maxLength: 70
                  description: Surname
                street:
                  type: string
                  maxLength: 255
                  description: Street
                house_number:
                  type: string
                  maxLength: 16
                  description: House number
                zip:
                  type: string
                  maxLength: 16
                  description: ZIP
                city:
                  type: string
                  maxLength: 128
                  description: City
                country_id:
                  type: integer
                  format: int32
                  description: Country id
                date_of_birth:
                  type: string
                  format: date
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  description: Date of birth
                phone_home:
                  type: string
                  maxLength: 50
                  description: Home phone number
                phone_home_area_code:
                  type: string
                  maxLength: 10
                  description: Home phone area code
                phone_mobile:
                  type: string
                  maxLength: 50
                  description: Mobile phone number
                phone_mobile_area_code:
                  type: string
                  maxLength: 10
                  description: Mobile phone area code
                phone_business:
                  type: string
                  maxLength: 50
                  description: Business phone number
                phone_business_area_code:
                  type: string
                  maxLength: 10
                  description: Business phone area code
                email_private:
                  type: string
                  maxLength: 255
                  description: Private email
                email_business:
                  type: string
                  maxLength: 255
                  description: Business email
                reference_field_1:
                  type: string
                  maxLength: 255
                  description: Reference field 1
                reference_field_2:
                  type: string
                  maxLength: 255
                  description: Reference field 2
                billing_company:
                  type: string
                  maxLength: 255
                  description: Billing company
                billing_salutation:
                  type: integer
                  format: int32
                  description: Billing salutation
                billing_title:
                  type: string
                  maxLength: 70
                  description: Billing title
                billing_firstname:
                  type: string
                  maxLength: 70
                  description: Billing firstname
                billing_surname:
                  type: string
                  maxLength: 70
                  description: Billing surname
                billing_street:
                  type: string
                  maxLength: 255
                  description: Billing street
                billing_house_number:
                  type: string
                  maxLength: 16
                  description: Billing house number
                billing_zip:
                  type: string
                  maxLength: 16
                  description: Billing ZIP
                billing_city:
                  type: string
                  maxLength: 128
                  description: Billing city
                billing_country_id:
                  type: integer
                  format: int32
                  description: Billing country id
                billing_email:
                  type: string
                  maxLength: 128
                  description: Billing email
                billing_phone:
                  type: string
                  maxLength: 128
                  description: Billing phone
                billing_fax:
                  type: string
                  maxLength: 128
                  description: Billing fax
                vehicle_manufacturer:
                  type: string
                  maxLength: 100
                  description: Vehicle manufacturer
                vehicle_model:
                  type: string
                  maxLength: 100
                  description: Vehicle model
                vehicle_license_plate:
                  type: string
                  maxLength: 50
                  description: Vehicle license plate
                vehicle_country_of_registration_id:
                  type: integer
                  format: int32
                  description: Vehicle country of registration
                auth_username:
                  type: string
                  maxLength: 255
                  description: App login username
                auth_password:
                  type: string
                  maxLength: 128
                  description: Auth password
                advertising_agreement_mail:
                  type: boolean
                  default: false
                  description: Advertising agreement mail
                advertising_agreement_phone:
                  type: boolean
                  default: false
                  description: Advertising agreement phone
                advertising_agreement_email:
                  type: boolean
                  default: false
                  description: Advertising agreement email
                accept_current_agb:
                  type: boolean
                  default: false
                  description: Accept current AGB
                accept_current_privacy_policy:
                  type: boolean
                  default: false
                  description: Accept current privacy policy
                vat_identification_number:
                  type: string
                  maxLength: 50
                  description: VAT identification number
                tax_code:
                  type: string
                  maxLength: 50
                  description: Tax code
                simulation:
                  type: boolean
                  default: false
                  description: Simulation mode
                start_date:
                  type: string
                  format: date
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  description: Start date
                attributes:
                  type: string
                  description: >-
                    JSON-encoded key-value pairs of attribute identifiers and
                    values
        required: true
      responses:
        '201':
          description: Contract created
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - contract
                properties:
                  contract:
                    type: object
                    properties:
                      uuid:
                        type: string
                        maxLength: 36
                        description: Contract UUID
                      type:
                        type: string
                        enum:
                          - energy
                          - energy_external
                          - energy_external_lima
                          - emobility
                          - emobility_adhoc
                          - non_commodity
                        description: Contract type
                      created_at:
                        type: string
                        format: date-time
                        pattern: >-
                          ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|[+-]\d{2}:\d{2})$
                        description: Contract creation date
                      ordered_at:
                        type: string
                        format: date-time
                        pattern: >-
                          ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|[+-]\d{2}:\d{2})$
                        description: Order date
                      status:
                        type: string
                        enum:
                          - open
                          - cancellation_previous
                          - delivery_net
                          - waiting
                          - active
                          - blocked
                          - terminated
                          - expired
                          - done
                          - cancelled
                        description: Contract status
                      modification_date:
                        type: string
                        format: date-time
                        pattern: >-
                          ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|[+-]\d{2}:\d{2})$
                        description: Modification date
                      is_locked:
                        type: boolean
                        default: false
                        description: Locked for editing
                      billing_blocked:
                        type: boolean
                        default: false
                        description: Billing blocked
                      dunning_locked:
                        type: boolean
                        default: false
                        description: Dunning locked
                      billable:
                        type: boolean
                        default: false
                        description: Billable
                      ext_contract_id:
                        type: string
                        maxLength: 50
                        description: External contract id
                      external_id:
                        type: string
                        maxLength: 15
                        description: External customer id
                      customer_group_id:
                        type: integer
                        format: int32
                        description: Customer group id
                      account_id:
                        type: integer
                        format: int32
                        description: Account id
                      campaign_id:
                        type: integer
                        format: int32
                        description: Campaign id
                      energy:
                        type: string
                        enum:
                          - electricity
                          - gas
                        description: Energy type
                      business:
                        type: boolean
                        default: false
                        description: Is business customer
                      company_name:
                        type: string
                        maxLength: 255
                        description: Company name
                      salutation:
                        type: integer
                        format: int32
                        description: Salutation
                      firstname:
                        type: string
                        maxLength: 70
                        description: Firstname
                      surname:
                        type: string
                        maxLength: 70
                        description: Surname
                      street:
                        type: string
                        maxLength: 255
                        description: Street
                      house_number:
                        type: string
                        maxLength: 16
                        description: House number
                      zip:
                        type: string
                        maxLength: 16
                        description: ZIP
                      city:
                        type: string
                        maxLength: 128
                        description: City
                      country_id:
                        type: integer
                        format: int32
                        description: Country id
                      phone:
                        type: string
                        maxLength: 255
                        description: Phone
                      fax:
                        type: string
                        maxLength: 255
                        description: Fax
                      email:
                        type: string
                        maxLength: 255
                        description: Email
                      reference_field_1:
                        type: string
                        maxLength: 255
                        description: Reference field 1
                      reference_field_2:
                        type: string
                        maxLength: 255
                        description: Reference field 2
                      billing_company:
                        type: string
                        maxLength: 255
                        description: Billing company
                      billing_salutation:
                        type: integer
                        format: int32
                        description: Billing salutation
                      billing_title:
                        type: string
                        maxLength: 70
                        description: Billing title
                      billing_firstname:
                        type: string
                        maxLength: 70
                        description: Billing firstname
                      billing_surname:
                        type: string
                        maxLength: 70
                        description: Billing surname
                      billing_street:
                        type: string
                        maxLength: 255
                        description: Billing street
                      billing_house_number:
                        type: string
                        maxLength: 16
                        description: Billing house number
                      billing_zip:
                        type: string
                        maxLength: 16
                        description: Billing ZIP
                      billing_city:
                        type: string
                        maxLength: 128
                        description: Billing city
                      billing_country_id:
                        type: integer
                        format: int32
                        description: Billing country id
                      billing_email:
                        type: string
                        maxLength: 128
                        description: Billing email
                      billing_phone:
                        type: string
                        maxLength: 128
                        description: Billing phone
                      billing_fax:
                        type: string
                        maxLength: 128
                        description: Billing fax
                      title:
                        type: string
                        maxLength: 50
                        description: Title
                      tax_code:
                        type: string
                        maxLength: 50
                        description: Tax code
                      external_customer_id:
                        type: string
                        maxLength: 15
                        description: External customer ID
                      auth_enabled:
                        type: boolean
                        default: false
                        description: App login enabled
                      auth_username:
                        type: string
                        maxLength: 255
                        description: App login username
                      phone_home:
                        type: string
                        maxLength: 50
                        description: Home phone number
                      phone_home_area_code:
                        type: string
                        maxLength: 10
                        description: Home phone area code
                      phone_mobile:
                        type: string
                        maxLength: 50
                        description: Mobile phone number
                      phone_mobile_area_code:
                        type: string
                        maxLength: 10
                        description: Mobile phone area code
                      phone_business:
                        type: string
                        maxLength: 50
                        description: Business phone number
                      phone_business_area_code:
                        type: string
                        maxLength: 10
                        description: Business phone area code
                      email_private:
                        type: string
                        maxLength: 255
                        description: Private email
                      email_business:
                        type: string
                        maxLength: 255
                        description: Business email
                      vehicle_manufacturer:
                        type: string
                        maxLength: 100
                        description: Vehicle manufacturer
                      vehicle_model:
                        type: string
                        maxLength: 100
                        description: Vehicle model
                      vehicle_license_plate:
                        type: string
                        maxLength: 50
                        description: Vehicle license plate
                      vehicle_country_of_registration_id:
                        type: integer
                        format: int32
                        description: Vehicle country of registration
                      advertising_agreement_mail:
                        type: boolean
                        default: false
                        description: Advertising agreement mail
                      advertising_agreement_phone:
                        type: boolean
                        default: false
                        description: Advertising agreement phone
                      advertising_agreement_email:
                        type: boolean
                        default: false
                        description: Advertising agreement email
                      accept_current_agb:
                        type: boolean
                        default: false
                        description: Accept current AGB
                      accept_current_privacy_policy:
                        type: boolean
                        default: false
                        description: Accept current privacy policy
                    required:
                      - uuid
                      - type
                      - is_locked
                      - billing_blocked
                      - dunning_locked
                      - billable
                      - account_id
                      - campaign_id
                      - energy
                      - business
                      - salutation
                      - firstname
                      - surname
                      - street
                      - house_number
                      - zip
                      - city
                      - phone
                      - fax
                      - email
                      - billing_salutation
                      - billing_firstname
                      - billing_surname
                      - billing_street
                      - billing_house_number
                      - billing_zip
                      - billing_city
                      - billing_email
                      - billing_phone
                    description: Contract
                  customer_id:
                    type: integer
                    format: int32
                    description: Customer ID
                  external_customer_id:
                    type: string
                    description: External customer ID
                  mail_verification_needed:
                    type: boolean
                    default: false
                    description: Mail verification needed
                  contract_confirmation_needed:
                    type: boolean
                    default: false
                    description: Contract confirmation needed
        '401':
          description: Unauthorized
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '403':
          description: Forbidden
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '404':
          description: Not found
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '405':
          description: Method not allowed
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '422':
          description: Request validation failed
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - errors
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        errorKey:
                          type: string
                          description: A key identifying the error
                        message:
                          type: string
                          description: The error message
                        parameter:
                          type: string
                          description: The parameter that caused the error, if any
                      required:
                        - errorKey
                        - message
                        - parameter
                      description: Error
                    description: List of errors
        '429':
          description: Too many requests
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '500':
          description: Internal server error
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
      security:
        - bearer:
            - crm:contract
components:
  headers:
    Content-Language:
      description: The locale of the response content (BCP 47 language tag).
      schema:
        type: string
        example: en
  securitySchemes:
    bearer:
      type: http
      description: OAuth2 Bearer Authorization
      scheme: bearer
      bearerFormat: JWT

````

## Related topics

- [Creates a location](/api-reference/locations/creates-a-location.md)
- [Creates a parking](/api-reference/parking/creates-a-parking.md)
- [Creates a plug](/api-reference/plugs/creates-a-plug.md)
