openapi: "3.0.1"
info:
  title: "Confirmation of Funds 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 MI Vision - Confirmation of Funds API**. For detail implementation guidelines, please refer to the respective section of Documentation page.
  version: "4.0"
tags:
  - name: "Funds Confirmation Consent"
    description: "Endpoints to create, retrieve and delete funds confirmation consent"
  - name: "Funds Confirmation Data"
    description: "Endpoints to check funds availability on consented accounts"
paths:
  /funds-confirmation-consents:
    post:
      tags:
        - "Funds Confirmation Consent"
      summary: "Create Funds Confirmation Consent"
      description: This API enables TPP to create a funds confirmation consent. Product type supported is Credit Cards.
      operationId: "CreateFundsConfirmationConsents"
      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/Authorization1"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OBFundsConfirmationConsent1"
        description: Request body contains all relevant fields to be sent in the request for /funds-confirmation-consents
        required: true
      responses:
        "201":
          $ref: "#/components/responses/201FundsConfirmationConsentsCreated"
        "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/500Error"
      security:
        - BearerAuth: []
          TPPOAuth2Security:
            - "fundsconfirmations"
  /funds-confirmation-consents/{ConsentId}:
    get:
      tags:
        - "Funds Confirmation Consent"
      summary: "Get Funds Confirmation Consent"
      description: This API enables TPP to retrieve a funds confirmation consent.Supported products are Business Current Account and Credit cards, Working Capital
      operationId: "GetFundsConfirmationConsentsConsentId"
      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/Authorization1"
        - $ref: "#/components/parameters/x-customer-user-agent"
      responses:
        "200":
          $ref: "#/components/responses/200FundsConfirmationConsentsConsentIdRead"
        "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"
        "429":
          $ref: "#/components/responses/429Error"
        "500":
          $ref: "#/components/responses/500Error"
      security:
        - BearerAuth: []
          TPPOAuth2Security:
            - "fundsconfirmations"
    delete:
      tags:
        - "Funds Confirmation Consent"
      summary: "Delete Funds Confirmation Consent"
      description: This API enables TPP to delete a funds confirmation consent.Supported products are Business Current Account and Credit cards, Working Capital
      operationId: "DeleteFundsConfirmationConsentsConsentId"
      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/Authorization1"
        - $ref: "#/components/parameters/x-customer-user-agent"
      responses:
        "204":
          $ref: "#/components/responses/204FundsConfirmationConsentsConsentIdDeleted"
        "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"
        "429":
          $ref: "#/components/responses/429Error"
        "500":
          $ref: "#/components/responses/500Error"
      security:
        - BearerAuth: []
          TPPOAuth2Security:
            - "fundsconfirmations"
  /funds-confirmations:
    post:
      tags:
        - "Funds Confirmation Data"
      summary: "Create Funds Confirmation"
      description: This API enables TPP to create funds confirmation.Supported products are Business Current Account and Credit cards, Working Capital
      operationId: "CreateFundsConfirmations"
      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/Authorization2"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OBFundsConfirmation1"
        description: "Default"
        required: true
      responses:
        "201":
          $ref: "#/components/responses/201FundsConfirmationsCreated"
        "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/500Error"
      security:
        - BearerAuth: []
          PSUOAuth2Security:
            - "fundsconfirmations"
servers:
  - url: "https://sandbox.ob.mivision.hsbc.co.uk/mock/ce/obie/open-banking/v4.0/cbpii"
    description: "Sandbox Base URL"
components:
  parameters:
    ConsentId:
      name: "ConsentId"
      in: "path"
      description: "ConsentId"
      required: true
      schema:
        type: "string"
      example: "764331140"
    Authorization1:
      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 GhHumL9VYAha...mlSLaT5RqYvlN"
    Authorization2:
      in: "header"
      name: "Authorization"
      required: true
      description: "An authorisation token which was obtained from an authorisation server using Authorisation Code Grant (https://www.rfc-editor.org/rfc/rfc6749#section-4.1). 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 GhHumL9VYAha...mlSLaT5RqYvlN"
    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: "Wed, 30 Nov 2022 15:05:25 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"
  responses:
    201FundsConfirmationConsentsCreated:
      description: "Funds Confirmation Consent Created"
      headers:
        x-fapi-interaction-id:
          required: true
          description: "An RFC4122 UID used as a correlation id."
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/OBFundsConfirmationConsentResponse1"
    200FundsConfirmationConsentsConsentIdRead:
      description: "Funds Confirmation Consent Read"
      headers:
        x-fapi-interaction-id:
          required: true
          description: "An RFC4122 UID used as a correlation id."
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/OBFundsConfirmationConsentResponse1"
    204FundsConfirmationConsentsConsentIdDeleted:
      description: "Funds Confirmation Consent Deleted"
      headers:
        x-fapi-interaction-id:
          required: true
          description: "An RFC4122 UID used as a correlation id."
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
    201FundsConfirmationsCreated:
      description: "Funds Confirmation Created"
      headers:
        x-fapi-interaction-id:
          required: true
          description: "An RFC4122 UID used as a correlation id."
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/OBFundsConfirmationResponse1"
    400Error:
      description: "Bad request"
      headers:
        x-fapi-interaction-id:
          required: true
          description: "An RFC4122 UID used as a correlation id."
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/OBErrorResponse1"
    401Error:
      description: "Unauthorized"
      headers:
        x-fapi-interaction-id:
          required: true
          description: "An RFC4122 UID used as a correlation id."
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
    403Error:
      description: "Forbidden"
      headers:
        x-fapi-interaction-id:
          required: true
          description: "An RFC4122 UID used as a correlation id."
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/OBErrorResponse1"
    405Error:
      description: "Method Not Allowed"
      headers:
        x-fapi-interaction-id:
          required: true
          description: "An RFC4122 UID used as a correlation id."
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
    406Error:
      description: "Not Acceptable"
      headers:
        x-fapi-interaction-id:
          required: true
          description: "An RFC4122 UID used as a correlation id."
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
    415Error:
      description: "Unsupported Media Type"
      headers:
        x-fapi-interaction-id:
          required: true
          description: "An RFC4122 UID used as a correlation id."
          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."
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
    500Error:
      description: "Internal Server Error"
      headers:
        x-fapi-interaction-id:
          required: true
          description: "An RFC4122 UID used as a correlation id."
          schema:
            type: "string"
          example: "f8273b70-d5c0-4ef7-b3ba-2b3400fe1956"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/OBErrorResponse1"
  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. TokenURL 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:
            fundsconfirmations: "Funds confirmation entitlement"
    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. TokenURL 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:
            fundsconfirmations: "Funds confirmation entitlement"
  schemas:
    Links:
      type: "object"
      description: "Links relevant to the payload"
      properties:
        Self:
          description: "A link to the same resource used for the current request"
          type: "string"
          format: "uri"
          example: "https://secure.sandbox.ob.mivision.hsbc.co.uk/ce/obie/open-banking/v3.1/cbpii/funds-confirmation-consents/1234567890"
      additionalProperties: false
      required:
        - "Self"
    Meta:
      title: "MetaData"
      type: "object"
      description: "Meta Data relevant to the payload"
      properties:
        TotalPages:
          type: "integer"
      additionalProperties: false
    OBError1:
      type: "object"
      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.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"
          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"
      additionalProperties: false
      minProperties: 1
    OBErrorResponse1:
      description: "An array of detail error codes, and messages, and URLs to documentation to help remediation."
      type: "object"
      properties:
        Code:
          description: "High level textual error code, to help categorize the errors."
          type: "string"
          minLength: 1
          maxLength: 40
          example: "ERR-4231"
        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"
      additionalProperties: false
    OBFundsConfirmation1:
      type: "object"
      required:
        - "Data"
      properties:
        Data:
          type: "object"
          required:
            - "ConsentId"
            - "Reference"
            - "InstructedAmount"
          properties:
            ConsentId:
              description: "Unique identification as assigned by the ASPSP to uniquely identify the funds confirmation consent resource."
              type: "string"
              minLength: 1
              maxLength: 128
              example: "2537482945"
            Reference:
              description: "Unique reference, as assigned by the CBPII, to unambiguously refer to the request related to the payment transaction."
              type: "string"
              minLength: 1
              maxLength: 35
              example: 12345
            InstructedAmount:
              $ref: "#/components/schemas/OBActiveOrHistoricCurrencyAndAmount"
      additionalProperties: false
    OBFundsConfirmationConsent1:
      type: "object"
      required:
        - "Data"
      properties:
        Data:
          type: "object"
          required:
            - "DebtorAccount"
          properties:
            ExpirationDateTime:
              description: "Specified date and time the funds confirmation authorisation will expire.\n If this is not populated, the authorisation will be open ended.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
              type: "string"
              format: "date-time"
              example: "2023-10-05T10:53:10+00:00"
            DebtorAccount:
              $ref: "#/components/schemas/OBCashAccountDebtor4"
      additionalProperties: false
    OBFundsConfirmationConsentResponse1:
      type: "object"
      required:
        - "Data"
      properties:
        Data:
          type: "object"
          required:
            - "ConsentId"
            - "CreationDateTime"
            - "StatusUpdateDateTime"
            - "DebtorAccount"
          properties:
            ConsentId:
              description: "Unique identification as assigned to identify the funds confirmation consent resource."
              type: "string"
              minLength: 1
              maxLength: 128
              example: "62f58a32-4eb8-4b13-a378-206ba088f1c2"
            CreationDateTime:
              $ref: "#/components/schemas/CreationDateTime"
            ExpirationDateTime:
              description: "Specified date and time the funds confirmation authorisation will expire.\nIf this is not populated, the authorisation will be open ended.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
              type: "string"
              format: "date-time"
              example: "2023-10-05T10:53:10+00:00"
            Status:
              $ref: "#/components/schemas/OBInternalConsentStatus1Code"
            StatusReason:
              type: "array"
              items:
                $ref: "#/components/schemas/OBStatusReason"
            StatusUpdateDateTime:
              $ref: "#/components/schemas/StatusUpdateDateTime"
            DebtorAccount:
              $ref: "#/components/schemas/OBCashAccountDebtor4"
        Links:
          $ref: "#/components/schemas/Links"
        Meta:
          $ref: "#/components/schemas/Meta"
      additionalProperties: false
    OBFundsConfirmationResponse1:
      type: "object"
      required:
        - "Data"
      properties:
        Data:
          type: "object"
          required:
            - "FundsConfirmationId"
            - "ConsentId"
            - "CreationDateTime"
            - "FundsAvailable"
            - "Reference"
            - "InstructedAmount"
          properties:
            FundsConfirmationId:
              description: "Unique identification as assigned by the ASPSP to uniquely identify the funds confirmation resource."
              type: "string"
              minLength: 1
              maxLength: 40
              example: "ba7501a1-aa4d-4d82-b6a9-48cb5c7abd7f"
            ConsentId:
              description: "Unique identification as assigned by the ASPSP to uniquely identify the funds confirmation consent resource."
              type: "string"
              minLength: 1
              maxLength: 128
              example: "2537482945"
            CreationDateTime:
              description: "Date and time at which the resource was created.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
              type: "string"
              format: "date-time"
              example: "2023-10-05T10:43:10+00:00"
            FundsAvailable:
              description: "Flag to indicate the result of a confirmation of funds check."
              type: "boolean"
              example: "true"
            Reference:
              description: "Unique reference, as assigned by the CBPII, to unambiguously refer to the request related to the payment transaction."
              type: "string"
              minLength: 1
              maxLength: 35
              example: "12345"
            InstructedAmount:
              $ref: "#/components/schemas/OBActiveOrHistoricCurrencyAndAmount"
        Links:
          $ref: "#/components/schemas/Links"
      additionalProperties: false
    CreationDateTime:
      description: "Date and time at which the resource was created."
      type: "string"
      format: "date-time"
      example: "2023-01-04T13:22:20+00:00"
    StatusUpdateDateTime:
      description: "Date and time at which the resource status was updated."
      type: "string"
      format: "date-time"
      example: "2023-01-04T00:00:00+00:00"
    OBInternalConsentStatus1Code:
      description: >
        Specifies the status of consent resource in code form.
        <dl>
          <dt>AUTH</dt><dd>Authorised - The consent resource has been successfully authorised.</dd>
          <dt>AWAU</dt><dd>Awaiting Authorisation - The consent resource is awaiting PSU authorisation.</dd>
          <dt>RJCT</dt><dd>Rejected - The consent resource has been rejected.</dd>
          <dt>CANC</dt><dd>Consumed - The access has been cancelled at the ASPSP by either the PSU or the ASPSP.</dd>
          <dt>EXPD</dt><dd>Expired - The consent resource has been marked as expired after expiry of validaty date.</dd>
        </dl>
      type: "string"
      enum:
        - "AWAU"
        - "AUTH"
        - "RJCT"
        - "CANC"
        - "EXPD"
      example:
        "AWAU"
    OBStatusReason:
      type: "object"
      properties:
        StatusReasonCode:
          $ref: "#/components/schemas/OBExternalStatusReason1Code"
        StatusReasonDescription:
          description: "Description supporting the StatusReasonCode."
          type: "string"
          maxLength: 500
        Path:
          description: "Path is optional but relevant when the status reason refers to an object/field and hence conditional to provide JSON path."
          type: "string"
          maxLength: 500
    OBExternalStatusReason1Code:
      description: >
        Specifies the status reason in a code form.
        <dl>
          <dt>U001</dt><dd>Field is expected</dd>
          <dt>U002</dt><dd>Field is invalid</dd>
          <dt>U003</dt><dd>Field has a invalid date</dd>
          <dt>U004</dt><dd>A required field is missing</dd>
          <dt>U005</dt><dd>A value is provided when not required</dd>
          <dt>U006</dt><dd>Header is invalid</dd>
          <dt>U007</dt><dd>Header is missing</dd>
          <dt>U008</dt><dd>Mismatch between staged consent and payment order request</dd>
          <dt>U009</dt><dd>Unexpected consent status</dd>
          <dt>U010</dt><dd>Invalid schema</dd>
          <dt>U011</dt><dd>Resource cannot be found</dd>
          <dt>U012</dt><dd>Payment received after cutoff date and time</dd>
          <dt>U013</dt><dd>Reference found is duplicate</dd>
          <dt>U014</dt><dd>Payment outside control parameters</dd>
          <dt>U015</dt><dd>Invalid signature</dd>
          <dt>U016</dt><dd>Invalid claim in a signature</dd>
          <dt>U017</dt><dd>Invalid or missing claim in a signature</dd>
          <dt>U018</dt><dd>Signature is malformed</dd>
          <dt>U019</dt><dd>Missing information related to signature</dd>
          <dt>U020</dt><dd>Signature was not expected in header but was provided</dd>
          <dt>U021</dt><dd>Unsupported account identified has been provided</dd>
          <dt>U022</dt><dd>Unsupported secondary account identified has been provided</dd>
          <dt>U023</dt><dd>Unsupported currency is provided. Also use U002 or provide path.</dd>
          <dt>U024</dt><dd>Unsupported event type</dd>
          <dt>U025</dt><dd>Unsupported frequency</dd>
          <dt>U026</dt><dd>Unsupported localInstrument</dd>
          <dt>U027</dt><dd>Unsupported scheme</dd>
          <dt>U028</dt><dd>Reauthentication is required by PSU</dd>
          <dt>U029</dt><dd>Duplicate resource submitted</dd>
          <dt>U000</dt><dd>Can use this in conjunction with NARR code to specific the specific unexpected error
        </dl>
      type: "string"
      enum:
        - "U001"
        - "U002"
        - "U003"
        - "U004"
        - "U005"
        - "U006"
        - "U007"
        - "U008"
        - "U009"
        - "U010"
        - "U011"
        - "U012"
        - "U013"
        - "U014"
        - "U015"
        - "U016"
        - "U017"
        - "U018"
        - "U019"
        - "U020"
        - "U021"
        - "U022"
        - "U023"
        - "U024"
        - "U025"
        - "U026"
        - "U027"
        - "U028"
        - "U029"
        - "U000"
        - "AM06"
        - "AM07"
        - "AM09"
        - "AM10"
        - "AM11"
        - "AM12"
        - "AM13"
        - "AM14"
        - "AM15"
        - "AM16"
        - "AM17"
        - "AM18"
        - "AM19"
        - "AM20"
        - "AM21"
        - "AM22"
        - "AM23"
        - "BE01"
        - "BE04"
        - "BE05"
        - "BE06"
        - "BE07"
        - "BE08"
        - "BE09"
        - "BE10"
        - "BE11"
        - "BE12"
        - "BE13"
        - "BE14"
        - "BE15"
        - "BE16"
        - "BE17"
        - "BE18"
        - "BE19"
        - "BE20"
        - "BE21"
        - "BE22"
        - "BE23"
        - "CERI"
        - "CH03"
        - "CH04"
        - "CH07"
        - "CH09"
        - "CH10"
        - "CH11"
        - "CH12"
        - "CH13"
        - "CH14"
        - "CH15"
        - "CH16"
        - "CH17"
        - "CH19"
        - "CH20"
        - "CH21"
        - "CH22"
        - "CHQC"
        - "CNOR"
        - "CURR"
        - "CUST"
        - "DNOR"
        - "DS01"
        - "DS02"
        - "DS03"
        - "DS04"
        - "DS05"
        - "DS06"
        - "DS07"
        - "DS08"
        - "DS09"
        - "DS0A"
        - "DS0B"
        - "DS0C"
        - "DS0D"
        - "DS0E"
        - "DS0F"
        - "DS0G"
        - "DS0H"
        - "DS0K"
        - "DS10"
        - "DS11"
        - "DS12"
        - "DS13"
        - "DS14"
        - "DS15"
        - "DS16"
        - "DS17"
        - "DS18"
        - "DS19"
        - "DS20"
        - "DS21"
        - "DS22"
        - "DS23"
        - "DS24"
        - "DS25"
        - "DS26"
        - "DS27"
        - "DT01"
        - "DT02"
        - "DT03"
        - "DT04"
        - "DT05"
        - "DT06"
        - "DU01"
        - "DU02"
        - "DU03"
        - "DU04"
        - "DU05"
        - "DUPL"
        - "ED01"
        - "ED03"
        - "ED05"
        - "ED06"
        - "ERIN"
        - "FF01"
        - "FF02"
        - "FF03"
        - "FF04"
        - "FF05"
        - "FF06"
        - "FF07"
        - "FF08"
        - "FF09"
        - "FF10"
        - "FF11"
        - "G000"
        - "G001"
        - "G002"
        - "G003"
        - "G004"
        - "G005"
        - "G006"
        - "ID01"
        - "MD01"
        - "MD02"
        - "MD05"
        - "MD06"
        - "MD07"
        - "MS02"
        - "MS03"
        - "NARR"
        - "NERI"
        - "RC01"
        - "RC02"
        - "RC03"
        - "RC04"
        - "RC05"
        - "RC06"
        - "RC07"
        - "RC08"
        - "RC09"
        - "RC10"
        - "RC11"
        - "RC12"
        - "RCON"
        - "RECI"
        - "RF01"
        - "RR01"
        - "RR02"
        - "RR03"
        - "RR04"
        - "RR05"
        - "RR06"
        - "RR07"
        - "RR08"
        - "RR09"
        - "RR10"
        - "RR11"
        - "RR12"
        - "S000"
        - "S001"
        - "S002"
        - "S003"
        - "S004"
        - "SL01"
        - "SL02"
        - "SL03"
        - "SL11"
        - "SL12"
        - "SL13"
        - "SL14"
        - "TA01"
        - "TD01"
        - "TD02"
        - "TD03"
        - "TK01"
        - "TK02"
        - "TK03"
        - "TK09"
        - "TKCM"
        - "TKSG"
        - "TKSP"
        - "TKVE"
        - "TKXP"
        - "TM01"
        - "TS01"
        - "TS04"
        - "CN01"
        - "FOCR"
        - "FR01"
        - "NOCM"
        - "NOAS"
        - "RUTA"
        - "UPAY"
        - "ALAC"
        - "AEXR"
        - "ARFR"
        - "ARJR"
        - "ATNS"
        - "EDTR"
        - "EDTL"
        - "FRAD"
        - "IEDT"
        - "IRNR"
        - "NOAR"
        - "NOPG"
        - "NRCH"
        - "RTNS"
        - "REPR"
        - "SPII"
        - "PINS"
        - "UCRD"
        - "FF12"
        - "FF13"
        - "DC02"
        - "APAR"
      example: "U000"
    OBCashAccountDebtor4:
      type: "object"
      description: "Unambiguous identification of the account of the debtor, in the case of a crebit transaction."
      required:
        - "SchemeName"
        - "Identification"
      properties:
        SchemeName:
          $ref: "#/components/schemas/OBInternalAccountIdentification4Code"
        Identification:
          description: "Identification assigned by an institution to identify an account. This identification is known by the account owner."
          type: "string"
          minLength: 1
          maxLength: 256
          example: "Sample Identyfication0"
        Name:
          description: "The account name is the name or names of the account owner(s) represented at an account level, as displayed by the ASPSP's online channels.\nNote, the account name is not the product name or the nickname of the account."
          type: "string"
          minLength: 1
          maxLength: 350
          example: "ABC"
        SecondaryIdentification:
          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)."
          type: "string"
          minLength: 1
          maxLength: 34
          example: "4941202460847847"
        Proxy:
          $ref: "#/components/schemas/OBProxy1"
    OBInternalAccountIdentification4Code:
      description: >
        Name of the identification scheme, in a coded form as published in an external list.
        <dl>
          <dt>UK.OBIE.BBAN</dl><dd>Basic Bank Account Number (BBAN) - identifier used nationally by financial institutions, ie, in individual countries, generally as part of a National Account Numbering Scheme(s), to uniquely identify the account of a customer.</dd>
          <dt>UK.OBIE.IBAN</dl><dd>An identifier used internationally by financial institutions to uniquely identify the account of a customer at a financial institution, as described in the latest edition of the international standard ISO 13616. "Banking and related financial services - International Bank Account Number (IBAN)".</dd>
          <dt>UK.OBIE.PAN</dl><dd>Primary Account Number - identifier scheme used to identify a card account.
          <dt>UK.OBIE.Paym</dl><dd>Paym Scheme to make payments via mobile</dd>
          <dt>UK.OBIE.SortCodeAccountNumber</dl><dd>Sort Code and Account Number - identifier scheme used in the UK by financial institutions to identify the account of a customer. The identifier is the concatenation of the 6 digit UK sort code and 8 digit account number. The regular expression for this identifier is: ^[0-9]{6}[0-9]{8}$</dd>
          <dt>UK.OBIE.Wallet</dl><dd>A primary and unique account identifier used to identify a wallet. An ASPSP must document on their developer portal, the payment methods that supports this account identifier.</dd>
        </dl>
      type: "string"
      enum:
        - "UK.OBIE.BBAN"
        - "UK.OBIE.IBAN"
        - "UK.OBIE.PAN"
        - "UK.OBIE.Paym"
        - "UK.OBIE.Wallet"
        - "UK.OBIE.SortCodeAccountNumber"
      example: "UK.OBIE.BBAN"
    OBProxy1:
      description: "Specifies an alternate assumed name for the identification of the account."
      type: "object"
      required:
        - "Identification"
        - "Code"
      properties:
        Identification:
          description: "Identification used to indicate the account identification under another specified name."
          type: "string"
          maxLength: 2048
        Type:
          description: "Type of the proxy identification."
          type: "string"
          maxLength: 35
        Code:
          $ref: "#/components/schemas/ExternalProxyAccountType1Code"
    ExternalProxyAccountType1Code:
      description: >
        Specifies the external proxy account type code, as published in the proxy account type external code set.
        <dl>
          <dt>TELE</dt><dd>TelephoneNumber - A telephone number in the format specified by the 'The international public telecommunication numbering plan ITU-T E.164.</dd>
          <dt>EMAL</dt><dd>EmailAddress - Internationalised address of an electronic mail box for internet messages.</dd>
          <dt>DNAM</dt><dd>DomainName - Internationalised internet domain name.</dd>
          <dt>CINC</dt><dd>CertificateOfIncorporationNumber - Corporate Identification issued by a national institution or regulator, used as account proxy. (applied for corporate account proxy).</dd>
          <dt>COTX</dt><dd>CorporateTaxIdentification - Unique government-issued tax Identification used as account proxy to identify the corporate (for example for government tax) and typically linked to the corporate bank account (applied for corporate account proxy).</dd>
          <dt>COID</dt><dd>CountryAuthorityIdentification - Identification issued by a national institution or regulator (different from a national scheme like a clearing provider), used as account proxy (applied for corporate or individual account proxy).</dd>
          <dt>CUST</dt><dd>CustomerIdentificationNumber - Any other customer identification number issued by a corporate, bank or other organization, used as account proxy. (applied for corporate or individual account proxy).</dd>
          <dt>DRLC</dt><dd>DriverLicenseNumber - Unique government-issued Identification used as account proxy to identify the individual (for example for government charges, road taxes and tolls,vaccination charges) and typically linked to the individual's bank account (applied for individual account proxy).</dd>
          <dt>EIDN</dt><dd>ElectronicIdentification - Government-issued Identification (different from a passport Identification or a national Identification). Used as account proxy to identify the individual (for example for public benefits) and typically linked to the individual's bank account (applied for individual account proxy).</dd>
          <dt>EWAL</dt><dd>EWalletIdentification - Market-adopted prepaid instruments like e-Wallets, payments to / from e-wallets from / to bank accounts (applied for corporate or individual account proxy).</dd>
          <dt>PVTX</dt><dd>IndividualTaxIdentification - Unique government-issued tax Identification used as account proxy to identify the individual for example for government tax) and typically linked to the individual's bank account (applied for individual account proxy).</dd>
          <dt>LEIC</dt><dd>LegalEntityIdentifierCode - Legal Entity Identifier used as account proxy (applied for corporate account proxy). Use cases: Can be used by corporates as a "government-issued" Identification for registration with payment schemes as a proxy. The proxy may be further used for payments and collections using the underlying instant payment rails for a variety of corporate use cases.</dd>
          <dt>MBNO</dt><dd>MobilePhoneNumber - Mobile phone number in the format specified by the “The international public telecommunication numbering plan ITU- T E 164" (applied for corporate or individual account proxy).</dd>
          <dt>NIDN</dt><dd>NationalIdentificationNumber - Unique government-issued Identification used as account proxy to identify the individual or corporate for example for public benefits, government subsidies) and typically linked to the individual's / corporate bank account. (applied for corporate or individual account proxy).</dd>
          <dt>CCPT</dt><dd>PassportNumber - Unique government-issued Identification used as account proxy to identify the individual (for example for government charges, road taxes, vaccination charges) and typically linked to the individual's bank account (applied for individual account proxy).</dd>
          <dt>SHID</dt><dd>SchemeIdentificationNumber - Account proxy issued by a payment scheme (applied for corporate or individual account proxy). Use cases: Any proxies issued by clearing systems, for example VPA (India), FPS Identifier (Hong Kong), Jompay (Malaysia) CCIN (Canada).</dd>
          <dt>SOSE</dt><dd>SocialSecurityNumber - Unique government-issued Identification used as account proxy to identify the individual (for example for public benefits) and typically linked to the individual's bank account (applied for individual account proxy).</dd>
          <dt>TOKN</dt><dd>TokenIdentification - Electronic Identification used, for example, to mask an account number as a means of data secrecy. (applied for corporate or individual account proxy).</dd>
          <dt>UBIL</dt><dd>UtilitiesSubscriptionIdentification - Subscriber Identification for utilities and services. As opposed to a biller Identification, this identification is used for the subscriber of the service (applied for corporate or individual account proxy).</dd>
          <dt>VIPN</dt><dd>VehicleIdentificationPlateNumber - Account proxy for receiving insurance claims, pay insurance premium, road tax payments, traffic tickets etc.(applied for corporate or individual account proxy).</dd>
          <dt>BIID</dt><dd>BillerSubscriberIdentification - Billers of specific utilities could register for a Biller Identification as supported in the clearing scheme, and use this identification for collections (applied for corporate account proxy).</dd>
        </dl>
      type: "string"
      enum:
        - "TELE"
        - "EMAL"
        - "DNAM"
        - "CINC"
        - "COTX"
        - "COID"
        - "CUST"
        - "DRLC"
        - "EIDN"
        - "EWAL"
        - "PVTX"
        - "LEIC"
        - "MBNO"
        - "NIDN"
        - "CCPT"
        - "SHID"
        - "SOSE"
        - "TOKN"
        - "UBIL"
        - "VIPN"
        - "BIID"
      example: "TELE"
    OBActiveCurrencyAndAmount_SimpleType:
      description: "A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217."
      type: "string"
      pattern: "^\\d{1,13}$|^\\d{1,13}\\.\\d{1,5}$"
      example: "1000"
    ActiveOrHistoricCurrencyCode:
      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\"."
      type: "string"
      pattern: "^[A-Z]{3,3}$"
      example: "USD"
    OBActiveOrHistoricCurrencyAndAmount:
      type: "object"
      required:
        - "Amount"
        - "Currency"
      description: "Amount of money to be confirmed as available funds in the debtor account. Contains an Amount and a Currency."
      properties:
        Amount:
          $ref: "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
        Currency:
          $ref: "#/components/schemas/ActiveOrHistoricCurrencyCode"