> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openfinance-hackathon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve a Payment Consent

> Retrieve a Payment Consent




## OpenAPI

````yaml open-finance-api/yaml/uae-bank-initiation-openapi.yaml get /payment-consents/{ConsentId}
openapi: 3.0.0
info:
  title: UAE Payment API
  description: '## UAE Open Finance Payment API Specification'
  version: v1.2
servers:
  - url: /open-finance/payment/v1.2
security: []
tags:
  - name: Payment Initiation
    description: Initiate a Payment Consent
  - name: Payment Instruction
    description: Instruct the Payment
  - name: Payment Instruction File
    description: Instruct the File Payment
  - name: Payment Instruction File Report
    description: Retrieve the Payment Instruction File Report
paths:
  /payment-consents/{ConsentId}:
    get:
      tags:
        - Payment Initiation
      summary: Retrieve a Payment Consent
      description: |
        Retrieve a Payment Consent
      operationId: RetrievePaymentConsent
      parameters:
        - $ref: '#/components/parameters/authorization'
        - $ref: '#/components/parameters/x-fapi-auth-date'
        - $ref: '#/components/parameters/x-fapi-customer-ip-address'
        - $ref: '#/components/parameters/x-fapi-interaction-id-request'
        - $ref: '#/components/parameters/x-customer-user-agent'
        - $ref: '#/components/parameters/ConsentId'
      responses:
        '200':
          $ref: '#/components/responses/200PaymentConsentRetrieve'
        '400':
          $ref: '#/components/responses/400Error'
        '401':
          $ref: '#/components/responses/401Error'
        '403':
          $ref: '#/components/responses/403Error'
        '404':
          $ref: '#/components/responses/404Error'
        '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:
        - TPPOAuth2Security:
            - openid
            - payments
components:
  parameters:
    authorization:
      in: header
      name: authorization
      required: true
      description: An authorization Token as per https://tools.ietf.org/html/rfc6750
      schema:
        type: string
      example: Bearer 12773da5-81c5-45e7-893c-381ca3cecc30
    x-fapi-auth-date:
      in: header
      name: x-fapi-auth-date
      required: false
      description: >-
        The time when the User last logged in with the TPP. 

        All dates in the HTTP headers are represented as RFC 7231 Full Dates. An
        example is below: 

        Sun, 10 Sep 2023 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: Thu, 26 Jan 2023 16:31:32 UTC
    x-fapi-customer-ip-address:
      in: header
      name: x-fapi-customer-ip-address
      required: false
      description: The User's IP address if the User is currently logged in with the TPP.
      schema:
        type: string
      example: 51.235.115.203
    x-fapi-interaction-id-request:
      in: header
      name: x-fapi-interaction-id
      required: false
      description: An RFC4122 UID used as a correlation id.
      schema:
        type: string
      example: 49df2c2c-6b80-40ee-96a1-71910a248048
    x-customer-user-agent:
      in: header
      name: x-customer-user-agent
      description: Indicates the user-agent that the User is using.
      required: false
      schema:
        type: string
      example: >-
        Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X)
        AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304
        Safari/602.1
    ConsentId:
      name: ConsentId
      in: path
      description: >-
        Unique identification as assigned by the LFI to uniquely identify the
        Consent resource
      required: true
      schema:
        type: string
      example: aac-69255d98-ab0e-4758-92a7-cacbf3073efa
  responses:
    200PaymentConsentRetrieve:
      description: Payment Consent Retrieve
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/AEPaymentConsentResponseSigned'
    400Error:
      description: Bad request
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/AEErrorResponseSigned'
          examples:
            Bad Request:
              $ref: '#/components/examples/Error400BadRequestSigned'
    401Error:
      description: Unauthorized
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
    403Error:
      description: Forbidden
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/AEErrorResponseSigned'
          examples:
            Forbidden:
              $ref: '#/components/examples/Error403ForbiddenSigned'
    404Error:
      description: Not found
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
    405Error:
      description: Method Not Allowed
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
    406Error:
      description: Not Acceptable
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
    415Error:
      description: Unsupported Media Type
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
    429Error:
      description: Too Many Requests
      headers:
        Retry-After:
          description: Number in seconds to wait
          schema:
            type: integer
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
    500Error:
      description: Internal Server Error
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/AEErrorResponseSigned'
          examples:
            Internal Server Error:
              $ref: '#/components/examples/Error500InternalServerErrorSigned'
  headers:
    x-fapi-interaction-id:
      required: true
      description: An RFC4122 UID used as a correlation id.
      schema:
        type: string
      example: 49df2c2c-6b80-40ee-96a1-71910a248048
  schemas:
    AEPaymentConsentResponseSigned:
      description: |
        Payment Consent Response Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/AEPaymentConsentResponse'
          required:
            - message
    AEErrorResponseSigned:
      description: |
        Error Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/AEErrorResponse'
          required:
            - message
    AEJwt:
      description: >
        [https://www.rfc-editor.org/rfc/rfc7519](https://www.rfc-editor.org/rfc/rfc7519)
      type: object
      properties:
        iss:
          description: >
            [https://www.rfc-editor.org/rfc/rfc7519#section-4.1.1](https://www.rfc-editor.org/rfc/rfc7519#section-4.1.1)
          type: string
        exp:
          description: >
            [https://www.rfc-editor.org/rfc/rfc7519#section-4.1.4](https://www.rfc-editor.org/rfc/rfc7519#section-4.1.4)
          type: number
        nbf:
          description: >
            [https://www.rfc-editor.org/rfc/rfc7519#section-4.1.5](https://www.rfc-editor.org/rfc/rfc7519#section-4.1.5)
          type: number
        aud:
          description: >
            [https://www.rfc-editor.org/rfc/rfc7519#section-4.1.3](https://www.rfc-editor.org/rfc/rfc7519#section-4.1.3)
          type: array
          items:
            type: string
        iat:
          description: >
            [https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6](https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6)
          type: number
      required:
        - iss
        - exp
        - nbf
    AEPaymentConsentResponse:
      description: |
        Payment Consent Response Schema
      type: object
      additionalProperties: false
      required:
        - Data
        - Links
      properties:
        Data:
          type: object
          additionalProperties: false
          required:
            - ConsentId
            - BaseConsentId
            - Status
            - StatusUpdateDateTime
            - CreationDateTime
            - ExpirationDateTime
            - ControlParameters
            - PaymentPurposeCode
            - PaymentConsumption
          properties:
            ConsentId:
              $ref: '#/components/schemas/AEConsentId'
            BaseConsentId:
              $ref: '#/components/schemas/AEBaseConsentId'
            IsSingleAuthorization:
              $ref: '#/components/schemas/IsSingleAuthorization'
            AuthorizationExpirationDateTime:
              $ref: '#/components/schemas/AuthorizationExpirationDateTime'
            Permissions:
              $ref: '#/components/schemas/AEConsentPermissions'
            ExpirationDateTime:
              $ref: '#/components/schemas/AEConsentExpirationDateTime'
            Status:
              $ref: '#/components/schemas/AEConsentStatus'
            RevokedBy:
              $ref: '#/components/schemas/AERevokedBy'
            CreationDateTime:
              $ref: '#/components/schemas/AECreationDateTime'
            StatusUpdateDateTime:
              $ref: '#/components/schemas/AEStatusUpdateDateTime'
            Charges:
              $ref: '#/components/schemas/AECharges'
            ExchangeRate:
              $ref: '#/components/schemas/AEExchangeRateInformation'
            CurrencyRequest:
              $ref: '#/components/schemas/AECurrencyRequest'
            ControlParameters:
              description: >
                Control Parameters set the overall rules for the Payment
                Schedule
              type: object
              additionalProperties: false
              properties:
                IsDelegatedAuthentication:
                  type: boolean
                  description: >-
                    Indicates whether the all payment controls will be defined
                    and managed by the TPP under the Payment with Delegated
                    Authentication capability
                ConsentSchedule:
                  type: object
                  description: >
                    The various payment types that can be initiated:

                    * A Single Payment

                    * A Multi-Payment

                    * A Combined Payment (one SinglePayment and one
                    MultiPayment)
                  properties:
                    SinglePayment:
                      description: |
                        A Consent definition for defining Single Payments
                      oneOf:
                        - $ref: '#/components/schemas/AESingleInstantPayment'
                        - $ref: '#/components/schemas/AESingleFutureDatedPayment'
                      discriminator:
                        propertyName: Type
                    MultiPayment:
                      $ref: '#/components/schemas/AELongLivedPaymentConsent'
                    FilePayment:
                      $ref: '#/components/schemas/AEFilePaymentConsent'
                  additionalProperties: false
            DebtorReference:
              $ref: '#/components/schemas/AEStructuredDebtorReference'
            CreditorReference:
              $ref: '#/components/schemas/AEStructuredCreditorReference'
            PaymentPurposeCode:
              $ref: '#/components/schemas/AEPaymentPurposeCode'
            SponsoredTPPInformation:
              $ref: '#/components/schemas/AESponsoredTPPInformation'
            PaymentConsumption:
              $ref: '#/components/schemas/AEPaymentConsumption'
            OpenFinanceBilling:
              $ref: '#/components/schemas/AEServiceInitiationOpenFinanceBilling'
        Subscription:
          $ref: '#/components/schemas/AEEventNotification'
        Links:
          $ref: '#/components/schemas/AELinksRelatedPayment'
        Meta:
          $ref: '#/components/schemas/AEMetaMultiAuthorization'
    AEErrorResponse:
      description: >-
        An array of detail error codes, and messages, and URLs to documentation
        to help remediation.
      type: object
      properties:
        Errors:
          items:
            $ref: '#/components/schemas/AEError'
          type: array
          minItems: 1
      required:
        - Errors
      additionalProperties: false
    AEConsentId:
      description: >
        Unique identification assigned by the TPP to identify the consent
        resource.
      type: string
      minLength: 1
      maxLength: 128
      example: aac-69255d98-ab0e-4758-92a7-cacbf3073efa
    AEBaseConsentId:
      description: >
        The original ConsentId assigned by the TPP.

        It is used by the TPP for updating/renewing parameters associated with
        long-lived consents.

        It must be provided when long-lived consent parameters are
        updated/renewed for a current consent that has not yet finished.
      type: string
      minLength: 1
      maxLength: 128
      example: abc-19877d98-ab0e-4758-92a7-vvffr1234abv
    IsSingleAuthorization:
      description: >
        Specifies to the LFI that the consent authorization must be completed in
        a single authorization Step 

        with the LFI
      type: boolean
    AuthorizationExpirationDateTime:
      description: >-
        The date and time by which a Consent (in AwaitingAuthorization status)
        must be Authorized by the User.
      type: string
      format: date-time
    AEConsentPermissions:
      type: array
      description: >
        Specifies the permitted Account Access data types. 

        This is a list of the data groups being consented by the User, and
        requested for authorization with the LFI.


        This allows a TPP to request a balance check permission.
      items:
        type: string
        enum:
          - ReadAccountsBasic
          - ReadAccountsDetail
          - ReadBalances
          - ReadRefundAccount
      minItems: 1
    AEConsentExpirationDateTime:
      description: >
        Specified date and time the consent will expire.

        All dates in the JSON payloads are represented in ISO 8601 date-time
        format.

        All date-time fields in responses must include the timezone. An example
        is :2023-04-05T10:43:07+00:00
      type: string
      format: date-time
    AEConsentStatus:
      description: >
        Specifies the status of a consent.


        | Consent Status| State Type| Description|

        |---------------|-----------|------|

        | AwaitingAuthorization | Pending | The consent is awaiting
        authorization.|

        | Authorized | In Use | The consent has been successfully authorized.|

        | Rejected | Terminal | The unauthorized consent has been rejected at
        the LFI.|

        | Revoked | Terminal | The consent has been revoked at the TPP or LFI.|

        | Expired | Terminal | The consent is now expired.|

        | Consumed | Terminal | The consented action(s) have either been
        completed successfully.|

        | Suspended | In Use | The consent has been suspended, pending further
        enquiries.|
      type: string
      enum:
        - AwaitingAuthorization
        - Authorized
        - Rejected
        - Revoked
        - Expired
        - Consumed
        - Suspended
    AERevokedBy:
      description: |
        Denotes the Identifier of the revocation.

        | Identifier| Description|
        |-----------|------------|
        | LFI | Revoked by LFI without User initiation|
        | TPP | Revoked by TPP without User initiation|
        | LFI.InitiatedByUser | Initiated by User via the LFI|
        | TPP.InitiatedByUser | Initiated by User via the TPP|
      type: string
      enum:
        - LFI
        - TPP
        - LFI.InitiatedByUser
        - TPP.InitiatedByUser
    AECreationDateTime:
      description: >-
        Date and time at which the message was created. All dates in the JSON
        payloads are represented in ISO 8601 date-time format. 

        All date-time fields in responses must include the timezone. An example
        is below:

        2023-04-05T10:43:07+00:00
      type: string
      format: date-time
    AEStatusUpdateDateTime:
      description: >-
        Date and time at which the resource status was updated.All dates in the
        JSON payloads are represented in ISO 8601 date-time format. 

        All date-time fields in responses must include the timezone. An example
        is below:

        2023-04-05T10:43:07+00:00
      type: string
      format: date-time
    AECharges:
      type: array
      items:
        type: object
        additionalProperties: false
        description: >
          Set of elements used to provide details of a charge for the payment
          initiation.

          * For Payments, these Charges are on the Debtor.
        required:
          - ChargeBearer
          - Type
          - Amount
        properties:
          ChargeBearer:
            $ref: '#/components/schemas/AEChargeBearerType1Code'
          Type:
            $ref: '#/components/schemas/AEExternalPaymentChargeTypeCode'
          Amount:
            $ref: '#/components/schemas/AEActiveCurrencyAmount'
    AEExchangeRateInformation:
      type: object
      additionalProperties: false
      required:
        - UnitCurrency
        - ExchangeRate
        - RateType
      description: >-
        Further detailed information on the exchange rate that has been used in
        the payment transaction - returned by the LFI.
      properties:
        UnitCurrency:
          description: >-
            Currency in which the rate of exchange is expressed in a currency
            exchange. In the example 1GBP = xxxCUR, the unit currency is GBP.
          type: string
          pattern: ^[A-Z]{3,3}$
        ExchangeRate:
          description: >-
            The factor used for conversion of an amount from one currency to
            another. This reflects the price at which one currency was bought
            with another currency.
          type: number
        RateType:
          description: Specifies the type used to complete the currency exchange.
          type: string
          enum:
            - Actual
            - Agreed
            - Indicative
        ContractIdentification:
          description: >-
            Unique and unambiguous reference to the foreign exchange contract
            agreed between the initiating party/creditor and the debtor agent.
          type: string
          minLength: 1
          maxLength: 256
        ExpirationDateTime:
          description: >-
            Specified date and time the exchange rate agreement will expire. All
            dates in the JSON payloads are represented in ISO 8601 date-time
            format. 

            All date-time fields in responses must include the timezone. An
            example is below:

            2017-04-05T10:43:07+00:00
          type: string
          format: date-time
    AECurrencyRequest:
      description: >
        The details of the non-local currency or FX request that has been agreed
        between the User and the TPP.

        The LFI may return different ChargeBearer and ExchangeRateInformation in
        the Consent object.
      type: object
      additionalProperties: false
      required:
        - ExtendedPurpose
        - CurrencyOfTransfer
      properties:
        InstructionPriority:
          description: >-
            Indicator of the urgency or order of importance that the instructing
            party would like the instructed party to apply to the processing of
            the instruction.
          type: string
          enum:
            - Normal
            - Urgent
        ExtendedPurpose:
          description: >-
            Specifies the purpose of an international payment, when there is no
            corresponding 4 character code available in the ISO20022 list of
            Purpose Codes.
          type: string
          minLength: 1
          maxLength: 140
        ChargeBearer:
          $ref: '#/components/schemas/AEChargeBearerType1Code'
        CurrencyOfTransfer:
          description: >-
            Specifies the currency of the to be transferred amount, which is
            different from the currency of the debtor's account.
          type: string
          pattern: ^[A-Z]{3,3}$
        DestinationCountryCode:
          description: >-
            Country in which Credit Account is domiciled. Code to identify a
            country, a dependency, or another area of particular geopolitical
            interest, on the basis of country names obtained from the United
            Nations (ISO 3166, Alpha-2 code).
          type: string
          pattern: '[A-Z]{2,2}'
        ExchangeRateInformation:
          type: object
          additionalProperties: false
          required:
            - UnitCurrency
            - RateType
          description: Provides details on the currency exchange rate and contract.
          properties:
            UnitCurrency:
              description: >-
                Currency in which the rate of exchange is expressed in a
                currency exchange. In the example 1GBP = xxxCUR, the unit
                currency is GBP.
              type: string
              pattern: ^[A-Z]{3,3}$
            ExchangeRate:
              description: >-
                The factor used for conversion of an amount from one currency to
                another. This reflects the price at which one currency was
                bought with another currency.
              type: number
            RateType:
              description: Specifies the type used to complete the currency exchange.
              type: string
              enum:
                - Actual
                - Agreed
                - Indicative
            ContractIdentification:
              description: >-
                Unique and unambiguous reference to the foreign exchange
                contract agreed between the initiating party/creditor and the
                debtor agent.
              type: string
              minLength: 1
              maxLength: 256
    AESingleInstantPayment:
      type: object
      description: >
        A single immediate payment consent that MUST be used for a single
        payment which will be initiated immediately after User authorization at
        the LFI.
      required:
        - Type
        - Amount
      properties:
        Type:
          type: string
          description: The Payment Type
          enum:
            - SingleInstantPayment
        Amount:
          $ref: '#/components/schemas/AEActiveCurrencyAmount'
      additionalProperties: false
    AESingleFutureDatedPayment:
      type: object
      description: >
        A single payment consent that MUST be used for a single payment executed
        by the LFI on a future date. This payment consent will be authorized by
        the User during the payment journey, and the payment will be exectued by
        the TPP immediately.
      required:
        - Type
        - Amount
        - RequestedExecutionDate
      properties:
        Type:
          type: string
          description: The Payment Type
          enum:
            - SingleFutureDatedPayment
        Amount:
          $ref: '#/components/schemas/AEActiveCurrencyAmount'
        RequestedExecutionDate:
          $ref: '#/components/schemas/AERequestedExecutionDate'
      additionalProperties: false
    AELongLivedPaymentConsent:
      type: object
      description: |
        A long-lived payment consent.
      required:
        - PeriodicSchedule
      properties:
        MaximumCumulativeValueOfPayments:
          $ref: '#/components/schemas/AEMaximumCumulativeValueOfPayments'
        MaximumCumulativeNumberOfPayments:
          $ref: '#/components/schemas/AEMaximumCumulativeNumberOfPayments'
        PeriodicSchedule:
          description: |
            The definition for a schedule
          oneOf:
            - $ref: '#/components/schemas/AEFixedDefinedSchedule'
            - $ref: '#/components/schemas/AEVariableDefinedSchedule'
            - $ref: '#/components/schemas/AEFixedPeriodicSchedule'
            - $ref: '#/components/schemas/AEVariablePeriodicSchedule'
            - $ref: '#/components/schemas/AEFixedOnDemand'
            - $ref: '#/components/schemas/AEVariableOnDemand'
          discriminator:
            propertyName: Type
      additionalProperties: false
    AEFilePaymentConsent:
      type: object
      description: |
        A file based payment consent.
      required:
        - FileType
        - FileHash
        - NumberOfTransactions
        - ControlSum
      properties:
        FileType:
          $ref: '#/components/schemas/AEFileType'
        FileHash:
          $ref: '#/components/schemas/AEFileHash'
        FileReference:
          $ref: '#/components/schemas/AEReference'
        NumberOfTransactions:
          $ref: '#/components/schemas/AEFileNumberOfTransactions'
        ControlSum:
          $ref: '#/components/schemas/AEControlSum'
        RequestedExecutionDate:
          $ref: '#/components/schemas/AERequestedExecutionDate'
      additionalProperties: false
    AEStructuredDebtorReference:
      description: >
        A reason or reference in relation to a payment, set to facilitate a
        structured Debtor reference consisting of:


        * For payments to Merchants: TPP ID, Merchant ID, BIC for the Creditor
        Account, followed by freeform text to a maximum of 120 characters.


        * For other payments: TPP ID and BIC for the Creditor Account, followed
        by freeform text to a maximum of 120 characters.


        The TPP ID value will match the organization ID value from the Trust
        Framework, and therefore will be a v4 UUID.


        The Merchant ID wil be as per the existing Aani Core rules for the
        Merchant identification, and will incorporate the Trade License number
        for the Merchant.


        A BIC is specific according to the standard format for ISO 20022, and
        can therefore be either 8 or 11 characters in length.


        If the value of the concatenated string exceeds 120 characters, the TPP
        must omit or truncate the freeform element of the reference.
      type: string
      minLength: 1
      maxLength: 120
      pattern: >-
        ^TPP=[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12},(Merchant=[A-Z0-9]{3}-[A-Z]{4}-TL.+-[0-9]{4},|)BIC=[A-Z0-9]{4}[A-Z0-9]{2}[A-Z0-9]{2}([A-Z0-9]{3}){0,1}($|,.+$)
    AEStructuredCreditorReference:
      description: >
        A reason or reference in relation to a payment, set to facilitate a
        structured Creditor reference consisting of:


        * TPP ID and BIC for the Debtor Account, followed by freeform text to a
        maximum of 120 characters.


        The TPP ID value will match the organization ID value from the Trust
        Framework, and therefore will be a v4 UUID.


        A BIC is specific according to the standard format for ISO 20022, and
        can therefore be either 8 or 11 characters in length.


        If the value of the concatenated string exceeds 120 characters, the TPP
        must first omit or truncate the freeform element of the reference.
      type: string
      minLength: 1
      maxLength: 120
      pattern: >-
        ^TPP=[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12},BIC=[A-Z0-9]{4}[A-Z0-9]{2}[A-Z0-9]{2}([A-Z0-9]{3}){0,1}($|,.+$)
    AEPaymentPurposeCode:
      description: >-
        A category code that relates to the type of services or goods that
        corresponds to the underlying purpose of the payment. The code must
        conform to the published Aani payment purpose code list.
      type: string
      minLength: 1
      maxLength: 3
      pattern: ^[A-Z]{3}$
    AESponsoredTPPInformation:
      type: object
      description: >
        The Sponsored TPP is:

        * A TPP that itself has no direct Open Banking API integrations. 

        * A TPP that is using the integration of another TPP that does have
        direct Open Banking API integrations.
      properties:
        Name:
          type: string
          minLength: 1
          maxLength: 50
          description: |
            The Sponsored TPP Name
        Identification:
          type: string
          minLength: 1
          maxLength: 50
          description: |
            The Sponsored TPP Identification
      additionalProperties: false
    AEPaymentConsumption:
      type: object
      description: >
        Data to track the consumption of Payments in relation to an authorized
        Consent Schedule
      required:
        - CumulativeNumberOfPayments
        - CumulativeValueOfPayments
      properties:
        CumulativeNumberOfPayments:
          type: number
          description: >
            The cumulative number of payment instructions initiated under the
            consent schedule, excluding instructions in a Rejected state.
          minLength: 1
          example: 4
        CumulativeValueOfPayments:
          description: >
            The cumulative value of payment instructions initiated under the
            consent schedule, excluding instructions in a Rejected state.

            A number of monetary units specified in an active currency where the
            unit of currency is explicit and compliant with ISO 4217."
          type: object
          required:
            - Amount
            - Currency
          properties:
            Amount:
              $ref: '#/components/schemas/AEActiveOrHistoricAmount'
            Currency:
              $ref: '#/components/schemas/AEActiveOrHistoricCurrencyCode'
        CumulativeNumberOfPaymentsInCurrentPeriod:
          type: number
          description: >
            The cumulative number of payment instructions in the current period
            initiated under the consent schedule, excluding instructions in a
            Rejected state.
          minLength: 1
          example: 1
        CumulativeValueOfPaymentsInCurrentPeriod:
          description: >
            The cumulative value of payment instructions in the current period
            initiated under the consent schedule, excluding instructions in a
            Rejected state.

            A number of monetary units specified in an active currency where the
            unit of currency is explicit and compliant with ISO 4217."
          type: object
          required:
            - Amount
            - Currency
          properties:
            Amount:
              $ref: '#/components/schemas/AEActiveOrHistoricAmount'
            Currency:
              $ref: '#/components/schemas/AEActiveOrHistoricCurrencyCode'
      additionalProperties: false
    AEServiceInitiationOpenFinanceBilling:
      type: object
      properties:
        IsLargeCorporate:
          type: boolean
          description: Customer has more than 100 million AED turnover
      description: Billing parameters specified by the LFI
      additionalProperties: false
    AEEventNotification:
      type: object
      description: |
        A Webhook Subscription Schema
      required:
        - Webhook
      properties:
        Webhook:
          description: |
            A Webhook Schema
          type: object
          properties:
            Url:
              description: |
                The TPP Callback URL being registered with the LFI
              type: string
              example: https://api.tpp.com/webhook/callbackUrl
            IsActive:
              description: >
                The TPP specifying whether the LFI should send (IsActive true)
                or not send (IsActive false) Webhook Notifications to the TPP's
                Webhook URL
              type: boolean
              example: false
          additionalProperties: false
      additionalProperties: false
    AELinksRelatedPayment:
      type: object
      description: Links relevant to the resource
      required:
        - Self
        - Related
      properties:
        Self:
          $ref: '#/components/schemas/AESelfConsent'
        Related:
          $ref: '#/components/schemas/AERelatedPayment'
      additionalProperties: false
    AEMetaMultiAuthorization:
      type: object
      description: >
        Meta Data with Multi-Authorization relevant to the payload. 

        For a payment, it represents any Authorizers within the LFI domain that
        are involved in approving the payment request.
      properties:
        MultipleAuthorizers:
          type: object
          description: Multiple Authorizers Schema
          properties:
            TotalRequired:
              description: |
                The total number of Authorizers required to process the request
              type: number
            Authorizations:
              type: array
              items:
                description: |
                  Authorizer
                type: object
                properties:
                  AuthorizerId:
                    description: |
                      The Authorizer's Identifier
                    type: string
                  AuthorizerType:
                    description: >
                      The Type of Authorizer. For example, Financial,
                      Management, etc.
                    type: string
                  AuthorizationDate:
                    description: >
                      The DateTime of when the Authorization occurred. 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:\n2023-04-05T10:43:07+00:00
                    type: string
                    format: date-time
                  AuthorizationStatus:
                    description: >
                      The Status reflecting the Authorizer's final decision
                      regarding the request
                    type: string
                    enum:
                      - Pending
                      - Approved
                      - Rejected
                additionalProperties: false
          additionalProperties: false
      additionalProperties: false
    AEError:
      description: Error
      type: object
      required:
        - Code
        - Message
      additionalProperties: false
      minProperties: 1
      properties:
        Code:
          description: Low level textual error code
          type: string
          enum:
            - AccessToken.Unauthorized
            - AccessToken.InvalidScope
            - Consent.TransientAccountAccessFailure
            - Consent.AccountTemporarilyBlocked
            - Consent.PermanentAccountAccessFailure
            - Consent.Invalid
            - Consent.BusinessRuleViolation
            - Consent.FailsControlParameters
            - Consent.InvalidUserIdentifier
            - JWS.InvalidSignature
            - JWS.Malformed
            - JWS.InvalidClaim
            - JWS.InvalidHeader
            - JWE.DecryptionError
            - JWE.InvalidHeader
            - GenericRecoverableError
            - GenericError
            - Event.UnexpectedEvent
            - Body.InvalidFormat
            - Resource.InvalidResourceId
            - Resource.InvalidFormat
        Message:
          $ref: '#/components/schemas/AEMessage'
        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
        Url:
          description: >-
            URL to help remediate the problem, or provide more information, or
            to API Reference, or help etc
          type: string
    AEChargeBearerType1Code:
      description: >-
        Specifies which party/parties will bear the charges associated with the
        processing of the payment transaction.
      type: string
      enum:
        - BorneByCreditor
        - BorneByDebtor
        - Shared
    AEExternalPaymentChargeTypeCode:
      description: Charge type, in a coded form.
      type: string
      enum:
        - VAT
        - Fees
    AEActiveCurrencyAmount:
      description: |
        The Currency and Amount relating to the Payment
      type: object
      required:
        - Amount
        - Currency
      properties:
        Amount:
          $ref: '#/components/schemas/AEActiveOrHistoricAmount'
        Currency:
          $ref: '#/components/schemas/AEActiveOrHistoricCurrencyCode'
    AERequestedExecutionDate:
      description: >
        The date when the TPP expects the LFI to execute the payment.

        The date must be in the future and cannot be on the same day or a day in
        the past. 

        The maximum date in the future that can be specified is 1 year from the
        day of the consent of the User to the TPP. 

        All dates in the JSON payloads are represented in ISO 8601 date format.
      type: string
      format: date
    AEMaximumCumulativeValueOfPayments:
      description: >
        The maximum cumulative value of all successful payment rails executions
        under the Consent. 

        Each successful payment rails execution amount (related to the Consent)
        is added to the total cumulative value of the Consent which cannot
        exceed the maximum value agreed with the User at the point of consent.
      type: object
      required:
        - Amount
        - Currency
      properties:
        Amount:
          $ref: '#/components/schemas/AEActiveOrHistoricAmount'
        Currency:
          $ref: '#/components/schemas/AEActiveOrHistoricCurrencyCode'
    AEMaximumCumulativeNumberOfPayments:
      type: integer
      description: >
        The maximum cumulative number of all successful payment rails executions
        under the Consent. 

        Each successful payment rails execution (related to the Consent) is
        added to the total cumulative number of payments for the Consent which
        cannot exceed the maximum value agreed with the User at the point of
        consent.
    AEFixedDefinedSchedule:
      type: object
      description: >
        Payment Schedule denoting a list of pre-defined future dated payments
        all with fixed amounts and dates.
      additionalProperties: false
      required:
        - Schedule
        - Type
      properties:
        Type:
          type: string
          description: The Periodic Schedule Type
          enum:
            - FixedDefinedSchedule
        Schedule:
          type: array
          minItems: 1
          maxItems: 53
          uniqueItems: false
          items:
            type: object
            additionalProperties: false
            required:
              - PaymentExecutionDate
              - Amount
            properties:
              PaymentExecutionDate:
                $ref: '#/components/schemas/AEPaymentExecutionDate'
              Amount:
                $ref: '#/components/schemas/AEActiveCurrencyAmount'
    AEVariableDefinedSchedule:
      type: object
      description: >
        Payment Schedule denoting a list of pre-defined future dated payments
        all with variable amounts and dates.
      additionalProperties: false
      required:
        - Schedule
        - Type
      properties:
        Type:
          type: string
          description: The Periodic Schedule Type
          enum:
            - VariableDefinedSchedule
        Schedule:
          type: array
          minItems: 1
          maxItems: 53
          uniqueItems: false
          items:
            type: object
            additionalProperties: false
            required:
              - PaymentExecutionDate
              - MaximumIndividualAmount
            properties:
              PaymentExecutionDate:
                $ref: '#/components/schemas/AEPaymentExecutionDate'
              MaximumIndividualAmount:
                $ref: '#/components/schemas/AEMaximumIndividualAmount'
    AEFixedPeriodicSchedule:
      description: >
        Payment Controls that apply to all payment instructions in a given
        period under this payment consent.

        The payments for this consent must be executed only on the
        PeriodStartDate, and

        dates recurring based on the PeriodType.
      type: object
      additionalProperties: false
      required:
        - PeriodType
        - PeriodStartDate
        - Amount
        - Type
      properties:
        Type:
          type: string
          description: The Periodic Schedule Type
          enum:
            - FixedPeriodicSchedule
        PeriodType:
          $ref: '#/components/schemas/AEPeriodType'
        PeriodStartDate:
          $ref: '#/components/schemas/AEPeriodStartDate'
        Amount:
          $ref: '#/components/schemas/AEActiveCurrencyAmount'
    AEVariablePeriodicSchedule:
      description: >
        Payment Controls that apply to all payment instructions in a given
        period under this payment consent.

        The payments for this consent must be executed only on the
        PeriodStartDate, and

        dates recurring based on the PeriodType.
      type: object
      additionalProperties: false
      required:
        - PeriodType
        - PeriodStartDate
        - Type
        - MaximumIndividualAmount
      properties:
        Type:
          type: string
          description: The Periodic Schedule Type
          enum:
            - VariablePeriodicSchedule
        PeriodType:
          $ref: '#/components/schemas/AEPeriodType'
        PeriodStartDate:
          $ref: '#/components/schemas/AEPeriodStartDate'
        MaximumIndividualAmount:
          $ref: '#/components/schemas/AEMaximumIndividualAmount'
    AEFixedOnDemand:
      description: >
        Payment Controls that apply to all payment instructions in a given
        period under this payment consent.

        The payments for this consent may be executed on any date, as long as
        they are within the Controls for a PeriodType
      type: object
      additionalProperties: false
      required:
        - PeriodType
        - PeriodStartDate
        - Amount
        - Type
        - Controls
      properties:
        Type:
          type: string
          description: The Periodic Schedule Type
          enum:
            - FixedOnDemand
        PeriodType:
          $ref: '#/components/schemas/AEPeriodType'
        PeriodStartDate:
          $ref: '#/components/schemas/AEPeriodStartDate'
        Amount:
          $ref: '#/components/schemas/AEActiveCurrencyAmount'
        Controls:
          type: object
          minProperties: 1
          additionalProperties: false
          properties:
            MaximumCumulativeValueOfPaymentsPerPeriod:
              $ref: >-
                #/components/schemas/AEPeriodTypeMaximumCumulativeValueOfPayments
            MaximumCumulativeNumberOfPaymentsPerPeriod:
              $ref: >-
                #/components/schemas/AEPeriodTypeMaximumCumulativeNumberOfPayments
    AEVariableOnDemand:
      description: >
        Payment Controls that apply to all payment instructions in a given
        period under this payment consent.

        The payments for this consent may be executed on any date, as long as
        they are within the Controls for a PeriodType
      type: object
      additionalProperties: false
      required:
        - Type
        - PeriodType
        - PeriodStartDate
        - Controls
      properties:
        Type:
          type: string
          description: The Periodic Schedule Type
          enum:
            - VariableOnDemand
        PeriodType:
          $ref: '#/components/schemas/AEPeriodType'
        PeriodStartDate:
          $ref: '#/components/schemas/AEPeriodStartDate'
        Controls:
          type: object
          minProperties: 1
          additionalProperties: false
          properties:
            MaximumIndividualAmount:
              $ref: '#/components/schemas/AEMaximumIndividualAmount'
            MaximumCumulativeValueOfPaymentsPerPeriod:
              $ref: >-
                #/components/schemas/AEPeriodTypeMaximumCumulativeValueOfPayments
            MaximumCumulativeNumberOfPaymentsPerPeriod:
              $ref: >-
                #/components/schemas/AEPeriodTypeMaximumCumulativeNumberOfPayments
    AEFileType:
      type: string
      description: Specifies the payment file type
      minLength: 1
      maxLength: 40
    AEFileHash:
      type: string
      description: A base64 encoding of a SHA256 hash of the file to be uploaded.
      minLength: 1
      maxLength: 44
    AEReference:
      description: |
        A reason or reference in relation to a payment. 
      type: string
      minLength: 1
      maxLength: 120
    AEFileNumberOfTransactions:
      type: integer
      description: "Number of individual transactions contained in the payment information group.\t\n"
    AEControlSum:
      description: >
        Total of all individual amounts included in the group, irrespective of
        currencies.
      type: string
      pattern: ^\d{1,16}\.\d{2}$
      example: '100.00'
    AEActiveOrHistoricAmount:
      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,16}\.\d{2}$
      example: '100.00'
    AEActiveOrHistoricCurrencyCode:
      description: >-
        A 3 character alphabetic code allocated to a currency under an
        international currency 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: AED
    AESelfConsent:
      description: A link to the related payment consents resource
      type: string
      format: uri
      example: >-
        https://api.lfi.sa/open-banking/payment/2023.11.01-final/payment-consents/aac-69255d98-ab0e-4758-92a7-cacbf3073efa
    AERelatedPayment:
      description: >
        A link to the related payments resource. 


        * For a Single Payment, this Array must have have 1 entry, associated
        with the Single Payment resource created against this consent. 

        * For Multi-Payment, this Array will have 1 or more entries of all the
        Payment resources created against this Consent
      type: array
      items:
        type: string
      example: []
    AEMessage:
      description: >-
        A description of the error that occurred. e.g., 'A mandatory field isn't
        supplied' or 'RequestedExecutionDate must be in future'

        UAEOF doesn't standardise this field
      type: object
      required:
        - en
      properties:
        en:
          type: string
          description: English value of the string
          minLength: 1
          maxLength: 500
        ar:
          type: string
          description: Arabic value of the string
          minLength: 1
          maxLength: 500
      additionalProperties: false
    AEPaymentExecutionDate:
      description: |
        Used to specify the expected payment execution date/time.
        All dates in the JSON payloads are represented in ISO 8601 date format.
        An example is: 2023-04-05
      type: string
      format: date
    AEMaximumIndividualAmount:
      description: |
        This is the Maximum amount a variable payment can take per period.
      type: object
      required:
        - Amount
        - Currency
      properties:
        Amount:
          $ref: '#/components/schemas/AEActiveOrHistoricAmount'
        Currency:
          $ref: '#/components/schemas/AEActiveOrHistoricCurrencyCode'
    AEPeriodType:
      type: string
      description: >
        |Period Type|Description| 

        |-----------|-----------| 

        |Day|A continuous period of time, consisting of 24 consecutive hours,
        starting from midnight (00:00:00) and finishing at 23:59:59 of the same
        day. |

        |Week|A continuous period of time, consisting of seven consecutive days,
        starting from midnight (00:00:00) and finishing at 23:59:59 of the 7th
        day. |

        |Month|A continuous period of time starting from midnight (00:00:00) of
        the first day of a month and finishing at 23:59:59 of the last day of
        that month.|

        |Year|A continuous period of time, consisting of 12 months.|
      enum:
        - Day
        - Week
        - Month
        - Year
    AEPeriodStartDate:
      type: string
      description: |
        Specifies the start date of when a payment schedule begins.
      format: date
    AEPeriodTypeMaximumCumulativeValueOfPayments:
      description: >
        The maximum cumulative payment value of all payment initiations per
        Period Type.
      type: object
      required:
        - Amount
        - Currency
      properties:
        Amount:
          $ref: '#/components/schemas/AEActiveOrHistoricAmount'
        Currency:
          $ref: '#/components/schemas/AEActiveOrHistoricCurrencyCode'
    AEPeriodTypeMaximumCumulativeNumberOfPayments:
      type: integer
      description: |
        The maximum frequency of payment initiations per Period Type.
  examples:
    Error400BadRequestSigned:
      summary: 400 Bad Request
      description: 400 Bad Request
      value:
        iss: c50f0152-49bb-4dc4-b866-b625271c4e78
        exp: 3349494246
        nbf: 1675765189
        aud:
          - e63df191-5fff-4e9c-bba2-b273c94e87f0
        iat: 1675765189
        message:
          Errors:
            - Code: GenericError
              Message:
                en: A mandatory field is missing.
    Error403ForbiddenSigned:
      summary: 403 Forbidden
      description: 403 Forbidden
      value:
        iss: c50f0152-49bb-4dc4-b866-b625271c4e78
        exp: 3349494246
        nbf: 1675765189
        aud:
          - e63df191-5fff-4e9c-bba2-b273c94e87f0
        iat: 1675765189
        message:
          Errors:
            - Code: AccessToken.InvalidScope
              Message:
                en: >-
                  The access token did not have an appropriate scope attached to
                  it.
    Error500InternalServerErrorSigned:
      summary: 500 Internal Server Error
      description: 500 Internal Server Error
      value:
        iss: c50f0152-49bb-4dc4-b866-b625271c4e78
        exp: 3349494246
        nbf: 1675765189
        aud:
          - e63df191-5fff-4e9c-bba2-b273c94e87f0
        iat: 1675765189
        message:
          Errors:
            - Code: GenericError
              Message:
                en: >-
                  An Internal Server error has occurred. Please retry in 60
                  seconds.
  securitySchemes:
    TPPOAuth2Security:
      type: oauth2
      description: >-
        TPP confidential client authorization with the LFI to stage a consent.
        **Please refer to [OpenID FAPI Security Profile 1.0 -Part 2
        Advanced](https://openid.net/specs/openid-financial-api-part-2-1_0.html#authorization-server)
        - 5.2.2 point 14 - shall authenticate the confidential client using one
        of the following methods private_key_jwt and [OpenID Connect Core
        1.0](https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication)
        9. Client Authentication private_key_jwt**
      flows:
        clientCredentials:
          tokenUrl: https://authserver.example/token
          scopes:
            openid: Activates OpenID Connect Support
            payments: Ability for accessing payments.
            accounts: Ability for accessing account information.

````