openapi: 3.0.0
info:
  description: >
    This is the specification of the bLink 'customer-management' module API. (as
    implemented by SIX and used by clients (e.g. third party providers)) 

    This API is part of the OpenWealth APIs for the connectivity between custody
    banks and WealthTechs (e.g. Portfolio Management Systems). This API allows
    the user to receive data from custody banks regarding customer data and
    alter and create address and contact data.
  version: 1.0.9.4-six
  title: bLink API - customer management module
  contact:
    name: SIX BBS AG
    url: https://www.six-group.com/en/products-services/banking-services/blink.html
servers:
  - url: >-
      https://api.six-group.com/api/bankingservices/b-link-consent-2/customer-management/v1
paths:
  /customers:
    get:
      summary: Returns a list of customers.
      description: >-
        Returns a list of all customers. A customer is an object which holds a
        contract with a (custody-)bank. Paging is done based on the customer
        object, i.e. if limit is set to 1, then 1 customer will be returned per
        page.
      operationId: getCustomers
      tags:
        - customer
      parameters:
        - $ref: '#/components/parameters/cursor'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/correlation_in_header'
        - $ref: '#/components/parameters/authorization_in_header'
        - $ref: '#/components/parameters/agent_in_header'
        - $ref: '#/components/parameters/targetid_in_header'
        - $ref: '#/components/parameters/psu_ip_in_header'
        - $ref: '#/components/parameters/psu_user_agent_in_header'
      responses:
        '200':
          description: A customer object list.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
            nextCursor:
              $ref: '#/components/headers/nextCursor'
            X-CorAPI-Source:
              $ref: '#/components/headers/X-CorAPI-Source'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/customer'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '503':
          $ref: '#/components/responses/standard503'
  /customers/{customerId}:
    parameters:
      - $ref: '#/components/parameters/cursor'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/customerId'
      - $ref: '#/components/parameters/correlation_in_header'
      - $ref: '#/components/parameters/authorization_in_header'
      - $ref: '#/components/parameters/agent_in_header'
      - $ref: '#/components/parameters/targetid_in_header'
      - $ref: '#/components/parameters/psu_ip_in_header'
      - $ref: '#/components/parameters/psu_user_agent_in_header'
    get:
      summary: Returns a specific customer.
      description: Returns a full client record for a specific customer id.
      operationId: getCustomerByCustomerId
      tags:
        - customer
      responses:
        '200':
          description: A specific customer object.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
            X-CorAPI-Source:
              $ref: '#/components/headers/X-CorAPI-Source'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customer'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '503':
          $ref: '#/components/responses/standard503'
  /customers/{customerId}/kyc:
    parameters:
      - $ref: '#/components/parameters/cursor'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/customerId'
      - $ref: '#/components/parameters/correlation_in_header'
      - $ref: '#/components/parameters/authorization_in_header'
      - $ref: '#/components/parameters/agent_in_header'
      - $ref: '#/components/parameters/targetid_in_header'
      - $ref: '#/components/parameters/psu_ip_in_header'
      - $ref: '#/components/parameters/psu_user_agent_in_header'
    get:
      summary: Returns the kyc to a specific customer.
      description: Returns the know-your-client record for a specific customer.
      operationId: getKycByCustomerId
      tags:
        - kyc
      responses:
        '200':
          description: A specific kyc object.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
            X-CorAPI-Source:
              $ref: '#/components/headers/X-CorAPI-Source'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customerAndKycResponse'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '503':
          $ref: '#/components/responses/standard503'
  /persons:
    parameters:
      - $ref: '#/components/parameters/cursor'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/correlation_in_header'
      - $ref: '#/components/parameters/authorization_in_header'
      - $ref: '#/components/parameters/agent_in_header'
      - $ref: '#/components/parameters/targetid_in_header'
      - $ref: '#/components/parameters/psu_ip_in_header'
      - $ref: '#/components/parameters/psu_user_agent_in_header'
    get:
      summary: Returns a list with all person objects.
      description: >-
        Returns all person records. Paging is done based on the person object,
        i.e. if limit is set to 1, then 1 person will be returned per page.
      operationId: getPersons
      tags:
        - person
      responses:
        '200':
          description: A person list.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
            nextCursor:
              $ref: '#/components/headers/nextCursor'
            X-CorAPI-Source:
              $ref: '#/components/headers/X-CorAPI-Source'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/person'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '503':
          $ref: '#/components/responses/standard503'
  /persons/{personId}:
    parameters:
      - $ref: '#/components/parameters/personId'
      - $ref: '#/components/parameters/cursor'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/correlation_in_header'
      - $ref: '#/components/parameters/authorization_in_header'
      - $ref: '#/components/parameters/agent_in_header'
      - $ref: '#/components/parameters/targetid_in_header'
      - $ref: '#/components/parameters/psu_ip_in_header'
      - $ref: '#/components/parameters/psu_user_agent_in_header'
    get:
      summary: Returns a specific person object.
      description: Returns a person record for a specific person id.
      operationId: getPersonByPersonId
      tags:
        - person
      responses:
        '200':
          description: A specific person object.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
            X-CorAPI-Source:
              $ref: '#/components/headers/X-CorAPI-Source'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/person'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '503':
          $ref: '#/components/responses/standard503'
  /persons/{personId}/contactdetails:
    parameters:
      - $ref: '#/components/parameters/personId'
      - $ref: '#/components/parameters/cursor'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/correlation_in_header'
      - $ref: '#/components/parameters/authorization_in_header'
      - $ref: '#/components/parameters/agent_in_header'
      - $ref: '#/components/parameters/targetid_in_header'
      - $ref: '#/components/parameters/psu_ip_in_header'
      - $ref: '#/components/parameters/psu_user_agent_in_header'
    get:
      summary: Returns the contact details for a specific person.
      description: Returns a contact detail list for a specific person id.
      operationId: getContactDetailsByPersonId
      tags:
        - person
      responses:
        '200':
          description: A contact detail list.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
            X-CorAPI-Source:
              $ref: '#/components/headers/X-CorAPI-Source'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/contactDetails'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '503':
          $ref: '#/components/responses/standard503'
    post:
      summary: Creates new contact details for a specific person.
      description: Creates new contact details for a specific person id.
      operationId: postContactDetailsByPersonId
      tags:
        - person
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/contactDetails'
      responses:
        '201':
          description: Contact details created.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contactDetails'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '503':
          $ref: '#/components/responses/standard503'
  /customers/{customerId}/addresses:
    parameters:
      - $ref: '#/components/parameters/customerId'
      - $ref: '#/components/parameters/cursor'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/correlation_in_header'
      - $ref: '#/components/parameters/authorization_in_header'
      - $ref: '#/components/parameters/agent_in_header'
      - $ref: '#/components/parameters/targetid_in_header'
      - $ref: '#/components/parameters/psu_ip_in_header'
      - $ref: '#/components/parameters/psu_user_agent_in_header'
    post:
      summary: Creates a new address object for a specific customer.
      operationId: postAddressByCustomerId
      tags:
        - address
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/addressNew'
      responses:
        '201':
          description: Successfully created a new address object.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
            X-CorAPI-Source:
              $ref: '#/components/headers/X-CorAPI-Source'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/addressIdentificationResponse'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '503':
          $ref: '#/components/responses/standard503'
    get:
      summary: Returns the address of a specific customer.
      description: Returns a address record for a specific address id.
      operationId: getAddressByCustomerId
      tags:
        - address
      responses:
        '200':
          description: A specific address object.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/address'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '503':
          $ref: '#/components/responses/standard503'
    put:
      summary: Updates an existing address object for a specific customer.
      operationId: putAddressByCustomerId
      tags:
        - address
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/address'
      responses:
        '204':
          description: No content.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '503':
          $ref: '#/components/responses/standard503'
  /healthcheck:
    get:
      tags:
        - diagnostics
      summary: >-
        Returns all specified request headers and additional diagnostic
        information
      operationId: healthCheckGet
      parameters:
        - $ref: '#/components/parameters/optional_correlation_in_header'
        - $ref: '#/components/parameters/optional_authorization_in_header'
        - $ref: '#/components/parameters/optional_agent_in_header'
        - $ref: '#/components/parameters/targetid_in_header'
        - $ref: '#/components/parameters/optional_psu_ip_in_header'
        - $ref: '#/components/parameters/optional_psu_user_agent_in_header'
      responses:
        '200':
          description: Health Check Response
          headers:
            X-CorAPI-Source:
              $ref: '#/components/headers/X-CorAPI-Source'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/healthCheckResponse'
    post:
      tags:
        - diagnostics
      summary: >-
        Returns all specified request headers, the request body and additional
        diagnostic information
      operationId: healthCheckPost
      parameters:
        - $ref: '#/components/parameters/optional_correlation_in_header'
        - $ref: '#/components/parameters/optional_authorization_in_header'
        - $ref: '#/components/parameters/optional_agent_in_header'
        - $ref: '#/components/parameters/targetid_in_header'
        - $ref: '#/components/parameters/optional_psu_ip_in_header'
        - $ref: '#/components/parameters/optional_psu_user_agent_in_header'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: string
      responses:
        '200':
          description: Health Check Response
          headers:
            X-CorAPI-Source:
              $ref: '#/components/headers/X-CorAPI-Source'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/healthCheckResponse'
components:
  parameters:
    customerId:
      name: customerId
      in: path
      required: true
      schema:
        type: string
      description: The customer's id
    personId:
      name: personId
      in: path
      required: true
      schema:
        type: string
      description: The persons's id
    limit:
      name: limit
      in: query
      description: Maximum number of items to return.
      required: false
      schema:
        type: integer
        format: int32
        minimum: 1
    cursor:
      name: cursor
      in: query
      description: An opaque string value used for pagination
      required: false
      schema:
        type: string
    targetid_in_header:
      name: X-CorAPI-Target-ID
      in: header
      description: >-
        ID that identifies the provider (e.g., a financial institution). (SCOPE:
        SIX required)
      required: true
      schema:
        type: string
    psu_ip_in_header:
      name: X-PSU-IP-Address
      in: header
      description: >-
        IP address of the user initiating the operation or AUTO for system
        triggered processes (SCOPE: SIX required)
      required: true
      schema:
        type: string
    psu_user_agent_in_header:
      name: X-PSU-User-Agent
      in: header
      description: >-
        User agent of the user initiating the operation or AUTO for system
        triggered processes (SCOPE: SIX required)
      required: true
      schema:
        type: string
    authorization_in_header:
      name: Authorization
      in: header
      description: Bearer followed by a base64 encoded OAuth access token
      required: true
      schema:
        type: string
    optional_authorization_in_header:
      name: Authorization
      in: header
      description: Bearer followed by a base64 encoded OAuth access token
      required: false
      schema:
        type: string
    correlation_in_header:
      name: X-Correlation-ID
      in: header
      description: >-
        Unique ID (defined by the caller) which will be reflected back in the
        response.
      required: true
      schema:
        type: string
        maxLength: 64
    agent_in_header:
      name: User-Agent
      in: header
      description: Name and version of the of the Client software
      required: true
      schema:
        type: string
    optional_targetid_in_header:
      name: X-CorAPI-Target-ID
      in: header
      description: 'ID of the target, e.g., a financial institution. (SCOPE: FI - optional)'
      required: false
      schema:
        type: string
    optional_correlation_in_header:
      name: X-Correlation-ID
      in: header
      description: >-
        Unique ID (defined by the caller) which will be reflected back in the
        response.
      required: false
      schema:
        type: string
        maxLength: 64
    optional_agent_in_header:
      name: User-Agent
      in: header
      description: Name and version of the of the client software
      required: false
      schema:
        type: string
    optional_psu_ip_in_header:
      name: X-PSU-IP-Address
      in: header
      description: 'IP address of the user initiating the operation (SCOPE: FI - optional)'
      required: false
      schema:
        type: string
    optional_psu_user_agent_in_header:
      name: X-PSU-User-Agent
      in: header
      description: 'User of the client software (SCOPE: FI - optional)'
      required: false
      schema:
        type: string
  headers:
    Content-Language:
      description: always en
      schema:
        type: string
    WWW-Authenticate:
      description: i.e. "Bearer error='invalid_token'" according to RFC6750 section-3
      schema:
        type: string
    X-Correlation-ID:
      description: >-
        Client defined ID from request to correlate HTTP requests between a
        client and a server
      schema:
        type: string
        maxLength: 64
        example: f058ebd6-02f7-4d3f-942e-904344e8cde5
    X-CorAPI-Source:
      description: >
        Indicates whether the response was created by the bLink platform or by
        the provider.
      schema:
        type: string
        enum:
          - PLATFORM
          - PROVIDER
    nextCursor:
      description: An opaque string value, or an empty string if there are no more results.
      required: false
      schema:
        type: string
  schemas:
    customer:
      type: object
      required:
        - customerIdentification
        - status
      properties:
        customerIdentification:
          type: string
          minLength: 1
          maxLength: 35
          example: 987654321
          description: Customer ID of the bank
        externalReference:
          type: string
          maxLength: 35
          example: 123-456-787
          description: External customer ID
        name:
          type: string
          maxLength: 70
          example: Steve Rogers
          description: Name of the customer object
        status:
          type: string
          example: active
          enum:
            - active
            - inactive
            - closed
          description: Status of the customer
        referenceCurrency:
          $ref: '#/components/schemas/currency'
        openingDate:
          $ref: '#/components/schemas/date'
        personList:
          type: array
          items:
            type: object
            properties:
              personRelation:
                type: string
                example: accountOwner
                description: >-
                  Indicates what relation this person has to the specified
                  customer.
                enum:
                  - beneficialOwner
                  - authorisedRepresentative
                  - assetManager
                  - accountOwner
                  - authorisedSignatory
                  - other
              personIdentification:
                type: string
                maxLength: 35
                example: 876543219
                description: Bank identification of the person
        addressList:
          type: array
          description: List of addresses associated with the customer
          items:
            type: object
            properties:
              addressIdentification:
                type: number
                example: 12345678
                description: Bank ID of the address object
    person:
      type: object
      required:
        - personIdentification
        - personDetails
      properties:
        personIdentification:
          type: string
          minLength: 1
          maxLength: 35
          example: 876543219
          description: Bank identification of the person
        externalReference:
          type: string
          maxLength: 35
          example: 987-654-321
          description: External person ID
        customerList:
          type: array
          items:
            type: object
            properties:
              customerIdentification:
                type: string
                maxLength: 35
                example: 123123
        fullName:
          type: string
          maxLength: 70
          example: Tony Stark
          description: Name of the person object
        countryOfDomicile:
          $ref: '#/components/schemas/country'
        language:
          type: string
          maxLength: 35
          example: German
          description: Language for all communication concerning the account
        contactInformation:
          type: array
          items:
            $ref: '#/components/schemas/contactDetails'
        personDetails:
          $ref: '#/components/schemas/personDetails'
        taxDomicile:
          type: array
          description: Indicates the tax domiciles of the person
          items:
            $ref: '#/components/schemas/country'
    personDetails:
      description: Further details about the person. Schema depends on personType.
      type: object
      required:
        - personType
      properties:
        personType:
          type: string
          enum:
            - naturalPerson
            - legalPerson
            - personAssociation
            - trust
            - soleProprietorship
          example: naturalPerson
          description: Indicates the type of the personDetails object
      discriminator:
        propertyName: personType
    naturalPerson:
      allOf:
        - $ref: '#/components/schemas/personDetails'
        - type: object
          properties:
            givenName:
              type: string
              maxLength: 35
              example: Anthony
              description: Given name of the person
            middleName:
              type: string
              maxLength: 35
              example: Edward
              description: Middle name of the person
            lastName:
              type: string
              maxLength: 35
              example: Stark
              description: Last name of the person
            title:
              type: string
              maxLength: 35
              example: PhD
              description: Official title of the person
            dates:
              type: array
              items:
                type: object
                properties:
                  date:
                    $ref: '#/components/schemas/date'
                  dateType:
                    description: Type of the date
                    type: string
                    enum:
                      - birthDate
                      - divorceDate
                      - deathDate
            gender:
              type: string
              enum:
                - male
                - female
                - other
              example: male
              description: Gender of the person
            nationality:
              type: array
              description: Indicates the nationality of the person
              items:
                $ref: '#/components/schemas/country'
            civilStatus:
              type: string
              enum:
                - unmarried
                - married
                - divorced
                - widowed
              example: married
              description: Civil status of the individual person
            TIN:
              type: string
              maxLength: 35
              example: 123-12-1234
    legalPerson:
      allOf:
        - $ref: '#/components/schemas/personDetails'
        - type: object
          required:
            - organisationName
            - legalForm
            - domicilaryCompany
          properties:
            organisationName:
              type: string
              minLength: 1
              maxLength: 35
              description: >-
                Name by which the organisation is known and which is usually
                used to identify that organisation
              example: Stark Industries
            legalForm:
              type: string
              maxLength: 35
              description: Legal status of the company
              example: AG
            LEI:
              type: string
              pattern: '[A-Z0-9]{18,18}[0-9]{2,2}'
              example: 529900UVM8LC55IFAA52
              description: Legal entity identifier
            domicilaryCompany:
              type: boolean
              description: Indicates whether the company is a domiciliary company
              example: false
    personAssociation:
      allOf:
        - $ref: '#/components/schemas/personDetails'
        - type: object
          required:
            - personAssociationName
          properties:
            personAssociationName:
              type: string
              minLength: 1
              maxLength: 70
              description: Name of the association object
              example: Anthony Stark a/o Piper Potts
            personAssociationType:
              type: string
              enum:
                - compteJoint
                - jointHeirs
                - unregisteredPartnership
                - limitedPartnership
                - collectiveProprietorship
              description: Type of association
              example: compteJoint
    trust:
      allOf:
        - $ref: '#/components/schemas/personDetails'
        - type: object
          required:
            - trustName
            - trustType
          properties:
            trustName:
              type: string
              minLength: 1
              maxLength: 70
              description: Name of the trust object
              example: Spiderman Trust
            trustType:
              type: string
              enum:
                - simpleTrust
                - complexTrust
                - grantorTrust
              description: Type of trust
              example: simpleTrust
    soleProprietorship:
      allOf:
        - $ref: '#/components/schemas/personDetails'
        - type: object
          required:
            - soleProprietorshipName
          properties:
            soleProprietorshipName:
              type: string
              minLength: 1
              maxLength: 70
              description: Name of the sole proprietorship object
              example: Anthony Stark
    kyc:
      type: object
      properties:
        nonFinancialSituation:
          type: object
          properties:
            profession:
              type: string
              maxLength: 35
              description: Name of the occupation or job of the person
              example: Philantropist
            employingCompany:
              type: string
              maxLength: 35
              description: >-
                Organisation represented by a person, or for which a person
                works
              example: Stark Industries
            educationLevel:
              type: string
              maxLength: 70
              description: Highest level of education reached by the individual person
              example: University
            function:
              type: string
              maxLength: 35
              description: Title of the job function
              example: CEO
            typeOfEmployment:
              type: string
              description: Type of employment of the natural person
              enum:
                - selfEmployed
                - employed
                - unemployed
                - retired
              example: employed
            riskDomicile:
              $ref: '#/components/schemas/country'
            reasonForDomiciliaryCompany:
              type: string
              maxLength: 35
              description: Describes the reason for domiciliary company
              example: Wealth management
            sector:
              type: string
              maxLength: 70
              description: Sector of economic activity
              example: Energy supply
            numberOfEmployees:
              type: integer
              description: Number of employees
              example: 250
            dateOfIncorporation:
              $ref: '#/components/schemas/date'
            companyPurpose:
              type: string
              maxLength: 70
              description: Describes the purpose of the company
              example: Provide sustainable energy
            structureControllingPerson:
              type: string
              maxLength: 70
              description: Structures of controlling persons
              example: Anthony Stark (75%), Piper Potts (25%)
            structureBeneficialOwners:
              type: string
              maxLength: 70
              description: Structure of beneficial owners
              example: Anthony Stark (100%)
            reasonForTrust:
              type: string
              maxLength: 70
              description: Describes the reason for the trust
              example: Succession Planning
            revocability:
              type: boolean
              description: Indicates whether the trust is revocable or not
              example: true
            resettled:
              type: boolean
              description: Indicates whether the trust is resettled
              example: false
            merged:
              type: boolean
              description: Indicates whether the trust is merged
              example: false
            beneficialOwner:
              type: string
              maxLength: 70
              description: >-
                Ultimate party that is entitled to either receive the benefits
                of the ownership of a financial instrument, or to be
                paid/credited as a result of a transfer
              example: Max Muster
            beneficiary:
              type: string
              maxLength: 70
              example: Peter Parker
            protector:
              type: string
              maxLength: 70
              description: >-
                Person appointed under the trust instrument to direct or
                restrain the trustees in relation to their administration of the
                trust. Typically, this is a controlling person of a trust.
              example: Stark Industries
            dateOfTrustContract:
              $ref: '#/components/schemas/date'
        financialSituation:
          type: object
          properties:
            incomeCurrentPeriod:
              type: object
              description: Income received in the current income year
              properties:
                currency:
                  $ref: '#/components/schemas/currency'
                amount:
                  type: string
                  pattern: '[0-9]{1,12}([.][0-9]{1,9})?'
                  maxLength: 22
                  example: '100000'
            sourceOfIncome:
              type: string
              description: Specifies the origin of the income
              enum:
                - income
                - savings
                - inheritance
                - lifeInsurance
                - pensionFunds
                - gift
              example: income
            annualTurnover:
              type: object
              description: Indicates the annual turnover
              properties:
                currency:
                  $ref: '#/components/schemas/currency'
                amount:
                  type: string
                  pattern: '[0-9]{1,12}([.][0-9]{1,9})?'
                  maxLength: 22
                  example: '200000'
            monetaryWealth:
              type: object
              description: >-
                Annual wealth of the individual person or share capital value of
                the legal entity 
              properties:
                currency:
                  $ref: '#/components/schemas/currency'
                amount:
                  type: string
                  pattern: '[0-9]{1,12}([.][0-9]{1,9})?'
                  maxLength: 22
                  example: '1000000'
            sourceOfWealth:
              type: array
              description: Indicates the sources of wealth of the customer.
              items:
                type: object
                properties:
                  sourceOfWealth:
                    type: string
                    description: Indicates the type of the sources of wealth
                    example: inheritance
                    enum:
                      - retirementPolicy
                      - selfEmploymentIncome
                      - employeeIncome
                      - savings
                      - gift
                      - inheritance
                      - redemtion
                      - winnings
                      - insurancePremiumLiquidation
                      - saleOfGoods
                      - realEstateSale
                      - saleAquisitionCorporation
                      - cashProceeds
                      - alimony
                      - compensation
                      - other
                  currency:
                    $ref: '#/components/schemas/currency'
                  amount:
                    type: string
                    pattern: '[0-9]{1,12}([.][0-9]{1,9})?'
                    maxLength: 22
                    example: '25000000'
                  dateOfReceipt:
                    $ref: '#/components/schemas/date'
                  originator:
                    type: object
                    description: >-
                      Information about the founder/donor/testator that left the
                      money for the customer.
                    properties:
                      name:
                        type: string
                        maxLength: 70
                        description: Name of the originator, e.g. founder/donor/testator
                        example: Howard Stark
                      relationToCustomer:
                        type: string
                        maxLength: 35
                        description: Relation of the originator to the customer
                        example: Relatives
                      occupation:
                        type: string
                        maxLength: 35
                        description: >-
                          Describes the (former) occupation of the originator
                          (founder/donor/testator)
                        example: Technology Provider
            priorBank:
              type: object
              properties:
                namePriorBank:
                  type: string
                  maxLength: 70
                domicilePriorBank:
                  $ref: '#/components/schemas/country'
    customerAndKycResponse:
      type: object
      description: Wrapper object for a customer and a kyc
      properties:
        customer:
          $ref: '#/components/schemas/customer'
        kyc:
          $ref: '#/components/schemas/kyc'
    contactDetails:
      type: object
      required:
        - medium
        - contactContent
      properties:
        contactIdentification:
          type: string
          maxLength: 35
          example: 123987
          readOnly: true
        medium:
          type: string
          description: Medium for contacting the client.
          example: phone
          enum:
            - email
            - phone
            - fax
            - website
            - socialMediaProfile
        contactMediumType:
          type: string
          description: Specifies the type of contact details
          example: business
          enum:
            - private
            - business
        contactContent:
          type: string
          minLength: 1
          maxLength: 70
          description: >-
            Content of the contact details, e.g. phone number, email-address,
            Website URL
          example: 41998887766
        additionalContactInformation:
          type: string
          maxLength: 70
          description: Used for additional information regarding the contact details
          example: Prio 1 Phone Number
    addressNew:
      type: object
      properties:
        addressName:
          type: string
          maxLength: 70
          example: Stark Mansion
          description: Name of the address object
        mailingInstruction:
          type: string
          maxLength: 35
          example: MainDispatch
          description: Mailing instruction
        postalAddress:
          $ref: '#/components/schemas/postalAddress'
    address:
      type: object
      required:
        - addressIdentification
        - dispatchType
      properties:
        addressIdentification:
          type: number
          example: 12345678
          description: Bank ID of the address object
        addressName:
          type: string
          maxLength: 70
          example: Stark Mansion
          description: Name of the address object
        isDomicile:
          type: boolean
          description: Indicates whether this address is the domicile address
          example: true
        isMailingAddress:
          type: boolean
          description: Indicates whether this address is used for mailing purposes.
          example: true
        mailingInstruction:
          type: string
          maxLength: 35
          example: MainDispatch
          description: Mailing instruction
        dispatchType:
          type: string
          description: >-
            Indicates wether the correspondance is sent out digitally (e.g. to
            the e-banking) or physically.
          enum:
            - postal
            - electronical
            - other
        language:
          type: string
          maxLength: 35
          example: German
          description: Language for all communication concerning this address
        postalAddress:
          $ref: '#/components/schemas/postalAddress'
    postalAddress:
      type: object
      required:
        - salutation
        - isDomicile
        - isMailingAddress
        - postCode
        - townName
        - country
      properties:
        salutation:
          type: object
          properties:
            receptionRestriction:
              type: string
              maxLength: 35
              description: Reception restrictions of physical delivery of mail
              example: confidential
            salutation:
              type: string
              maxLength: 35
              description: Salutation of the person
              example: Mr.
            title:
              type: string
              maxLength: 35
              description: >-
                Additional information about the person that follows a person's
                name, for example, qualification such as Doctor of Philosophy
                (PhD).
              example: PhD
            overrideSalutation:
              type: string
              maxLength: 35
              example: Dear Ironman
              description: Used to override the salutations in letters.
        name:
          type: object
          properties:
            organisationName:
              type: string
              maxLength: 70
              description: >-
                Name by which the organisation is known and which is usually
                used to identify that organisation
              example: Strak Industries
            givenName:
              type: string
              maxLength: 35
              description: First name of the person
              example: Anthony
            middleName:
              type: string
              maxLength: 35
              description: Second- or middlename of the person
              example: Edward
            lastName:
              type: string
              maxLength: 35
              description: Last name of the person
              example: Stark
            nameSuffix:
              type: string
              maxLength: 35
              description: Additional information on a name of the person
              example: jr.
        physicalAddress:
          type: object
          properties:
            careOf:
              type: string
              maxLength: 35
              description: >-
                When the individual resides at another person's address, the
                name of the other person
              example: Piper Potts
            toTheAttentionOf:
              type: string
              maxLength: 35
              description: >-
                When the mail should be distributed to a specific person within
                a company
              example: Jarvis
            streetName:
              type: string
              maxLength: 35
              description: Name of the street or thoroughfare
              example: Malibu Point
            buildingNumber:
              type: string
              maxLength: 35
              description: Number that identifies the position of the building on a street
              example: 10880
            postBox:
              type: string
              maxLength: 35
              description: >-
                Post box number of the addressee within the residential or
                company building
              example: 12
            addressSuffix:
              type: string
              maxLength: 35
              description: Additional infromation
              example: Appartment 1
            postCode:
              type: string
              maxLength: 35
              description: >-
                Identifier consisting of a group of letters and/or numbers that
                is added to a postal address to assist the sorting of mail
              example: 90265
            townName:
              type: string
              maxLength: 35
              description: Name of the town or city
              example: Malibu
            countrySubDivision:
              type: string
              maxLength: 35
              description: >-
                Identifies a subdivision of a country such as state, region,
                county
              example: CA
            country:
              $ref: '#/components/schemas/country'
    addressIdentificationResponse:
      type: object
      properties:
        addressIdentification:
          type: string
          example: 7353
          description: ID of the newly created address object.
    country:
      type: string
      pattern: '[A-Z]{2}'
      example: CH
      description: 2-Letter ISO 3166-2 Country Code
    currency:
      description: ISO 4217 code
      type: string
      pattern: '[A-Z]{3}'
      example: CHF
    date:
      type: string
      format: date
      description: Date according to ISO 8601 i.e. YYYY-MM-DD format
      example: '2018-04-13'
    healthCheckResponse:
      title: Health Check Response
      type: object
      properties:
        requestDateTime:
          title: Request Time
          type: string
          format: date-time
          example: '2018-04-13T11:11:11Z'
        receivedHeaders:
          title: Received Headers
          type: array
          items:
            type: object
            properties:
              headerName:
                type: string
                example: X-Correlation-ID
              headerValue:
                type: string
                description: As received
        receivedPayload:
          title: Received Payload
          type: string
          example: ... as received ...
    commonErrorResponse:
      title: Common Error Response
      type: object
      properties:
        type:
          $ref: '#/components/schemas/commonErrorType'
        title:
          type: string
          example: This is the general problem description
        detail:
          type: string
          example: >-
            Detailed problem description with respect to the current request,
            e.g., invalid account number format
        instance:
          type: string
          example: path/to/corresponding/resource
    commonErrorType:
      title: Common Error Type
      type: string
      description: >-
        Error Types for commonErrorResponse. See Appendix for detailed
        information.
      example: /problems/TECHNICAL_ERROR
      enum:
        - /problems/INVALID_PAYLOAD
        - /problems/MALFORMED_PAYLOAD
        - /problems/INVALID_TOKEN
        - /problems/EXPIRED_TOKEN
        - /problems/INSUFFICIENT_PRIVILEGES
        - /problems/NO_ACCESS_TO_RESOURCE
        - /problems/RESOURCE_DOES_NOT_EXIST
        - /problems/RESOURCE_NOT_READY
        - /problems/RESOURCE_TOO_LARGE
        - /problems/WRONG_METHOD
        - /problems/OPERATION_NOT_ALLOWED
        - /problems/TECHNICAL_ERROR
        - /problems/NOT_IMPLEMENTED
  responses:
    standard400:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        WWW-Authenticate:
          $ref: '#/components/headers/WWW-Authenticate'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
        X-CorAPI-Source:
          $ref: '#/components/headers/X-CorAPI-Source'
      description: Bad Request - The format of the request was invalid.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard401:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        WWW-Authenticate:
          $ref: '#/components/headers/WWW-Authenticate'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
        X-CorAPI-Source:
          $ref: '#/components/headers/X-CorAPI-Source'
      description: >-
        Unauthorized - Either no token or an invalid (e.g., token expired) token
        was received.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard403:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        WWW-Authenticate:
          $ref: '#/components/headers/WWW-Authenticate'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
        X-CorAPI-Source:
          $ref: '#/components/headers/X-CorAPI-Source'
      description: >-
        Forbidden - A valid OAuth Token was received, but access was denied.
        (Depending on the security requirements, providers can return 404
        instead)
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard404:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
        X-CorAPI-Source:
          $ref: '#/components/headers/X-CorAPI-Source'
      description: >-
        Not Found - Either the endpoint does not exist or a requested resource
        is not yet available (e.g., account statements)
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard405:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
        X-CorAPI-Source:
          $ref: '#/components/headers/X-CorAPI-Source'
      description: Method Not Allowed
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard500:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
        X-CorAPI-Source:
          $ref: '#/components/headers/X-CorAPI-Source'
      description: Internal Server Error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard501:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
        X-CorAPI-Source:
          $ref: '#/components/headers/X-CorAPI-Source'
      description: Not Implemented
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard503:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
        X-CorAPI-Source:
          $ref: '#/components/headers/X-CorAPI-Source'
      description: Service Unavailable
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
