openapi: 3.0.1

servers:
  - url: "https://sandbox.ob.business.hsbc.co.uk/mock/obie/open-banking/v3.1/pisp"
    description: "Sandbox Base URL"

info:
  title: Variable Recurring Payments API
  description: >
    In this document, you'll find the steps your organization needs to take to use our API services. Included in this guide are details of request and response messages used to support your organization’s integration.
    The intended audience for this document are **Technical Architects**, **Development Engineers**, **Test Engineers**, and **Operation & Maintenance Engineers** involved in development and support of your organization’s integration.
    Setting up our API Services is best completed with the assistance of your organization’s IT team, or someone with experience and knowledge of application programming interfaces. This should include experience with **JSON payloads**, **security** and **public key infrastructure (PKI)**.
    This Document describes the following request and response structure of **HSBC UK Business - Variable Recurring Payments API**. For detail implementation guidelines, please refer to the respective section of Documentation page.
  version: 3.1.11

tags:
  - name: "Domestic VRP Consents"
    description: "Manage domestic variable recurring payment consents"
  - name: "Domestic VRPs"
    description: "Domestic variable recurring payments"

paths:
  /domestic-vrp-consents:
    post:
      operationId: domesticVrpConsentsPost
      tags:
        - "Domestic VRP Consents"

      summary: Create a domestic VRP consent
      description: >
        This API enables TPP to create a domestic VRP consent. Product type supported is Business Current Account.
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/Authorization"
        - $ref: "#/components/parameters/x-idempotency-key"
        - $ref: "#/components/parameters/x-jws-signature"
        - $ref: "#/components/parameters/x-customer-user-agent"

      responses:
        '201':
          description: Created
          headers:
            x-fapi-interaction-id:
              schema:
                $ref: "#/components/parameters/x-fapi-interaction-id"
            x-jws-signature:
              schema:
                $ref: "#/components/parameters/x-jws-signature"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OBDomesticVRPConsentResponse"
        '400':
          $ref: "#/components/responses/400Error"
        '401':
          $ref: "#/components/responses/401Error"
        '403':
          $ref: "#/components/responses/403Error"
        '405':
          $ref: "#/components/responses/405Error"
        '406':
          $ref: "#/components/responses/406Error"
        '409':
          $ref: "#/components/responses/409Error"
        '415':
          $ref: "#/components/responses/415Error"
        '429':
          $ref: "#/components/responses/429Error"
        '500':
          $ref: "#/components/responses/InternalError"

      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OBDomesticVRPConsentRequest"
        description: Request body contains all the relevant fields to be sent in the request for /domestic-vrp-consents
        required: true

      security:
        - BearerAuth: []
          TPPOAuth2Security:
            - "payments"

  /domestic-vrp-consents/{ConsentId}:
    get:
      operationId: domesticVrpConsentsGet
      tags:
        - "Domestic VRP Consents"

      summary: Retrieve a domestic VRP consent
      description: This API enables TPP to retrieve a domestic VRP consent. Product type supported is Business Current Account.
      parameters:
        - $ref: "#/components/parameters/ConsentId"
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/Authorization"
        - $ref: "#/components/parameters/x-customer-user-agent"

      responses:
        '200':
          description: OK
          headers:
            x-fapi-interaction-id:
              schema:
                $ref: "#/components/parameters/x-fapi-interaction-id"
            x-jws-signature:
              schema:
                $ref: "#/components/parameters/x-jws-signature"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OBDomesticVRPConsentResponse"
        '400':
          $ref: "#/components/responses/400Error"
        '401':
          $ref: "#/components/responses/401Error"
        '403':
          $ref: "#/components/responses/403Error"
        '405':
          $ref: "#/components/responses/405Error"
        '406':
          $ref: "#/components/responses/406Error"
        '415':
          $ref: "#/components/responses/415Error"
        '429':
          $ref: "#/components/responses/429Error"
        '500':
          $ref: "#/components/responses/InternalError"

      security:
        - BearerAuth: []
          TPPOAuth2Security:
            - "payments"

    delete:
      operationId: domesticVrpConsentsDelete
      tags:
        - "Domestic VRP Consents"

      summary: Delete a domestic VRP
      description: This API enables TPP to delete a domestic VRP consent. Product type supported is Business Current Account.
      parameters:
        - $ref: "#/components/parameters/ConsentId"
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/Authorization"
        - $ref: "#/components/parameters/x-customer-user-agent"

      responses:
        '204':
          description: 'No Content'
        '400':
          $ref: "#/components/responses/400Error"
        '401':
          $ref: "#/components/responses/401Error"
        '403':
          $ref: "#/components/responses/403Error"
        '405':
          $ref: "#/components/responses/405Error"
        '406':
          $ref: "#/components/responses/406Error"
        '415':
          $ref: "#/components/responses/415Error"
        '429':
          $ref: "#/components/responses/429Error"
        '500':
          $ref: "#/components/responses/InternalError"

      security:
        - BearerAuth: []
          TPPOAuth2Security:
            - "payments"

  /domestic-vrp-consents/{ConsentId}/funds-confirmation:
    post:
      operationId: domesticVrpConsentsFundsConfirmation

      tags:
        - "Domestic VRP Consents"
      summary: Confirm availability of funds for a VRP
      description: This API enables TPP to confirm availability of funds for a VRP. Product type supported is Business Current Account.

      parameters:
        - $ref: "#/components/parameters/ConsentId"
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/Authorization"
        - $ref: "#/components/parameters/x-jws-signature"
        - $ref: "#/components/parameters/x-customer-user-agent"

      responses:
        '201':
          $ref: "#/components/responses/201OBDomesticVRPFundsConfirmationResponse"
        '400':
          $ref: "#/components/responses/400Error"
        '401':
          $ref: "#/components/responses/401Error"
        '403':
          $ref: "#/components/responses/403Error"
        '405':
          $ref: "#/components/responses/405Error"
        '406':
          $ref: "#/components/responses/406Error"
        '415':
          $ref: "#/components/responses/415Error"
        '429':
          $ref: "#/components/responses/429Error"
        '500':
          $ref: "#/components/responses/InternalError"

      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OBVRPFundsConfirmationRequest"
        description: Request body contains all the relevant fields to be sent in the request for /domestic-vrp-consents/{ConsentId}/funds-confirmation
        required: true

      security:
        - BearerAuth: []
          TPPOAuth2Security:
            - "payments"

  /domestic-vrps:
    post:
      operationId: domesticVrpPost
      tags:
        - "Domestic VRPs"
      summary: Create a domestic VRP
      description: This API enables TPP to create a domestic VRP. Product type supported is Business Current Account.
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/Authorization"
        - $ref: "#/components/parameters/x-jws-signature"
        - $ref: "#/components/parameters/x-customer-user-agent"
        - $ref: "#/components/parameters/x-idempotency-key"
      responses:
        '201':
          description: "Created"
          headers:
            x-fapi-interaction-id:
              schema:
                $ref: "#/components/parameters/x-fapi-interaction-id"
            x-jws-signature:
              schema:
                $ref: "#/components/parameters/x-jws-signature"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OBDomesticVRPResponse"
        '400':
          $ref: "#/components/responses/400Error"
        '401':
          $ref: "#/components/responses/401Error"
        '403':
          $ref: "#/components/responses/403Error"
        '405':
          $ref: "#/components/responses/405Error"
        '406':
          $ref: "#/components/responses/406Error"
        '409':
          $ref: "#/components/responses/409Error"
        '415':
          $ref: "#/components/responses/415Error"
        '429':
          $ref: "#/components/responses/429Error"
        '500':
          $ref: "#/components/responses/InternalError"

      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OBDomesticVRPRequest"
        description: Request body contains all relevant fields to be sent in the request for /domestic-vrps
        required: true

      security:
        - BearerAuth: []
          PSUOAuth2Security:
            - "payments"

  /domestic-vrps/{DomesticVRPId}:
    get:
      operationId: domesticVrpGet
      tags:
        - "Domestic VRPs"
      summary: Get domestic VRP
      description: This API enables TPP to retrieve a domestic VRP. Product type supported is Business Current Account.
      parameters:
        - $ref: "#/components/parameters/DomesticVRPId"
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/Authorization"
        - $ref: "#/components/parameters/x-customer-user-agent"

      responses:
        '200':
          description: "OK"
          headers:
            x-fapi-interaction-id:
              schema:
                $ref: "#/components/parameters/x-fapi-interaction-id"
            x-jws-signature:
              schema:
                $ref: "#/components/parameters/x-jws-signature"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OBDomesticVRPResponse"
        '400':
          $ref: "#/components/responses/400Error"
        '401':
          $ref: "#/components/responses/401Error"
        '403':
          $ref: "#/components/responses/403Error"
        '405':
          $ref: "#/components/responses/405Error"
        '406':
          $ref: "#/components/responses/406Error"
        '415':
          $ref: "#/components/responses/415Error"
        '429':
          $ref: "#/components/responses/429Error"
        '500':
          $ref: "#/components/responses/InternalError"

      security:
        - BearerAuth: []
          TPPOAuth2Security:
            - "payments"

components:
  responses:
    400Error:
      description: "Bad request"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
        x-jws-signature:
          description: "Header containing a detached JWS signature of the body of the payload."
          required: true
          schema:
            type: "string"
          example: "eyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCI6MTY3MzMzNjQ0OSwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC90YW4iOiJkd3U5OTZ2dzIxOTFmLmNsb3VkZnJvbnQubmV0IiwiY3JpdCI6WyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCIsImh0dHA6XC9cL29wZW5iYW5raW5nLm9yZy51a1wvdGFuIiwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC9pc3MiXSwia2lkIjoiZXh0ZXJuYWxfMjAyMiIsInR5cCI6IkpPU0UiLCJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lzcyI6IkM9R0IsTD1Mb25kb24sTz1IU0JDIEdyb3VwIE1hbmFnZW1lbnQgU2VydmljZXMgTGltaXRlZCxPVT1PcGVuIEJhbmtpbmcgU2hhcmVkIFNlcnZpY2VzLENOPVByZXByb2QtUFNEMi1FeHRlcm5hbC1TaWduYXR1cmUuaHNiYy5jby51ayIsImFsZyI6IlBTMjU2In0..VKQA7mVLNwGPUpAngcvtyumGa9heFwrVSatjlnbnDBpeJnNH9JAo66IqyG0VKFlVE53K-RY47ka7h2ugAAjJnzkGhqxVmvI5K0UdIH7h1ctasTZzU9He6jI-HI5YIR0Mz7myVTDDiP0BHg22WyftzdudaXkgyRJNk8BEHpLWO4kWMuXX6AO6u0rjnsMf1lYuroAe18N2M5XTbWJ0CbJvQfNL_OgPbKpAhzF-tuNoN_9qnYXa2oP-K2GbaW6Chmu4DKIcLX5vswAmXbQuIRfeckou3rk4-VDAmeA1Izm-P1pYsVFAjOVHK1sYHnwbQBY8GMutYsCOn5ZRCtMy1C_IjA"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/OBErrorResponse1"
    401Error:
      description: "Unauthorized"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
    403Error:
      description: "Forbidden"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
        x-jws-signature:
          description: "Header containing a detached JWS signature of the body of the payload."
          required: true
          schema:
            type: "string"
          example: "eyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCI6MTY3MzMzNjQ0OSwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC90YW4iOiJkd3U5OTZ2dzIxOTFmLmNsb3VkZnJvbnQubmV0IiwiY3JpdCI6WyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCIsImh0dHA6XC9cL29wZW5iYW5raW5nLm9yZy51a1wvdGFuIiwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC9pc3MiXSwia2lkIjoiZXh0ZXJuYWxfMjAyMiIsInR5cCI6IkpPU0UiLCJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lzcyI6IkM9R0IsTD1Mb25kb24sTz1IU0JDIEdyb3VwIE1hbmFnZW1lbnQgU2VydmljZXMgTGltaXRlZCxPVT1PcGVuIEJhbmtpbmcgU2hhcmVkIFNlcnZpY2VzLENOPVByZXByb2QtUFNEMi1FeHRlcm5hbC1TaWduYXR1cmUuaHNiYy5jby51ayIsImFsZyI6IlBTMjU2In0..VKQA7mVLNwGPUpAngcvtyumGa9heFwrVSatjlnbnDBpeJnNH9JAo66IqyG0VKFlVE53K-RY47ka7h2ugAAjJnzkGhqxVmvI5K0UdIH7h1ctasTZzU9He6jI-HI5YIR0Mz7myVTDDiP0BHg22WyftzdudaXkgyRJNk8BEHpLWO4kWMuXX6AO6u0rjnsMf1lYuroAe18N2M5XTbWJ0CbJvQfNL_OgPbKpAhzF-tuNoN_9qnYXa2oP-K2GbaW6Chmu4DKIcLX5vswAmXbQuIRfeckou3rk4-VDAmeA1Izm-P1pYsVFAjOVHK1sYHnwbQBY8GMutYsCOn5ZRCtMy1C_IjA"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/OBErrorResponse1"
    405Error:
      description: "Method Not Allowed"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
    406Error:
      description: "Not Acceptable"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
    409Error:
      description: "Conflict"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
        x-jws-signature:
          description: "Header containing a detached JWS signature of the body of the payload."
          required: true
          schema:
            type: "string"
          example: "eyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCI6MTY3MzMzNjQ0OSwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC90YW4iOiJkd3U5OTZ2dzIxOTFmLmNsb3VkZnJvbnQubmV0IiwiY3JpdCI6WyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCIsImh0dHA6XC9cL29wZW5iYW5raW5nLm9yZy51a1wvdGFuIiwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC9pc3MiXSwia2lkIjoiZXh0ZXJuYWxfMjAyMiIsInR5cCI6IkpPU0UiLCJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lzcyI6IkM9R0IsTD1Mb25kb24sTz1IU0JDIEdyb3VwIE1hbmFnZW1lbnQgU2VydmljZXMgTGltaXRlZCxPVT1PcGVuIEJhbmtpbmcgU2hhcmVkIFNlcnZpY2VzLENOPVByZXByb2QtUFNEMi1FeHRlcm5hbC1TaWduYXR1cmUuaHNiYy5jby51ayIsImFsZyI6IlBTMjU2In0..VKQA7mVLNwGPUpAngcvtyumGa9heFwrVSatjlnbnDBpeJnNH9JAo66IqyG0VKFlVE53K-RY47ka7h2ugAAjJnzkGhqxVmvI5K0UdIH7h1ctasTZzU9He6jI-HI5YIR0Mz7myVTDDiP0BHg22WyftzdudaXkgyRJNk8BEHpLWO4kWMuXX6AO6u0rjnsMf1lYuroAe18N2M5XTbWJ0CbJvQfNL_OgPbKpAhzF-tuNoN_9qnYXa2oP-K2GbaW6Chmu4DKIcLX5vswAmXbQuIRfeckou3rk4-VDAmeA1Izm-P1pYsVFAjOVHK1sYHnwbQBY8GMutYsCOn5ZRCtMy1C_IjA"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/OBErrorResponse1"
    415Error:
      description: "Unsupported Media Type"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
    429Error:
      description: "Too Many Requests"
      headers:
        Retry-After:
          description: "Number in seconds to wait"
          schema:
            type: "integer"
          example: 2
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"

    InternalError:
      description: "Internal Server Error"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
        x-jws-signature:
          description: "Header containing a detached JWS signature of the body of the payload."
          required: true
          schema:
            type: "string"
          example: "eyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCI6MTY3MzMzNjQ0OSwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC90YW4iOiJkd3U5OTZ2dzIxOTFmLmNsb3VkZnJvbnQubmV0IiwiY3JpdCI6WyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCIsImh0dHA6XC9cL29wZW5iYW5raW5nLm9yZy51a1wvdGFuIiwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC9pc3MiXSwia2lkIjoiZXh0ZXJuYWxfMjAyMiIsInR5cCI6IkpPU0UiLCJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lzcyI6IkM9R0IsTD1Mb25kb24sTz1IU0JDIEdyb3VwIE1hbmFnZW1lbnQgU2VydmljZXMgTGltaXRlZCxPVT1PcGVuIEJhbmtpbmcgU2hhcmVkIFNlcnZpY2VzLENOPVByZXByb2QtUFNEMi1FeHRlcm5hbC1TaWduYXR1cmUuaHNiYy5jby51ayIsImFsZyI6IlBTMjU2In0..VKQA7mVLNwGPUpAngcvtyumGa9heFwrVSatjlnbnDBpeJnNH9JAo66IqyG0VKFlVE53K-RY47ka7h2ugAAjJnzkGhqxVmvI5K0UdIH7h1ctasTZzU9He6jI-HI5YIR0Mz7myVTDDiP0BHg22WyftzdudaXkgyRJNk8BEHpLWO4kWMuXX6AO6u0rjnsMf1lYuroAe18N2M5XTbWJ0CbJvQfNL_OgPbKpAhzF-tuNoN_9qnYXa2oP-K2GbaW6Chmu4DKIcLX5vswAmXbQuIRfeckou3rk4-VDAmeA1Izm-P1pYsVFAjOVHK1sYHnwbQBY8GMutYsCOn5ZRCtMy1C_IjA"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/OBErrorResponse1"

    201OBDomesticVRPFundsConfirmationResponse:
      description: Created
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
        x-jws-signature:
          description: "Header containing a detached JWS signature of the body of the payload."
          required: true
          schema:
            type: "string"
          example: "eyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCI6MTY3MzMzNjQ0OSwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC90YW4iOiJkd3U5OTZ2dzIxOTFmLmNsb3VkZnJvbnQubmV0IiwiY3JpdCI6WyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCIsImh0dHA6XC9cL29wZW5iYW5raW5nLm9yZy51a1wvdGFuIiwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC9pc3MiXSwia2lkIjoiZXh0ZXJuYWxfMjAyMiIsInR5cCI6IkpPU0UiLCJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lzcyI6IkM9R0IsTD1Mb25kb24sTz1IU0JDIEdyb3VwIE1hbmFnZW1lbnQgU2VydmljZXMgTGltaXRlZCxPVT1PcGVuIEJhbmtpbmcgU2hhcmVkIFNlcnZpY2VzLENOPVByZXByb2QtUFNEMi1FeHRlcm5hbC1TaWduYXR1cmUuaHNiYy5jby51ayIsImFsZyI6IlBTMjU2In0..VKQA7mVLNwGPUpAngcvtyumGa9heFwrVSatjlnbnDBpeJnNH9JAo66IqyG0VKFlVE53K-RY47ka7h2ugAAjJnzkGhqxVmvI5K0UdIH7h1ctasTZzU9He6jI-HI5YIR0Mz7myVTDDiP0BHg22WyftzdudaXkgyRJNk8BEHpLWO4kWMuXX6AO6u0rjnsMf1lYuroAe18N2M5XTbWJ0CbJvQfNL_OgPbKpAhzF-tuNoN_9qnYXa2oP-K2GbaW6Chmu4DKIcLX5vswAmXbQuIRfeckou3rk4-VDAmeA1Izm-P1pYsVFAjOVHK1sYHnwbQBY8GMutYsCOn5ZRCtMy1C_IjA"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/OBVRPFundsConfirmationResponse"

    20xOBDomesticVRPRequestDetailResponse:
      description: "OK"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
        x-jws-signature:
          description: "Header containing a detached JWS signature of the body of the payload."
          required: true
          schema:
            type: "string"
          example: "eyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCI6MTY3MzMzNjQ0OSwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC90YW4iOiJkd3U5OTZ2dzIxOTFmLmNsb3VkZnJvbnQubmV0IiwiY3JpdCI6WyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCIsImh0dHA6XC9cL29wZW5iYW5raW5nLm9yZy51a1wvdGFuIiwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC9pc3MiXSwia2lkIjoiZXh0ZXJuYWxfMjAyMiIsInR5cCI6IkpPU0UiLCJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lzcyI6IkM9R0IsTD1Mb25kb24sTz1IU0JDIEdyb3VwIE1hbmFnZW1lbnQgU2VydmljZXMgTGltaXRlZCxPVT1PcGVuIEJhbmtpbmcgU2hhcmVkIFNlcnZpY2VzLENOPVByZXByb2QtUFNEMi1FeHRlcm5hbC1TaWduYXR1cmUuaHNiYy5jby51ayIsImFsZyI6IlBTMjU2In0..VKQA7mVLNwGPUpAngcvtyumGa9heFwrVSatjlnbnDBpeJnNH9JAo66IqyG0VKFlVE53K-RY47ka7h2ugAAjJnzkGhqxVmvI5K0UdIH7h1ctasTZzU9He6jI-HI5YIR0Mz7myVTDDiP0BHg22WyftzdudaXkgyRJNk8BEHpLWO4kWMuXX6AO6u0rjnsMf1lYuroAe18N2M5XTbWJ0CbJvQfNL_OgPbKpAhzF-tuNoN_9qnYXa2oP-K2GbaW6Chmu4DKIcLX5vswAmXbQuIRfeckou3rk4-VDAmeA1Izm-P1pYsVFAjOVHK1sYHnwbQBY8GMutYsCOn5ZRCtMy1C_IjA"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/OBDomesticVRPDetails"



  parameters:
    ConsentId:
      name: "ConsentId"
      in: "path"
      description: "ConsentId"
      required: true
      schema:
        type: "string"
      example: "9944a9db-2c18-40fc-a611-a28fd85965a1"
    DomesticVRPId:
      name: "DomesticVRPId"
      in: "path"
      description: "DomesticVRPId"
      required: true
      schema:
        type: "string"
      example: "xw8v4fog53xz98tofdhycyj8k1cgw3wa1uqc"
    Authorization:
      in: "header"
      name: "Authorization"
      required: true
      description: "An authorisation token which was obtained from an authorisation server using Client Credentials Grant (https://www.rfc-editor.org/rfc/rfc6749#section-4.4). The obtained token must be sent using 'Bearer' scheme (https://tools.ietf.org/html/rfc6750#section-2) for this request."
      schema:
        type: "string"
      example: "Bearer CGfo01Zr391wSkMCvPeiMytEQsw"
    x-customer-user-agent:
      in: "header"
      name: "x-customer-user-agent"
      description: "Indicates the user-agent that the PSU is using."
      required: false
      schema:
        type: "string"
      example: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
    x-fapi-customer-ip-address:
      in: "header"
      name: "x-fapi-customer-ip-address"
      required: false
      description: "The PSU's IP address if the PSU is currently logged in with the TPP."
      schema:
        type: "string"
        pattern: ^((((25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\s?)|(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\s?),?\s?)+$
      example: "12.201.45.125"
    x-fapi-auth-date:
      in: "header"
      name: "x-fapi-auth-date"
      required: false
      description: "The time when the PSU last logged in with the TPP. \nAll dates in the HTTP headers are represented as RFC 7231 Full Dates. An example is below: \nSun, 10 Sep 2017 19:43:31 UTC"
      schema:
        type: "string"
        pattern: "^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), \\d{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d{4} \\d{2}:\\d{2}:\\d{2} (GMT|UTC)$"
      example: "Sun, 10 Sep 2017 19:43:31 UTC"
    x-fapi-interaction-id:
      in: "header"
      name: "x-fapi-interaction-id"
      required: false
      description: "An RFC4122 UID used as a correlation id."
      schema:
        type: "string"
      example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
    x-idempotency-key:
      name: "x-idempotency-key"
      in: "header"
      description: "Every request will be processed only once per x-idempotency-key.  The\nIdempotency Key will be valid for 24 hours.\n"
      required: true
      schema:
        type: "string"
        maxLength: 40
        pattern: "^(?!\\s)(.*)(\\S)$"
      example: "igxlwFGgIk015ImMlH4d"
    x-jws-signature:
      in: "header"
      name: "x-jws-signature"
      required: true
      description: "A detached JWS signature of the body of the payload."
      schema:
        type: "string"
      example: "eyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCI6MTY3MzMzNjQ0OSwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC90YW4iOiJkd3U5OTZ2dzIxOTFmLmNsb3VkZnJvbnQubmV0IiwiY3JpdCI6WyJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lhdCIsImh0dHA6XC9cL29wZW5iYW5raW5nLm9yZy51a1wvdGFuIiwiaHR0cDpcL1wvb3BlbmJhbmtpbmcub3JnLnVrXC9pc3MiXSwia2lkIjoiZXh0ZXJuYWxfMjAyMiIsInR5cCI6IkpPU0UiLCJodHRwOlwvXC9vcGVuYmFua2luZy5vcmcudWtcL2lzcyI6IkM9R0IsTD1Mb25kb24sTz1IU0JDIEdyb3VwIE1hbmFnZW1lbnQgU2VydmljZXMgTGltaXRlZCxPVT1PcGVuIEJhbmtpbmcgU2hhcmVkIFNlcnZpY2VzLENOPVByZXByb2QtUFNEMi1FeHRlcm5hbC1TaWduYXR1cmUuaHNiYy5jby51ayIsImFsZyI6IlBTMjU2In0..VKQA7mVLNwGPUpAngcvtyumGa9heFwrVSatjlnbnDBpeJnNH9JAo66IqyG0VKFlVE53K-RY47ka7h2ugAAjJnzkGhqxVmvI5K0UdIH7h1ctasTZzU9He6jI-HI5YIR0Mz7myVTDDiP0BHg22WyftzdudaXkgyRJNk8BEHpLWO4kWMuXX6AO6u0rjnsMf1lYuroAe18N2M5XTbWJ0CbJvQfNL_OgPbKpAhzF-tuNoN_9qnYXa2oP-K2GbaW6Chmu4DKIcLX5vswAmXbQuIRfeckou3rk4-VDAmeA1Izm-P1pYsVFAjOVHK1sYHnwbQBY8GMutYsCOn5ZRCtMy1C_IjA"

  schemas:
    OBError1:
      type: "object"
      additionalProperties: false
      properties:
        ErrorCode:
          description: "Low level textual error code, e.g., UK.OBIE.Field.Missing"
          type: "string"
          enum:
            - "UK.OBIE.Field.Expected"
            - "UK.OBIE.Field.Invalid"
            - "UK.OBIE.Field.InvalidDate"
            - "UK.OBIE.Field.Missing"
            - "UK.OBIE.Field.Unexpected"
            - "UK.OBIE.Header.Invalid"
            - "UK.OBIE.Header.Missing"
            - "UK.OBIE.Reauthenticate"
            - "UK.OBIE.Resource.ConsentMismatch"
            - "UK.OBIE.Resource.InvalidConsentStatus"
            - "UK.OBIE.Resource.InvalidFormat"
            - "UK.OBIE.Resource.NotFound"
            - "UK.OBIE.Rules.AfterCutOffDateTime"
            - "UK.OBIE.Rules.DuplicateReference"
            - "UK.OBIE.Rules.FailsControlParameters"
            - "UK.OBIE.Signature.Invalid"
            - "UK.OBIE.Signature.InvalidClaim"
            - "UK.OBIE.Signature.Malformed"
            - "UK.OBIE.Signature.Missing"
            - "UK.OBIE.Signature.MissingClaim"
            - "UK.OBIE.Signature.Unexpected"
            - "UK.OBIE.UnexpectedError"
            - "UK.OBIE.Unsupported.AccountIdentifier"
            - "UK.OBIE.Unsupported.AccountSecondaryIdentifier"
            - "UK.OBIE.Unsupported.Currency"
            - "UK.OBIE.Unsupported.Frequency"
            - "UK.OBIE.Unsupported.LocalInstrument"
            - "UK.OBIE.Unsupported.Scheme"
            - "UK.OBIE.Rules.ResourceAlreadyExists"
          example: "UK.OBIE.Field.InvalidDate"
        Message:
          description: "A description of the error that occurred. e.g., 'A mandatory field isn't supplied' or 'RequestedExecutionDateTime must be in future'\nOBIE doesn't standardise this field"
          type: "string"
          minLength: 1
          maxLength: 500
          example: "Provided expiration date is not valid"
        Path:
          description: "Recommended but optional reference to the JSON Path of the field with error, e.g., Data.Initiation.InstructedAmount.Currency"
          type: "string"
          minLength: 1
          maxLength: 500
          example: "Data.ExpirationDateTime"
        Url:
          description: "URL to help remediate the problem, or provide more information, or to API Reference, or help etc"
          type: "string"
      required:
        - "ErrorCode"
        - "Message"
      minProperties: 1

    OBErrorResponse1:
      description: "An array of detail error codes, and messages, and URLs to documentation to help remediation."
      type: "object"
      additionalProperties: false
      properties:
        Code:
          description: "High level textual error code, to help categorize the errors."
          type: "string"
          minLength: 1
          maxLength: 40
          example: "400"
        Id:
          description: "A unique reference for the error instance, for audit purposes, in case of unknown/unclassified errors."
          type: "string"
          minLength: 1
          maxLength: 40
          example: "c7cd8b64-50e8-48dd-9085-8981941abe0a"
        Message:
          description: "Brief Error message, e.g., 'There is something wrong with the request parameters provided'"
          type: "string"
          minLength: 1
          maxLength: 500
          example: "There is something wrong with the request parameters provided"
        Errors:
          items:
            $ref: "#/components/schemas/OBError1"
          type: "array"
          minItems: 1
      required:
        - "Code"
        - "Message"
        - "Errors"


    OBDomesticVRPConsentResponse:
      type: object
      required:
        - Data
        - Risk
        - Links
        - Meta

      properties:
        Data:
          type: object
          required:
            - ConsentId
            - CreationDateTime
            - Status
            - StatusUpdateDateTime
            - ControlParameters
            - Initiation
          properties:
            ReadRefundAccount:
              type: string
              enum:
                - Yes
                - No
              description: >
                Indicates whether information about RefundAccount should be included in the payment response.
              example: Yes
            ConsentId:
              type: string
              minLength: 1
              maxLength: 128
              description: >
                Unique identification as assigned by the ASPSP to uniquely identify the consent resource.
              example: "9944a9db-2c18-40fc-a611-a28fd85965a1"
            CreationDateTime:
              type: string
              format: date-time
              description: >
                Date and time at which the resource was created.
              example: 2019-08-24T14:15:22Z
            Status:
              type: string
              description: >
                Specifies the status of resource in code form.
              enum:
                - Authorised
                - AwaitingAuthorisation
                - Rejected
              example: AwaitingAuthorisation
            StatusUpdateDateTime:
              type: string
              format: date-time
              description: >
                Date and time at which the resource status was updated.
              example: 2019-08-24T14:15:22Z
            ControlParameters:
              $ref: '#/components/schemas/OBDomesticVRPControlParameters'
            Initiation:
              $ref: '#/components/schemas/OBDomesticVRPInitiation'
        Risk:
          $ref: '#/components/schemas/OBRisk1'
        Links:
          $ref: '#/components/schemas/Links'
        Meta:
          $ref: '#/components/schemas/Meta'

    OBDomesticVRPConsentRequest:
      type: object
      required:
        - Data
        - Risk
      properties:
        Data:
          type: object
          required:
            - ControlParameters
            - Initiation

          properties:
            ReadRefundAccount:
              type: string
              enum:
                - Yes
                - No
              description: >
                Indicates whether information about RefundAccount should be included in the payment response.
              example: Yes
            ControlParameters:
              $ref: '#/components/schemas/OBDomesticVRPControlParameters'
            Initiation:
              $ref: '#/components/schemas/OBDomesticVRPInitiation'
        Risk:
          $ref: '#/components/schemas/OBRisk1'

    OBDomesticVRPControlParameters:
      type: object
      required:
        - VRPType
        - PSUAuthenticationMethods
        - MaximumIndividualAmount
        - PeriodicLimits
      properties:
        ValidFromDateTime:
          type: string
          format: date-time
          description: Start date time for which the consent remains valid. If not provided, the from datetime of the request will be set by us of when we received the instruction. This field must not be > ValidToDateTime. Past timestamp allowed only for the current date of when the instruction is submitted. Past date is not permitted.
          example: "2019-08-24T14:15:22Z"
        ValidToDateTime:
          type: string
          format: date-time
          description: End date time for which the consent remains valid. If provided, must be >= now and must be >= ValidFromDateTime.
          example: "2019-08-24T14:15:22Z"
        MaximumIndividualAmount:
          $ref: '#/components/schemas/OBActiveOrHistoricCurrencyAndAmount1'
        PeriodicLimits:
          type: array
          minItems: 1
          items:
            type: object
            required:
              - PeriodType
              - PeriodAlignment
              - Amount
              - Currency
            properties:
              PeriodType:
                type: string
                enum:
                  - Day
                  - Week
                  - Fortnight
                  - Month
                  - Half-year
                  - Year
                description: Period type for this period limit. Each PeriodType must be used at most 1 time in the items within PeriodicLimits.
                example: Week
              PeriodAlignment:
                type: string
                enum:
                  - Consent
                  - Calendar
                description: Specifies whether the period starts on the date of consent creation or lines up with a calendar. PeriodAlignment must be Consent if PeriodType=Fortnight.
                example: Calendar
              Amount:
                $ref: '#/components/schemas/OBActiveCurrencyAndAmount_SimpleType1'
              Currency:
                $ref: '#/components/schemas/ActiveOrHistoricCurrencyCode2'
        VRPType:
          type: array
          items:
            $ref: '#/components/schemas/OBVRPConsentType'
          minItems: 1
          description: The types of payments that can be made under this VRP consent. This can be used to indicate whether this include sweeping payment or other ecommerce payments. Must contain UK.OBIE.VRPType.Sweeping and it must be the only value provided.
        PSUAuthenticationMethods:
          type: array
          items:
            type: string
            enum:
            - UK.OBIE.SCANotRequired
            example: UK.OBIE.SCANotRequired
          minItems: 1
          description: Indicates that the PSU authentication methods supported. Must contain UK.OBIE.SCANotRequired and it must be the only value provided.
        PSUInteractionTypes:
          type: array
          items:
            $ref: '#/components/schemas/OBVRPInteractionTypes'
          description: Indicates interaction type, currently if customer is present or not present.
        SupplementaryData:
          type: object
          description: Additional information that can not be captured in the structured fields and/or any other specific block


    OBDomesticVRPInitiation:
      type: object
      required:
        - RemittanceInformation
      properties:
        DebtorAccount:
          $ref: '#/components/schemas/OBCashAccountDebtorWithName'
        CreditorAccount:
          $ref: '#/components/schemas/OBCashAccountCreditor3'
        CreditorPostalAddress:
          $ref: "#/components/schemas/OBPostalAddress6"
        RemittanceInformation:
          type: object
          required:
            - Reference
          description: Information supplied to enable the matching of an entry with the items that the transfer is intended to settle, such as commercial invoices in an accounts' receivable system.
          properties:
            Unstructured:
              type: string
              minLength: 1
              maxLength: 140
              description: Information supplied to enable the matching/reconciliation of an entry with the items that the payment is intended to settle, such as commercial invoices in an accounts' receivable system, in an unstructured form.
              example: "exXVpUNKaDsR9BdVHm"
            Reference:
              type: string
              minLength: 1
              maxLength: 18
              description : Unique reference, as assigned by the creditor,
                to unambiguously refer to the payment transaction.
                Usage - If available, the initiating party should provide this reference in the structured remittance information, to enable reconciliation by the creditor upon receipt of the amount of money. If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification. This field can contain A to Z, a to z, 0 to 9 and the special characters & - / (spaces are also allowed).
              example: "ref52626262"
    OBCashAccountDebtorWithName:
      type: object
      required:
        - SchemeName
        - Identification
        - Name
      properties:
        SchemeName:
         description: Name of the identification scheme, in a coded form as published in an external list.
         type: "string"
         enum:
          - "UK.OBIE.SortCodeAccountNumber"
         example: "UK.OBIE.SortCodeAccountNumber"
        Identification:
          type: string
          minLength: 14
          maxLength: 14
          description: Identification assigned by an institution to identify an account. This identification is known by the account owner. If provided, this must not be equal to CreditorAccount Identification and the first digit must be 4.
          example: "40641531310006"
        Name:
          type: string
          minLength: 1
          maxLength: 350
          description: Name of the account, as assigned by the account servicing institution.  Usage The account name is the name or names of the account owner(s) represented at an account level. The account name is not the product name or the nickname of the account.
          example: "tesco banking"
        SecondaryIdentification:
          type: string
          minLength: 1
          maxLength: 34
          description: This is secondary identification of the account, as assigned by the account servicing institution.  This can be used by building societies to additionally identify accounts with a roll number (in addition to a sort code and account number combination)
          example: "xUO61DyFKvdxX5HxZ42G"

    OBCashAccountCreditor3:
      type: object
      required:
        - SchemeName
        - Identification
        - Name
      properties:
        SchemeName:
         description: Name of the identification scheme, in a coded form as published in an external list.
         type: "string"
         enum:
          - "UK.OBIE.SortCodeAccountNumber"
         example: "UK.OBIE.SortCodeAccountNumber"
          
        Identification:
          type: string
          minLength: 14
          maxLength: 14
          description: |-
            Identification assigned by an institution to identify an account. This identification is known by the account owner. This must not be equal to DebtorAccount Identification.
          example: "40180000133787"
        Name:
          type: string
          minLength: 1
          maxLength: 18
          description: |-
            Name of the account, as assigned by the account servicing institution.
            Usage: the account name is the name or names of the account owner(s) represented at an account level.
            The account name is not the product name or the nickname of the account. This must be the same allowed characters as in Domestic SIP 0-9 a-z A- Z ?/&.*-.
          example: "test user"
        SecondaryIdentification:
          type: string
          minLength: 1
          maxLength: 34
          description: |-
            This is secondary identification of the account, as assigned by the account servicing institution.
            This can be used by building societies to additionally identify accounts with a roll number (in addition to a sort code and account number combination)
          example: "xUO61DyFKvdxX5HxZ42G"

    OBDomesticVRPRequest:
      type: object
      required:
        - Data
        - Risk
      properties:
        Data:
          type: object
          required:
            - ConsentId
            - PSUAuthenticationMethod
            - Initiation
            - Instruction
            - VRPType
          properties:
            ConsentId:
              type: string
              minLength: 1
              maxLength: 128
              description: |-
                Identifier for the Domestic VRP Consent that this payment is made under.
              example: "9944a9db-2c18-40fc-a611-a28fd85965a1"
            PSUAuthenticationMethod:
              allOf:
                - $ref: '#/components/schemas/OBVRPAuthenticationMethods1'
                - description: The authentication method that was used to authenticate the PSU.
                - example: UK.OBIE.SCA
            PSUInteractionType:
              allOf:
                - $ref: '#/components/schemas/OBVRPInteractionTypes'
                - description: The interaction style used.
                - example: InSession
            VRPType:
              $ref: '#/components/schemas/OBVRPConsentType'
            Initiation:
              $ref: '#/components/schemas/OBDomesticVRPInitiation'
            Instruction:
              $ref: '#/components/schemas/OBDomesticVRPInstruction'
        Risk:
          $ref: '#/components/schemas/OBRisk1'

    OBDomesticVRPResponse:
      type: object
      required:
        - Data
        - Risk
        - Links
        - Meta
      properties:
        Data:
          type: object
          required:
            - DomesticVRPId
            - ConsentId
            - CreationDateTime
            - Status
            - StatusUpdateDateTime
            - Initiation
            - Instruction
          properties:
            DomesticVRPId:
              type: string
              minLength: 1
              maxLength: 40
              description: >
                Unique identification as assigned by the ASPSP to uniquely identify the domestic payment resource.
              example: "xw8v4fog53xz98tofdhycyj8k1cgw3wa1uqc"
            ConsentId:
              type: string
              minLength: 1
              maxLength: 128
              description: >
                Identifier for the Domestic VRP Consent that this payment is made under.
              example: "9944a9db-2c18-40fc-a611-a28fd85965a1"
            CreationDateTime:
              type: string
              format: date-time
              description: >
                Date and time at which the resource was created.
              example: 2019-08-24T14:15:22Z
            Status:
              type: string
              description: Specifies the status of the payment information group.
              enum:
                - AcceptedCreditSettlementCompleted
                - AcceptedSettlementInProcess
                - Pending
                - Rejected
              example: AcceptedWithoutPosting
            StatusReason:
              $ref: '#/components/schemas/OBVRPStatusReasonCode'
            StatusReasonDescription:
              type: string
              minLength: 1
              maxLength: 256
              description: >
                Description related to provided Status/StatusReason
              example: TODO update example for StatusReasonDescription
            StatusUpdateDateTime:
              type: string
              format: date-time
              description: >
                Date and time at which the resource status was updated.
              example: 2019-08-24T14:15:22Z
            ExpectedExecutionDateTime:
              type: string
              format: date-time
              description: >
                Expected execution date and time for the payment resource.
              example: 2019-08-24T14:15:22Z
            ExpectedSettlementDateTime:
              type: string
              format: date-time
              description: >
                Expected settlement date and time for the payment resource.
              example: 2019-08-24T14:15:22Z
            Refund:
              $ref: '#/components/schemas/OBCashAccountDebtorWithName'
              description: >
                Only included in the response if `Data.ReadRefundAccount` is set to `Yes` in the consent.
            Charges:
              type: array
              items:
                required:
                  - Amount
                  - ChargeBearer
                  - Type
                type: object
                properties:
                  ChargeBearer:
                    $ref: '#/components/schemas/OBChargeBearerType1Code'
                  Type:
                    $ref: '#/components/schemas/OBExternalPaymentChargeType1Code'
                  Amount:
                    $ref: '#/components/schemas/OBActiveOrHistoricCurrencyAndAmount2'
                description: Set of elements used to provide details of a charge for
                  the payment initiation.
            Initiation:
              $ref: '#/components/schemas/OBDomesticVRPInitiation'
            Instruction:
              $ref: '#/components/schemas/OBDomesticVRPInstruction'
        Risk:
          $ref: '#/components/schemas/OBRisk1'
        Links:
          $ref: '#/components/schemas/Links'
        Meta:
          $ref: '#/components/schemas/Meta'

    OBDomesticVRPDetails:
      type: object
      properties:
        Data:
          type: object
          properties:
            PaymentStatus:
              type: array
              items:
                # TODO: extract (would do it but i'm not fully getting the naming convention)
                required:
                  - PaymentTransactionId
                  - Status
                  - StatusUpdateDateTime
                type: object
                properties:
                  PaymentTransactionId:
                    type: string
                    minLength: 1
                    maxLength: 210
                    description: |-
                      Unique identifier for the transaction within an servicing institution. This identifier is both unique and immutable.
                    example: TODO update example for PaymentTransactionId
                  Status:
                    type: string
                    description: |-
                      Status of a transfer, as assigned by the transaction administrator.
                    enum:
                      - AcceptedSettlementInProcess
                      - Pending
                      - Rejected
                    example: AcceptedCancellationRequest
                  StatusUpdateDateTime:
                    type: string
                    format: date-time
                    description: >
                      Date and time at which the status was assigned to the transfer.
                    example: 2019-08-24T14:15:22Z
                  StatusDetail:
                    type: object
                    required:
                      - Status
                    properties:
                      LocalInstrument:
                        $ref: '#/components/schemas/OBExternalLocalInstrument1Code'
                      Status:
                        type: string
                        minLength: 1
                        maxLength: 128
                        description: |-
                          Status of a transfer, as assigned by the transaction administrator.
                        example: TODO update example for Status
                      StatusReason:
                        type: string
                        description: |-
                          Reason Code provided for the status of a transfer.
                        enum:
                          - Cancelled
                          - PendingFailingSettlement
                          - PendingSettlement
                          - Proprietary
                          - ProprietaryRejection
                          - Suspended
                          - Unmatched
                        example: PendingFailingSettlement
                      StatusReasonDescription:
                        type: string
                        minLength: 1
                        maxLength: 128
                        description: |-
                          Reason provided for the status of a transfer.
                        example: TODO update example for StatusReasonDescription

    OBVRPFundsConfirmationRequest:
      type: object
      required:
        - Data
      description: |-
        The OBVRPFundsConfirmationRequest object must be used to request funds availability for a specific amount in the Debtor Account included in the VRP consents.
      properties:
        Data:
          type: object
          required:
            - ConsentId
            - InstructedAmount
          properties:
            ConsentId:
              type: string
              minLength: 1
              maxLength: 128
              description: |-
                Unique identification as assigned by the ASPSP to uniquely identify the funds confirmation consent resource.
              example: "9944a9db-2c18-40fc-a611-a28fd85965a1"
            Reference:
              type: string
              minLength: 1
              maxLength: 35
              description: |-
                Unique reference, as assigned by the PISP, to unambiguously refer to the request related to the payment transaction.
              example: "reg7373736hhjj"
            InstructedAmount:
              $ref: '#/components/schemas/OBActiveOrHistoricCurrencyAndAmount2'

    OBVRPFundsConfirmationResponse:
      type: object
      required:
        - Data
      description: |-
        The confirmation of funds response contains the result of a funds availability check.
      properties:
        Data:
          type: object
          required:
            - FundsConfirmationId
            - ConsentId
            - CreationDateTime
            - FundsAvailableResult
            - InstructedAmount
          properties:
            FundsConfirmationId:
              type: string
              minLength: 1
              maxLength: 40
              description: |-
                Unique identification as assigned by the ASPSP to uniquely identify the funds confirmation resource.
              example: "8c9116ba-c7ce-459a-83b4-569abec83fdd"
            ConsentId:
              type: string
              minLength: 1
              maxLength: 128
              description: |-
                Unique identification as assigned by the ASPSP to uniquely identify the funds confirmation consent resource.
              example: "9944a9db-2c18-40fc-a611-a28fd85965a1"
            CreationDateTime:
              type: string
              format: date-time
              description: |-
                Date and time at which the resource was created.
              example: 2019-08-24T14:15:22Z
            Reference:
              type: string
              minLength: 1
              maxLength: 35
              description: |-
                Unique reference, as assigned by the CBPII, to unambiguously refer to the request related to the payment transaction.
              example: "reg7373736hhjj"
            FundsAvailableResult:
              $ref: '#/components/schemas/OBPAFundsAvailableResult1'
            InstructedAmount:
              $ref: '#/components/schemas/OBActiveOrHistoricCurrencyAndAmount2'

    OBPAFundsAvailableResult1:
      type: object
      description: |-
        Availability result, clearly indicating the availability of funds given the Amount in the request.
      required:
        - FundsAvailableDateTime
        - FundsAvailable
      properties:
        FundsAvailableDateTime:
          type: string
          format: date-time
          description: |-
            Date and time at which the funds availability check was generated.
          example: 2019-08-24T14:15:22Z
        FundsAvailable:
          type: string
          description: |-
            Availability result, clearly indicating the availability of funds given the Amount in the request.
          enum:
            - Available
            - NotAvailable
          example: Available

    OBChargeBearerType1Code:
      type: string
      description: |-
        Specifies which party/parties will bear the charges associated with the processing of the payment transaction.
      enum:
        - BorneByCreditor
        - BorneByDebtor
        - FollowingServiceLevel
        - Shared
      example: BorneByDebtor

    OBDomesticVRPInstruction:
      type: object
      required:
        - InstructionIdentification
        - EndToEndIdentification
        - InstructedAmount
        - CreditorAccount
        - RemittanceInformation
      properties:
        InstructionIdentification:
          type: string
          minLength: 1
          maxLength: 35
          description: |-
            Unique identification as assigned by an instructing party for an instructed party to unambiguously identify the instruction.
            Usage: the instruction identification is a point to point reference that can be used between the instructing party and the instructed party to refer to the individual instruction.
            It can be included in several messages related to the instruction.
          example: "YOz4NFfJDEOMWj2KPDmj"
        EndToEndIdentification:
          type: string
          minLength: 1
          maxLength: 35
          description: |-
            Unique identification assigned by the initiating party to unambiguously identify the transaction.
            This identification is passed on, unchanged, throughout the entire end-to-end chain.
            Usage: The end-to-end identification can be used for reconciliation or to link tasks relating to the transaction.
            It can be included in several messages related to the transaction.
            OB: The Faster Payments Scheme can only access 31 characters for the EndToEndIdentification field
          example: "Uc6Ca8PbBAfhDV3W0Lfv"
        RemittanceInformation:
          $ref: '#/components/schemas/OBVRPRemittanceInformation'
        LocalInstrument:
          $ref: '#/components/schemas/OBExternalLocalInstrument1Code'
        InstructedAmount:
          $ref: '#/components/schemas/OBActiveOrHistoricCurrencyAndAmount2'
        CreditorPostalAddress:
          $ref: "#/components/schemas/OBPostalAddress6"
        CreditorAccount:
          $ref: '#/components/schemas/OBCashAccountCreditor3'
        SupplementaryData:
          type: object
          description: >
            Additional information that can not be captured in the structured fields and/or any other specific block.

    OBVRPRemittanceInformation:
      type: object
      required:
        - Reference
      description: |-
        Information supplied to enable the matching of an entry with the items that the transfer is intended to settle, such as commercial invoices in an accounts' receivable system.
      properties:
        Unstructured:
          type: string
          minLength: 1
          maxLength: 140
          description: |-
            Information supplied to enable the matching/reconciliation of an entry with the items that the payment is intended to settle, such as commercial invoices in an accounts' receivable system, in an unstructured form.
          example: "exXVpUNKaDsR9BdVHm"
        Reference:
          type: string
          minLength: 1
          maxLength: 18
          description: |-
            Unique reference, as assigned by the creditor, to unambiguously refer to the payment transaction. The PISP must populate this with the same value as specified in the `Data.Initiation.RemittanceInformation.Reference` of the consent. This field can contain A to Z, a to z, 0 to 9 and the special characters & - / (spaces are also allowed).
          example: "reg636367373"


    OBExternalAccountIdentification4Code1:
      type: string
      description: |-
        Name of the identification scheme, in a coded form as published in an external list. If DebtorAccount provided, this must be UK.OBIE.SortCodeAccountNumber.
      enum:
        - UK.OBIE.BBAN
        - UK.OBIE.IBAN
        - UK.OBIE.PAN
        - UK.OBIE.Paym
        - UK.OBIE.SortCodeAccountNumber
      example: UK.OBIE.IBAN

    OBExternalAccountIdentification4Code2:
      type: string
      description: |-
        Name of the identification scheme, in a coded form as published in an external list. Must be UK.OBIE.SortCodeAccountNumber
      enum:
        - UK.OBIE.SortCodeAccountNumber
      example: UK.OBIE.SortCodeAccountNumber

    OBExternalExtendedAccountType1Code:
      description: "Specifies the extended type of account."
      type: "string"
      enum:
        - Business
        - BusinessSavingsAccount
        - Charity
        - Collection
        - Corporate
        - Ewallet
        - Government
        - Investment
        - ISA
        - JointPersonal
        - Pension
        - Personal
        - PersonalSavingsAccount
        - Premier
        - Wealth
      example: BusinessSavingsAccount

    OBExternalLocalInstrument1Code:
      type: string
      description: |-
        User community specific instrument.
        Usage: This element is used to specify a local instrument, local clearing option and/or further qualify the service or service level.
      enum:
        - UK.OBIE.BACS
        - UK.OBIE.BalanceTransfer
        - UK.OBIE.CHAPS
        - UK.OBIE.Euro1
        - UK.OBIE.FPS
        - UK.OBIE.Link
        - UK.OBIE.MoneyTransfer
        - UK.OBIE.Paym
        - UK.OBIE.SEPACreditTransfer
        - UK.OBIE.SEPAInstantCreditTransfer
        - UK.OBIE.SWIFT
        - UK.OBIE.Target2
      example: UK.OBIE.BalanceTransfer

    OBActiveOrHistoricCurrencyAndAmount2:
      required:
        - Amount
        - Currency
      type: object
      properties:
        Amount:
          $ref: '#/components/schemas/OBActiveCurrencyAndAmount_SimpleType2'
        Currency:
          $ref: '#/components/schemas/ActiveOrHistoricCurrencyCode1'

    OBActiveOrHistoricCurrencyAndAmount1:
      required:
        - Amount
        - Currency
      type: object
      properties:
        Amount:
          $ref: '#/components/schemas/OBActiveCurrencyAndAmount_SimpleType3'
        Currency:
          $ref: '#/components/schemas/ActiveOrHistoricCurrencyCode1'

    ActiveOrHistoricCurrencyCode1:
      type: string
      minLength: 3
      maxLength: 3
      pattern: ^[A-Z]{3,3}$
      description: A code allocated to a currency by a Maintenance Agency under an
        international identification scheme, as described in the latest edition of
        the international standard ISO 4217 "Codes for the representation of currencies
        and funds".
      example: GBP

    ActiveOrHistoricCurrencyCode2:
      type: string
      minLength: 3
      maxLength: 3
      pattern: ^[A-Z]{3,3}$
      description: A code allocated to a currency by a Maintenance Agency under an
        international identification scheme, as described in the latest edition of
        the international standard ISO 4217 "Codes for the representation of currencies
        and funds". This must be GBP.
      example: GBP

    OBActiveCurrencyAndAmount_SimpleType2:
      pattern: ^\d{1,13}$|^\d{1,13}\.\d{1,5}$
      type: string
      description: A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217.
      example: 0.1

    OBActiveCurrencyAndAmount_SimpleType3:
      pattern: ^\d{1,13}$|^\d{1,13}\.\d{1,5}$
      type: string
      description: A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217. Maximum Individual Payment amount cannot exceed the PSU’s single payment limit. This will be checked at consent set-up and payment fulfilment.
      example: 0.1

    OBActiveCurrencyAndAmount_SimpleType1:
      pattern: ^\d{1,13}$|^\d{1,13}\.\d{1,5}$
      type: string
      description: >
        A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217.
        ####
        Limit of lower period should be lesser than limit on higher period. Example:
        * Maximum individual amount < Daily,Weekly,...
        * Daily should be < than Weekly,Fortnightly...
        * Weekly should be < than Fortnightly,Monthly...
        * Fortnightly should be < than Monthly,Half Yearly
        * Monthly should be < than Half Yearly,Yearly
        * Half Yearly should be < than Yearly.
        The amount must be at most 2 decimal places. Periodic limit amount cannot exceed the PSU’s daily limit x the number of days in the period (Week = 7 days, Fortnight = 14 days, One month = 31 days, Half Year = 183 days, One Year = 366 days). This will be checked at consent setup.
      example: 0.1

    OBExternalPaymentChargeType1Code:
      type: string
      enum:
        - UK.OBIE.CHAPSOut
        - UK.OBIE.BalanceTransferOut
        - UK.OBIE.MoneyTransferOut
      example: UK.OBIE.BalanceTransferOut

    OBPostalAddress6:
      type: object
      additionalProperties: false
      description: Information that locates and identifies a specific address, as defined by postal services.
      properties:
        AddressType:
          $ref: "#/components/schemas/OBAddressTypeCode"
        Department:
          $ref: "#/components/schemas/Department"
        SubDepartment:
          $ref: "#/components/schemas/SubDepartment"
        StreetName:
          $ref: "#/components/schemas/StreetName"
        BuildingNumber:
          $ref: "#/components/schemas/BuildingNumber"
        PostCode:
          $ref: "#/components/schemas/PostCode"
        TownName:
          $ref: "#/components/schemas/TownName"
        CountrySubDivision:
          $ref: "#/components/schemas/CountrySubDivision"
        Country:
          $ref: "#/components/schemas/CountryCode"
        AddressLine:
          type: array
          items:
            description: |-
              Information that locates and identifies a specific address, as defined by postal services, presented in free format text.
            type: "string"
            minLength: 1
            maxLength: 70
          minItems: 0
          maxItems: 7
          example: ["Flat 70","Rose Lodge"]

    OBAddressTypeCode:
      description: Identifies the nature of the postal address.
      type: string
      enum:
        - Business
        - Correspondence
        - DeliveryTo
        - MailTo
        - POBox
        - Postal
        - Residential
        - Statement
      example: Correspondence

    Department:
      description: Identification of a division of a large organisation or building.
      type: string
      minLength: 1
      maxLength: 70

    SubDepartment:
      description: Identification of a sub-division of a large organisation or building.
      type: string
      minLength: 1
      maxLength: 70

    StreetName:
      type: string
      minLength: 1
      maxLength: 70
      description: Name of a street or thoroughfare.
      example: "VRP Street Name"

    BuildingNumber:
      type: string
      minLength: 1
      maxLength: 16
      description: Number that identifies the position of a building on a street.
      example: "20"

    PostCode:
      type: string
      minLength: 1
      maxLength: 16
      description: Identifier consisting of a group of letters and/or numbers that
        is added to a postal address to assist the sorting of mail.
      example: "AB1 2CD"

    TownName:
      type: string
      minLength: 1
      maxLength: 35
      description: Name of a built-up area, with defined boundaries, and a local government.
      example: "VRPTownName"

    CountrySubDivision:
      type: string
      minLength: 1
      maxLength: 35
      description: Identifies a subdivision of a country such as state, region, county.
      example: "Kent"

    CountryCode:
      type: string
      pattern: "^[A-Z]{2,2}$"
      description: Nation with its own government.
      example: "UK"


    OBVRPStatusReasonCode:
      type: string
      enum:
        - UK.OBIE.ExemptionNotApplied
        - UK.OBIE.OtherReason
      description: >
        Reason Code provided for the status of a VRP. To be documented in the Developer Portal.
      example: UK.OBIE.ExemptionNotApplied

    OBVRPConsentType:
      type: string
      enum:
       - UK.OBIE.VRPType.Sweeping
       - UK.OBIE.VRPType.Other
      example: UK.OBIE.VRPType.Sweeping

    OBVRPAuthenticationMethods1:
      type: string
      enum:
        - UK.OBIE.SCA
        - UK.OBIE.SCANotRequired
      example: UK.OBIE.SCANotRequired

    OBVRPAuthenticationMethods2:
      type: string
      enum:
        - UK.OBIE.SCANotRequired
      example: UK.OBIE.SCANotRequired

    OBVRPInteractionTypes:
      type: string
      enum:
        - InSession
        - OffSession
      example: InSession

    OBRisk1:
      type: object
      additionalProperties: false
      properties:
        # OBExternalPaymentContext1Code
        PaymentContextCode:
          type: string
          description: |
            Specifies the payment context
            * BillPayment - @deprecated
            * EcommerceGoods - @deprecated
            * EcommerceServices - @deprecated
            * Other - @deprecated
            * PartyToParty - @deprecated
          enum:
            - BillingGoodsAndServicesInAdvance
            - BillingGoodsAndServicesInArrears
            - PispPayee
            - EcommerceMerchantInitiatedPayment
            - FaceToFacePointOfSale
            - TransferToSelf
            - TransferToThirdParty
            # Deprecated values
            - BillPayment
            - EcommerceGoods
            - EcommerceServices
            - Other
            - PartyToParty
          example: PispPayee
        MerchantCategoryCode:
          type: string
          minLength: 3
          maxLength: 4
          description: Category code conform to ISO 18245, related to the type of
            services or goods the merchant provides for the transaction.
          example: "5967"
        MerchantCustomerIdentification:
          type: string
          minLength: 1
          maxLength: 70
          description: The unique customer identifier of the PSU with the merchant.
          example: "07775554433"
        ContractPresentInidicator:
          type: boolean
          description: Indicates if Payee has a contractual relationship with the PISP.
          example: true
        BeneficiaryPrepopulatedIndicator:
          type: boolean
          description: Indicates if PISP has immutably prepopulated payment details in for the PSU.
          example: true
        PaymentPurposeCode:
          type: string
          minLength: 3
          maxLength: 4
          description: Category code, related to the type of services or goods that corresponds to the underlying purpose of the payment that conforms to Recommended UK Purpose Code in ISO 20022 Payment Messaging List
          example: INTP
        BeneficiaryAccountType:
          $ref: '#/components/schemas/OBExternalExtendedAccountType1Code'
        # PostalAddress2Lines
        DeliveryAddress:
          required:
            - Country
            - TownName
          type: object
          properties:
            AddressLine:
              maxItems: 2
              minItems: 0
              type: array
              items:
                type: string
                minLength: 1
                maxLength: 70
                description: |-
                  Information that locates and identifies a specific address,
                  as defined by postal services, that is presented in free format
                  text.
              example: ["Flat 70","Rose Lodge"]
            StreetName:
              $ref: '#/components/schemas/StreetName'
            BuildingNumber:
              $ref: '#/components/schemas/BuildingNumber'
            PostCode:
              $ref: '#/components/schemas/PostCode'
            TownName:
              $ref: '#/components/schemas/TownName'
            CountrySubDivision:
              $ref: '#/components/schemas/CountrySubDivision'
            Country:
              $ref: '#/components/schemas/CountryCode'
          description: |-
            Information that locates and identifies a specific address,
            as defined by postal services or in free format text.
      description: |-
        The Risk section is sent by the initiating party to the ASPSP.
        It is used to specify additional details for risk scoring for Payments.

    Links:
      required:
        - Self
      type: object
      properties:
        Self:
          type: string
          format: uri
          description: "A link to the same resource used for the current request."
          example: "https://nginx-fulfilment-hsbc-nlb-0edf724b85e94fb5.elb.eu-west-1.amazonaws.com/obie/open-banking/v3.1/pisp/domestic-vrp-consents/128093de-176c-438d-830a-d259aab0a14b"
      description: Links relevant to the payload
    Meta:
      title: MetaData
      type: object
      description: Meta Data relevant to the payload. At present no fields are used for VRP.
      example: {
        TotalPages: 1
      }


  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Authorization scheme used to authenticate & authorize access to a protected resource on a web server. It is used in conjunction with the OAuth 2.0 protocol for securing API endpoints.
    TPPOAuth2Security:
      type: oauth2
      description: TPP client credential authorisation flow with the ASPSP. Token URL to be used by TPP to obtain a token. Check the well-known configuration endpoint, the 'token_endpoint' property.
      flows:
        clientCredentials:
          tokenUrl: "/obie/open-banking/v1.1/oauth2/token"
          scopes:
            payments: Generic payment scope
    PSUOAuth2Security:
      type: oauth2
      description: OAuth flow, it is required when the PSU needs to perform SCA with
        the ASPSP when a TPP wants to access an ASPSP resource owned by the PSU. Authorization URL to be used by TPP to redirect the PSU in order to start consent authorization journey. Check the well-known configuration endpoint, the 'authorization_endpoint' property. Token URL to be used by TPP to obtain a token. Check the well-known configuration endpoint, the 'token_endpoint' property.
      flows:
        authorizationCode:
          authorizationUrl: "/obie/open-banking/v1.1/oauth2/authorize"
          tokenUrl: "/obie/open-banking/v1.1/oauth2/token"
          scopes:
            payments: Generic payment scope

