openapi: "3.0.0"
info:
  title: Exedra API
  description: the API for interfacing with Exedra (open banking etc)
  version: 1.0.0
servers:
  - url: newaccounts.vat.direct
    description: the API for interfacing with Exedra (open banking etc)
paths:
  /workflow/function/restapi/identifybankoptions/multiplepageletrequest/:
    get:
      summary: Find out what can be downloaded
      parameters:
        - in: query
          name: legalentity
          schema: 
            type: integer
      responses:
        '200':
           description: OK
  /workflow/function/restapi/getbankinfooneaccount/multiplepageletrequest/:
    get:
      summary: Download something
      parameters:
        - in: query
          name: legalentity
          schema: 
            type: integer
        - in: query
          name: bankid
          schema: 
            type: string
            description: wildcard is *
        - in: query
          name: bank
          schema: 
            type: string
            description: wildcard is *
        - in: query
          name: identifier
          schema: 
            type: string
            description: wildcard is *
        - in: query
          name: accountnumber
          schema: 
            type: string
            description: wildcard is *
        - in: query
          name: fromdate
          schema: 
            type: string
        - in: query
          name: todate
          schema: 
            type: string
        - in: query
          name: shortorlong
          schema: 
            type: string
            description: short or long
      responses:
        '200':
           description: OK
  /workflow/function/restapi/getbankinfo/multiplepageletrequest/:
    post:
      summary: Download something (and potential export from server as well)
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                listOfItems:
                  type: array
                  items:
                      type: object
                      properties:
                        identifier:
                          type: string
                        legalentity:
                          type: integer
                        bankid:
                          type: string
                        bank:
                          type: string
                        accountnumber:
                          type: string
                        todate:
                          type: string
                        export:
                          type: string
                          description: Y or y to export from the bank (much slower) as well as download
                        fromdate:
                          type: string
      responses:
        '200':
           description: OK
  /workflow/function/restapi/getbankinfobycode/multiplepageletrequest/:
    post:
      summary: Download something
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                listOfItems:
                  type: array
                  items:
                      type: object
                      properties:
                        identifier:
                          type: string
                        legalentity:
                          type: integer
                        bankid:
                          type: string
                        bank:
                          type: string
                        accountnumber:
                          type: string
                        sequencecode:
                          type: string
      responses:
        '200':
           description: OK
  /workflow/function/restapi/getrunobapi/multiplepageletrequest/{obapicode}:
    get:
      summary: Run an OB Api
      parameters:
        - in: query
          name: legalentity
          schema: 
            type: integer
        - in: path
          name: obapicode
          required: true
          schema: 
            type: string
            description: API code 
      responses:
        '200':
           description: OK
  /workflow/function/restapi/runobapi/multiplepageletrequest/{obapicode}:
    post:
      summary: Run an OB Api
      parameters:
        - in: path
          name: obapicode
          required: true
          schema: 
            type: string
            description: API code 
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                listOfItems:
                  type: array
                  items:
                      type: object
                      properties:
                        identifier:
                          type: string
                        legalentity:
                          type: integer
                        bankid:
                          type: string
                        bank:
                          type: string
                        accountnumber:
                          type: string
                        sequencecode:
                          type: string
      responses:
        '200':
           description: OK
  /workflow/function/restapi/getsysopstatus/multiplepageletrequest/:
    get:
      summary: Get status for system operator
      parameters:
        - in: query
          name: legalentity
          schema: 
            type: string
            description: wildcard is *
        - in: query
          name: bankid
          schema: 
            type: string
            description: wildcard is *
        - in: query
          name: bank
          schema: 
            type: string
            description: wildcard is *
        - in: query
          name: identifier
          schema: 
            type: string
            description: wildcard is *
        - in: query
          name: accountnumber
          schema: 
            type: string
            description: wildcard is *
      responses:
        '200':
           description: OK
  /workflow/function/restapi/hmrcmtdvat/multiplepageletrequest/:
    post:
      summary: HMRC Making Tax Digital VAT - submit return special
      parameters:
        - in: query
          name: legalentity
          schema: 
            type: string
            description: legal entity key - this is overridden by the unique id
        - in: query
          name: uniqueid
          schema: 
            type: string
            description: unique id (if a legal entity does not exist for this id one will be created)
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                antiFraudHeaders:
                  type: object
                  description: This is an object with the anti-fraud headers (see HMRC hub for details), properties are header names
                PERIODKEY:
                  type: string
                oAuthReturnURL:
                  type: object
                  description: This is the URL to use to override the default return URL at the end of Oauth if needed
                BOX9:
                  type: string
                BOX8:
                  type: string
                vrn:
                  type: integer
                  description: this needs to be the right one otherwise OAuth will rejected this transaction
                BOX7:
                  type: string
                BOX6:
                  type: string
                BOX5:
                  type: string
                BOX4:
                  type: string
                BOX3:
                  type: string
                BOX2:
                  type: string
                BOX1:
                  type: string
      responses:
        '200':
           description: OK
  /workflow/function/restapi/hmrcmtdgeneric/multiplepageletrequest/{mtdapicode}:
    post:
      summary: HMRC Making Tax Digital VAT - run an MTD api (VAT or ITSA) - refer to the HMRC Hub for details of contents of jsonOut (posted body) and meaning of other parameters
      parameters:
        - in: query
          name: legalentity
          schema: 
            type: string
            description: legal entity key
        - in: query
          name: uniqueid
          schema: 
            type: string
            description: unique id - (if a legal entity does not exist for this id one will be created)
        - in: path
          name: mtdapicode
          required: true
          schema: 
            type: string
            description: API code 
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                antiFraudHeaders:
                  type: object
                mode:
                  type: string
                  description: this defaults to 'live', but if you want the sandbox you need to put 'test' - it only has an effect when creating a new legal entity
                vrn:
                  type: string
                  description: this needs to be the right one otherwise OAuth will rejected this transaction
                oAuthReturnURL:
                  type: object
                  description: This is the URL to use to override the default return URL at the end of Oauth if needed
                jsonOut:
                  type: string
                  description:  this is the object that will be posted to HMRC
      responses:
        '200':
           description: OK
  /workflow/function/restapi/sysopstatus/multiplepageletrequest/:
    post:
      summary: Get status for system operator
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                identifier:
                  type: string
                  description: wildcard is *
                legalentity:
                  type: string
                  description: wildcard is *
                bankid:
                  type: string
                  description: wildcard is *
                bank:
                  type: string
                  description: wildcard is *
                accountnumber:
                  type: string
                  description: wildcard is *
      responses:
        '200':
           description: OK
  /workflow/function/restapi/getnewsystemoperator/multiplepageletrequest/:
    post:
      summary: Get a completely new system operator (requires a high authority token on a special domain) not written yet
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                systemOperatorName:
                  type: string
                preferredDomain:
                  type: string
                emailToUse:
                  type: string
      responses:
        '200':
           description: OK
  /workflow/function/restapi/getlistofavailablebrands/multiplepageletrequest/:
    get:
      summary: Get the list of brands where OB is possible (part written)
      responses:
        '200':
           description: OK
  /workflow/function/restapi/geturlforauthorisation/multiplepageletrequest/:
    post:
      summary: Get the URL for the user to click on to authorise a brand for OB (part written)
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                legalentity:
                  type: string
                bankid:
                  type: string
                bank:
                  type: string
      responses:
        '200':
           description: OK
  /workflow/function/restapi/getoauthtoken/multiplepageletrequest/:
    post:
      summary: Get the OAuth token for validating things not written yet
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                legalentity:
                  type: string
                password:
                  type: string
                userEmail:
                  type: string
      responses:
        '200':
           description: OK
  /workflow/function/restapi/databaseaccess/multiplepageletrequest/{tableName}/{tableFunction}:
    post:
      summary: Access the database where permitted (not all tables available)
      parameters:
        - in: path
          name: tableFunction
          required: true
          schema: 
            type: string
            description: add delete update (or) datadict 
        - in: path
          name: tableName
          required: true
          schema: 
            type: string
            description:  the TableName 
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                listOfDataElements:
                  type: array
                  items:
                      type: object
                      properties:
                        columnValue:
                          type: string
                        columnName:
                          type: string
      responses:
        '200':
           description: OK

