openapi: 3.2.0
info:
  title: CX-0009 CX Registration API
  version: 2.1.0
tags:
  - name: Core Service Provider B
    description: Endpoints to be implemented by the Core Service Provider B.
paths:
  /api/administration/registration/network/partnerregistration:
    post:
      tags:
        - Core Service Provider B
      summary: 'Registers a partner company (Authorization required - Roles: configure_partner_registration)'
      requestBody:
        description: Data for the registration
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartnerRegistrationData'
            example:
              externalId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
              name: "Example GmbH"
              city: "Munich"
              streetName: "Main street"
              streetNumber: "42"
              streetAdditional: null
              zipCode: "80331"
              region: "BY"
              countryAlpha2Code: "DE"
              bpn: "BPNL000000055EPN"
              shortName: "ExGmbH"
              uniqueIds:
                - type: "COMMERCIAL_REG_NUMBER"
                  value: "HRB 123456"
              userDetails:
                - identityProviderId: "3fa85f64-5717-4562-b3fc-2c963f66afa6"
                  providerId: "ext-user-001"
                  username: "jane.doe"
                  firstName: "Jane"
                  lastName: "Doe"
                  email: "jane.doe@example.com"
              companyRoles:
                - "ACTIVE_PARTICIPANT"
      responses:
        '200':
          description: Empty response on success.
        '500':
          description: Internal Server Error
        '401':
          description: The user is unauthorized.
  /api/administration/osp/v2/participant-registration:
    post:
      tags:
        - Core Service Provider B
      summary: 'Registers a participant invited by an Onboarding Service Provider (Authorization required - Roles: configure_partner_registration)'
      requestBody:
        required: true
        description: Data for the participant registration.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OspParticipantRegistrationData'
            example:
              externalId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
              name: "Example GmbH"
              shortName: "Example GmbH"
              city: "Munich"
              streetName: "Main street"
              countryAlpha2Code: "DE"
              region: "BY"
              zipCode: "80331"
              did: "did:web:teaching-especially-rodent.ngrok-free.app"
              uniqueIds:
                - type: "COMMERCIAL_REG_NUMBER"
                  value: "HRB 123456"
              userDetails:
                - identityProviderId: "3fa85f64-5717-4562-b3fc-2c963f66afa6"
                  providerId: "ext-user-001"
                  username: "jane.doe"
                  firstName: "Jane"
                  lastName: "Doe"
                  email: "jane.doe@example.com"
              siteDetail:
                name: "Main Plant Munich"
                city: "Munich"
                streetName: "Factory road"
                countryAlpha2Code: "DE"
                region: "BY"
                streetNumber: "7"
                zipCode: "80331"
              consents:
                - kind: "CX_OPERATING_MODEL"
                  fileIds: []
                - kind: "CX_TEN_GOLDEN_RULES"
                  fileIds: []
                - kind: "CX_DATA_EXCHANGE_GOVERNANCE"
                  fileIds: []
      responses:
        '201':
          description: Registration request successfully created.
        '401':
          description: The user is unauthorized.
        '409':
          description: A registration request already exists with this externalId for this Onboarding Service Provider.
        '500':
          description: Internal Server Error.
  /api/administration/osp/v2/participant-registration/fileupload:
    post:
      tags:
        - Core Service Provider B
      summary: 'Creates a presigned URL for uploading a file for a participant registration (Authorization required - Roles: configure_partner_registration)'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileUploadRequest'
            example:
              fileName: "handelsregister.pdf"
              externalId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
              contentType: "application/pdf"
      responses:
        '200':
          description: Returns the file ID and a presigned URL. The OSP uses this URL to PUT the binary file content.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileUploadResponse'
              example:
                fileId: "b2c3d4e5-f6a7-8901-bcde-f12345678901"
                presignedUploadUrl: "https://storage.example.com/upload/b2c3d4e5?token=..."
                expiresAt: "2026-08-25T12:00:00Z"
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: The user is unauthorized.
        '500':
          description: Internal Server Error
  /api/administration/registrationstatus/callback:
    get:
      tags:
        - Core Service Provider B
      summary: 'Gets the callback address of the Onboarding Service Provider (Authorization required - Roles: configure_partner_registration)'
      responses:
        '200':
          description: Returns the configured callback data, excluding the client secret. Empty if not configured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OnboardingServiceProviderCallbackConfigurationResponse'
              example:
                callbackUrl: "https://osp.example.com/callbacks/catenax-registration"
                authUrl: "https://osp.example.com/oauth/token"
                clientId: "osp-client-id"
        '400':
          description: The company is not an Onboarding Service Provider.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
        '401':
          description: The user is unauthorized.
    post:
      tags:
        - Core Service Provider B
      summary: 'Sets the callback address of the Onboarding Service Provider (Authorization required - Roles: configure_partner_registration)'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OnboardingServiceProviderCallbackConfigurationRequest'
            example:
              callbackUrl: "https://osp.example.com/callbacks/catenax-registration"
              authUrl: "https://osp.example.com/oauth/token"
              clientId: "osp-client-id"
              clientSecret: "s3cr3t"
      responses:
        '204':
          description: Returns no content.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
        '401':
          description: The user is unauthorized.
components:
  schemas:
    Consent:
      type: object
      properties:
        kind:
          $ref: '#/components/schemas/ConsentKind'
        fileIds:
          type: array
          items:
            type: string
      required:
        - kind
      additionalProperties: true
    CompanyRoleId:
      enum:
        - ACTIVE_PARTICIPANT
        - APP_PROVIDER
        - SERVICE_PROVIDER
        - OPERATOR
        - ONBOARDING_SERVICE_PROVIDER
      type: string
    CompanyUniqueIdData:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/UniqueIdentifierId'
        value:
          type: string
      required:
        - type
        - value
      additionalProperties: false
    ConsentKind:
      enum:
        - CX_OPERATING_MODEL
        - CX_TEN_GOLDEN_RULES
        - CX_DATA_EXCHANGE_GOVERNANCE
        - OTHER
      type: string
    ErrorDetails:
      type: object
      properties:
        errorCode:
          type: string
        type:
          type: string
        message:
          type: string
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/ErrorParameter'
      additionalProperties: true
    ErrorParameter:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
          format: int32
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        errorId:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetails'
          nullable: true
      additionalProperties: true
    FileUploadRequest:
      type: object
      properties:
        fileName:
          type: string
          description: Name of the file the OSP intends to upload.
        externalId:
          type: string
          description: Identifier used to correlate this file with the registration request.
        contentType:
          type: string
          description: Media type of the file the OSP intends to upload.
      required:
        - fileName
        - externalId
        - contentType
      additionalProperties: true
    FileUploadResponse:
      type: object
      properties:
        fileId:
          type: string
          description: Unique ID assigned to this file.
        presignedUploadUrl:
          type: string
          format: uri
          description: URL to which the OSP MUST send an HTTP PUT request containing the binary file content. The required HTTP headers are specific to the storage provider and are provided separately by the CSP-B to integrators.
        expiresAt:
          type: string
          format: date-time
          nullable: true
          description: Date and time until which the presignedUploadUrl is valid. If the URL has expired, request a new URL through the fileupload endpoint before retrying the upload.
      required:
        - fileId
        - presignedUploadUrl
      additionalProperties: true
    OnboardingServiceProviderCallbackConfigurationRequest:
      type: object
      properties:
        callbackUrl:
          type: string
        authUrl:
          type: string
        clientId:
          type: string
        clientSecret:
          type: string
      required:
        - callbackUrl
        - authUrl
        - clientId
        - clientSecret
      additionalProperties: true
    OnboardingServiceProviderCallbackConfigurationResponse:
      type: object
      properties:
        callbackUrl:
          type: string
        authUrl:
          type: string
        clientId:
          type: string
      additionalProperties: true
    OspParticipantRegistrationData:
      type: object
      properties:
        externalId:
          type: string
        name:
          type: string
        city:
          type: string
        streetName:
          type: string
        countryAlpha2Code:
          type: string
        region:
          type: string
          nullable: true
        uniqueIds:
          type: array
          items:
            $ref: '#/components/schemas/CompanyUniqueIdData'
        userDetails:
          type: array
          items:
            $ref: '#/components/schemas/UserDetailData'
        shortName:
          type: string
          nullable: true
        streetNumber:
          type: string
        streetAdditional:
          type: string
          nullable: true
        siteDetail:
          $ref: '#/components/schemas/SiteDetailData'
        zipCode:
          type: string
        did:
          type: string
          nullable: true
          description: Decentralized Identifier used to receive Verifiable Credentials when required by the CSP-B configuration.
        consents:
          type: array
          minItems: 3
          allOf:
            - contains:
                type: object
                properties:
                  kind:
                    const: CX_OPERATING_MODEL
                required:
                  - kind
            - contains:
                type: object
                properties:
                  kind:
                    const: CX_TEN_GOLDEN_RULES
                required:
                  - kind
            - contains:
                type: object
                properties:
                  kind:
                    const: CX_DATA_EXCHANGE_GOVERNANCE
                required:
                  - kind
          items:
            $ref: '#/components/schemas/Consent'
      required:
        - externalId
        - name
        - city
        - streetName
        - countryAlpha2Code
        - uniqueIds
        - userDetails
        - siteDetail
        - zipCode
        - consents
      additionalProperties: true
    PartnerRegistrationData:
      type: object
      properties:
        name:
          type: string
        city:
          type: string
        streetName:
          type: string
        countryAlpha2Code:
          type: string
        bpn:
          type: string
          nullable: true
        shortName:
          type: string
          nullable: true
        region:
          type: string
        streetAdditional:
          type: string
          nullable: true
        streetNumber:
          type: string
          nullable: true
        zipCode:
          type: string
          nullable: true
        uniqueIds:
          type: array
          items:
            $ref: '#/components/schemas/CompanyUniqueIdData'
        externalId:
          type: string
        userDetails:
          type: array
          items:
            $ref: '#/components/schemas/UserDetailData'
        companyRoles:
          type: array
          items:
            $ref: '#/components/schemas/CompanyRoleId'
        did:
          type: string
          nullable: true
      required:
        - externalId
        - name
        - city
        - streetName
        - countryAlpha2Code
        - region
        - companyRoles
        - uniqueIds
        - userDetails
      additionalProperties: true
    SiteDetailData:
      type: object
      properties:
        name:
          type: string
        city:
          type: string
        streetName:
          type: string
        countryAlpha2Code:
          type: string
        region:
          type: string
          nullable: true
        streetNumber:
          type: string
          nullable: true
        zipCode:
          type: string
      required:
        - name
        - city
        - streetName
        - countryAlpha2Code
        - zipCode
      additionalProperties: true
    UniqueIdentifierId:
      enum:
        - COMMERCIAL_REG_NUMBER
        - VAT_ID
        - LEI_CODE
        - VIES
        - EORI
      type: string
    UserDetailData:
      type: object
      properties:
        identityProviderId:
          type: string
          format: uuid
          nullable: true
        providerId:
          type: string
        username:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
      required:
        - providerId
        - firstName
        - lastName
        - email
      additionalProperties: true
  securitySchemes:
    Bearer:
      type: apiKey
      description: >
        JWT Authorization header using the Bearer scheme.
        Enter 'Bearer' [space] and then your token in the text input below.
        Example: "Bearer 12345abcdef"
      name: Authorization
      in: header
security:
  - Bearer: []