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

# Add new connection

> Returns the url that can be used by your client to enable his integrations.



## OpenAPI

````yaml post /consumers/{consumer_id}/connections
openapi: 3.1.0
info:
  title: Chift API
  description: >-
    The Chift API is a universal API giving you access to financial data from
    the software of your clients. It helps software companies to offer native
    integrations to their clients without the effort needed to maintain those
    native integrations. By using the APIs (Accounting, POS, eCommerce) of
    Chift, you connect once and allow your clients to use their software
    packages.
  version: 1.0.0
servers:
  - url: https://api.chift.eu
    description: Chift
security:
  - bearerAuth: []
paths:
  /consumers/{consumer_id}/connections:
    post:
      tags:
        - Connections
      summary: Add new connection
      description: >-
        Returns the url that can be used by your client to enable his
        integrations.
      operationId: connections_create_connection
      parameters:
        - name: consumer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Consumer Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/PostConnectionItem'
                - type: 'null'
              title: Item
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkItem'
        '400':
          content:
            application/json:
              examples:
                Integration is not valid or active:
                  value:
                    message: >-
                      The specified integrationid is not valid, is not active or
                      does not exist
                    status: error
                Connection already exists:
                  value:
                    message: >-
                      There is already an active connection for the
                      integrationid {integrationid}. Only one can be created for
                      each consumer for each integrationid.
                    status: error
                Invalid country code:
                  value:
                    message: '{country_code} is not a valid country code.'
                    status: error
                Country not supported:
                  value:
                    message: No integration supports country '{country_code}'
                    status: error
                Missing credentials:
                  value:
                    message: Missing at least one credential for this integration
                    status: error
                Missing postconnection value:
                  value:
                    message: >-
                      Missing at least one post connection value for this
                      integration. When providing post connection values, make
                      sure to provide all mandatory post connection values.
                    status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Bad Request
        '404':
          content:
            application/json:
              example:
                message: The consumer does not exist
                status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Not Found
        '422':
          content:
            application/json:
              example:
                message: Invalid datetime format in key {key}
                status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Unprocessable Entity
      security:
        - mcp_auth:
            - connections
components:
  schemas:
    PostConnectionItem:
      properties:
        integrationid:
          anyOf:
            - type: integer
            - type: 'null'
          title: Integrationid
          description: >-
            Can be used to specify the integration code of a specific connector.
            If specified, the url will point directly to the connection page of
            the connector and will redirect on save to the redirect url of the
            consumer if specified.
        name:
          anyOf:
            - type: string
              maxLength: 80
            - type: 'null'
          title: Name
          description: >-
            Can be used to specify the name of the connection. Must be used in
            combination with an integrationid.
        credentials:
          anyOf:
            - items:
                $ref: '#/components/schemas/CredentialItem'
              type: array
            - type: 'null'
          title: Credentials
          description: >-
            Can be used to specify the credentials of your connection. Must be
            used in combination with an integrationid and a name. Please use the
            getIntegrations route to see the available credentials for each
            integration
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: >-
            ISO 3166-1 alpha-2 country code to filter connectors by country.
            Ignored if integrationid is provided.
        redirect:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Redirect
          description: >-
            Indicates whether you want to return to the consumer's redirectUrl
            after creation (true) or whether you want to stay on the connection
            selection page (false)(This field is ignored if integrationid is
            provided)
          default: false
        apis:
          anyOf:
            - items:
                type: string
                enum:
                  - Point of Sale
                  - eCommerce
                  - Accounting
                  - Invoicing
                  - Banking
                  - Custom
                  - Payment
                  - Property Management System
              type: array
            - type: 'null'
          title: Apis
          description: >-
            Can be used to filter connectors by APIs. Ignored if integrationid
            is provided.
      type: object
      title: PostConnectionItem
    LinkItem:
      properties:
        url:
          type: string
          title: Url
      type: object
      required:
        - url
      title: LinkItem
    ChiftError:
      properties:
        message:
          type: string
          title: Message
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          default: error
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          default: ''
      type: object
      required:
        - message
      title: ChiftError
    CredentialItem:
      properties:
        key:
          type: string
          title: Key
        value:
          type: string
          title: Value
      type: object
      required:
        - key
        - value
      title: CredentialItem
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        This access token needs to be included in each of your request to the
        Chift API.

````