openapi: 3.0.0
paths:
  /business/admin/type:
    post:
      operationId: BusinessController_createBusinessType
      summary: 'ADMIN: Create a new business type'
      description: Create a new business type
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessTypeCreateRequestDTO'
      responses:
        '200':
          description: Business type created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessTypeDTO'
      tags:
        - Business
      security:
        - tenantAdminJWT: []
    put:
      operationId: BusinessController_updateBusinessType
      summary: 'ADMIN: Update a business type'
      description: Update a business type
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessTypeDTO'
      responses:
        '200':
          description: Business type updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessTypeDTO'
      tags:
        - Business
      security:
        - tenantAdminJWT: []
  /business/admin/type/{id}:
    delete:
      operationId: BusinessController_deleteBusinessType
      summary: 'ADMIN: Delete a business type'
      description: Delete a business type
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Business type deleted
          content:
            application/json:
              schema:
                type: boolean
      tags:
        - Business
      security:
        - tenantAdminJWT: []
  /business/type:
    get:
      operationId: BusinessController_getAllBusinessTypes
      summary: Get all business types
      description: Get all business types
      parameters: []
      responses:
        '200':
          description: Business types found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessTypeDTO'
      tags:
        - Business
      security:
        - projectKey: []
  /business/business/me:
    get:
      operationId: BusinessController_getByApiKey
      summary: 'BUSINESS: Get business info'
      description: Get business info with current token balances
      parameters: []
      responses:
        '200':
          description: Business found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessTokenBalancesDTO'
        '404':
          description: Business not found
      tags:
        - Business
  /business:
    get:
      operationId: BusinessController_getAll
      summary: Get all active business info
      description: Get all active business info w/o balances
      parameters: []
      responses:
        '200':
          description: Business found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessDTO'
        '404':
          description: Business not found
      tags:
        - Business
      security:
        - projectKey: []
  /business/admin:
    get:
      operationId: BusinessController_getAllAsAdmibn
      summary: 'ADMIN: Get all business info active or not'
      description: Get all business info active or not w/o balances
      parameters:
        - name: active
          required: false
          in: query
          description: Filter by active status (optional)
          schema:
            type: string
        - name: sanitize
          required: false
          in: query
          description: >-
            Sanitize user models: soft checks for current wallet address, hard
            overwrites wallet in case of update (use with caution)
          schema:
            type: string
      responses:
        '200':
          description: Business found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessDTO'
        '404':
          description: Business not found
      tags:
        - Business
      security:
        - tenantAdminJWT: []
    post:
      operationId: BusinessController_create
      summary: 'ADMIN: Create a new business account'
      description: Create a new business account, will be inactive until activated by admin
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessCreateRequestDTO'
      responses:
        '200':
          description: Business created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessApiKeyDTO'
      tags:
        - Business
      security:
        - tenantAdminJWT: []
  /business/account/{accountAddress}:
    get:
      operationId: BusinessController_getByAccountAddress
      summary: Get business info
      description: Get business info w/o balances
      parameters:
        - name: accountAddress
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Business found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessDTO'
        '404':
          description: Business not found
      tags:
        - Business
      security:
        - projectKey: []
  /business/{id}:
    get:
      operationId: BusinessController_getById
      summary: Get business info
      description: Get business info w/o balances
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Business found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessDTO'
        '404':
          description: Business not found
      tags:
        - Business
      security:
        - projectKey: []
  /business/admin/{id}/api-key:
    put:
      operationId: BusinessController_generateNewBusinessApiKey
      summary: Retrieve a new api key
      description: Retrieve a new api key and revoke previous
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Business found
          content:
            application/json:
              schema:
                type: string
        '404':
          description: Business not found
      tags:
        - Business
      security:
        - tenantAdminJWT: []
  /business/admin/{id}:
    put:
      operationId: BusinessController_update
      summary: 'ADMIN: Update a business account'
      description: Update a business account
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessUpdateRequestDTO'
      responses:
        '200':
          description: Business created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessTokenBalancesDTO'
      tags:
        - Business
      security:
        - tenantAdminJWT: []
  /business/admin/activate/{id}:
    put:
      operationId: BusinessController_setActive
      summary: 'ADMIN: Toggle business account active'
      description: Toggle business account active
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessToggleActiveRequestDTO'
      responses:
        '200':
          description: Business account permissions updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessDTO'
      tags:
        - Business
      security:
        - tenantAdminJWT: []
  /user/auth/me:
    get:
      operationId: UserController_checkAuthUser
      summary: 'AUTH USER: Get user info without balances'
      description: Get a user account by auth and return w/o token balance
      parameters: []
      responses:
        '200':
          description: User found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDTO'
        '404':
          description: User not found
      tags:
        - User
      security:
        - projectKey: []
        - authUserJWT: []
    put:
      operationId: UserController_updateMe
      summary: 'AUTH USER: Update user account'
      description: Update user account
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreateRequestDTO'
      responses:
        '200':
          description: User updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserTokenBalancesDTO'
        '404':
          description: User not found
      tags:
        - User
      security:
        - projectKey: []
        - authUserJWT: []
  /user/business/info:
    post:
      operationId: UserController_checkUser
      summary: 'BUSINESS: Get a user info without balances'
      description: Get a user account by auth and return w/o token balance
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreateRequestDTO'
      responses:
        '200':
          description: User found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserTokenBalancesDTO'
        '404':
          description: User not found
      tags:
        - User
  /user/info:
    post:
      operationId: UserController_checkUserLegacy
      summary: 'BUSINESS: Get a user info without balances (legacy)'
      description: >-
        Get a user account by auth and return w/o token balance. This endpoint
        is legacy and will be removed in the future. Please use
        user/business/info
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreateRequestDTO'
      responses:
        '200':
          description: User found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserTokenBalancesDTO'
        '404':
          description: User not found
      tags:
        - User
  /user/business/balance:
    post:
      operationId: UserController_checkBalance
      summary: 'BUSINESS: Get a user info with balances'
      description: Get a user account by email and retrieve current token balances
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreateRequestDTO'
      responses:
        '200':
          description: User found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserTokenBalancesDTO'
        '404':
          description: User not found
      tags:
        - User
  /user/balance:
    post:
      operationId: UserController_checkBalanceLegacy
      summary: 'BUSINESS: Get a user info with balances (legacy)'
      description: >-
        Get a user account by email and retrieve current token balances. This
        endpoint is legacy and will be removed in the future. Please use
        user/business/balance
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreateRequestDTO'
      responses:
        '200':
          description: User found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserTokenBalancesDTO'
        '404':
          description: User not found
      tags:
        - User
  /user/admin/balance:
    post:
      operationId: UserController_checkUserBalance
      summary: 'ADMIN: Get a user account info with balances'
      description: Get a user account by email and retrieve current token balances as admin
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreateRequestDTO'
      responses:
        '200':
          description: User found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserTokenBalancesDTO'
        '404':
          description: User not found
      tags:
        - User
      security:
        - tenantAdminJWT: []
  /user/auth/balance:
    get:
      operationId: UserController_checkAccountAuth
      summary: 'AUTH USER: Get user info with balances'
      description: Get a user account by auth and retrieve current token balances
      parameters: []
      responses:
        '200':
          description: User found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserTokenBalancesDTO'
        '404':
          description: User not found
      tags:
        - User
      security:
        - projectKey: []
        - authUserJWT: []
  /user/auth/status:
    get:
      operationId: UserController_checkUserStatus
      summary: 'AUTH USER: Get user status'
      description: Get a logged user user status
      parameters: []
      responses:
        '200':
          description: User status found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserStatusTypeDTO'
        '404':
          description: User status not found
      tags:
        - User
      security:
        - projectKey: []
        - authUserJWT: []
  /user/business/account:
    post:
      operationId: UserController_create
      summary: 'BUSINESS: Create / update an user account'
      description: Create or update an user account
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreateRequestDTO'
      responses:
        '200':
          description: User created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserTokenBalancesDTO'
      tags:
        - User
  /user/admin:
    get:
      operationId: UserController_getAllUsers
      summary: 'ADMIN: Get all users'
      description: >-
        Get all users, if sanitize is set true it checks and recovers account
        addresses. This might take longer
      parameters:
        - name: sanitize
          required: false
          in: query
          description: >-
            Sanitize user models: soft checks for current wallet address, hard
            overwrites wallet in case of update (use with caution)
          schema:
            type: string
        - name: merge
          required: false
          in: query
          description: >-
            Merge user models: soft checks for current wallet address, hard
            overwrites wallet in case of update (use with caution)
          schema:
            type: string
      responses:
        '200':
          description: Users found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserDTO'
      tags:
        - User
      security:
        - tenantAdminJWT: []
    post:
      operationId: UserController_createUser
      summary: 'ADMIN: Create one or multiple user accounts by admin'
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/UserCreateRequestDTO'
      responses:
        '200':
          description: User(s) created
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserTokenBalancesDTO'
        '404':
          description: User not found
      tags:
        - User
      security:
        - tenantAdminJWT: []
  /user/public:
    get:
      operationId: UserController_getAllPublicProfiles
      summary: Get all public profiles
      description: Get all public profiles
      parameters:
        - name: filterKey
          required: false
          in: query
          description: Property key in publicProfile to filter by
          schema:
            type: string
        - name: filterValue
          required: false
          in: query
          description: Value to match in the publicProfile property
          schema:
            type: string
      responses:
        '200':
          description: Public profiles
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PublicUserDTO'
        '404':
          description: Public profiles not found
      tags:
        - User
      security:
        - projectKey: []
  /user/public/{id}:
    get:
      operationId: UserController_getPublicProfile
      summary: Get a public profile
      description: Get a public profile by id
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Public profile
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicUserDTO'
        '404':
          description: Public profile not found
      tags:
        - User
      security:
        - projectKey: []
  /user/exists:
    get:
      operationId: UserController_checkUserExists
      summary: Check if user exists
      description: Check if user exists by any identifier field, optional specify
      parameters:
        - name: filterValue
          required: true
          in: query
          description: Value to search for
          schema:
            type: string
        - name: filterKey
          required: false
          in: query
          description: >-
            Field to use for identification (id, email, instagramAccountId,
            etc.)
          schema: {}
      responses:
        '200':
          description: User exists
          content:
            application/json:
              schema:
                type: boolean
        '404':
          description: User not found
      tags:
        - User
      security:
        - projectKey: []
  /user/admin/{id}:
    get:
      operationId: UserController_getUser
      summary: 'ADMIN: Get user by any identifier field'
      description: Get user by any identifier field
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: User found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDTO'
        '404':
          description: User not found
      tags:
        - User
      security:
        - tenantAdminJWT: []
    put:
      operationId: UserController_updateUser
      summary: 'ADMIN: Update user account by admin'
      description: Update user account by admin
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreateRequestDTO'
      responses:
        '200':
          description: User updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserTokenBalancesDTO'
        '404':
          description: User not found
      tags:
        - User
      security:
        - tenantAdminJWT: []
  /user/admin/url:
    post:
      operationId: UserController_uploadUsersFromUrl
      summary: 'ADMIN: Create user account by admin from external url'
      description: Create user account by admin from external url
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UrlRequestDTO'
      responses:
        '200':
          description: Users created
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserTokenBalancesDTO'
        '404':
          description: User not found
      tags:
        - User
      security:
        - tenantAdminJWT: []
  /user/admin/status-type:
    post:
      operationId: UserController_createUserStatusType
      summary: 'ADMIN: Create user status type'
      description: Create user status type
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserStatusTypeCreateRequestDTO'
      responses:
        '200':
          description: User status type created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserStatusTypeDTO'
      tags:
        - User
      security:
        - tenantAdminJWT: []
  /user/admin/status-type/{id}/eligible-token/{eligibleTokenAddress}:
    put:
      operationId: UserController_updateUserStatusTypeEligibleToken
      summary: 'ADMIN: Add or remove eligible token to user status type'
      description: Add or remove eligible token to user status type
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: eligibleTokenAddress
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: User status type updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserStatusTypeDTO'
        '404':
          description: User status type not found
      tags:
        - User
      security:
        - tenantAdminJWT: []
  /user/status-type:
    get:
      operationId: UserController_getAllUserStatusTypes
      summary: Get all user status types
      description: Get all user status types
      parameters: []
      responses:
        '200':
          description: User status types
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserStatusTypeDTO'
      tags:
        - User
      security:
        - projectKey: []
  /user/status-type/{id}:
    get:
      operationId: UserController_getUserStatusType
      summary: Get a user status type
      description: Get a user status type by id
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: User status type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserStatusTypeDTO'
        '404':
          description: User status type not found
      tags:
        - User
      security:
        - projectKey: []
  /user/admin/{id}/toggle-active:
    put:
      operationId: UserController_toggleUserActiveStatus
      summary: 'ADMIN: Toggle user active status'
      description: Toggle user active status
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: User updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserTokenBalancesDTO'
        '404':
          description: User not found
      tags:
        - User
      security:
        - tenantAdminJWT: []
  /admin/admin:
    get:
      operationId: AdminController_getAdminsByTenatId
      summary: 'ADMIN: Get all admins'
      description: Get all admins
      parameters: []
      responses:
        '200':
          description: Admins found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AdminDTO'
      tags:
        - Admin
      security:
        - tenantAdminJWT: []
    post:
      operationId: AdminController_createOrUpdateAdmin
      summary: 'ADMIN: Create or update admin'
      description: Create or update admin
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdminCreateRequestDTO'
      responses:
        '200':
          description: Admin created or updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminDTO'
      tags:
        - Admin
      security:
        - tenantAdminJWT: []
  /admin/admin/{adminId}/toggle-tenant:
    put:
      operationId: AdminController_addOrRemoveAdminToTenant
      summary: 'ADMIN: Add or remove admin to tenant'
      description: >-
        Add or remove admin to tenant, this relates automatically to the tenant
        of current admin invoking method
      parameters:
        - name: adminId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdminCreateRequestDTO'
      responses:
        '200':
          description: Admin added or removed from tenant
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminDTO'
      tags:
        - Admin
      security:
        - tenantAdminJWT: []
  /auth/admin/login:
    post:
      operationId: AuthController_loginTenantAdmin
      summary: Login
      description: Login tenant admin and get JWT tokens
      parameters: []
      responses:
        '200':
          description: Admin successfully logged-in
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminLoginResponseDTO'
      tags:
        - Auth
      security:
        - authAdminJWT: []
  /auth/refresh:
    post:
      operationId: AuthController_refresh
      summary: Refresh
      description: Refresh the access token
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefreshTokenRequestDTO'
      responses:
        '200':
          description: New access token created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoginResponseDTO'
      tags:
        - Auth
  /token/admin:
    post:
      operationId: TokenController_create
      summary: 'ADMIN: Create a new testnet token contract'
      description: >-
        Create a new testnet token contract for project. This can later be
        converted into a mainnet version
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenCreateRequestDTO'
      responses:
        '200':
          description: Token created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenDTO'
      tags:
        - Token
      security:
        - tenantAdminJWT: []
  /token/admin/{id}/mainnet/{contractAddress}/chain/{chainId}:
    put:
      operationId: TokenController_createTokenMainnetAddress
      summary: 'ADMIN: Create mainnet token Address for existing token'
      description: Create mainnet token Address for existing token
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: contractAddress
          required: true
          in: path
          schema:
            type: string
        - name: chainId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Mainnet token Address created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenDTO'
      tags:
        - Token
      security:
        - tenantAdminJWT: []
  /token/admin/{id}/toggle-active:
    put:
      operationId: TokenController_setActive
      summary: 'ADMIN: Toggle token active'
      description: Toggle token active to be used
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Token toggled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenDTO'
      tags:
        - Token
      security:
        - tenantAdminJWT: []
  /token/admin/{id}:
    put:
      operationId: TokenController_update
      summary: 'ADMIN: Update token'
      description: Update token
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenUpdateRequestDTO'
      responses:
        '200':
          description: Token updates
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenDTO'
      tags:
        - Token
      security:
        - tenantAdminJWT: []
  /token/admin/{id}/metadata:
    post:
      operationId: TokenController_createTokenMetadata
      summary: 'ADMIN: Create token metadata'
      description: Create token metadata for a specific token contract
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenMetadataCreateRequestDTO'
      responses:
        '200':
          description: Token metadata created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenMetadataDTO'
      tags:
        - Token
      security:
        - tenantAdminJWT: []
  /token/admin/metadata/{id}/toggle-active:
    put:
      operationId: TokenController_toggleActiveTokenMetadata
      summary: 'ADMIN: Toggle token metadata active'
      description: Toggle token metadata active
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Token metadata toggled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenMetadataDTO'
      tags:
        - Token
      security:
        - tenantAdminJWT: []
  /token/admin/type:
    post:
      operationId: TokenController_createType
      summary: 'ADMIN: Create a new token type'
      description: Create a new token type for project
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenTypeDTO'
      responses:
        '200':
          description: Token type created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenTypeDTO'
      tags:
        - Token
      security:
        - tenantAdminJWT: []
  /token/type:
    get:
      operationId: TokenController_getAllTypes
      summary: Get all token types
      description: Get all token types
      parameters: []
      responses:
        '200':
          description: Token types
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TokenTypeDTO'
      tags:
        - Token
      security:
        - projectKey: []
  /token/address/{contractAddress}:
    get:
      operationId: TokenController_getByAddress
      summary: Get token by address
      description: Get token by contract address
      parameters:
        - name: contractAddress
          required: true
          in: path
          schema:
            type: string
        - name: contractTokenId
          required: false
          in: query
          description: Token ID for ERC721 or ERC1155 tokens
          schema:
            type: string
      responses:
        '200':
          description: Token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenDTO'
      tags:
        - Token
      security:
        - projectKey: []
  /token:
    get:
      operationId: TokenController_getAll
      summary: Get all token contracts
      description: Get all token contracts
      parameters:
        - name: active
          required: false
          in: query
          description: 'Filter for active tokens only (default: true)'
          schema:
            type: string
      responses:
        '200':
          description: Tokens
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TokenDTO'
      tags:
        - Token
      security:
        - projectKey: []
  /token/credit:
    get:
      operationId: TokenController_getActive
      summary: Get active credit token contracts
      description: Get active credit token contracts
      parameters: []
      responses:
        '200':
          description: Credit token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenDTO'
      tags:
        - Token
      security:
        - projectKey: []
  /token/reward:
    get:
      operationId: TokenController_getRewards
      summary: Get all reward token contracts
      description: Get all reward token contracts
      parameters:
        - name: active
          required: false
          in: query
          description: 'Filter for active reward tokens only (default: true)'
          schema:
            type: string
      responses:
        '200':
          description: Reward tokens
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TokenDTO'
      tags:
        - Token
      security:
        - projectKey: []
  /token/status:
    get:
      operationId: TokenController_getStatus
      summary: Get all status token contracts
      description: Get all status token contracts
      parameters:
        - name: active
          required: false
          in: query
          description: 'Filter for active status tokens only (default: true)'
          schema:
            type: string
      responses:
        '200':
          description: Status tokens
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TokenDTO'
      tags:
        - Token
      security:
        - projectKey: []
  /contract:
    post:
      operationId: Web3ContractController_create
      summary: Create a new contract
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Web3ContractCreateRequestDTO'
      responses:
        '200':
          description: Contract created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Web3ContractDTO'
      tags:
        - Web3 Contract
  /chain/{chainId}:
    get:
      operationId: Web3ChainController_getChainData
      summary: Get chain data
      description: >-
        Get chain data by chain id. This includes an READ jwt for
        authentification. Valid for 30 days
      parameters:
        - name: chainId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Chain data retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChainDataDTO'
      tags:
        - Web3 Chain
  /tenant:
    post:
      operationId: TenantController_create
      summary: Create a new tenant
      description: Create a new tenant aka project
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantCreateRequestDTO'
      responses:
        '200':
          description: Tenant created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantDTO'
      tags:
        - Tenant
      security:
        - '': []
  /tenant/admin/api-key:
    post:
      operationId: TenantController_createApiKey
      summary: 'ADMIN: Create a new api key for tenant with tenant admin credentials'
      description: >-
        Create a new api key for tenant with tenant admin credentials. Store
        this key securely, you will not be able to see this again
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantApiKeyRequestDTO'
      responses:
        '200':
          description: Api key created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantDTO'
      tags:
        - Tenant
      security:
        - tenantAdminJWT: []
  /tenant/admin/jwt:
    post:
      operationId: TenantController_createJwtToken
      summary: 'ADMIN: Create a new jwt token for tenant with tenant admin credentials'
      description: >-
        Create a new jwt token for tenant with tenant admin credentials. Store
        this key securely, you will not be able to see this again
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantJWTRequestDTO'
      responses:
        '200':
          description: Api key created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantDTO'
      tags:
        - Tenant
      security:
        - tenantAdminJWT: []
  /tenant/admin:
    put:
      operationId: TenantController_update
      summary: 'ADMIN: Update tenant'
      description: Update tenant information
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantUpdateRequestDTO'
      responses:
        '200':
          description: Tenant updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantDTO'
      tags:
        - Tenant
      security:
        - tenantAdminJWT: []
  /tenant/login-token:
    get:
      operationId: TenantController_loginToken
      summary: Get login token
      description: Get login token for project
      parameters: []
      responses:
        '200':
          description: Login token
          content:
            application/json:
              schema:
                type: string
      tags:
        - Tenant
      security:
        - projectKey: []
  /tenant/public:
    get:
      operationId: TenantController_public
      summary: Get public tenant
      description: Get public tenant information
      parameters: []
      responses:
        '200':
          description: Tenant information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantPublicDTO'
      tags:
        - Tenant
      security:
        - projectKey: []
  /tenant/client-config:
    get:
      operationId: TenantController_clientConfig
      summary: Get client config
      description: Get client config for project
      parameters: []
      responses:
        '200':
          description: Client config
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantClientConfigDTO'
      tags:
        - Tenant
      security:
        - projectKey: []
  /transaction/business/mint/credits:
    post:
      operationId: TransactionController_earn
      summary: 'BUSINESS: Mint credits'
      description: Mint credits to account from active minter account
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/BusinessToUserCreditTransactionCreateRequestDTO
      responses:
        '200':
          description: Transaction complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
  /transaction/admin/mint/credits:
    post:
      operationId: TransactionController_mintCreditsToUserByAdmin
      summary: 'ADMIN: Mint credits to user'
      description: Mint credits to user account from tenant
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/BusinessToUserCreditTransactionCreateRequestDTO
      responses:
        '200':
          description: Transaction complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - tenantAdminJWT: []
  /transaction/business/transfer/credits:
    post:
      operationId: TransactionController_spend
      summary: 'BUSINESS: Transfer credits'
      description: Transfer credits from user account to business account
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/BusinessToUserCreditTransactionCreateRequestDTO
      responses:
        '200':
          description: Transaction complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
  /transaction/admin/transfer/credits:
    post:
      operationId: TransactionController_transferCreditsFromUserToTenant
      summary: 'ADMIN: Transfer credits from user'
      description: Transfer credits from user account to tenant account
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/BusinessToUserCreditTransactionCreateRequestDTO
      responses:
        '200':
          description: Transaction complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - tenantAdminJWT: []
  /transaction/auth/transfer/credits:
    post:
      operationId: TransactionController_authUserToBusinessSpend
      summary: 'AUTH USER: Transfer credits'
      description: Transfer credits from account to business account
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/UserToBusinessTokenTransactionCreateRequestDTO
      responses:
        '200':
          description: Transaction complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - projectKey: []
        - authUserJWT: []
  /transaction/auth/transfer/token:
    post:
      operationId: TransactionController_authUserToBusinessSpendToken
      summary: 'AUTH USER: Transfer token'
      description: Transfer token from account to business account
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/UserToBusinessTokenTransactionCreateRequestDTO
      responses:
        '200':
          description: Transaction complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - projectKey: []
        - authUserJWT: []
  /transaction/auth/burn/token:
    post:
      operationId: TransactionController_authUserBurnToken
      summary: 'AUTH USER: Burn token'
      description: Burn token from account
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserBurnTokenRequestDTO'
      responses:
        '200':
          description: Transaction complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - projectKey: []
        - authUserJWT: []
  /transaction/admin/mint/token:
    post:
      operationId: TransactionController_transferToken
      summary: 'ADMIN: Mint token'
      description: Mint token to account
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionCreateRequestDTO'
      responses:
        '200':
          description: Transaction complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - tenantAdminJWT: []
  /transaction/admin/mint/token/url:
    post:
      operationId: TransactionController_mintBulkTokenFromUrl
      summary: 'ADMIN: Mint token'
      description: Mint token to account
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionBulkCreateRequestDTO'
      responses:
        '200':
          description: Transactions completed
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - tenantAdminJWT: []
  /transaction/admin/burn/token:
    post:
      operationId: TransactionController_burnToken
      summary: 'ADMIN: Burn token'
      description: Burn token from account
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionCreateRequestDTO'
      responses:
        '200':
          description: Transaction complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - tenantAdminJWT: []
  /transaction/auth/sender:
    get:
      operationId: TransactionController_authTransactionsSender
      summary: 'AUTH USER: Get transactions by sender for authentificated user'
      description: Get transactions by sender for authentificated user
      parameters: []
      responses:
        '200':
          description: Transactions by user as sender
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - projectKey: []
        - authUserJWT: []
  /transaction/auth/recipient:
    get:
      operationId: TransactionController_authTransactionsRecipient
      summary: 'AUTH USER: Get transactions by recipient for authentificated user'
      description: Get transactions by recipient for authentificated user
      parameters: []
      responses:
        '200':
          description: Transactions by user as recipeint
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - projectKey: []
        - authUserJWT: []
  /transaction/admin/sender:
    post:
      operationId: TransactionController_adminTransactionsSender
      summary: 'ADMIN: Get transactions by sender for authenticated admin'
      description: Get transactions by sender for authenticated admin
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionByUserOrBusinessRequestDTO'
      responses:
        '200':
          description: Transactions as sender
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - tenantAdminJWT: []
  /transaction/admin/recipient:
    post:
      operationId: TransactionController_adminTransactionsRecipient
      summary: Get transactions by recipient for authenticated admin
      description: Get transactions by recipient for authenticated admin
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionByUserOrBusinessRequestDTO'
      responses:
        '200':
          description: Transactions as recipient
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - tenantAdminJWT: []
  /transaction/admin:
    get:
      operationId: TransactionController_adminGetTransactions
      summary: 'ADMIN: Get transactions'
      description: Get transactions for authenticated admin
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionByUserOrBusinessRequestDTO'
      responses:
        '200':
          description: Transactions as recipient
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - tenantAdminJWT: []
  /transaction/{id}:
    get:
      operationId: TransactionController_getBusinessTransaction
      summary: Get transaction by id
      description: Get transaction by id
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Transaction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDTO'
      tags:
        - Transaction
      security:
        - projectKey: []
  /purchase/stripe-webhook:
    post:
      operationId: PurchaseController_stripeWebhookHandler
      summary: Stripe webhook
      description: webhook for stripe payment events
      parameters: []
      responses:
        '200':
          description: webhook handle success
          content:
            application/json:
              schema:
                type: boolean
      tags:
        - Purchase
      security:
        - '': []
  /purchase/admin/token:
    post:
      operationId: PurchaseController_createPurchaseToken
      summary: 'ADMIN: Create a new purchase Token'
      description: Create a new purchase Token
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseTokenCreateRequestDTO'
      responses:
        '200':
          description: Token created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseTokenDTO'
      tags:
        - Purchase
      security:
        - tenantAdminJWT: []
  /purchase/admin/token/{id}:
    put:
      operationId: PurchaseController_updatePurchaseToken
      summary: 'ADMIN: Update an existing purchase Token'
      description: Update an existing purchase Token
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseTokenUpdateRequestDTO'
      responses:
        '200':
          description: Token updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseTokenDTO'
      tags:
        - Purchase
      security:
        - tenantAdminJWT: []
    delete:
      operationId: PurchaseController_deletePurchaseToken
      summary: 'ADMIN: Delete an existing purchase Token'
      description: Delete an existing purchase Token
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Token deleted
          content:
            application/json:
              schema:
                type: boolean
      tags:
        - Purchase
      security:
        - tenantAdminJWT: []
  /purchase/admin/type:
    post:
      operationId: PurchaseController_createPurchaseType
      summary: 'ADMIN: Create a new purchase Type'
      description: Create a new purchase Type
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseTypeCreateRequestDTO'
      responses:
        '200':
          description: Purchase Type created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseTypeCreateRequestDTO'
      tags:
        - Purchase
      security:
        - tenantAdminJWT: []
  /purchase/admin/donation/type:
    post:
      operationId: PurchaseController_createDonationType
      summary: 'ADMIN: Create a new donation Type'
      description: Create a new donation Type
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DonationTypeDTO'
      responses:
        '200':
          description: Purchase Type created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DonationTypeDTO'
      tags:
        - Purchase
      security:
        - tenantAdminJWT: []
  /purchase/donation/type:
    get:
      operationId: PurchaseController_getAllDonationTypes
      summary: Get all donation Types
      description: Get all donation Types
      parameters: []
      responses:
        '200':
          description: Donation Types
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DonationTypeDTO'
      tags:
        - Purchase
      security:
        - projectKey: []
  /purchase/token:
    get:
      operationId: PurchaseController_getActivePurchaseTokens
      summary: get active Purchase Tokens
      description: Get active Purchase Tokens
      parameters:
        - name: active
          required: false
          in: query
          description: Filter by active status
          schema:
            type: string
      responses:
        '200':
          description: Active Purchase Tokens
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PurchaseTokenDTO'
      tags:
        - Purchase
      security:
        - projectKey: []
  /purchase/auth:
    post:
      operationId: PurchaseController_createUserTokenPurchase
      summary: 'AUTH USER: Create Purchase'
      description: Create Purchase and return including Payment Client Secret
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseCreateRequestDTO'
      responses:
        '200':
          description: Purchase Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseCreateResponseDTO'
      tags:
        - Purchase
      security:
        - projectKey: []
        - authUserJWT: []
    get:
      operationId: PurchaseController_getAuthUserPurchases
      summary: 'AUTH USER: Get user past Purchases'
      description: Get user past Purchases
      parameters: []
      responses:
        '200':
          description: Purchase found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PurchaseDTO'
      tags:
        - Purchase
      security:
        - projectKey: []
        - authUserJWT: []
  /purchase/payment-intent:
    post:
      operationId: PurchaseController_createPaymentIntent
      summary: Create a new payment intent
      description: Create a new payment intent
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentIntentCreateDTO'
      responses:
        '200':
          description: Payment intent created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntentDTO'
      tags:
        - Purchase
      security:
        - projectKey: []
  /purchase/payment-intent/{paymentIntentId}:
    put:
      operationId: PurchaseController_updatePaymentIntent
      summary: Update a payment intent
      description: Update a payment intent
      parameters:
        - name: paymentIntentId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentIntentCreateDTO'
      responses:
        '200':
          description: Payment intent updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntentDTO'
      tags:
        - Purchase
      security:
        - projectKey: []
    delete:
      operationId: PurchaseController_cancelPaymentIntent
      summary: Cancel a payment intent
      description: Cancel a payment intent
      parameters:
        - name: paymentIntentId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Payment intent cancelled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntentDTO'
      tags:
        - Purchase
      security:
        - projectKey: []
  /campaign:
    get:
      operationId: CampaignController_listActiveCampaigns
      summary: List active campaigns
      description: List active campaigns
      parameters: []
      responses:
        '200':
          description: Campaigns
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - projectKey: []
  /campaign/admin:
    get:
      operationId: CampaignController_listCampaigns
      summary: 'ADMIN: List campaigns'
      description: 'ADMIN: List campaigns'
      parameters:
        - name: active
          required: false
          in: query
          description: Filter by active status
          schema:
            type: string
      responses:
        '200':
          description: Campaigns
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
    post:
      operationId: CampaignController_createCampaign
      summary: 'ADMIN: Create new campaign'
      description: Create new campaign
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignCreateRequestDTO'
      responses:
        '200':
          description: Campaign created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/{id}:
    get:
      operationId: CampaignController_getCampaign
      summary: Get campaign
      description: Get campaign
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Campaign
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - projectKey: []
  /campaign/admin/{id}:
    put:
      operationId: CampaignController_updateCampaign
      summary: 'ADMIN: Update campaign'
      description: Update campaign
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignCreateRequestDTO'
      responses:
        '200':
          description: Campaign updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
    delete:
      operationId: CampaignController_deleteCampaign
      summary: 'ADMIN: Delete campaign'
      description: Delete campaign
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Campaign deleted
          content:
            application/json:
              schema:
                type: boolean
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/{id}/activate:
    put:
      operationId: CampaignController_activateCampaign
      summary: 'ADMIN: Toggle activate campaign'
      description: 'Activate / deactivate campaign '
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Campaign activated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/{id}/environment:
    put:
      operationId: CampaignController_setCampaignTestnet
      summary: 'ADMIN: Toggle testnet campaign'
      description: Set campaign to testnet or mainnet
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Campaign set to testnet or mainnet
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/{id}/token-units:
    post:
      operationId: CampaignController_createCampaignToken
      summary: 'ADMIN: Add campaign token'
      description: Add campaign token
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenUnitCreateRequestDTO'
      responses:
        '200':
          description: Campaign token added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/{id}/token-units/{tokenUnitId}:
    put:
      operationId: CampaignController_updateCampaignToken
      summary: 'ADMIN: Update campaign token'
      description: Update campaign token
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: tokenUnitId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenUnitCreateRequestDTO'
      responses:
        '200':
          description: Campaign token updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
    delete:
      operationId: CampaignController_removeCampaignToken
      summary: 'ADMIN: Remove campaign token'
      description: Remove campaign token
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: tokenUnitId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Campaign token removed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/{id}/trigger/{triggerId}:
    put:
      operationId: CampaignController_setCampaignTrigger
      summary: 'ADMIN: Set campaign trigger'
      description: Set campaign trigger
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Campaign trigger set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/{id}/business-engagement:
    post:
      operationId: CampaignController_addBusinessEngagementToCampaign
      summary: 'ADMIN: Add business engagement to campaign'
      description: Add business engagement to campaign
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignBusinessEngagementCreateRequestDTO'
      responses:
        '200':
          description: Business engagement added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/{id}/business-engagement/{businessEngagementId}:
    put:
      operationId: CampaignController_updateBusinessEngagementInCampaign
      summary: 'ADMIN: Update business engagement in campaign'
      description: Update business engagement in campaign
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: businessEngagementId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignBusinessEngagementCreateRequestDTO'
      responses:
        '200':
          description: Business engagement updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
    delete:
      operationId: CampaignController_removeBusinessEngagementFromCampaign
      summary: 'ADMIN: Remove business engagement from campaign'
      description: Remove business engagement from campaign
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: businessEngagementId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Business engagement removed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/trigger/all:
    get:
      operationId: CampaignController_listTriggers
      summary: List triggers
      description: List triggers
      parameters: []
      responses:
        '200':
          description: Triggers
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CampaignTriggerDTO'
      tags:
        - Campaign
      security:
        - projectKey: []
  /campaign/admin/trigger:
    post:
      operationId: CampaignController_triggerCampaign
      summary: 'ADMIN: Create trigger for campaign'
      description: Create trigger for campaign
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignTriggerCreateRequestDTO'
      responses:
        '200':
          description: Campaign trigger
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignTriggerDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/trigger/{id}:
    put:
      operationId: CampaignController_updateCampaignTrigger
      summary: 'ADMIN: Update campaign trigger'
      description: Update campaign trigger
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignTriggerCreateRequestDTO'
      responses:
        '200':
          description: Campaign trigger updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignTriggerDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
    delete:
      operationId: CampaignController_deleteCampaignTrigger
      summary: 'ADMIN: Delete campaign trigger'
      description: Delete campaign trigger
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Campaign trigger deleted
          content:
            application/json:
              schema:
                type: boolean
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/trigger/{triggerId}/condition/{conditionId}:
    put:
      operationId: CampaignController_updateCampaignTriggerConditions
      summary: 'ADMIN: Add or remove condition to campaign trigger'
      description: Add or remove condition to campaign trigger
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: conditionId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Campaign trigger updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignTriggerDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/trigger-condition:
    post:
      operationId: CampaignController_createCampaignTriggerCondition
      summary: 'ADMIN: Create campaign trigger condition'
      description: Create campaign trigger condition
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignTriggerConditionDTO'
      responses:
        '200':
          description: Campaign trigger condition created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignTriggerConditionCreateRequestDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/trigger-condition/{id}:
    put:
      operationId: CampaignController_updateCampaignTriggerCondition
      summary: 'ADMIN: Update campaign trigger condition'
      description: Update campaign trigger condition
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignTriggerConditionDTO'
      responses:
        '200':
          description: Campaign trigger condition updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignTriggerConditionCreateRequestDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/system/claim:
    post:
      operationId: CampaignController_claimCampaignRewardAdmin
      summary: Claim campaign reward by System
      description: >-
        Claim campaign reward by System api key needs to be a valid tenant api
        key
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignClaimBusinessRequestDTO'
      responses:
        '200':
          description: Campaign reward claimed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignUserClaimDTO'
      tags:
        - Campaign
  /campaign/business/claim:
    post:
      operationId: CampaignController_claimCampaignRewardBusiness
      summary: 'BUSINESS: Claim campaign reward'
      description: Claim campaign reward
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignClaimBusinessRequestDTO'
      responses:
        '200':
          description: Campaign reward claimed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignUserClaimDTO'
      tags:
        - Campaign
  /campaign/auth/claim:
    post:
      operationId: CampaignController_claimCampaignReward
      summary: 'AUTH USER: Claim campaign reward'
      description: Claim campaign reward
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignClaimRequestDTO'
      responses:
        '200':
          description: Campaign reward claimed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignUserClaimDTO'
      tags:
        - Campaign
      security:
        - projectKey: []
        - authUserJWT: []
    get:
      operationId: CampaignController_getClaimHistoryAll
      summary: 'AUTH USER: Get claim history'
      description: Get claim history
      parameters: []
      responses:
        '200':
          description: Claim history
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CampaignUserClaimDTO'
      tags:
        - Campaign
      security:
        - projectKey: []
        - authUserJWT: []
  /campaign/auth/{campaignId}/claim:
    get:
      operationId: CampaignController_getClaimHistory
      summary: 'AUTH USER: Get claim history by campaign'
      description: Get claim history campaign
      parameters:
        - name: campaignId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Claim history
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CampaignUserClaimDTO'
      tags:
        - Campaign
      security:
        - projectKey: []
        - authUserJWT: []
  /campaign/admin/claim:
    get:
      operationId: CampaignController_getClaimHistoryAllAdmin
      summary: 'ADMIN: Get all campaigns claim history'
      description: Get all campaigns claim history
      parameters: []
      responses:
        '200':
          description: Claim history
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CampaignUserClaimDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/{campaignId}/claim:
    get:
      operationId: CampaignController_getClaimHistoryAdmin
      summary: 'ADMIN: Get claim history by campaign'
      description: Get claim history by campaign
      parameters:
        - name: campaignId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Claim history
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CampaignUserClaimDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/claim/user/{userId}:
    get:
      operationId: CampaignController_getUserClaims
      summary: 'ADMIN: Get all campaigns claim history'
      description: Get all campaigns claim history
      parameters:
        - name: userId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Claim history
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CampaignUserClaimDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /campaign/admin/claim/business/{businessId}:
    get:
      operationId: CampaignController_getClaimsByBusiness
      summary: 'ADMIN: Get all campaigns claim history'
      description: Get all campaigns claim history
      parameters:
        - name: businessId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Claim history
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CampaignUserClaimDTO'
      tags:
        - Campaign
      security:
        - tenantAdminJWT: []
  /redemption:
    get:
      operationId: RedemptionController_getActive
      summary: Get all active redemptions
      description: Get all active redemptions
      parameters: []
      responses:
        '200':
          description: Redemptions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RedemptionDTO'
      tags:
        - Redemption
      security:
        - projectKey: []
  /redemption/admin:
    get:
      operationId: RedemptionController_get
      summary: 'ADMIN: Get all redemptions'
      description: 'ADMIN: Get all redemptions'
      parameters:
        - name: active
          required: false
          in: query
          description: Filter by active status
          schema:
            type: string
      responses:
        '200':
          description: Redemptions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RedemptionDTO'
      tags:
        - Redemption
      security:
        - tenantAdminJWT: []
    post:
      operationId: RedemptionController_create
      summary: 'ADMIN: Create a new redemption'
      description: Create a new redemption
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RedemptionCreateRequestDTO'
      responses:
        '200':
          description: Redemption created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedemptionDTO'
      tags:
        - Redemption
      security:
        - tenantAdminJWT: []
  /redemption/type:
    get:
      operationId: RedemptionController_getTypes
      summary: Get redemption types
      description: Get all redemption types
      parameters: []
      responses:
        '200':
          description: Redemption types
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RedemptionTypeDTO'
      tags:
        - Redemption
      security:
        - projectKey: []
  /redemption/{id}:
    get:
      operationId: RedemptionController_getById
      summary: Get redemption
      description: Get redemption by ID
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Redemption
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedemptionDTO'
      tags:
        - Redemption
      security:
        - projectKey: []
  /redemption/admin/{id}:
    put:
      operationId: RedemptionController_update
      summary: 'ADMIN: Update redemption'
      description: Update redemption information
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RedemptionCreateRequestDTO'
      responses:
        '200':
          description: Redemption updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedemptionDTO'
      tags:
        - Redemption
      security:
        - tenantAdminJWT: []
    delete:
      operationId: RedemptionController_delete
      summary: 'ADMIN: Delete redemption'
      description: Delete redemption
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Redemption deleted
          content:
            application/json:
              schema:
                type: boolean
      tags:
        - Redemption
      security:
        - tenantAdminJWT: []
  /redemption/admin/{id}/toggle-active:
    put:
      operationId: RedemptionController_activate
      summary: 'ADMIN: Activate redemption'
      description: Activate redemption
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Redemption activated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedemptionDTO'
      tags:
        - Redemption
      security:
        - tenantAdminJWT: []
  /redemption/admin/{id}/token-units:
    post:
      operationId: RedemptionController_createTokenUnit
      summary: 'ADMIN: Create redemption token unit'
      description: Create redemption token unit
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenUnitCreateRequestDTO'
      responses:
        '200':
          description: Redemption token unit updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedemptionDTO'
      tags:
        - Redemption
      security:
        - tenantAdminJWT: []
  /redemption/admin/{id}/token-units/{tokenUnitId}:
    put:
      operationId: RedemptionController_updateTokenUnit
      summary: 'ADMIN: Update redemption token unit'
      description: Update redemption token unit
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: tokenUnitId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenUnitCreateRequestDTO'
      responses:
        '200':
          description: Redemption token unit updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedemptionDTO'
      tags:
        - Redemption
      security:
        - tenantAdminJWT: []
    delete:
      operationId: RedemptionController_removeTokenUnit
      summary: 'ADMIN: Remove redemption token unit'
      description: Remove redemption token unit
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: tokenUnitId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Redemption token unit removed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedemptionDTO'
      tags:
        - Redemption
      security:
        - tenantAdminJWT: []
  /redemption/admin/type:
    post:
      operationId: RedemptionController_createType
      summary: 'ADMIN: Create a new redemption type'
      description: Create a new redemption type
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RedemptionTypeCreateRequestDTO'
      responses:
        '200':
          description: Redemption type created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedemptionTypeDTO'
      tags:
        - Redemption
      security:
        - tenantAdminJWT: []
  /redemption/auth/redeem:
    post:
      operationId: RedemptionController_redeem
      summary: 'AUTH USER: Redeem a redemption'
      description: Redeem a redemption
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RedemptionRedeemRequestDTO'
      responses:
        '200':
          description: Redemption redeemed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedemptionUserRedeemDetailedDTO'
      tags:
        - Redemption
      security:
        - projectKey: []
        - authUserJWT: []
    get:
      operationId: RedemptionController_getRedemptionUserRedeems
      summary: 'AUT USER: Get all redemption user redeems'
      description: Get all redemption user redeems
      parameters: []
      responses:
        '200':
          description: Redemption user redeems
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RedemptionUserRedeemDTO'
      tags:
        - Redemption
      security:
        - projectKey: []
        - authUserJWT: []
  /redemption/{id}/available-supply:
    get:
      operationId: RedemptionController_getRedeemsAmountAvailable
      summary: Get redemption redeems amount available
      description: Get redemption redeems amount available
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Redemption redeems amount available
          content:
            application/json:
              schema:
                type: number
      tags:
        - Redemption
      security:
        - projectKey: []
  /:
    get:
      operationId: RootController_get
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - Root
      security:
        - '': []
  /healthcheck:
    get:
      operationId: RootController_getCurrentTime
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - Root
  /system:
    get:
      operationId: RootController_getSystem
      summary: Check if tenant system api key is valid
      description: Check if tenant system api key is valid
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - Root
  /admin:
    get:
      operationId: RootController_getAdmin
      summary: 'ADMIN: Check if admin'
      description: Get if admin
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - Root
      security:
        - tenantAdminJWT: []
  /balance/auth/me:
    get:
      operationId: BalanceController_getByUser
      summary: 'AUTH USER: Get Account Balance'
      description: >-
        Gets detailed Balances of all active token for loggedin account
        incluiding token metadata
      parameters: []
      responses:
        '200':
          description: Account Balance Retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountTokenMetadataBalancesDTO'
        '404':
          description: Account not found
      tags:
        - Balance
      security:
        - projectKey: []
        - authUserJWT: []
  /balance/admin/account/{accountAddress}:
    get:
      operationId: BalanceController_getByAccountAddress
      summary: 'ADMIN: Get Account Balance'
      description: >-
        ADMIN: Gets detailed Balances of all active token for account incluiding
        token metadata
      parameters:
        - name: accountAddress
          required: true
          in: path
          schema:
            type: string
        - name: includeInactive
          required: false
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Account Balance Retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountTokenMetadataBalancesDTO'
        '404':
          description: Account not found
      tags:
        - Balance
      security:
        - tenantAdminJWT: []
  /file/admin/entity-storage-url:
    post:
      operationId: FileController_upload
      summary: >-
        Get signed url for entity storage. This is needed to upload files to
        bucket
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EntityStorageUrlDTO'
      responses:
        '201':
          description: The record has been successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSignedURLResponseDTO'
      tags:
        - File
      security:
        - tenantAdminJWT: []
  /file/auth/entity-storage-url:
    post:
      operationId: FileController_uploadAuthUser
      summary: >-
        Get signed url for entity storage. This is needed to upload files to
        bucket
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EntityStorageUrlDTO'
      responses:
        '201':
          description: The record has been successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSignedURLResponseDTO'
      tags:
        - File
      security:
        - authUserJWT: []
info:
  title: PERS-api docs
  description: ''
  version: 1.8.1
  contact: {}
tags:
  - name: Introduction
    description: >-
      Introducing PERS (Phygital Experience Rewards System) the ultimate SaaS of
      Loyalty & Reward System.
          Connect **PERS API** to your system and get ready to create multi-projects, with your own dashboard and independent database, while ensuring users data confidentiality. This structure enables:
          - **Interoperable Rewards**
          - **Boost Customer Engagement**
          - **Simplified Management**
          - **Effortless Integration**
          - **Security and Privacy**
          - **Data-Driven Strategy**
          ![PERS System](https://s3.eu-west-1.amazonaws.com/pers.assets.prod/tenant/a0df6ebf-51cc-4c18-afcd-0de355c250dc_DemoApp_eXplorins/Documentation/PERS_frictionsless_image.png)
  - name: Setup Flow
    description: >-
      This diagram illustrates the comprehensive flow of **creating and
      connecting various components within the SaaS PERS ecosystem**. It
      outlines the interactions and dependencies between Tokens, Campaigns,
      Redemptions, Purchase, and Business entities.
          ![API Flow](https://s3.eu-west-1.amazonaws.com/pers.assets.prod/Platform/API+Flow_PERS.png)
  - name: Claim Campaign
    description: >-
      The Claim System Flow in SaaS PERS outlines the process through which
      **rewards and tokens can be claimed** by different entities within the
      system. This flow ensures that the claiming process is secure, efficient,
      and flexible, catering to various use cases and integration requirements.
          ![Claim System Flow](https://s3.eu-west-1.amazonaws.com/pers.assets.prod/Platform/Claim+System+Flow_PERS.png)
          This flow ensures that the process of claiming rewards is adaptable to various scenarios, making it seamless for system administrators, business partners, and end-users to interact with the reward system efficiently.
  - name: Tenant
    description: |-
      ## Description
          The Tenant module in SaaS PERS represents the business or organization that leads the reward and loyalty program. As the primary administrator, the tenant has overarching control over the configuration and management of the loyalty and reward system. Key responsibilities and features for the tenant include:
          <br/>
          - **Program Management:** Define and oversee the overall structure and rules of the reward program.
          <br/>
          - **Dashboard Access:** Utilize a comprehensive dashboard to monitor and manage all aspects of the reward system.
          <br/>
          - **Data Confidentiality:** Ensure that all user data within the system is handled with the highest level of confidentiality and security.
          <br/>
          - **Customization:** Tailor the reward system to align with the business's unique objectives and customer engagement strategies.
          <br/>
          - **Integration:** Seamlessly integrate the reward system with existing business systems and processes through the PERS API.
  - name: Token
    description: |-
      ## Description
          <div style="font-size: 14px; line-height: 1.5;">
            The Token module in SaaS PERS is a versatile system <strong>enabling users to earn or spend various types of tokens. Tokens can be categorised as Credits, Rewards, or Status.</strong> This module ensures seamless management of token transactions, providing a robust foundation for creating engaging reward experiences. It supports multiple token operations, including issuance, balance checks, and redemption, thus facilitating a dynamic and customizable rewards ecosystem. The Token module is designed to be easily integrated into any business model, providing a flexible and scalable solution to enhance customer loyalty and engagement.
          </div>
          <div style="width: 100%; max-height: 400px; display: flex; justify-content: center; align-items: center; overflow: hidden; margin: 0;">
            <img src="https://s3.eu-west-1.amazonaws.com/pers.assets.prod/tenant/a0df6ebf-51cc-4c18-afcd-0de355c250dc_DemoApp_eXplorins/Documentation/Tokens_image.png" alt="Token Module" style="width: 100%; height: auto; object-fit: contain; margin: 0;">
          </div>
  - name: Campaign
    description: |-
      ## Description
          The Campaign module in SaaS PERS **enables the creation and management of multi-campaigns that users can participate in to earn tokens**. This module supports a wide range of campaign types, including promotional, engagement, and loyalty campaigns, each designed to incentivize specific user behaviours. **Campaigns are a strategic tool for boosting customer engagement and driving desired actions**. With robust analytics and reporting features, the Campaign module allows businesses to monitor campaign performance and optimise their strategies for maximum impact. The flexibility of this module ensures that businesses can design campaigns tailored to their unique goals and customer demographics.
          ![Campaign Module](https://s3.eu-west-1.amazonaws.com/pers.assets.prod/tenant/a0df6ebf-51cc-4c18-afcd-0de355c250dc_DemoApp_eXplorins/Documentation/Campaign_image.png)
          <br/>
          **Key Campaign Features**
          <br/><br/>
          - **Integration with External APIs**: The Campaign module supports connections to over 7,000 external APIs, including CMS, CRM, Email Marketing, Events, Social Media, Product Sales, and AI. This extensive integration capability allows businesses to automate and streamline their campaign processes.
            [Connect with Zapier](https://zapier.com/developer/public-invite/202740/fbbe320ee8d12ba8d534ebb5d274ccb3/)
            <br/><br/>
          - **Tailored Strategies**: Businesses can design campaigns to align with specific goals, such as marketing objectives, sales targets, sustainability and environmental initiatives, and productivity improvements. This flexibility ensures that campaigns are not only engaging but also strategically impactful.
            <br/><br/>
          - **Dynamic Campaign Models**: The module supports various campaign types, each designed to incentivize different user behaviors. Whether it's a promotional campaign to boost short-term sales or a loyalty program to foster long-term customer engagement, the Campaign module can handle it.
            <br/><br/>
          - **User Engagement**: By participating in campaigns, users can earn tokens for completing specific actions. These actions can range from social media interactions and product purchases to attending events and more, depending on the campaign's objectives.
            <br/><br/>
          - **Data-Driven Optimization**: With robust analytics and reporting features, businesses can monitor the performance of their campaigns in real-time. This data-driven approach allows for continuous optimization, ensuring that campaigns achieve their desired outcomes.
            <br/><br/>
  - name: Redemption
    description: |-
      ## Description
          <div style="font-size: 14px; line-height: 1.5;">
            The Redemption module facilitates <strong>the exchange rules of one type of token for another</strong>, providing a flexible and rewarding experience for users. This module is essential for maintaining the value and utility of tokens within the SaaS PERS ecosystem. Users can redeem their tokens for various rewards, including products, services, or other token types, thus enhancing their engagement and satisfaction.
          </div>
          <div style="font-size: 14px; line-height: 1.5;">
            The Redemption module supports a streamlined and efficient redemption process, ensuring that users can easily and quickly access their desired rewards that are previously listed on the system. By offering diverse redemption options, this module helps businesses maintain a vibrant and <strong>attractive rewards program for their business and together with the partners ecosystem</strong>.
          </div>
          <div style="width: 100%; max-height: 400px; display: flex; justify-content: center; align-items: center; overflow: hidden; margin: 0;">
            <img src="https://s3.eu-west-1.amazonaws.com/pers.assets.prod/tenant/a0df6ebf-51cc-4c18-afcd-0de355c250dc_DemoApp_eXplorins/Documentation/Redemption_image.png" alt="Redemption Module" style="width: 100%; height: auto; object-fit: contain; margin: 0;">
          </div>
  - name: Purchase
    description: |-
      ## Description
          <div style="font-size: 14px; line-height: 1.5;">
            The Purchase module facilitates the <strong>recharging of balances through credit card payments</strong>. This module is optional and helps maintain the fluidity of the reward system by allowing users to top-up their accounts effortlessly. It supports secure and efficient payment processing, ensuring that users can quickly and safely add funds to their accounts. The Purchase module is designed with high security standards to protect user information and transaction data, thereby ensuring a trustworthy environment for financial operations within the SaaS PERS ecosystem. Its seamless integration with the token and rewards system enables a cohesive and user-friendly experience.
          </div>
          <div style="width: 100%; max-height: 400px; display: flex; justify-content: center; align-items: center; overflow: hidden; margin: 0;">
            <img src="https://s3.eu-west-1.amazonaws.com/pers.assets.prod/tenant/a0df6ebf-51cc-4c18-afcd-0de355c250dc_DemoApp_eXplorins/Documentation/Purchase_image.png" alt="Purchase Module" style="width: 100%; height: auto; object-fit: contain; margin: 0;">
          </div>
  - name: Business
    description: |-
      ## Description
          The Business module encompasses **all participants and partners involved** in the reward system. This includes the partner community, such as vendors, service providers, artist community, commercial partners, public or private institutions and other entities that contribute to the reward ecosystem. Key features of the Business module include:
          <br/>
          - **Partner Management:** Onboard and manage partners who participate in the reward system.
            <br/><br/>
          - **Collaboration:** Facilitate collaboration between the tenant and business partners to create cohesive and engaging reward campaigns.
            <br/><br/>
          - **Incentive Structures:** Develop and implement incentive structures that motivate partners to actively contribute to the reward system.
            <br/><br/>
          - **Performance Tracking:** Monitor the performance and engagement levels of business partners within the reward ecosystem.
            <br/><br/>
          - **Community Building:** Foster a sense of community among business participants to enhance the overall value and appeal of the reward program.
            <br/><br/> 
  - name: Transaction
    description: |-
      ## Description
          The Transaction module in SaaS PERS manages all transactional operations related to credits and tokens within the reward system. It ensures a smooth and secure flow of credits and tokens between users and the system.
          <br/>
          **API Endpoints**
          <br/>
          - **Mint credits:** Mint credits to a user's account.
          <br/>
          - **Transfer credits:** Transfer credits from one user account to another.
          <br/>
          - **Burn token:** Remove tokens from a user's account.
          <br/>
          - **Mint token:** Add new tokens to a user's account.
          <br/>
          - **Authorize transaction:** Ensure the user has the necessary permissions and balance for a transaction.
          <br/>
          - **Get balance:** Retrieve the balance of a user's account, including both credits and tokens.
          **Key Transaction Features**
          <br/>
          - **Secure Transactions:** Ensures all transactions are secure and authorized, protecting user data and maintaining the integrity of the reward system.
          <br/>
          - **Comprehensive Management:** Supports a variety of transactional operations, providing flexibility in how credits and tokens are managed within the system.
          <br/>
          - **Real-Time Processing:** All transactions are processed in real-time, ensuring that user balances are updated instantly.
          <br/>
          - **Integration Capabilities:** Easily integrates with other modules and external systems to provide a seamless transactional experience.
          <br/>
          The Transaction module is essential for the efficient and secure management of credits and tokens, enhancing user engagement and satisfaction within the SaaS PERS system.
  - name: User
    description: User endpoints
servers:
  - url: https://api.pers.ninja/v1.8
components:
  securitySchemes:
    tenantAdminJWT:
      scheme: bearer
      bearerFormat: JWT
      type: http
    authUserJWT:
      scheme: bearer
      bearerFormat: JWT
      type: http
    authAdminJWT:
      scheme: bearer
      bearerFormat: JWT
      type: http
    projectKey:
      type: apiKey
      in: header
      name: x-project-key
      description: Project API key
    businessApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Business API key
  schemas:
    BusinessTypeCreateRequestDTO:
      type: object
      properties:
        name:
          type: string
          description: Business type name
        description:
          type: string
          description: Business type description
        code:
          type: string
          description: Business type code
        iconUrl:
          type: string
          description: Business type icon url
      required:
        - name
        - description
    BusinessTypeDTO:
      type: object
      properties:
        id:
          type: number
          description: Business type id
        name:
          type: string
          description: Business type name
        description:
          type: string
          description: Business type description
        code:
          type: string
          description: Business type code
        iconUrl:
          type: string
          description: Business type icon url
      required:
        - name
        - description
    TokenBalanceDTO:
      type: object
      properties:
        contractAddress:
          type: string
        chainId:
          type: number
        balance:
          type: number
        tokenName:
          type: string
        tokenSymbol:
          type: string
        tokenType:
          type: string
          enum:
            - ERC20
            - ERC721
            - ERC1155
        tokenId:
          type: string
          nullable: true
        metadataUri:
          type: string
          nullable: true
      required:
        - contractAddress
        - chainId
        - balance
        - tokenType
        - tokenId
        - metadataUri
    BusinessTokenBalancesDTO:
      type: object
      properties:
        id:
          type: string
          description: >-
            The id of the business, this is unique and will be used to identify
            the business.
        email:
          type: string
          description: >-
            The email of the business, this is unique and will be used to
            identify the business.
        accountAddress:
          type: string
          description: >-
            The address of the business, this is the address that will be shown
            to the public.
        businessLegalName:
          type: string
          description: >-
            The legal name of the business, this is the name that will be used
            for legal purposes.
        displayName:
          type: string
          description: >-
            The display name of the business, this is the name that will be
            shown to the public.
        description:
          type: string
          description: >-
            The description of the business, this is the description that will
            be shown to the public.
        shortDescription:
          type: string
          description: >-
            The short description of the business, this is the description that
            will be shown to the public.
        websiteUrl:
          type: string
          description: >-
            The website of the business, this is the website that will be shown
            to the public.
        imageUrl:
          type: string
          description: >-
            The image of the business, this is the image that will be shown to
            the public.
        streetAddress:
          type: string
          description: >-
            The address of the business, this is the address that will be shown
            to the public.
        city:
          type: string
          description: >-
            The city of the business, this is the city that will be shown to the
            public.
        postalCode:
          type: string
          description: >-
            The postal code of the business, this is the postal code that will
            be shown to the public.
        coordsLatitude:
          type: number
          description: >-
            The latitude of the business, this is the latitude that will be
            shown to the public.
        coordsLongitude:
          type: number
          description: >-
            The longitude of the business, this is the longitude that will be
            shown to the public.
        businessType:
          description: >-
            The business type of the business, this is the business type that
            will be shown to the public.
          allOf:
            - $ref: '#/components/schemas/BusinessTypeDTO'
        isActive:
          type: boolean
          description: >-
            The status of the business, this is the status that will be shown to
            the public.
        canMintToken:
          type: boolean
          description: >-
            The ability to mint token for the business, this is the ability that
            will be shown to the public.
        canChargeToken:
          type: boolean
          description: >-
            The ability to charge token for the business, this is the ability
            that will be shown to the public.
        canManageUsers:
          type: boolean
          description: >-
            The ability to manage users for the business, this is the ability
            that will be shown to the public.
        canReceiveDonation:
          type: boolean
          description: >-
            The ability to receive donation for the business, this is the
            ability that will be shown to the public.
        tokenBalances:
          description: >-
            The token balances of the business, this is the token balances that
            will be shown to the public.
          type: array
          items:
            $ref: '#/components/schemas/TokenBalanceDTO'
      required:
        - id
        - isActive
        - canMintToken
        - canChargeToken
        - canManageUsers
        - canReceiveDonation
        - tokenBalances
    BusinessDTO:
      type: object
      properties:
        id:
          type: string
          description: >-
            The id of the business, this is unique and will be used to identify
            the business.
        email:
          type: string
          description: >-
            The email of the business, this is unique and will be used to
            identify the business.
        accountAddress:
          type: string
          description: >-
            The address of the business, this is the address that will be shown
            to the public.
        businessLegalName:
          type: string
          description: >-
            The legal name of the business, this is the name that will be used
            for legal purposes.
        displayName:
          type: string
          description: >-
            The display name of the business, this is the name that will be
            shown to the public.
        description:
          type: string
          description: >-
            The description of the business, this is the description that will
            be shown to the public.
        shortDescription:
          type: string
          description: >-
            The short description of the business, this is the description that
            will be shown to the public.
        websiteUrl:
          type: string
          description: >-
            The website of the business, this is the website that will be shown
            to the public.
        imageUrl:
          type: string
          description: >-
            The image of the business, this is the image that will be shown to
            the public.
        streetAddress:
          type: string
          description: >-
            The address of the business, this is the address that will be shown
            to the public.
        city:
          type: string
          description: >-
            The city of the business, this is the city that will be shown to the
            public.
        postalCode:
          type: string
          description: >-
            The postal code of the business, this is the postal code that will
            be shown to the public.
        coordsLatitude:
          type: number
          description: >-
            The latitude of the business, this is the latitude that will be
            shown to the public.
        coordsLongitude:
          type: number
          description: >-
            The longitude of the business, this is the longitude that will be
            shown to the public.
        businessType:
          description: >-
            The business type of the business, this is the business type that
            will be shown to the public.
          allOf:
            - $ref: '#/components/schemas/BusinessTypeDTO'
        isActive:
          type: boolean
          description: >-
            The status of the business, this is the status that will be shown to
            the public.
        canMintToken:
          type: boolean
          description: >-
            The ability to mint token for the business, this is the ability that
            will be shown to the public.
        canChargeToken:
          type: boolean
          description: >-
            The ability to charge token for the business, this is the ability
            that will be shown to the public.
        canManageUsers:
          type: boolean
          description: >-
            The ability to manage users for the business, this is the ability
            that will be shown to the public.
        canReceiveDonation:
          type: boolean
          description: >-
            The ability to receive donation for the business, this is the
            ability that will be shown to the public.
      required:
        - id
        - isActive
        - canMintToken
        - canChargeToken
        - canManageUsers
        - canReceiveDonation
    BusinessCreateRequestDTO:
      type: object
      properties:
        displayName:
          type: string
          description: >-
            The display name of the business, this is the name that will be
            shown to the public.
      required:
        - displayName
    BusinessApiKeyDTO:
      type: object
      properties:
        id:
          type: string
          description: >-
            The id of the business, this is unique and will be used to identify
            the business.
        email:
          type: string
          description: >-
            The email of the business, this is unique and will be used to
            identify the business.
        accountAddress:
          type: string
          description: >-
            The address of the business, this is the address that will be shown
            to the public.
        businessLegalName:
          type: string
          description: >-
            The legal name of the business, this is the name that will be used
            for legal purposes.
        displayName:
          type: string
          description: >-
            The display name of the business, this is the name that will be
            shown to the public.
        description:
          type: string
          description: >-
            The description of the business, this is the description that will
            be shown to the public.
        shortDescription:
          type: string
          description: >-
            The short description of the business, this is the description that
            will be shown to the public.
        websiteUrl:
          type: string
          description: >-
            The website of the business, this is the website that will be shown
            to the public.
        imageUrl:
          type: string
          description: >-
            The image of the business, this is the image that will be shown to
            the public.
        streetAddress:
          type: string
          description: >-
            The address of the business, this is the address that will be shown
            to the public.
        city:
          type: string
          description: >-
            The city of the business, this is the city that will be shown to the
            public.
        postalCode:
          type: string
          description: >-
            The postal code of the business, this is the postal code that will
            be shown to the public.
        coordsLatitude:
          type: number
          description: >-
            The latitude of the business, this is the latitude that will be
            shown to the public.
        coordsLongitude:
          type: number
          description: >-
            The longitude of the business, this is the longitude that will be
            shown to the public.
        businessType:
          description: >-
            The business type of the business, this is the business type that
            will be shown to the public.
          allOf:
            - $ref: '#/components/schemas/BusinessTypeDTO'
        isActive:
          type: boolean
          description: >-
            The status of the business, this is the status that will be shown to
            the public.
        canMintToken:
          type: boolean
          description: >-
            The ability to mint token for the business, this is the ability that
            will be shown to the public.
        canChargeToken:
          type: boolean
          description: >-
            The ability to charge token for the business, this is the ability
            that will be shown to the public.
        canManageUsers:
          type: boolean
          description: >-
            The ability to manage users for the business, this is the ability
            that will be shown to the public.
        canReceiveDonation:
          type: boolean
          description: >-
            The ability to receive donation for the business, this is the
            ability that will be shown to the public.
        apiPrivateKey:
          type: string
          description: >-
            The api private key of the business, this is the api private key
            that will be used to identify the business with the api.
      required:
        - id
        - isActive
        - canMintToken
        - canChargeToken
        - canManageUsers
        - canReceiveDonation
        - apiPrivateKey
    BusinessUpdateRequestDTO:
      type: object
      properties:
        email:
          type: string
          description: >-
            The email of the business, this is unique and will be used to
            identify the business.
        businessLegalName:
          type: string
          description: >-
            The legal name of the business, this is the name that will be used
            for legal purposes.
        displayName:
          type: string
          description: >-
            The display name of the business, this is the name that will be
            shown to the public.
        description:
          type: string
          description: >-
            The description of the business, this is the description that will
            be shown to the public.
        shortDescription:
          type: string
          description: >-
            The short description of the business, this is the description that
            will be shown to the public.
        websiteUrl:
          type: string
          description: >-
            The website of the business, this is the website that will be shown
            to the public.
        imageUrl:
          type: string
          description: >-
            The image of the business, this is the image that will be shown to
            the public.
        streetAddress:
          type: string
          description: >-
            The address of the business, this is the address that will be shown
            to the public.
        city:
          type: string
          description: >-
            The city of the business, this is the city that will be shown to the
            public.
        postalCode:
          type: string
          description: >-
            The postal code of the business, this is the postal code that will
            be shown to the public.
        coordsLatitude:
          type: number
          description: >-
            The latitude of the business, this is the latitude that will be
            shown to the public.
        coordsLongitude:
          type: number
          description: >-
            The longitude of the business, this is the longitude that will be
            shown to the public
        businessTypeId:
          type: number
          description: >-
            The business type of the business, this is the business type that
            will be shown to the public.
    BusinessToggleActiveRequestDTO:
      type: object
      properties:
        isActive:
          type: boolean
        canMintToken:
          type: boolean
        canChargeToken:
          type: boolean
        canManageUsers:
          type: boolean
        canReceiveDonation:
          type: boolean
      required:
        - isActive
    UserDTO:
      type: object
      properties:
        id:
          type: string
        email:
          type: object
        firstName:
          type: object
          description: User first name
        lastName:
          type: object
          description: User last name
        externalId:
          type: object
          description: User external id
        accountAddress:
          type: string
          description: User account address
        instagramAccountId:
          type: object
          description: Instagram account id
        googleAccountName:
          type: object
          description: Google account name
        customData:
          type: object
          description: Custom data
        publicProfile:
          type: object
          description: Public profile data
        isActive:
          type: boolean
          description: Is active
      required:
        - id
        - firstName
        - lastName
        - externalId
        - accountAddress
        - instagramAccountId
        - googleAccountName
        - customData
        - publicProfile
        - isActive
    UserCreateRequestDTO:
      type: object
      properties:
        email:
          type: string
        instagramAccountId:
          type: string
          description: User Instagram account id
        googleAccountName:
          type: string
          description: User Google account name
        firstName:
          type: string
          description: User first name
        lastName:
          type: string
          description: User last name
        externalId:
          type: string
          description: User external id
        customData:
          type: object
          description: Custom data
        publicProfile:
          type: object
          description: Public profile data
        isActive:
          type: boolean
          description: User active status
    UserTokenBalancesDTO:
      type: object
      properties:
        id:
          type: string
        email:
          type: object
        firstName:
          type: object
          description: User first name
        lastName:
          type: object
          description: User last name
        externalId:
          type: object
          description: User external id
        accountAddress:
          type: string
          description: User account address
        instagramAccountId:
          type: object
          description: Instagram account id
        googleAccountName:
          type: object
          description: Google account name
        customData:
          type: object
          description: Custom data
        publicProfile:
          type: object
          description: Public profile data
        isActive:
          type: boolean
          description: Is active
        tokenBalances:
          type: array
          items:
            $ref: '#/components/schemas/TokenBalanceDTO'
      required:
        - id
        - firstName
        - lastName
        - externalId
        - accountAddress
        - instagramAccountId
        - googleAccountName
        - customData
        - publicProfile
        - isActive
        - tokenBalances
    UserStatusTypeDTO:
      type: object
      properties:
        name:
          type: string
          description: User Status Type name
        description:
          type: string
          description: User Status Type description
        minTokenBalance:
          type: number
          description: User Status Type eligible Token Addresses
        discountPercentage:
          type: number
          description: User Status Type discount Rate in percentage
        imageUrl:
          type: string
          description: User Status Type image Url
        id:
          type: number
          description: User Status Type id
        eligibleTokenAddresses:
          description: User Status Type eligible Token Addresses
          type: array
          items:
            type: string
      required:
        - name
        - minTokenBalance
        - discountPercentage
        - id
        - eligibleTokenAddresses
    PublicUserDTO:
      type: object
      properties:
        id:
          type: string
        publicProfile:
          type: object
          description: Public profile data
      required:
        - id
        - publicProfile
    UrlRequestDTO:
      type: object
      properties:
        url:
          type: string
          example: https://example.com/user-data
      required:
        - url
    UserStatusTypeCreateRequestDTO:
      type: object
      properties:
        name:
          type: string
          description: User Status Type name
        description:
          type: string
          description: User Status Type description
        minTokenBalance:
          type: number
          description: User Status Type eligible Token Addresses
        discountPercentage:
          type: number
          description: User Status Type discount Rate in percentage
        imageUrl:
          type: string
          description: User Status Type image Url
      required:
        - name
        - minTokenBalance
        - discountPercentage
    AdminDTO:
      type: object
      properties:
        id:
          type: string
          description: Id of the admin
        email:
          type: string
          description: Email of the admin
        displayName:
          type: object
          description: Display name of the admin
        type:
          type: string
          description: Type of the admin
          enum:
            - SUPER_ADMIN
            - TENANT_ADMIN
        tenants:
          type: object
          description: Tenant of the admin
      required:
        - id
        - email
        - displayName
        - type
    AdminCreateRequestDTO:
      type: object
      properties:
        email:
          type: string
          description: Email of the admin
        displayName:
          type: string
          description: Display name of the admin
        type:
          type: string
          description: Type of the admin
          enum:
            - SUPER_ADMIN
            - TENANT_ADMIN
      required:
        - email
        - type
    AdminLoginResponseDTO:
      type: object
      properties:
        accessToken:
          type: string
          description: >-
            JWT access token this token is used to authenticate the user, by
            default it expires in 15 minutes, and it should be sent in the
            Authorization header as Bearer token.
        refreshToken:
          type: string
          description: >-
            JWT refresh token this token is used to get a new access token when
            the current one expires. It is valid for 1 day.
        admin:
          description: Admin
          allOf:
            - $ref: '#/components/schemas/AdminDTO'
      required:
        - accessToken
        - refreshToken
        - admin
    RefreshTokenRequestDTO:
      type: object
      properties:
        refreshToken:
          type: string
          description: refresh token
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRJZCI6IjEiLCJpYXQiOjE2MjYxNzUwNzksImV4cCI6MTYyNjE3NTI3OX0.5w8A6t7b5lBx8D3FmLwJQgJ9z1D9c9Vz7A3f7BvzH2A
      required:
        - refreshToken
    LoginResponseDTO:
      type: object
      properties:
        accessToken:
          type: string
          description: >-
            JWT access token this token is used to authenticate the user, by
            default it expires in 15 minutes, and it should be sent in the
            Authorization header as Bearer token.
        refreshToken:
          type: string
          description: >-
            JWT refresh token this token is used to get a new access token when
            the current one expires. It is valid for 1 day.
      required:
        - accessToken
        - refreshToken
    TokenCreateRequestDTO:
      type: object
      properties:
        contractAddress:
          type: string
          description: Contract address is the address of the token contract on chain.
        abiUrl:
          type: string
          description: >-
            The ABI URL is the URL to the contract ABI. This is an optional
            field. If not provided, the contract ABI will be fetched from PERS
            instance depending on selected token type.
        type:
          type: string
          enum:
            - ERC20
            - ERC721
            - ERC1155
        decimals:
          type: number
          description: >-
            Decimals is the number of decimals the token uses. This is useful
            for ERC20 tokens.
      required:
        - contractAddress
        - type
    TokenDTO:
      type: object
      properties:
        id:
          type: string
          description: Id of the token
        contractAddress:
          type: string
          description: Address of the token
        metadata:
          type: object
          description: >-
            Metadata of the token, this is optional and can be null in case of
            Point token
        abi:
          type: object
          description: >-
            this is the abi of the contract, this is the interface of the
            contract to interact with it
        chainId:
          type: number
          description: this is the chain id of the chain where the token is deployed
        abiUrl:
          type: object
          description: >-
            this is the url of the abi of the contract, to be used to fetch the
            abi of the contract
        name:
          type: string
          description: this is the name of the token contract
        symbol:
          type: string
          description: >-
            this is the symbol of the token contract, this is optional and can
            be null
        decimals:
          type: number
          description: >-
            this is the decimals of the token. This is optional and only used
            for ERC20 tokens (Points)
        isActive:
          type: boolean
          description: This can be used to enable or disable the token
        isGallery:
          type: boolean
          description: This can be used to enable or disable the token for gallery
        type:
          type: string
          description: This is the underlying web3 native type of the token contract
          enum:
            - ERC20
            - ERC721
            - ERC1155
      required:
        - id
        - contractAddress
        - abi
        - chainId
        - abiUrl
        - isActive
        - isGallery
        - type
    TokenUpdateRequestDTO:
      type: object
      properties:
        isGallery:
          type: boolean
          description: >-
            This indicates if token should be included as a gallery. This is
            useful for ERC721 or ERC1155 tokens.
        name:
          type: string
          description: The name of the token
        symbol:
          type: string
          description: The symbol of the token
    TokenMetadataCreateRequestDTO:
      type: object
      properties:
        imageUrl:
          type: string
          description: ' This is the URL to the image of the item. Can be just about any type of image (including SVGs, which will be cached into PNGs by OpenSea), IPFS or Arweave URLs or paths. We recommend using a minimum 3000 x 3000 image.'
        externalUrl:
          type: string
          description: This is the URL that will appear below the asset's image
        description:
          type: string
          description: A human-readable description of the item. Markdown is supported.
        name:
          type: string
          description: Name of the item.
        expiryDate:
          format: date-time
          type: string
          description: expiry date in case of an utility reward
        animationUrl:
          type: string
          description: >-
            A URL to a multi-media attachment for the item. The file extensions
            GLTF, GLB, WEBM, MP4, M4V, OGV, and OGG are supported, along with
            the audio-only extensions MP3, WAV, and OGA. Animation_url also
            supports HTML pages, allowing you to build rich experiences and
            interactive NFTs using JavaScript canvas, WebGL, and more. Scripts
            and relative paths within the HTML page are now supported. However,
            access to browser extensions is not supported.
        youtubeUrl:
          type: string
          description: A URL to a YouTube video (only used if animation_url is not provide
        creatorAccountAddress:
          type: string
          description: Creator Address
        previewUrl:
          type: string
          description: Preview Url
    TokenMetadataDTO:
      type: object
      properties:
        imageUrl:
          type: string
          description: ' This is the URL to the image of the item. Can be just about any type of image (including SVGs, which will be cached into PNGs by OpenSea), IPFS or Arweave URLs or paths. We recommend using a minimum 3000 x 3000 image.'
        externalUrl:
          type: string
          description: This is the URL that will appear below the asset's image
        description:
          type: string
          description: A human-readable description of the item. Markdown is supported.
        name:
          type: string
          description: Name of the item.
        expiryDate:
          format: date-time
          type: string
          description: expiry date in case of an utility reward
        animationUrl:
          type: string
          description: >-
            A URL to a multi-media attachment for the item. The file extensions
            GLTF, GLB, WEBM, MP4, M4V, OGV, and OGG are supported, along with
            the audio-only extensions MP3, WAV, and OGA. Animation_url also
            supports HTML pages, allowing you to build rich experiences and
            interactive NFTs using JavaScript canvas, WebGL, and more. Scripts
            and relative paths within the HTML page are now supported. However,
            access to browser extensions is not supported.
        youtubeUrl:
          type: string
          description: A URL to a YouTube video (only used if animation_url is not provide
        creatorAccountAddress:
          type: string
          description: Creator Address
        previewUrl:
          type: string
          description: Preview Url
        id:
          type: string
          description: Token Metadata id
        animationWeb3StorageUrl:
          type: string
          description: web3 storage url for the animation file
        imageWeb3StorageUrl:
          type: string
          description: web3 storage url for the image
        web3StorageUrl:
          type: string
          description: Storage Url
        tokenMetadataIncrementalId:
          type: number
          description: Token Metadata Incremental Id
        isActive:
          type: boolean
          description: Is active
      required:
        - id
        - tokenMetadataIncrementalId
        - isActive
    TokenTypeDTO:
      type: object
      properties:
        nativeTokenType:
          type: string
          description: |-
            Token native Types: 
                    - ERC20: used for credits 
                    - ERC721: used for stamps and NFTs 
                    - ERC1155: used for rewards
          enum:
            - ERC20
            - ERC721
            - ERC1155
        name:
          type: string
          description: Token type name
        imageUrl:
          type: string
          description: Token type image url
        description:
          type: string
          description: Token type description
      required:
        - nativeTokenType
    Web3ContractCreateRequestDTO:
      type: object
      properties:
        implementationAddress:
          type: string
          description: >-
            this is implementation address, the address of the contract that is
            being used as implementation for the proxy. This is only used for
            proxy contracts
        contractAddress:
          type: string
          description: this is the address of the contract
        ownerAddress:
          type: string
          description: this is the address of the owner of the contract
        chainId:
          type: number
          description: this is the chain id of the contract
        contractVersion:
          type: string
          description: this is the version of the contract
        contractType:
          type: string
          description: this is the type of the contract
          enum:
            - SMART_WALLET_FACTORY
            - SMART_WALLET_IMPLEMENTATION
            - SMART_WALLET_PROXY
            - TOKEN_CONTRACT
        nativeTokenType:
          type: string
          description: >-
            this is the native token type of the contract, this is only used for
            native tokens
          enum:
            - ERC20
            - ERC721
            - ERC1155
        salt:
          type: string
          description: >-
            this is the salt of the contract, this is only used for proxy
            contract factories to generate unique contracts
        isProxy:
          type: boolean
          description: this is the flag to check if the contract is a proxy contract
        abiUrl:
          type: string
          description: >-
            this is the url of the abi of the contract, to be used to fetch the
            abi of the contract
      required:
        - contractAddress
        - ownerAddress
        - chainId
        - contractVersion
        - contractType
        - nativeTokenType
        - isProxy
        - abiUrl
    Web3ContractDTO:
      type: object
      properties:
        implementationAddress:
          type: string
          description: >-
            this is implementation address, the address of the contract that is
            being used as implementation for the proxy. This is only used for
            proxy contracts
        contractAddress:
          type: string
          description: this is the address of the contract
        ownerAddress:
          type: string
          description: this is the address of the owner of the contract
        chainId:
          type: number
          description: this is the chain id of the contract
        contractVersion:
          type: string
          description: this is the version of the contract
        contractType:
          type: string
          description: this is the type of the contract
          enum:
            - SMART_WALLET_FACTORY
            - SMART_WALLET_IMPLEMENTATION
            - SMART_WALLET_PROXY
            - TOKEN_CONTRACT
        nativeTokenType:
          type: string
          description: >-
            this is the native token type of the contract, this is only used for
            native tokens
          enum:
            - ERC20
            - ERC721
            - ERC1155
        salt:
          type: string
          description: >-
            this is the salt of the contract, this is only used for proxy
            contract factories to generate unique contracts
        isProxy:
          type: boolean
          description: this is the flag to check if the contract is a proxy contract
        abiUrl:
          type: string
          description: >-
            this is the url of the abi of the contract, to be used to fetch the
            abi of the contract
        abi:
          type: object
          description: >-
            this is the abi of the contract, this is the interface of the
            contract to interact with it
        tenantId:
          type: object
          description: >-
            this is the tenant id of the contract, this can be null for generic
            contracts
      required:
        - contractAddress
        - ownerAddress
        - chainId
        - contractVersion
        - contractType
        - nativeTokenType
        - isProxy
        - abiUrl
        - abi
        - tenantId
    ChainDataDTO:
      type: object
      properties:
        name:
          type: string
          description: Name of the chain
        shortName:
          type: string
          description: Short name of the chain
        chain:
          type: string
          description: Chain name
        network:
          type: string
          description: Network name
        chainId:
          type: number
          description: Chain ID
        explorerUrl:
          type: string
          description: explorer URL
        networkId:
          type: number
          description: Network ID
        rpcUrl:
          type: string
          description: RPC URL
        authHeader:
          type: string
          description: Authorization header
        chainType:
          type: string
          description: Chain type
          enum:
            - PRIVATE
            - PUBLIC
      required:
        - name
        - rpcUrl
        - chainType
    TenantCreateRequestDTO:
      type: object
      properties:
        projectName:
          type: string
      required:
        - projectName
    TenantDTO:
      type: object
      properties:
        projectName:
          type: string
          description: Name of the tenant.
        id:
          type: string
          description: >-
            Unique identifier for tenant. This id is used to identify tenant in
            the system for client requests.
        createdAt:
          format: date-time
          type: string
          description: Date when tenant was created.
        projectDescription:
          type: string
          description: Description of the tenant.
        projectWebsite:
          type: string
          description: Website of the tenant.
        projectEmail:
          type: string
          description: Email of the tenant.
        projectImageUrl:
          type: string
          description: Image URL of the tenant.
        projectApiKey:
          type: string
          description: >-
            Unique identifier for tenant. This id is used to identify tenant in
            the system for client requests.
        testnetProjectApiKey:
          type: string
          description: Testnet project API key for tenant. Used in case of testnet project.
        stripeApiKey:
          type: string
          description: Stripe API key for tenant. Used in case of stripe payment.
        stripeWebhookSecret:
          type: string
          description: Stripe webhook secret for tenant. Used in case of stripe payment.
        loginToken:
          type: string
          description: >-
            This is an optional field for any extra login requirements for your
            users.
        allowJWTForUnauthenticatedUsers:
          type: boolean
          description: >-
            This is an optional field for any extra login requirements for your
            users.
        firebaseTenantId:
          type: string
        jwt:
          type: string
          description: >-
            JWT token for tenant admin user. This token is used to authenticate
            tenant admin user. It is generated when tenant is created. Please
            store it securely, you will not be able to see this again. However,
            you can generate a new one if needed.
        apiPrivateKey:
          type: string
          description: >-
            API private key for tenant. This key is used to authenticate tenant
            when making API requests. It is generated on demand. Please store it
            securely, you will not be able to see this again. However, you can
            generate a new one if needed.
      required:
        - projectName
        - id
        - createdAt
        - projectApiKey
        - testnetProjectApiKey
        - allowJWTForUnauthenticatedUsers
    TenantApiKeyRequestDTO:
      type: object
      properties:
        keyName:
          type: string
          description: name of the key
      required:
        - keyName
    TenantJWTRequestDTO:
      type: object
      properties:
        isTestnet:
          type: boolean
          description: wheter the key is for testnet or mainnet
      required:
        - isTestnet
    TenantUpdateRequestDTO:
      type: object
      properties:
        projectName:
          type: string
          description: The project name
          example: My Project
        projectDescription:
          type: string
          description: The project description
        stripeApiKey:
          type: string
        stripeWebhookSecret:
          type: string
        stripePublishableKey:
          type: string
        loginToken:
          type: string
        allowJWTForUnauthenticatedUsers:
          type: boolean
          description: >-
            This is an optional field for any extra login requirements for your
            users.
        firebaseTenantId:
          type: string
        projectWebsite:
          type: string
        projectEmail:
          type: string
        projectImageUrl:
          type: string
    TenantPublicDTO:
      type: object
      properties:
        projectName:
          type: string
          description: Name of the tenant.
        id:
          type: string
          description: >-
            Unique identifier for tenant. This id is used to identify tenant in
            the system for client requests.
        createdAt:
          format: date-time
          type: string
          description: Date when tenant was created.
        projectDescription:
          type: string
          description: Description of the tenant.
        projectWebsite:
          type: string
          description: Website of the tenant.
        projectEmail:
          type: string
          description: Email of the tenant.
        projectImageUrl:
          type: string
          description: Image URL of the tenant.
      required:
        - projectName
        - id
        - createdAt
    TenantClientConfigDTO:
      type: object
      properties:
        projectName:
          type: string
          description: The project name
          example: My Project
        id:
          type: string
          description: The project id
          example: ererf-erf-erf-erf
        stripePublishableKey:
          type: string
          description: Stripe publishable key for tenant. Used in case of stripe payment.
        firebaseTenantId:
          type: string
          description: >-
            Firebase tenant ID for tenant. This id is needed, if you choose to
            setup Firebase for user authentification for your project.
        infuraApiKey:
          type: string
          description: >-
            Infura API key for tenant. Used in for client interaction with web3
            provider.
        polyScanApiKey:
          type: string
          description: >-
            PolyScan API key for tenant. Used in for client interaction with
            PolyScan.
      required:
        - projectName
        - id
        - infuraApiKey
        - polyScanApiKey
    BusinessToUserCreditTransactionCreateRequestDTO:
      type: object
      properties:
        userEmail:
          type: string
        userIdentifier:
          type: string
          description: >-
            User identifier, this is the user´s main reference to identify the
            user
          enum:
            - id
            - email
            - instagramAccountId
            - externalId
        amount:
          type: number
      required:
        - amount
    TransactionDTO:
      type: object
      properties:
        amount:
          type: number
          description: Transaction amount
        id:
          type: string
          description: Transaction id
        tokenAddress:
          type: string
          description: Transaction token address
        contractTokenId:
          type: object
          description: >-
            Transaction token contract id, this is the blockchain contract id of
            the token
          nullable: true
        tokenType:
          type: string
          description: Transaction token type
          enum:
            - ERC20
            - ERC721
            - ERC1155
        senderAddress:
          type: string
          description: Sender address
        recipientAddress:
          type: object
          description: Recipient address
        transactionHash:
          type: object
          description: Transaction hash
        type:
          type: string
          description: Transaction type
          enum:
            - MINT
            - TRANSFER
            - BURN
            - CLAIM
        triggerProcessType:
          type: string
          description: Trigger process type
          enum:
            - PURCHASE
            - SPEND
            - EARN
            - CAMPAIGN_USER_CLAIM
            - CAMPAIGN_SYSTEM_CLAIM
            - CAMPAIGN_BUSINESS_CLAIM
            - REDEMPTION_SPEND
            - REDEMPTION_RECEIVE
            - MIGRATION
            - ADMIN_TRIGGERED
        triggerProcessId:
          type: object
          description: >-
            Trigger process id, this is the id of the entity that triggered the
            transaction if applicable (e.g. CampaignUserClaim id)
        status:
          type: string
          description: Transaction status
          enum:
            - created
            - processing
            - broadcasted
            - succeeded
            - failed
        createdAt:
          type: object
          description: create date
        updatedAt:
          type: object
          description: update date
      required:
        - amount
        - id
        - tokenAddress
        - contractTokenId
        - tokenType
        - senderAddress
        - recipientAddress
        - transactionHash
        - type
        - triggerProcessType
        - triggerProcessId
        - status
        - createdAt
        - updatedAt
    UserToBusinessTokenTransactionCreateRequestDTO:
      type: object
      properties:
        businessId:
          type: string
          description: Business id
        tokenAddress:
          type: string
          description: >-
            Token address, this is optional, if not provided, the default credit
            token will be used
        tokenMetadataIncrementalId:
          type: number
          description: >-
            Token metadata incremental id, this is optional, if not provided,
            will be set to null
        chainId:
          type: number
          description: chain Id
        amount:
          type: number
      required:
        - chainId
        - amount
    UserBurnTokenRequestDTO:
      type: object
      properties:
        tokenAddress:
          type: string
          description: Token address
        chainId:
          type: number
          description: chain Id
        tokenMetadataIncrementalId:
          type: string
          description: Token id
        amount:
          type: number
      required:
        - tokenAddress
        - chainId
        - tokenMetadataIncrementalId
        - amount
    TransactionCreateRequestDTO:
      type: object
      properties:
        amount:
          type: number
          description: Transaction amount
        tokenAddress:
          type: string
          description: Transaction token address
        tokenMetadataIncrementalId:
          oneOf:
            - type: string
            - type: number
            - type: 'null'
          nullable: true
          description: Transaction token metadata incremental id
        chainId:
          type: number
          description: chain Id
        senderAddress:
          type: string
          description: Sender address
        recipientAddress:
          type: string
          description: Recipient address
      required:
        - amount
        - tokenAddress
        - chainId
    TransactionBulkCreateRequestDTO:
      type: object
      properties:
        url:
          type: string
          example: https://example.com/user-data
        amount:
          type: number
          description: >-
            Transaction amount, if not provided, the amount must be included in
            the file from url
        tokenAddress:
          type: string
          description: Transaction token address
        tokenMetadataIncrementalId:
          type: object
          description: Transaction token metadata incremental id
        chainId:
          type: number
          description: chain Id
        senderAddress:
          type: string
          description: Sender address
      required:
        - url
        - tokenAddress
        - chainId
    TransactionByUserOrBusinessRequestDTO:
      type: object
      properties:
        email:
          type: string
          description: User email
        userIdentifier:
          type: string
          description: User identifier
          enum:
            - id
            - email
            - instagramAccountId
            - externalId
        accountAddress:
          type: string
          description: User account address
        businessOrUserId:
          type: string
          description: Business or user id
        accountType:
          type: string
          description: 'Type to retrieve transactions from: user or business'
          enum:
            - BUSINESS
            - USER
      required:
        - accountType
    PurchaseTokenCreateRequestDTO:
      type: object
      properties:
        tokenId:
          type: string
          description: Token id
        description:
          type: string
          description: Purchase Token description
        purchaseTypeId:
          type: number
          description: Purchase Type id
      required:
        - tokenId
        - description
        - purchaseTypeId
    PurchaseTypeDTO:
      type: object
      properties:
        conversionRate:
          type: number
          description: Conversion Rate of the token
        currency:
          type: string
          description: Currency of the token
          enum:
            - eur
        id:
          type: number
          description: Purchase Type id
      required:
        - conversionRate
        - currency
        - id
    PurchaseTokenDTO:
      type: object
      properties:
        id:
          type: string
          description: Purchase Token id
        description:
          type: string
          description: Purchase Token description
        token:
          description: Token
          allOf:
            - $ref: '#/components/schemas/TokenDTO'
        contractTokenId:
          type: object
          description: optional contract token id
        purchaseType:
          description: Purchase Type
          allOf:
            - $ref: '#/components/schemas/PurchaseTypeDTO'
        isActive:
          type: boolean
          description: Purchase Token isActive
      required:
        - id
        - description
        - token
        - contractTokenId
        - purchaseType
        - isActive
    PurchaseTokenUpdateRequestDTO:
      type: object
      properties:
        description:
          type: string
          description: Purchase Token description
        isActive:
          type: boolean
          description: Purchase Token isActive
    PurchaseTypeCreateRequestDTO:
      type: object
      properties:
        conversionRate:
          type: number
          description: Conversion Rate of the token
        currency:
          type: string
          description: Currency of the token
          enum:
            - eur
      required:
        - conversionRate
        - currency
    DonationTypeDTO:
      type: object
      properties:
        percentage:
          type: number
          description: Percentage of donation
        id:
          type: number
          description: Id of the donation type
      required:
        - percentage
        - id
    PurchaseCreateRequestDTO:
      type: object
      properties:
        quantity:
          type: number
          description: Quantity of tokens to purchase
        paymentIntentId:
          type: string
          description: Payment Intent Id
        purchaseTokenId:
          type: string
          description: Purchase Token id
        donationTypeId:
          type: number
          description: Donation Type
        donationAccountAddress:
          type: string
          description: Donation Account Address
      required:
        - quantity
        - paymentIntentId
        - purchaseTokenId
    PurchaseCreateResponseDTO:
      type: object
      properties:
        id:
          type: string
          description: Purchase id
        stripePaymentIntentId:
          type: string
          description: Stripe Payment Intent id
        status:
          type: object
          description: Purchase status
        amount:
          type: number
          description: Amount to pay in cents
        currency:
          type: string
          description: Currency
          enum:
            - eur
        quantity:
          type: number
          description: Quantity of tokens to purchase
        purchaseToken:
          description: Purchase Token
          allOf:
            - $ref: '#/components/schemas/PurchaseTokenDTO'
        user:
          description: User
          allOf:
            - $ref: '#/components/schemas/UserDTO'
        business:
          description: Business
          allOf:
            - $ref: '#/components/schemas/BusinessDTO'
        donationAccountAddress:
          type: string
          description: Donation Account Address
        donationType:
          description: Donation Type
          allOf:
            - $ref: '#/components/schemas/DonationTypeDTO'
        createdAt:
          format: date-time
          type: string
          description: create date
        updatedAt:
          format: date-time
          type: string
          description: update date
        paymentClientSecret:
          type: object
          description: Stripe payment intent client secret
      required:
        - id
        - stripePaymentIntentId
        - status
        - amount
        - currency
        - quantity
        - purchaseToken
        - user
        - business
        - paymentClientSecret
    PaymentIntentCreateDTO:
      type: object
      properties:
        amount:
          type: number
          description: Amount in cents
        currency:
          type: string
          description: Currency
        receiptEmail:
          type: string
          description: Receipt Email
        description:
          type: string
          description: Description
      required:
        - amount
        - currency
        - receiptEmail
        - description
    PaymentIntentDTO:
      type: object
      properties:
        paymentClientSecret:
          type: object
          description: Payment Intent ClientSecrete to complete Stripe payment
        paymentIntentId:
          type: string
          description: Payment Intent Id
      required:
        - paymentClientSecret
        - paymentIntentId
    PurchaseDTO:
      type: object
      properties:
        id:
          type: string
          description: Purchase id
        stripePaymentIntentId:
          type: string
          description: Stripe Payment Intent id
        status:
          type: object
          description: Purchase status
        amount:
          type: number
          description: Amount to pay in cents
        currency:
          type: string
          description: Currency
          enum:
            - eur
        quantity:
          type: number
          description: Quantity of tokens to purchase
        purchaseToken:
          description: Purchase Token
          allOf:
            - $ref: '#/components/schemas/PurchaseTokenDTO'
        user:
          description: User
          allOf:
            - $ref: '#/components/schemas/UserDTO'
        business:
          description: Business
          allOf:
            - $ref: '#/components/schemas/BusinessDTO'
        donationAccountAddress:
          type: string
          description: Donation Account Address
        donationType:
          description: Donation Type
          allOf:
            - $ref: '#/components/schemas/DonationTypeDTO'
        createdAt:
          format: date-time
          type: string
          description: create date
        updatedAt:
          format: date-time
          type: string
          description: update date
      required:
        - id
        - stripePaymentIntentId
        - status
        - amount
        - currency
        - quantity
        - purchaseToken
        - user
        - business
    CampaignDTO:
      type: object
      properties:
        name:
          type: string
          description: Campaign name
        description:
          type: object
          description: Campaign description
        beneficiaryAccountAddress:
          type: object
          description: Campaign beneficiary account address
        startDate:
          type: object
          description: Campaign start date, default is the current date
        endDate:
          type: object
          description: Campaign end date
        imageUrl:
          type: object
          description: img url
        externalUrl:
          type: object
          description: Campaign url
        id:
          type: string
          description: Campaign id
        isActive:
          type: boolean
          description: Campaign isActive
        isTestnet:
          type: boolean
          description: >-
            Campaign isTestnet, this means that the campaign is running on
            testnet, not mainnet
        trigger:
          type: object
          description: >-
            Campaign trigger: what triggers the campaign, and what are the
            conditions for the trigger to be activated
        tokenUnits:
          description: 'Campaign reward: what are the rewards'
          type: array
          items:
            type: string
        businessEngagements:
          description: 'Campaign businesses: what businesses are involved in the campaign'
          type: array
          items:
            type: string
        createdAt:
          type: object
          description: create date
        updatedAt:
          type: object
          description: update date
      required:
        - name
        - description
        - beneficiaryAccountAddress
        - startDate
        - endDate
        - imageUrl
        - externalUrl
        - id
        - isActive
        - trigger
        - tokenUnits
        - businessEngagements
        - createdAt
        - updatedAt
    CampaignCreateRequestDTO:
      type: object
      properties:
        name:
          type: string
          description: Campaign name
        description:
          type: string
          description: Campaign description
        beneficiaryAccountAddress:
          type: string
          description: Campaign beneficiary account address
        startDate:
          format: date-time
          type: string
          description: Campaign start date, default is the current date
        endDate:
          format: date-time
          type: string
          description: Campaign end date
        imageUrl:
          type: string
          description: img url
        externalUrl:
          type: string
          description: Campaign url
      required:
        - name
    TokenUnitCreateRequestDTO:
      type: object
      properties:
        tokenId:
          type: string
          description: Token id
        tokenMetadataIncrementalId:
          type: number
          description: >-
            token metadata incremental id for the token unit, this is used to
            identify the specific token metadata that should be minted 
        amount:
          type: number
          description: >-
            Token unit amount is the amount of tokens that the user will receive
            when aquiring the token unit
        maxAmount:
          type: number
          description: >-
            Token unit max amount, this is the maximum amount of tokens that the
            user can receive when aquiring the token unit. This is relevant e.g.
            in campaigns where a user may receive token units per revenue spent
            etc
      required:
        - tokenId
        - amount
    CampaignBusinessEngagementCreateRequestDTO:
      type: object
      properties:
        businessIds:
          description: The business ids to engage with
          type: array
          items:
            type: string
        shortDescription:
          type: string
          description: >-
            A short description of the business engagement, with indications
            what to do etc
        maxPerBussiness:
          type: number
          description: max per user at the business
        maxPerDay:
          type: number
          description: >-
            max per day, the maximum number of times a user can engage with the
            buisness in the campaign per day
      required:
        - businessIds
    CampaignTriggerDTO:
      type: object
      properties:
        name:
          type: string
          description: Campaign trigger name
        description:
          type: string
          description: Campaign trigger description
        maxPerDay:
          type: number
          nullable: true
          description: Campaign trigger max per day
        maxPerUser:
          type: number
          nullable: true
          description: Campaign trigger max per user
        minCooldownSeconds:
          type: number
          nullable: true
          description: Campaign trigger min cooldown seconds
        maxGeoDistanceInMeters:
          type: number
          nullable: true
          description: Campaign trigger max geo distance to Business in meters
        requiredUserInfo:
          type: object
          description: Campaign trigger required user info
        triggerType:
          type: string
          description: Campaign trigger type
          enum:
            - CLAIM_BY_USER
            - CLAIM_BY_SYSTEM
            - CLAIM_BY_BUSINESS
        maxMultiplier:
          type: number
          nullable: true
          description: Campaign trigger max multiplier
        completionThreshold:
          type: number
          nullable: true
          description: >-
            Campaign trigger completion threshold. This indicates the number of
            completions required before the reward is granted
        id:
          type: string
          description: Campaign trigger id
        conditions:
          description: Campaign trigger conditions
          type: array
          items:
            type: string
      required:
        - name
        - id
        - conditions
    CampaignTriggerCreateRequestDTO:
      type: object
      properties:
        name:
          type: string
          description: Campaign trigger name
        description:
          type: string
          description: Campaign trigger description
        maxPerDay:
          type: number
          nullable: true
          description: Campaign trigger max per day
        maxPerUser:
          type: number
          nullable: true
          description: Campaign trigger max per user
        minCooldownSeconds:
          type: number
          nullable: true
          description: Campaign trigger min cooldown seconds
        maxGeoDistanceInMeters:
          type: number
          nullable: true
          description: Campaign trigger max geo distance to Business in meters
        requiredUserInfo:
          type: object
          description: Campaign trigger required user info
        triggerType:
          type: string
          description: Campaign trigger type
          enum:
            - CLAIM_BY_USER
            - CLAIM_BY_SYSTEM
            - CLAIM_BY_BUSINESS
        maxMultiplier:
          type: number
          nullable: true
          description: Campaign trigger max multiplier
        completionThreshold:
          type: number
          nullable: true
          description: >-
            Campaign trigger completion threshold. This indicates the number of
            completions required before the reward is granted
      required:
        - name
    CampaignTriggerConditionDTO:
      type: object
      properties:
        conditionType:
          type: string
          description: Trigger condition type
          enum:
            - EQUALS
            - NOT_EQUALS
            - GREATER_THAN
            - LESS_THAN
            - CONTAINS
            - IS_PART_OF
        value:
          type: object
          description: Trigger condition value
        key:
          type: string
          description: Trigger condition key
        id:
          type: string
      required:
        - conditionType
        - value
        - key
        - id
    CampaignTriggerConditionCreateRequestDTO:
      type: object
      properties:
        conditionType:
          type: string
          description: Trigger condition type
          enum:
            - EQUALS
            - NOT_EQUALS
            - GREATER_THAN
            - LESS_THAN
            - CONTAINS
            - IS_PART_OF
        value:
          type: object
          description: Trigger condition value
        key:
          type: string
          description: Trigger condition key
      required:
        - conditionType
        - value
        - key
    CampaignClaimBusinessRequestDTO:
      type: object
      properties:
        campaignId:
          type: string
          description: The campaign id
        conditionsData:
          type: object
          description: The campaign condition data
        multiplier:
          type: number
          description: >-
            The campaign multiplier that will be applied to the reward. Default
            is 1.0
        businessId:
          type: string
          description: Business identifier
        latitude:
          type: number
          description: geolocation latitude
        longitude:
          type: number
          description: geolocation longitude
        userIdentifier:
          type: string
          description: The user identifier
        startDate:
          format: date-time
          type: string
          description: The start date of the claim
        endDate:
          format: date-time
          type: string
          description: The end date of the claim
        id:
          type: string
          description: The id of the user
        email:
          type: string
          description: The email of the user
        instagramAccountId:
          type: string
          description: The instagramAccountId of the user
        externalId:
          type: string
          description: The externalId of the user
      required:
        - campaignId
    CampaignUserClaimDTO:
      type: object
      properties:
        id:
          type: string
          description: The id of the campaign user claim
        createdAt:
          type: object
          description: The date the campaign user claim was created
        user:
          description: The user that is claiming the campaign
          allOf:
            - $ref: '#/components/schemas/UserDTO'
        campaign:
          description: The campaign that the user is claiming
          allOf:
            - $ref: '#/components/schemas/CampaignDTO'
        business:
          description: The business that the user claimed the campaign for
          allOf:
            - $ref: '#/components/schemas/BusinessDTO'
      required:
        - id
        - createdAt
        - user
        - campaign
    CampaignClaimRequestDTO:
      type: object
      properties:
        campaignId:
          type: string
          description: The campaign id
        conditionsData:
          type: object
          description: The campaign condition data
        multiplier:
          type: number
          description: >-
            The campaign multiplier that will be applied to the reward. Default
            is 1.0
        businessId:
          type: string
          description: Business identifier
        latitude:
          type: number
          description: geolocation latitude
        longitude:
          type: number
          description: geolocation longitude
      required:
        - campaignId
    RedemptionTypeDTO:
      type: object
      properties:
        name:
          type: string
          description: Redemption type name
        description:
          type: string
          description: Redemption type description
        imageUrl:
          type: string
          description: Redemption type image url
        id:
          type: number
          description: Redemption type id
      required:
        - name
        - id
    RedemptionDTO:
      type: object
      properties:
        id:
          type: string
          description: Redemption id
        description:
          type: string
          description: Description of the redemption
        name:
          type: string
          description: Name of the redemption
        imageUrl:
          type: string
          description: Image url of the redemption
        isActive:
          type: boolean
          description: Redemptio is active
        creditTokenAmount:
          type: number
          description: The amount of credit tokens needed to redeem the redemption tokens
        type:
          description: The redemption type
          allOf:
            - $ref: '#/components/schemas/RedemptionTypeDTO'
        tokenUnits:
          description: The redemption tokens to be redeemed
          type: array
          items:
            type: string
        maxTotalSupply:
          type: number
          nullable: true
          description: The maximum total supply of the redemption
        availableSupply:
          type: number
          nullable: true
          description: The available supply of the redemption
        maxPerUser:
          type: object
          description: The maximum redemption per user
        minUserStatusType:
          description: The minimum user status type to redeem the redemption
          allOf:
            - $ref: '#/components/schemas/UserStatusTypeDTO'
      required:
        - isActive
        - creditTokenAmount
        - type
        - tokenUnits
    RedemptionCreateRequestDTO:
      type: object
      properties:
        creditTokenAmount:
          type: number
          description: The amount of credit tokens needed to redeem the redemption tokens
        description:
          type: string
          description: Description of the redemption
        name:
          type: string
          description: Name of the redemption
        imageUrl:
          type: string
          description: Image url of the redemption
        redemptionTypeId:
          type: number
          description: Redemption type id
        minUserStatusTypeId:
          type: number
          description: min user status type id to redeem the redemption
        maxTotalSupply:
          type: number
          description: The maximum total supply of the redemption
        maxPerUser:
          type: number
          description: The maximum redemption per user
    RedemptionTypeCreateRequestDTO:
      type: object
      properties:
        name:
          type: string
          description: Redemption type name
        description:
          type: string
          description: Redemption type description
        imageUrl:
          type: string
          description: Redemption type image url
      required:
        - name
    RedemptionRedeemRequestDTO:
      type: object
      properties:
        redemptionId:
          type: string
          description: The redemption id
      required:
        - redemptionId
    RedemptionUserRedeemDetailedDTO:
      type: object
      properties:
        id:
          type: string
          description: The id of the redemption user redeem
        userId:
          type: string
          description: The user id that is claiming the redemption
        redemptionId:
          type: string
          description: The redemption that the user is redeeming
        transactionIds:
          description: >-
            The transaction ids that resulted from the user redeeming the
            redemption
          type: array
          items:
            type: string
        transactions:
          description: >-
            The transactions that resulted from the user redeeming the
            redemption
          type: array
          items:
            type: string
      required:
        - id
        - userId
        - redemptionId
        - transactionIds
        - transactions
    RedemptionUserRedeemDTO:
      type: object
      properties:
        id:
          type: string
          description: The id of the redemption user redeem
        userId:
          type: string
          description: The user id that is claiming the redemption
        redemptionId:
          type: string
          description: The redemption that the user is redeeming
        transactionIds:
          description: >-
            The transaction ids that resulted from the user redeeming the
            redemption
          type: array
          items:
            type: string
      required:
        - id
        - userId
        - redemptionId
        - transactionIds
    TokenMetadataBalanceDTO:
      type: object
      properties:
        contractAddress:
          type: string
        chainId:
          type: number
        balance:
          type: number
        tokenName:
          type: string
        tokenSymbol:
          type: string
        tokenType:
          type: string
          enum:
            - ERC20
            - ERC721
            - ERC1155
        tokenId:
          type: string
          nullable: true
        metadataUri:
          type: string
          nullable: true
        metadata:
          type: object
      required:
        - contractAddress
        - chainId
        - balance
        - tokenType
        - tokenId
        - metadataUri
        - metadata
    AccountTokenMetadataBalancesDTO:
      type: object
      properties:
        accountAddress:
          type: string
        tokenBalances:
          type: array
          items:
            $ref: '#/components/schemas/TokenMetadataBalanceDTO'
      required:
        - accountAddress
        - tokenBalances
    EntityStorageUrlDTO:
      type: object
      properties:
        entityType:
          type: string
          description: The entity type
          enum:
            - token
            - campaign
            - redemption
            - business
            - tenant
            - user
        entityId:
          type: string
          description: The entity id
        signedUrlType:
          type: string
          description: >-
            The signed url type, GET or PUT. PUT is used for uploading files,
            GET is used for downloading files
          enum:
            - GET
            - PUT
        fileExtension:
          type: string
          description: The file extension
        fileName:
          type: string
          description: The file name
      required:
        - entityType
        - entityId
        - signedUrlType
        - fileExtension
    CreateSignedURLResponseDTO:
      type: object
      properties:
        signedUrl:
          type: string
          description: The signed url
      required:
        - signedUrl
security:
  - projectKey: []
    businessApiKey: []
