openapi: 3.0.0
info:
  title: TruFIU
  version: 1.0.0
  description: |
    Scalable FIU module to connect with multiple AA partners and manage consents for multiple internal applications.

    To get started,
    1. [Create an app](#/App/post_v1_apps_), this app credentails are required to make further API calls.
    2. [Configure your FIU details](#/Entities/post_v1_entities_)
    3. Add your partner [AA details](#/Entities/put_v1_entities__fiu_client_id__aa), thats all you are all set to create consent and fetch data in the AA ecosystem
  
  contact: 
    name: Bootstack Support
    url: https://github.com/getbootstack/trufiu
servers:
  - url: "http://localhost:8080"
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: |
        **Username**: Your App ID. | **Password**: Your App Secret.
  schemas: 
    AppRequest:
      type: object
      required: 
        - webhook_url
      properties:
        webhook_url: 
          type: string
          example: https://webhook.site/b28121f3-f837-4dfe-b3c9-2766f2ce67b0
    AppCreateResponse:
      type: object
      required: 
        - app_id
        - app_secret
      properties: 
        app_id:
          type: string
          example: ki_vtchP3kysaWPULdt9jQG6TUdaXvoABuX
        app_secret:
          type: string
          example: ks_gy27edJXbgWeXBW8fAw3vHHVASyWTYx6
    AppUpdateResponse:
      type: object
      required: 
        - app_id
      properties:
        app_id:
          type: string
          example: ki_vtchP3kysaWPULdt9jQG6TUdaXvoABuX
        webhook_url:
          type: string
          example: https://webhook.site/b28121f3-f837-4dfe-b3c9-2766f2ce67b0
    FIUConfig:
      type: object
      required:
        - client_id
        - client_secret
        - keypair
      properties:
        client_id:
          type: string
          description: your fiu entity/client id
        client_secret:
          type: string
          description: your entity/client secret
        keypair:
          $ref: '#/components/schemas/JWK'
        sahamatinet_enabled: 
          type: boolean
          default: false
    FIUConfigUpdateRequest:
      type: object
      properties:
        client_secret:
          type: string
          description: your entity/client secret
        keypair:
          type: string
          description: your json encoded JWK
        sahamatinet_enabled: 
          type: boolean
          default: false
    AAConfig:
      type: object
      required:
        - entity_id
        - redirect_secret
      properties:
        entity_id:
          type: string
          description: your partner AA entity/client id
        redirect_secret:
          type: string
          description: redirect secret shared by your partner AA
        sahamatinet_enabled: 
          type: boolean
          default: false
    AAConfigUpdateRequest:
      type: object
      properties:
        redirect_secret:
          type: string
          description: redirect secret shared by your partner AA
        sahamatinet_enabled: 
          type: boolean
          default: false
    ConsentRequest:
      type: object
      description: Specify the financial information types that customer wants to access
      required:
        - consent_start
        - consent_expiry
        - consent_mode
        - fetch_type
        - consent_types
        - fi_types
        - customer
        - purpose
        - fi_data_range
        - data_life
        - frequency
      properties:
        consent_start:
          type: string
          format: date-time
          example: '2019-12-06T11:39:57.153Z'
          description: >-
            Start date-time of the consent. This field would allow for
            Post-Dated consent.
          xml:
            attribute: true
        consent_expiry:
          type: string
          format: date-time
          example: '2019-12-06T11:39:57.153Z'
          description: Expiry date-time for the consent
          xml:
            attribute: true
        consent_mode:
          type: string
          description: Consent Mode as defined in the AA Technical Specification
          enum:
            - VIEW
            - STORE
            - QUERY
            - STREAM
          xml:
            attribute: true
        fetch_type:
          type: string
          description: FI Fetch type. Could be ONETIME or PERIODIC
          enum:
            - ONETIME
            - PERIODIC
          xml:
            attribute: true
        consent_types:
          type: array
          description: Defines the category of financial information which can be fetched using consent
          minItems: 1
          items:
            type: string
            enum:
              - PROFILE
              - SUMMARY
              - TRANSACTIONS
            example: PROFILE
          xml:
            attribute: true
        fi_types:
          type: array
          minItems: 1
          items:
            type: string
            description: List of financial information types.
            example: DEPOSIT
            enum:
              - DEPOSIT
              - TERM_DEPOSIT
              - RECURRING_DEPOSIT
              - SIP
              - CP
              - GOVT_SECURITIES
              - EQUITIES
              - BONDS
              - DEBENTURES
              - MUTUAL_FUNDS
              - ETF
              - IDR
              - CIS
              - AIF
              - INSURANCE_POLICIES
              - NPS
              - INVIT
              - REIT
              - GSTR1_3B
              - OTHER
        customer:
          type: object
          description: Contains the customer address
          properties:
            id:
              type: string
              example: customer_identifier@AA_identifier
              description: >-
                The identifier of the Customer can be generated during the
                registration with AA
              xml:
                attribute: true
            identifiers:
              type: array
              description: The list of strong identifiers to identify a customer
              items:
                type: object
                required:
                  - type
                  - value
                properties:
                  type:
                    type: string
                    description: The identifier type of given enum values.
                    enum:
                      - MOBILE
                      - EMAIL
                      - OTHERS
                    example: MOBILE
                    xml:
                      attribute: true
                  value:
                    type: string
                    description: verified value of selected identifier
                    example: 9867123456
                    xml:
                      attribute: true
              xml:
                name: Identifiers
        purpose:
          description: Purpose of the consent defined in the AA Technical Specification
          type: object
          required:
            - code
            - text
          properties:
            code:
              type: string
              description: 'Purpose Code as defined in the AA Technical Specification '
              example: '101'
              xml:
                attribute: true
            text:
              type: string
              description: Textual Description
              example: Wealth management service
              xml:
                attribute: true
        fi_data_range:
          type: object
          required:
            - from
            - to
          description: Specifies the date time range for which the financial information is requested
          properties:
            from:
              type: string
              format: date-time
              example: '2023-07-06T11:39:57.153Z'
              description: >-
                Date-time from which the financial information is requested
            to:
              type: string
              format: date-time
              example: '2019-12-06T11:39:57.153Z'
              description: >-
                Date-time till which the financial information is requested
        data_life:
          description: Time period for which consumer is allowed to store data.
          type: object
          required:
            - unit
            - value
          properties:
            unit:
              type: string
              description: Unit of time period for which consumer can store the data.
              xml:
                attribute: true
              enum:
                - MONTH
                - YEAR
                - DAY
                - INF
            value:
              type: number
              description: >-
                Define the value of unit of how long can consumer store the data
              xml:
                attribute: true
        frequency:
          description: >-
            Defines frequency of FI data fetch within the defined time unit. E.g.HOURLY,DAILY,MONTHLY,YEARLY.
          type: object
          required:
            - unit
            - value
          properties:
            unit:
              type: string
              example: HOUR
              description: >-
                Defines the time unit of the frequency to access the financial information.
              
              xml:
                attribute: true
              enum:
                - HOUR
                - DAY
                - MONTH
                - YEAR
                - INF
            value:
              type: number
              example: 1
              description: >-
                Define the number of times FI data can be fetched within the defined time unit.
              xml:
                attribute: true
        data_filter:
          type: array
          description: rules that will be utilized by FIP to filter the data
          items:
            type: object
            required:
              - type
              - operator
              - value
            properties:
              type:
                type: string
                description: The condition to filter the data on.
                enum:
                  - TRANSACTIONTYPE
                  - TRANSACTIONAMOUNT
                example: TRANSACTIONAMOUNT
                xml:
                  attribute: true
              operator:
                type: string
                description: Operator to filter data by.
                enum:
                  - '='
                  - '!='
                  - '>'
                  - '<'
                  - '>='
                  - '<='
                example: '>='
                xml:
                  attribute: true
              value:
                type: string
                description: Value based on which data is to be filtered.
                example: 20000
                xml:
                  attribute: true
          xml:
            name: DataFilter
    Account:
      type: object
      properties:
        fi_type:
          type: string
          example: DEPOSIT
        fip_id:
          type: string
          example: BARB0KIMXXX
        type:
          type: string
          example: SAVINGS
        link_ref_number:
          type: boolean
          example: 85ea4d61-0923-4ba0-8310-b44095cb2727
        masked_account_number:
          type: string
          example: XXXXX7295
    ConsentResponse:
      type: object
      properties:
        handle:
          type: string
          example: 478edfdf-e3ab-4f42-b69f-36a0c45e9fd2
        status:
          type: string
          enum:
            - PENDING
            - ACTIVE
            - PAUSED
            - REJECTED
            - REVOKED
          example: PENDING
        # accounts:
        #   type: array
        #   description: This will be returned only when the consent is in `ACTIVE` state
        #   items:
        #     $ref: '#/components/schemas/Account'
    ConsentsResponse:
      type: object
      description: Response from the AA for the given consent request
      properties: 
        consents:
          type: array
          items:
            $ref: '#/components/schemas/ConsentResponse'
        redirect_url:
          type: string
          example: >-
                  https://aa/webview?ecreq=dD7Tq0IYcZRqavmq9DaqJ1ECxjbyLVTQ8mP_mfriG0RwyjjjKNt7yd3B481BQ4ECNtlRXZxUR4IQroi9mxIEqKN7excdKKfYjXfuDZN9JGKHYhQyk-a8yNmgGCBSg3OiD_O7TyeGW9D7QDshj-7uQcBSdwFTE3VawFq6Cpat6nQkWQj_KaNuJAMn63E0ixlFEHqlvb-pLRvIdkF5kngJBk_a4aBnfNBNZrmqUfOGiBWRaLI1FlyuVPBnzaxGkBktmwjFtr-4IxwIfn5GqW3Qi_6KMuCw6wr5Tl5m5kwJzqCtC34TybMWnCksakfe1ZBwGOvaaiOCTyQKDRAVqRJL7w%3D%3D&fi=XFtWWEZYXUFLHEFYRA%3D%3D&reqdate=021020241149000
    DataRequest:
      type: object
      description: Request Data from AA for the given consent
      required:
        - consent_handle
        - from
        - to
      properties:
        consent_handle: 
          type: string
          example: 478edfdf-e3ab-4f42-b69f-36a0c45e9fd2
        from:
          type: string
          format: date-time
          example: '2023-07-06T11:39:57.153Z'
          description: >-
            Date-time from which the financial information is requested
        to:
          type: string
          format: date-time
          example: '2024-12-06T11:39:57.153Z'
          description: >-
            Date-time till which the financial information is requested
        curve:
          type: string
          default: X25519
          example: X25519
          description: >-
            Describes a secure elliptic curve standard that is used to perform ECDH.
          enum:
            - Curve25519
            - X25519
    DataFetchRequest:
      type: object
      required:
        - session_id
      properties:
        session_id: 
          type: string
          example: 9f5a8128-2151-46a3-99b0-f2939627b80c
    DataFetchResponse:
      type: object
      properties:
        fips:
          type: array
          items:
            type: object
            properties:
              fip_id: 
                type: string
                example: BARB0KIMXXX
              accounts:
                type: array
                items:
                  $ref: '#/components/schemas/AccountData'
    AccountData:
      type: object
      properties:
        link_ref_number: 
          type: string
          example: f91962a0-bb04-4675-b2f0-3a3077e64292
        masked_account_number: 
          type: string
          example: XXXXX6233
        data: 
          type: string
          example: >-
            <Account type="deposit" maskedAccNumber="XXXXX6233"
            version="1.1"
            linkedAccRef="f91962a0-bb04-4675-b2f0-3a3077e64292"
            xmlns="http://api.rebit.org.in/FISchema/deposit"
            xmlns:wstxns1="http://www.w3.org/2001/XMLSchema-instance"
            wstxns1:schemaLocation="http://api.rebit.org.in/FISchema/deposit
            https://specifications.rebit.org.in/api_schema/account_aggregator/FISchema/deposit.xsd"><Profile><Holders
            type="SINGLE"><Holder name="fName mName lName"
            dob="1966-06-08" mobile="9000090000"
            nominee="NOT-REGISTERED" landline="" address="Senapati
            Bapat Road,Pune,Maharashtra,India,411016"
            email="info@cookiejar.co.in" pan="ABCPD1234E"
            ckycCompliance="false"/></Holders></Profile><Summary
            currentBalance="44590.00" currency="INR" exchgeRate=""
            balanceDateTime="2024-07-19T00:00:00.000+00:00"
            type="SAVINGS" branch="SB Road Pune [SB]"
            facility="OD" ifscCode="SBP0000136" micrCode=""
            openingDate="2023-07-19" currentODLimit="2500000.0000"
            drawingLimit="2500000.0000" status="ACTIVE"><Pending
            transactionType="DEBIT"
            amount="6000.0"/></Summary><Transactions
            startDate="2023-09-17"
            endDate="2024-08-17"><Transaction type="DEBIT"
            mode="UPI" amount="1000.0" currentBalance="71560.00"
            transactionTimestamp="2023-09-19T00:00:00.000+00:00"
            valueDate="2023-09-19" txnId=""
            narration="UPI/218128539608/Electricity/tpslqr@MSEB"
            reference=""/><Transaction type="CREDIT" mode="OTHERS"
            amount="30000.0" currentBalance="101560.00"
            transactionTimestamp="2023-10-01T00:00:00.000+00:00"
            valueDate="2023-10-01" txnId=""
            narration="NEFT/SBIN322147057322/EMPLOYEE SALARY "
            reference=""/><Transaction type="DEBIT" mode="UPI"
            amount="300.0" currentBalance="101260.00"
            transactionTimestamp="2023-10-04T00:00:00.000+00:00"
            valueDate="2023-10-04" txnId=""
            narration="UPI/218128539608/Pay to BharatPe
            Merchant/BHARATPE" reference=""/><Transaction
            type="DEBIT" mode="OTHERS" amount="2500.0"
            currentBalance="98760.00"
            transactionTimestamp="2023-10-05T00:00:00.000+00:00"
            valueDate="2023-10-05" txnId=""
            narration="PCD/536799XXXXXX7446/POLICYBAZAAR"
            reference=""/></Transactions></Account>
    JWK:
      type: object
      description: |
        JSON Web Key payload. This material contains private key hence it is confidential. Entity should store this in a secure place and use to sign requests to the AA ecosystem. Refer to the Spec here: https://datatracker.ietf.org/doc/html/rfc7517
      example:
        alg: RS256
        d: >-
          qzHajqJtZXAJw4NXZ5uz0sBZZHjPaJrVQ5nMwJozT9AsYde13xiTi9m2yGsoUVZ09YWEKPQc19uHGP2HWN4OduzCpLGSxlhK8GZ7JbMld6CbCB-eU6HNoye9Uce8ytWhCP9DRMVdwHBiOHVhElr9UgYVc4t9pBQlenEd8QIQWfEjBKdcbWQ3QnvuQuElOyxtSS8GHB0lZlv9NdjhvU9_vkdU78rApTL_s9a5sAnwp5g_3vWdV2lUA0BkuVOP7b2tDeqQvck8JMsVXlCOIcW9AH-RTAX5WSg5gZHIpLx-ZtW3MB3D3XfM9D_RVlzTPu9rbC4h2Tw5UBrxl2a-IS_6IQ
        dp: >-
          zr9L-UFPsZ7IYYS1it5ZWT1mcs6OswpPDSGJXkZFblb4HltmGEdetZO41V6GkZMgn_SWl4EWrnjf2cLyLaknMVe3ivJMZrkTWRw4WVQVl0nSAO4NC6kOtKRkdo17Pr4J8XWl69XSUmq6-kC4Rg6AATun5-qVlQ8onzePFRxnMpE
        dq: >-
          Y3jx0rQp9zW40KDEsvANosUGy_8Z6cR0edTukXLB_-o5u7Qt9nu_v_Nj9AckjlB8_BrsvKvyPDxte-9YeRdCG-0S4ZZTDESw6tuIKTHWg8FSH8n19932d49nMkM0FXaZnD07OySHfa3a_bW1_TffaAb8rLtggaJqnYai9Sz7Mqc
        e: AQAB
        kid: 10c6c43b-7871-4666-ac0d-e4e568953a92
        kty: RSA
        'n': >-
          q7laSF_PQZfvfpd_3livD-epCInoKLIxx4S3joXbAvjRjo0Eb0nTm5Jolj_o6l7KuSXYZV_eEVP547hsI00e4jrZxnEGNctN6N1BRG0Ew4OU-LHqJBZ26FHIsBdQ4RMj5c-8Xu8sT5ihf6TR8JHyRDr5x77F-QJMXItBuLoLbv1D4mN3YfjqBajgcULvpf3UI6-jQwEd4oFnqUY2Owofk9-adPsZ5hQKtQvXW8Zw1AeuKAhtMZgJeKiKvgvgShIZOiCFdU50wUD2kk2QSZqLnFtpqAnde8yTKzAy_EDlFmdLb9g92ILsWErcsjJ-slYSc09L5FP6gGwZPscPTcnoxw
        p: >-
          06SZ0uA-AeOoRR4gWQKm6V3N0To0-Rcd5VzzlVRd_NOe0jmfdl77FNbBUy6g4jReHAUIVGMUihznX-daEqe7fQvufxPiA5CSpgw728okL4SfJI1emIa_ztACF1HzyfV4Xtjk9G5GxQ0yftAsfhTr36ARaqSZmJ7yUm3_QkjA3FE
        q: >-
          z7b1ZsiD1z8LN-lFD5f9WPzOoq16L-6gydeo8BSl_uBO4BT1zSHPyoRqhcekO2PGpX_-oFnpRtjN8eVD9SIMRwW9pFgZJNu4YUPQww-Rorv2pSR7tD1K6n1ToOlmgvAceVSfQXTAvvokCHTFDwP2DEVe7yxLDOtwV7YzmSBcZZc
        qi: >-
          puqOtZJ3Ow6A98ZXpiXX11wlOKbmuP0MQgOCF-buGQvx3Hrmn2RDXBCC050wil3qTMvwXde5FOIjAnx-Q1ubVcUsPd1SE3eYtNw8f8PE1Z2A4L8cvv627qfYl1wP6D1Paj_HjWOfCMVCevypiuTQ73xJMOjlC8Q6b8GEvDTcWoo
        use: sig
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: string
security:
  - basicAuth: []
tags:
  - name: App
  - name: Entities
  - name: Consent
  - name: Data
  - name: Utils
paths:
  /v2/consents/request:
    post:
      tags:
        - Consent
      summary: Create
      requestBody:
        content:
          application/json:
            schema:
              type: array
              minItems: 1
              items:
                $ref: '#/components/schemas/ConsentRequest'
      parameters:
        - name: fiu_entity_id
          in: header
          schema:
            type: string
        - name: aa_entity_id
          in: header
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentsResponse'
  /v2/consents/fetch:
    post:
      tags:
        - Consent
      summary: Fetch
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                handle: '{{consent_handle}}'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentsResponse'
              examples:
                example-0:
                  summary: Paused
                  value:
                    consents:
                      - handle: 079043cc-1516-430e-b814-f50eff54ffef
                        status: PAUSED
                example-1:
                  summary: Revoked
                  value:
                    consents:
                      - handle: 079043cc-1516-430e-b814-f50eff54ffef
                        status: REVOKED
                example-2:
                  summary: Pending
                  value:
                    consents:
                      - handle: 75448142-5a03-4a5e-8c30-27030f81f66e
                        status: PENDING
                    redirect_url: >-
                      https://aa/webview?ecreq=yLMV8ZqGxcgkP_4LBCBX0B4BHn5dnDAnxsA1cSkPsNQqBFHsInYLcQVFEXxO10YzYK5XPBl-16BWZrqZIrP3t_17FFO-nzIS9EvdU_EMSNzZltuTEcHYyM3tA6HHUJYiYN_cuRlEZkDFo1fczaVb1OnBq_KNCRZvy2miK8UliqnuWi0PCqhMWO3tdLFvs_VuphyB5M8B87XA1WzSNqCmqS6HfiYYfYaRWIYe3mBjc0-a_VBwU_dPALYrdY5h1KMCrTEm-NrmSWY1AyzzgxBHiQ%3D%3D&fi=XFtWWEZYXUFLH0dURA%3D%3D&reqdate=021020241225000
                example-3:
                  summary: Rejected
                  value:
                    consents:
                      - handle: 38235832-3d4e-4b0c-baac-6d8ef9810117
                        status: REJECTED
                example-4:
                  summary: Active
                  value:
                    consents:
                      - handle: 6af50ed5-6afd-4e67-a7bf-df1aea4b27e8
                        status: ACTIVE
                        accounts:
                          - fi_type: DEPOSIT
                            fip_id: BARB0KIMXXX
                            type: SAVINGS
                            link_ref_number: 85ea4d61-0923-4ba0-8310-b44095cb2727
                            masked_account_number: XXXXX7295
                          - fi_type: DEPOSIT
                            fip_id: BARB0KIMXXX
                            type: SAVINGS
                            link_ref_number: 54cf5454-7262-4e4c-9691-1d7f4f87290a
                            masked_account_number: XXXXX6233
  /v2/data/request:
    post:
      tags:
        - Data
      summary: Request
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataRequest'
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
                properties:
                  session_id: 
                    type: string
                    example: 9f5a8128-2151-46a3-99b0-f2939627b80c
        '400':
          description: Bad Request
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                errors:
                  - 'invalid consent status: PENDING'
  /v2/data/fetch:
    post:
      tags:
        - Data
      summary: Fetch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataFetchRequest'
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataFetchResponse'
              example:
                fip:
                  - fip_id: BARB0KIMXXX
                    accounts:
                      - link_ref_number: f91962a0-bb04-4675-b2f0-3a3077e64292
                        masked_account_number: XXXXX6233
                        data: >-
                          <Account type="deposit" maskedAccNumber="XXXXX6233"
                          version="1.1"
                          linkedAccRef="f91962a0-bb04-4675-b2f0-3a3077e64292"
                          xmlns="http://api.rebit.org.in/FISchema/deposit"
                          xmlns:wstxns1="http://www.w3.org/2001/XMLSchema-instance"
                          wstxns1:schemaLocation="http://api.rebit.org.in/FISchema/deposit
                          https://specifications.rebit.org.in/api_schema/account_aggregator/FISchema/deposit.xsd"><Profile><Holders
                          type="SINGLE"><Holder name="fName mName lName"
                          dob="1966-06-08" mobile="9000090000"
                          nominee="NOT-REGISTERED" landline="" address="Senapati
                          Bapat Road,Pune,Maharashtra,India,411016"
                          email="info@cookiejar.co.in" pan="ABCPD1234E"
                          ckycCompliance="false"/></Holders></Profile><Summary
                          currentBalance="44590.00" currency="INR" exchgeRate=""
                          balanceDateTime="2024-07-19T00:00:00.000+00:00"
                          type="SAVINGS" branch="SB Road Pune [SB]"
                          facility="OD" ifscCode="SBP0000136" micrCode=""
                          openingDate="2023-07-19" currentODLimit="2500000.0000"
                          drawingLimit="2500000.0000" status="ACTIVE"><Pending
                          transactionType="DEBIT"
                          amount="6000.0"/></Summary><Transactions
                          startDate="2023-09-17"
                          endDate="2024-08-17"><Transaction type="DEBIT"
                          mode="UPI" amount="1000.0" currentBalance="71560.00"
                          transactionTimestamp="2023-09-19T00:00:00.000+00:00"
                          valueDate="2023-09-19" txnId=""
                          narration="UPI/218128539608/Electricity/tpslqr@MSEB"
                          reference=""/><Transaction type="CREDIT" mode="OTHERS"
                          amount="30000.0" currentBalance="101560.00"
                          transactionTimestamp="2023-10-01T00:00:00.000+00:00"
                          valueDate="2023-10-01" txnId=""
                          narration="NEFT/SBIN322147057322/EMPLOYEE SALARY "
                          reference=""/><Transaction type="DEBIT" mode="UPI"
                          amount="300.0" currentBalance="101260.00"
                          transactionTimestamp="2023-10-04T00:00:00.000+00:00"
                          valueDate="2023-10-04" txnId=""
                          narration="UPI/218128539608/Pay to BharatPe
                          Merchant/BHARATPE" reference=""/><Transaction
                          type="DEBIT" mode="OTHERS" amount="2500.0"
                          currentBalance="98760.00"
                          transactionTimestamp="2023-10-05T00:00:00.000+00:00"
                          valueDate="2023-10-05" txnId=""
                          narration="PCD/536799XXXXXX7446/POLICYBAZAAR"
                          reference=""/></Transactions></Account>
                      - link_ref_number: 80b37f40-ce06-48a9-9614-767e92fc09c9
                        masked_account_number: XXXXX7295
                        data: >-
                          <Account type="deposit" maskedAccNumber="XXXXX7295"
                          version="1.1"
                          linkedAccRef="80b37f40-ce06-48a9-9614-767e92fc09c9"
                          xmlns="http://api.rebit.org.in/FISchema/deposit"
                          xmlns:wstxns1="http://www.w3.org/2001/XMLSchema-instance"
                          wstxns1:schemaLocation="http://api.rebit.org.in/FISchema/deposit
                          https://specifications.rebit.org.in/api_schema/account_aggregator/FISchema/deposit.xsd"><Profile><Holders
                          type="SINGLE"><Holder name="fName mName lName"
                          dob="1966-06-08" mobile="9000090000"
                          nominee="NOT-REGISTERED" landline="" address="Senapati
                          Bapat Road,Pune,Maharashtra,India,411016"
                          email="info@cookiejar.co.in" pan="ABCPD1234E"
                          ckycCompliance="false"/></Holders></Profile><Summary
                          currentBalance="46290.00" currency="INR" exchgeRate=""
                          balanceDateTime="2023-07-15T00:00:00.000+00:00"
                          type="SAVINGS" branch="SB Road Pune [SB]"
                          facility="OD" ifscCode="SBP0000136" micrCode=""
                          openingDate="2022-07-15" currentODLimit="2500000.0000"
                          drawingLimit="2500000.0000" status="ACTIVE"><Pending
                          transactionType="DEBIT"
                          amount="6000.0"/></Summary><Transactions
                          startDate="2023-09-17"
                          endDate="2024-08-17"/></Account>
  /v1/apps/:
    post:
      tags:
        - App
      summary: Create
      security: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppCreateResponse'
    put:
      tags:
        - App
      summary: Update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppUpdateResponse'
  /v1/entities/:
    post:
      tags:
        - Entities
      summary: Create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FIUConfig'
      responses:
        '201':
          description: Successful response
          content:
            application/json: {}
  /v1/entities/{fiu_client_id}:
    get:
      tags:
        - Entities
      summary: Get
      parameters:
        - name: fiu_client_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
    put:
      tags:
        - Entities
      summary: Update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FIUConfigUpdateRequest'
      parameters:
        - name: fiu_client_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /v1/entities/{fiu_client_id}/aa:
    put:
      tags:
        - Entities
      summary: Add AA
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AAConfig'
      parameters:
        - name: fiu_client_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '201':
          description: Successful response
          content:
            application/json: {}
  /v1/entities/{fiu_client_id}/aa/{aa_entity_id}:
    put:
      tags:
        - Entities
      summary: Update AA
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AAConfigUpdateRequest'
      parameters:
        - name: fiu_client_id
          in: path
          schema:
            type: string
          required: true
        - name: aa_entity_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /v1/utils/onboarding:
    post:
      tags:
        - Utils
      summary: Create Onboarding Payload
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - entity_name
                - entity_type
                - base_url
              properties:
                entity_name:
                  type: string
                  description: Your entity name.
                  example: Test Entity
                entity_type:
                  type: string
                  example: FIU
                  enum:
                    - FIU
                    - FIP
                    - AA
                base_url:
                  type: string
                  description: Your API Base URL. AA notifications like `/Consent/Notification` and `/FI/Notification` will be delivered to this URL.
                  example: https://bootstack.xyz
      security: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  onboarding_payload:
                    type: object
                    description: Entities to share this json object with Sahamati team for onboarding.
                    properties:
                      entityinfo:
                        type: object
                        properties:
                          baseurl: 
                            type: string
                            example: https://bootstack.xyz
                          certificate:
                            type: object
                            description: Your JWK certificate for verifying the request signatures
                            example:
                              alg: RS256
                              e: AQAB
                              kid: 10c6c43b-7871-4666-ac0d-e4e568953a92
                              kty: RSA
                              'n': >-
                                q7laSF_PQZfvfpd_3livD-epCInoKLIxx4S3joXbAvjRjo0Eb0nTm5Jolj_o6l7KuSXYZV_eEVP547hsI00e4jrZxnEGNctN6N1BRG0Ew4OU-LHqJBZ26FHIsBdQ4RMj5c-8Xu8sT5ihf6TR8JHyRDr5x77F-QJMXItBuLoLbv1D4mN3YfjqBajgcULvpf3UI6-jQwEd4oFnqUY2Owofk9-adPsZ5hQKtQvXW8Zw1AeuKAhtMZgJeKiKvgvgShIZOiCFdU50wUD2kk2QSZqLnFtpqAnde8yTKzAy_EDlFmdLb9g92ILsWErcsjJ-slYSc09L5FP6gGwZPscPTcnoxw
                              use: sig
                          code: 
                            type: string
                            example: test-entity
                          handle: 
                            type: string
                            example: test-entity
                          id: 
                            type: string
                            example: test-entity
                          name: 
                            type: string
                            example: Test Entity
                      type: 
                        type: string
                        example: FIU
                        enum:
                          - FIU
                          - FIP
                          - AA
                  private:
                    $ref: '#/components/schemas/JWK'
  /v1/utils/redirect:
      post:
        tags:
          - Utils
        summary: Create Redirect URL
        description: |
          Creates the redirect URL confirming to the [Redirect Request Spec](https://github.com/Sahamati/aa-redirection-guidelines/blob/main/specification/request-specification.md)
        requestBody:
          content:
            application/json:
              schema:
                type: object
                required:
                  - consent_handles
                properties: 
                  consent_handles:
                    type: array
                    minItems: 1
                    items:
                      type: string
                      example: 6f601734-c070-41b9-9af8-9e890eebca30
        responses:
          '200':
            description: OK
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    redirect_url:
                      type: string
                      example: >-
                        https://aa/webview?ecreq=UWuYh8Fw51lLnyogqpZ834L_gm9aVYbhTiAsO2QOMn3mU4PGFMWDp7x4L1TxL941HIgESgBp5zwOyTikNCAAHiheTWN_Deh9ZVjoSYBvT0oP_AvC3EUsB_RX-2QIKy-zcyD5ey9SALEoLqwl0y4JtcqybGRJV8QRr0amZuEwOZmPFu7K36RXr5KSn9w4_6cGl7x5HWALDGve1ofLtZntZWno05yn9NbSbe5YA7OGWSw-GDUIUs_XsF3MXbXd9Kous09vOEMv_u4diiZUtSwCtH7ha2iSfZzd-L3k_dky4R_MyrEJiJSF8iBAgbt2H0i1LqEASsWQp6gxB2MHiZ8iIA%3D%3D&fi=XFtWWEZYXUFKGUZYRA%3D%3D&reqdate=021020240439000 
  /v1/utils/redirect/decrypt:
      post:
        tags:
          - Utils
        summary: Decrypt Redirect Response
        description: |
          Refer to the [Redirect Response Spec](https://github.com/Sahamati/aa-redirection-guidelines/blob/main/specification/response-specification.md)
        requestBody:
          content:
            application/json:
              schema:
                type: object
                required:
                  - payload
                properties:
                  payload:
                    type: string
                example:
                  payload: >-
                    ?fi=VFNCWFBfU0ZUHlRQHURCVUJDX1Y=&resdate=021020240351040&ecres=_eubVNeoSNlN2vbQc3xKJrsUpRXQIKhoycBYHeb84Ja2ABI7TK7ga4vCRwxbQ0SZc7iNgogRjno8KWvuA00gBx2Ojq5lWmhh_6JjNFs6Wnf018v_uLsFduAgW95zF2_tn8EqnZ3cB0Hs270EIxKFNjNbWDPcZzUF2R_30P7aE1cRZ__9fbGTB-4UyE3ei6HtQP-ek-T2ajfYjvYj96sw0K7TywjSuw3OKuIi4TmxsJ57dY9Q0y4_PrA3wG3pwQFD1ZvFUK1noG0YBOSc7ARqx31KRk8rSh-sBeziKFs7TWCkN5VaKFqKsP8limcc4XiDMXQFycNSm41cqzgcdQ5pvDkqP4sicy4PYNOvPODa6mI=
        responses:
          '200':
            description: OK
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    fi:
                      type: string
                      example: dashboard-aa-preprod
                    resdate:
                      type: string
                      example: 021020240351040
                    payload:
                      type: object
                      properties:
                        txnid: 
                          type: string
                          example: 788855bd-e4fd-458d-ba1c-504fdc5344c2
                        sessionid: 
                          type: string
                          example: d3aaefd2-c9a7-4165-85d0-a40dfef3e7e8
                        userid:
                          type: string
                          example: 9000090000@dashboard-aa-preprod
                        status: 
                          type: string
                          example: S
                        errorcode: 
                          type: string
                          example: '0'
                        srcref:
                          type: array
                          items:
                            type: string
                            example: 20038aaf-790c-45e9-93fc-749a1e7e0c6b
