Phasio Internal Customer Controller API

Endpoints for internal customer management operations

OpenAPI Specification

phasio-internal-customer-controller-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Phasio Activity Internal Internal Customer Controller API
  description: This is the API documentation for the Phasio application.
  version: '1.0'
servers:
- url: https://m-api.eu.phas.io
  description: Generated server url
security:
- Phasio API Bearer Token: []
tags:
- name: Internal Customer Controller
  description: Endpoints for internal customer management operations
paths:
  /api/internal/v1/customer:
    post:
      tags:
      - Internal Customer Controller
      summary: Create new customer
      description: Creates a new customer account with the specified details
      operationId: createCustomer_1
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomerDto'
        required: true
      responses:
        '200':
          description: Customer successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerDto'
        '400':
          description: Invalid customer data
        '401':
          description: Unauthorized - missing or invalid authentication
        '409':
          description: Customer with the same email already exists
  /api/internal/v1/customer/principal:
    post:
      tags:
      - Internal Customer Controller
      summary: Get customer by principal
      description: Retrieves a customer by their authentication principal
      operationId: getCustomer_1
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerRequestDto'
        required: true
      responses:
        '200':
          description: Successfully retrieved customer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerDto'
        '401':
          description: Unauthorized - missing or invalid authentication
        '404':
          description: Customer not found
components:
  schemas:
    CustomerRequestDto:
      type: object
      description: Customer request data containing the principal
      properties:
        customerPrincipal:
          type: string
      required:
      - customerPrincipal
    CreateCustomerDto:
      type: object
      description: Customer data to create
      properties:
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
        phoneNumber:
          type: string
        language:
          type: string
          enum:
          - EN
          - DE
          - EL
          - FR
          - NL
          - SL
          - DA
          - TR
          - PL
          - ES
          - BG
          - IT
          - UK
          - RU
          - SV
        notificationPreference:
          type: string
          enum:
          - EMAIL
          - SMS
          - WHATSAPP
        affiliate:
          type: string
        organisationName:
          type: string
        taxExempt:
          type: boolean
      required:
      - notificationPreference
    CustomerDto:
      type: object
      properties:
        email:
          type: string
        customerId:
          type: integer
          format: int64
        organisationName:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        phoneNumber:
          type: string
        language:
          type: string
        notificationPreference:
          type: string
        discountId:
          type: integer
          format: int64
        discountPercentage:
          type: number
        customerType:
          type: string
      required:
      - customerType
      - language
      - notificationPreference
  securitySchemes:
    Phasio API Bearer Token:
      type: http
      name: Authorization
      in: header
      scheme: bearer
      bearerFormat: JWT