Smart Pension Switches API

The Switches API from Smart Pension — 3 operation(s) for switches.

OpenAPI Specification

smart-pension-switches-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Keystone Switches API
  version: v12
  description: This is the endpoint description of Keystone API.
servers:
- url: https://api.sandbox.autoenrolment.co.uk
- url: /
tags:
- name: Switches
paths:
  /companies/{company_id}/employees/{employee_id}/switches/delayability:
    get:
      summary: Companies/Employees/Switches/Delayability
      tags:
      - Switches
      security:
      - oAuth2:
        - employee
      parameters:
      - name: company_id
        in: path
        required: true
        example: 1566
        schema:
          type: string
      - name: employee_id
        in: path
        required: true
        example: 769
        schema:
          type: string
      - name: subaccount_uuid
        in: query
        required: false
        example: subaccount_uuid=4b80c8e1-529d-4c41-af6b-149017f914d3
        schema:
          type: string
      - name: subaccount_uuid
        in: query
        schema:
          type: string
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              example:
                delayability: false
              schema:
                $ref: '#/components/schemas/response_portfolio_switch_delayability'
        '401':
          description: Unauthorized
          content:
            text/plain:
              examples:
                unauthorized:
                  value: 'HTTP Token: Access denied.

                    '
  /companies/{company_id}/employees/{employee_id}/switches/request_for_current_holdings:
    post:
      summary: Companies/Employees/Switches/RequestForCurrentHoldings
      tags:
      - Switches
      security:
      - oAuth2:
        - employee
      parameters:
      - name: company_id
        in: path
        required: true
        example: 1568
        schema:
          type: string
      - name: employee_id
        in: path
        required: true
        example: 771
        schema:
          type: string
      requestBody:
        content:
          application/json:
            examples:
              Valid parameters:
                value:
                  from_subaccount_uuid: 29066616-2dbe-4f97-a782-5bbeaf36eac7
                  to_subaccount_uuid: 5d7641e8-ea85-449d-8235-cbc4b9ada269
              Invalid parameters:
                value:
                  from_subaccount_uuid: ''
                  to_subaccount_uuid: ''
            schema:
              type: object
              properties:
                from_subaccount_uuid:
                  type: string
                to_subaccount_uuid:
                  type: string
              required:
              - from_subaccount_uuid
              - to_subaccount_uuid
      responses:
        '200':
          description: Success
          content:
            application/json:
              example: ''
        '401':
          description: Unauthorized
          content:
            text/plain:
              examples:
                unauthorized:
                  value: 'HTTP Token: Access denied.

                    '
        '403':
          description: Forbidden
          content:
            application/json:
              example:
                errors:
                - code: 538
                  title: Cannot perform the action due to pending disinvestment on the specified subaccount.
                  detail: Cannot perform the action due to pending disinvestment on the specified subaccount.
                  form: null
                  attribute: base
                  error: unpredictable_units_for_disinvestment_exist
                  meta: {}
                  source:
                    pointer: /base
        '422':
          description: Invalid parameters
          content:
            application/json:
              example:
                errors:
                - code: 100001
                  title: Value can not be blank.
                  detail: From subaccount UUID is a required field.
                  meta: {}
                  source:
                    pointer: /data/attributes/from_subaccount_uuid
                - code: 100001
                  title: Value can not be blank.
                  detail: To subaccount UUID is a required field.
                  meta: {}
                  source:
                    pointer: /data/attributes/to_subaccount_uuid
  /companies/{company_id}/employees/{employee_id}/switches/request_monetary:
    post:
      summary: Companies/Employees/Switches/RequestMonetary
      tags:
      - Switches
      security:
      - oAuth2:
        - employee
      parameters:
      - name: company_id
        in: path
        required: true
        example: 1572
        schema:
          type: string
      - name: employee_id
        in: path
        required: true
        example: 775
        schema:
          type: string
      requestBody:
        content:
          application/json:
            examples:
              Valid parameters:
                value:
                  from_subaccount_uuid: 1aa87c11-492a-45bc-b262-4a44831ca7c5
                  to_subaccount_uuid: a0b7d6b7-8b5d-475e-b01a-db30ea95a001
                  amount: 150.75
              Invalid parameters:
                value:
                  from_subaccount_uuid: ''
                  to_subaccount_uuid: ''
                  amount: 0
            schema:
              type: object
              properties:
                from_subaccount_uuid:
                  type: string
                to_subaccount_uuid:
                  type: string
                amount:
                  type: number
              required:
              - from_subaccount_uuid
              - to_subaccount_uuid
              - amount
      responses:
        '200':
          description: Success
          content:
            application/json:
              example: ''
        '401':
          description: Unauthorized
          content:
            text/plain:
              examples:
                unauthorized:
                  value: 'HTTP Token: Access denied.

                    '
        '403':
          description: Forbidden
          content:
            application/json:
              example:
                errors:
                - code: 535
                  title: Cannot perform the action due to pending partial switch or pending move investment order.
                  detail: Cannot perform the action due to pending partial switch or pending move investment order.
                  form: null
                  attribute: base
                  error: pending_switch_or_pending_move_investment_order_exists
                  meta: {}
                  source:
                    pointer: /base
        '422':
          description: Invalid parameters
          content:
            application/json:
              example:
                errors:
                - code: 100001
                  title: Value can not be blank.
                  detail: From subaccount UUID is a required field.
                  meta: {}
                  source:
                    pointer: /data/attributes/from_subaccount_uuid
                - code: 100001
                  title: Value can not be blank.
                  detail: To subaccount UUID is a required field.
                  meta: {}
                  source:
                    pointer: /data/attributes/to_subaccount_uuid
                - code: 102001
                  title: Value is too small.
                  detail: Amount should be greater than 0.
                  meta:
                    value: '0.0'
                    count: 0
                  source:
                    pointer: /data/attributes/amount
components:
  schemas:
    response_portfolio_switch_delayability:
      type: object
      properties:
        delayability:
          type:
          - boolean
          - 'null'
  securitySchemes:
    oAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://id.sandbox.autoenrolment.co.uk/oauth/authorize
          tokenUrl: https://id.sandbox.autoenrolment.co.uk/oauth/token
          scopes:
            customer: 'Manage the customer''s company.

              - Create postponements

              - Create and import contributions

              - Edit company details

              - Add and edit employees'
            user: 'Manage all companies linked to the user''s adviser.

              - Manage adviser details

              - Add and edit adviser''s users

              - Create and import contributions for any company managed by the adviser'
            employee: 'Manage the employee account.

              - List employee contributions

              - Edit employee details and preferences'
x-samples-languages:
- curl
x-proxy-enabled: false