openapi: 3.0.0
info:
  title: UAE Payment API
  description: '## UAE Open Finance Payment API Specification'
  version: v2.1-errata3
servers:
  - url: /open-finance/payment/v2.2
tags:
  - name: Consent
    description: Consent operations
  - name: Payment Initiation
    description: Payment Initiation operations
  - name: Bulk/Batch
    description: Bulk/Batch operations
paths:
  /payment-consents:
    get:
      tags:
        - Consent
      summary: Retrieve Linked Payment Consents
      description: Retrieve all Payment Consents linked by a given `BaseConsentId`, as part of a linked consent group.
      operationId: RetrievePaymentConsentsByBaseConsentId
      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/baseConsentId'
      responses:
        '200':
          $ref: '#/components/responses/200BaseConsentIdConsentsRetrieve'
        '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
  /payment-consents/{ConsentId}:
    get:
      tags:
        - Consent
      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
    patch:
      tags:
        - Consent
      summary: Modify a Payment Consent
      description: Modify a Payment Consent
      operationId: PatchPaymentConsent
      parameters:
        - $ref: '#/components/parameters/authorization'
        - $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-request'
        - $ref: '#/components/parameters/x-customer-user-agent'
      requestBody:
        description: |
          Request Body
        content:
          application/jwt:
            schema:
              $ref: '#/components/schemas/AEPatchPaymentConsentSigned'
      responses:
        '204':
          $ref: '#/components/responses/204NoContent'
        '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:
        - TPPOAuth2Security:
            - openid
            - payments
  /payment-consents/{ConsentId}/refund:
    get:
      tags:
        - Consent
      summary: Retrieve Refund Details
      description: Retrieve a Payment Consent
      operationId: RetrievePaymentConsentRefund
      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/200PaymentConsentRefundRetrieve'
        '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
  /payment-consents/{ConsentId}/file:
    post:
      tags:
        - Consent
      summary: Upload Bulk/Batch Payment Instruction
      description: Upload a list of Bulk/Batch payment instructions.
      operationId: UploadFilePaymentConsent
      parameters:
        - $ref: '#/components/parameters/ConsentId'
        - $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/x-idempotency-key'
      requestBody:
        description: |
          Request Body
        content:
          '*/*':
            schema:
              type: string
              description: Accepts any content type.
      responses:
        '200':
          $ref: '#/components/responses/200NoContent'
        '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:
        - TPPOAuth2Security:
            - openid
            - payments
  /payments:
    post:
      tags:
        - Payment Initiation
      summary: Create a Payment
      description: |
        Create a Payment
      operationId: CreatePayment
      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/x-idempotency-key'
        - $ref: '#/components/parameters/x-consent-id'
      requestBody:
        description: |
          Request Body
        content:
          application/jwt:
            schema:
              $ref: '#/components/schemas/AEPaymentRequestSigned'
      responses:
        '201':
          $ref: '#/components/responses/201PaymentId'
        '400':
          $ref: '#/components/responses/400Error'
        '401':
          $ref: '#/components/responses/401Error'
        '403':
          $ref: '#/components/responses/403Error'
        '405':
          $ref: '#/components/responses/405Error'
        '406':
          $ref: '#/components/responses/406Error'
        '409':
          $ref: '#/components/responses/409Error'
        '415':
          $ref: '#/components/responses/415Error'
        '429':
          $ref: '#/components/responses/429Error'
        '500':
          $ref: '#/components/responses/500Error'
      security:
        - UserOAuth2Security:
            - openid
            - payments
    get:
      tags:
        - Payment Initiation
      summary: Query for a PaymentId
      description: >
        Lookup the Payments Resource using the x-idempotency-key. If an idempotency key is matched the `Links` object
        will be returned with the `Self` value populated. This will provide a pointer to the correct resource.


        This is an alternative way for TPPs to obtain the response to a payment initiation operation where they did not
        receive any response body from the LFI (due to network error or timeout).
      operationId: QueryPaymentResource
      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/x-idempotency-key'
      responses:
        '200':
          $ref: '#/components/responses/200IdempotencyKeyQuery'
        '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:
        - TPPOAuth2Security:
            - openid
            - payments
  /payments/{PaymentId}:
    get:
      tags:
        - Payment Initiation
      summary: Retrieve a Payment
      description: |
        Retrieve a Payment
      operationId: RetrievePayment
      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/PaymentId'
      responses:
        '200':
          $ref: '#/components/responses/200PaymentId'
        '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
  /file-payments:
    post:
      tags:
        - Bulk/Batch
      summary: Create a Bulk/Batch Payment
      description: |
        Create a Bulk/Batch Payment
      operationId: CreateFilePayment
      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/x-idempotency-key'
      requestBody:
        description: |
          Request Body
        content:
          application/jwt:
            schema:
              $ref: '#/components/schemas/AEFilePaymentRequestSigned'
      responses:
        '201':
          $ref: '#/components/responses/201FilePaymentId'
        '400':
          $ref: '#/components/responses/400Error'
        '401':
          $ref: '#/components/responses/401Error'
        '403':
          $ref: '#/components/responses/403Error'
        '405':
          $ref: '#/components/responses/405Error'
        '406':
          $ref: '#/components/responses/406Error'
        '409':
          $ref: '#/components/responses/409Error'
        '415':
          $ref: '#/components/responses/415Error'
        '429':
          $ref: '#/components/responses/429Error'
        '500':
          $ref: '#/components/responses/500Error'
      security:
        - UserOAuth2Security:
            - openid
            - payments
    get:
      tags:
        - Bulk/Batch
      summary: Query for a Bulk/Batch PaymentId
      description: >
        Lookup the Payments Resource using the x-idempotency-key. If an idempotency key is matched the `Links` object
        will be returned with the `Self` value populated. This will provide a pointer to the correct resource.


        This is an alternative way for TPPs to obtain the response to a payment initiation operation where they did not
        receive any response body from the LFI (due to network error or timeout).
      operationId: QueryFilePaymentResource
      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/x-idempotency-key'
      responses:
        '200':
          $ref: '#/components/responses/200IdempotencyKeyQuery'
        '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:
        - TPPOAuth2Security:
            - openid
            - payments
  /file-payments/{PaymentId}:
    get:
      tags:
        - Bulk/Batch
      summary: Retrieve a Bulk/Batch Payment
      description: |
        Retrieve a Bulk/Batch Payment
      operationId: RetrieveFilePayment
      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/PaymentId'
      responses:
        '200':
          $ref: '#/components/responses/200FilePaymentId'
        '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
  /file-payments/{PaymentId}/report:
    get:
      tags:
        - Bulk/Batch
      summary: Retrieve a Bulk/Batch Payment Report
      description: Retrieve a Bulk/Batch Payment Report
      operationId: RetrieveFilePaymentReport
      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/PaymentId'
      responses:
        '200':
          $ref: '#/components/responses/200FilePaymentsFilePaymentIdReportFile'
        '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:
  headers:
    Location:
      description: URI location to the created resource
      required: true
      schema:
        type: string
        maxLength: 40
    x-fapi-interaction-id:
      required: true
      description: An RFC4122 UID used as a correlation id.
      schema:
        type: string
      example: 49df2c2c-6b80-40ee-96a1-71910a248048
    x-idempotency-key-consent:
      description: Ensures the LFI processes the resource successfully only once per x-idempotency-key
      schema:
        type: string
        maxLength: 40
        pattern: ^(\S*)$
      example: 78dae4513b8847f98e2d4173b4ed0eb6
  responses:
    400Error:
      description: Bad request
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/AEError400ResponseSigned'
          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/AEError403ResponseSigned'
          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'
    409Error:
      description: Conflict
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/AEError409ResponseSigned'
    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/AEError500ResponseSigned'
          examples:
            Internal Server Error:
              $ref: '#/components/examples/Error500InternalServerErrorSigned'
    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'
    200PaymentConsentRefundRetrieve:
      description: Payment Consent Retrieve
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/AEPaymentConsentRefundResponseSigned'
    200BaseConsentIdConsentsRetrieve:
      description: Retrieve Payment Consents by BaseConsentId
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/AEPaymentConsentsByBaseConsentIdResponseSigned'
    201PaymentId:
      description: Payment Id
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
        x-idempotency-key:
          $ref: '#/components/headers/x-idempotency-key-consent'
        Location:
          $ref: '#/components/headers/Location'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/AEPaymentIdResponseSigned'
    201FilePaymentId:
      description: File Payment Id
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
        x-idempotency-key:
          $ref: '#/components/headers/x-idempotency-key-consent'
        Location:
          $ref: '#/components/headers/Location'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/AEFilePaymentIdResponseSigned'
    200PaymentId:
      description: Payment Id
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/AEPaymentIdResponseSigned'
    200FilePaymentId:
      description: File Payment Id
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/AEFilePaymentIdResponseSigned'
    204NoContent:
      description: No Content
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
    200IdempotencyKeyQuery:
      description: Provides a link to the resource created with the matching `x-idempotency-key` value
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/AEIdempotencyKeyQuery'
    200NoContent:
      description: 200 OK No Content
      headers:
        x-fapi-interaction-id:
          $ref: '#/components/headers/x-fapi-interaction-id'
    200FilePaymentsFilePaymentIdReportFile:
      description: File Payments Read
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          required: true
          schema:
            type: string
      content:
        '*/*':
          schema:
            type: string
            description: Any content type.
  schemas:
    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
    AEPaymentConsentResponseSigned:
      description: |
        Payment Consent Response Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/AEBankServiceInitiationConsentStatusV21.AEBankServiceInitiationConsentProperties'
          required:
            - message
    AEPaymentConsentRefundResponseSigned:
      description: |
        Payment Consent Response Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/AEPaymentConsentRefundResponse'
          required:
            - message
    AEPaymentConsentsByBaseConsentIdResponseSigned:
      description: |
        Payment Consents By BaseConsentId Response Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              type: array
              items:
                $ref: '#/components/schemas/AEBankServiceInitiationConsentStatusV21.AEBankServiceInitiationConsentProperties'
          required:
            - message
    AEPaymentIdResponseSigned:
      description: |
        Payment Response Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/AEPaymentIdResponse'
          required:
            - message
    AEFilePaymentIdResponseSigned:
      description: |
        Payment Response Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/AEFilePaymentIdResponse'
          required:
            - message
    AEPaymentRequestSigned:
      description: |
        Payment Request Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/AEPaymentRequest'
          required:
            - message
    AEFilePaymentRequestSigned:
      description: |
        Payment Request Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/AEFilePaymentRequest'
          required:
            - message
    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
    AEError400ResponseSigned:
      description: |
        Error Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/AEError400Response'
          required:
            - message
    AEError403ResponseSigned:
      description: |
        Error Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/AEError403Response'
          required:
            - message
    AEError409ResponseSigned:
      description: |
        Error Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/AEError409Response'
          required:
            - message
    AEError500ResponseSigned:
      description: |
        Error Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/AEError500Response'
          required:
            - message
    AEError400Response:
      description: An array of detail error codes, and messages, and URLs to documentation to help remediation.
      type: object
      properties:
        Errors:
          items:
            $ref: '#/components/schemas/AEError400'
          type: array
          minItems: 1
      required:
        - Errors
      additionalProperties: false
    AEError403Response:
      description: An array of detail error codes, and messages, and URLs to documentation to help remediation.
      type: object
      properties:
        Errors:
          items:
            $ref: '#/components/schemas/AEError403'
          type: array
          minItems: 1
      required:
        - Errors
      additionalProperties: false
    AEError409Response:
      description: An array of detail error codes, and messages, and URLs to documentation to help remediation.
      type: object
      properties:
        Errors:
          items:
            $ref: '#/components/schemas/AEError409'
          type: array
          minItems: 1
      required:
        - Errors
      additionalProperties: false
    AEError500Response:
      description: An array of detail error codes, and messages, and URLs to documentation to help remediation.
      type: object
      properties:
        Errors:
          items:
            $ref: '#/components/schemas/AEError500'
          type: array
          minItems: 1
      required:
        - Errors
      additionalProperties: false
    AEMessage:
      type: string
      minLength: 1
      maxLength: 500
      description: >-
        A description of the error that occurred. e.g., 'A mandatory field isn't supplied' or
        'RequestedExecutionDateTime must be in future'

        This field is not standardised
    AERejectReason:
      description: Rejection Reason
      type: object
      required:
        - Code
        - Message
      additionalProperties: false
      properties:
        Code:
          description: >
            Rejected Reason Code is a namespaced rejection reason code. The first part of the code is the namespace,
            which is the name of the organisation or system (e.g., AANI) that is rejecting the payment, and the second
            part is the specific rejection reason code for the originating organisation or system.

            Payments that are rejected by AANI will have the AANI prefix, followed by the specific ANNI reason code.


            The Payment resouce is updated with the rejection reason code if a Rejected payment is initially created in
            a Pending state. 

            If the Payment resource is rejected, and no Payment resource is created - a 4xx HTTP status code is returned
            to the TPP with the appropriate Error Response.
          type: string
          pattern: ^[A-Za-z]+\.[A-Za-z0-9]+$
        Message:
          $ref: '#/components/schemas/AEMessage'
    AEError400:
      description: Error
      type: object
      required:
        - Code
        - Message
      additionalProperties: false
      properties:
        Code:
          $ref: '#/components/schemas/AEError400Code'
        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
    AEError400Code:
      description: >-
        Error Code. This may either be one of the prescribed Error Code(s) or a namespaced Error Code where the
        namespace is the system or organisation that has responded with the error, and the code is the code specific to
        the system or organisation.
      type: string
      anyOf:
        - enum:
            - 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.InvalidFormat
        - pattern: ^[A-Za-z]+\.[A-Za-z0-9]+$
    AEError403:
      description: Error
      type: object
      required:
        - Code
        - Message
      additionalProperties: false
      properties:
        Code:
          $ref: '#/components/schemas/AEError403Code'
        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
    AEError403Code:
      description: >-
        Error Code. This may either be one of the prescribed Error Code(s) or a namespaced Error Code where the
        namespace is the system or organisation that has responded with the error, and the code is the code specific to
        the system or organisation.
      type: string
      anyOf:
        - enum:
            - AccessToken.InvalidScope
            - Consent.TransientAccountAccessFailure
            - Consent.AccountTemporarilyBlocked
            - Consent.PermanentAccountAccessFailure
            - GenericRecoverableError
            - GenericError
        - pattern: ^[A-Za-z]+\.[A-Za-z0-9]+$
    AEError409:
      description: Error
      type: object
      required:
        - Code
        - Message
      additionalProperties: false
      properties:
        Code:
          $ref: '#/components/schemas/AEError409Code'
        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
    AEError409Code:
      description: >-
        Error Code. This may either be one of the prescribed Error Code(s) or a namespaced Error Code where the
        namespace is the system or organisation that has responded with the error, and the code is the code specific to
        the system or organisation.
      type: string
      anyOf:
        - enum:
            - GenericRecoverableError
            - GenericError
        - pattern: ^[A-Za-z]+\.[A-Za-z0-9]+$
    AEError500:
      description: Error
      type: object
      required:
        - Code
        - Message
      additionalProperties: false
      properties:
        Code:
          $ref: '#/components/schemas/AEError500Code'
        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
    AEError500Code:
      description: >-
        Error Code. This may either be one of the prescribed Error Code(s) or a namespaced Error Code where the
        namespace is the system or organisation that has responded with the error, and the code is the code specific to
        the system or organisation.
      type: string
      anyOf:
        - enum:
            - GenericRecoverableError
            - GenericError
        - pattern: ^[A-Za-z]+\.[A-Za-z0-9]+$
    AELinksSelf:
      type: object
      description: Links relevant to the resource
      required:
        - Self
      properties:
        Self:
          $ref: '#/components/schemas/AESelf'
      additionalProperties: false
    AELinksRelatedConsent:
      type: object
      description: Links relevant to the resource
      required:
        - Self
        - Related
      properties:
        Self:
          $ref: '#/components/schemas/AERelatedSinglePayment'
        Related:
          $ref: '#/components/schemas/AESelfConsent'
      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
    AEMeta:
      type: object
      description: Meta Data relevant to the resource
      additionalProperties: false
    AESelf:
      description: A link to the current resource
      type: string
      format: uri
    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
    AERelatedSinglePayment:
      type: string
      format: uri
      description: A link to the current payment resource
      example: https://api.lfi.sa/open-banking/payment/2023.11.01-final/payments/83b47199-90c2-4c05-9ef1-aeae68b0fc7c
    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: []
    AEPaymentId:
      description: An API specific unique identification as assigned by the LFI to identify the domestic Payment resource.
      type: string
      minLength: 1
      maxLength: 40
      example: 83b47199-90c2-4c05-9ef1-aeae68b0fc7c
    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
    AEPaymentStatus:
      description: >
        Specifies the status of the payment information group

        * Pending: Payment initiation or individual transaction included in the payment initiation is pending. Further
        checks and status update will be performed.

        * Rejected: The payment initiation has been rejected

        * AcceptedSettlementCompleted: Settlement of the Debtor's account has been completed

        * AcceptedCreditSettlementCompleted: When the Creditor account has been credited with the funds of the payment
        initiated via the TPP

        * AcceptedWithoutPosting:  When the Recipient Bank has accepted the payment but has not applied the credit to
        the Creditor account yet.
      type: string
      enum:
        - Pending
        - AcceptedSettlementCompleted
        - AcceptedCreditSettlementCompleted
        - AcceptedWithoutPosting
        - Rejected
      example: Pending
    AEFilePaymentStatus:
      description: |
        Specifies the status of the payment information group
        * Received: The file payment has been received.
        * Rejected: The file payment has been rejected.
      type: string
      enum:
        - Received
        - Rejected
      example: Received
    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
    AEPatchConsentStatus:
      description: |
        Specifies the authorization statuses of a consent.

        | Consent Status| State Type| Description|
        |---------------|-----------|------|
        | Revoked | Terminal | The consent has been revoked at the TPP.|
      type: string
      enum:
        - Revoked
    AEJWEPaymentPII:
      type: string
      description: >
        A JSON Web Encryption (JWE) object, which encapsulates a JWS. The value is a compact serialization of a JWE,
        which is a string consisting of five base64url-encoded parts joined by dots. 

        It encapsulates encrypted content using JSON data structures. The decrypted JWS content has the structure of the
        AEPaymentPII schema.
      example: eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ....
    AEPaymentRequest:
      description: |
        Payment Request Schema
      type: object
      additionalProperties: false
      required:
        - Data
      properties:
        Data:
          type: object
          additionalProperties: false
          required:
            - ConsentId
            - Instruction
            - PaymentPurposeCode
            - OpenFinanceBilling
          properties:
            ConsentId:
              $ref: '#/components/schemas/AEPushedAuthorizationRequests.AEConsentId'
            Instruction:
              $ref: '#/components/schemas/AEPaymentInstruction'
            CurrencyRequest:
              $ref: '#/components/schemas/AECurrencyRequest'
            PersonalIdentifiableInformation:
              description: >-
                Personal Identifiable Information, represented in both encoded and decoded form using a `anyOf`, to help
                implementers readily understand both the structure and serialized form of the property. Schema Objects
                are provided for both Domestic and International payments.


                **Implementations MUST reflect the AEJWEPaymentPII Schema Object structure and the notes provided on**
                **implementing a JWS and JWE.**


                **The decoded form AEPaymentPII is for guidance on content only.**
              anyOf:
                - $ref: '#/components/schemas/AEBankServiceInitiation.AEDomesticPaymentPIIProperties'
                - $ref: '#/components/schemas/AEBankServiceInitiation.AEInternationalPaymentPIIProperties'
                - $ref: '#/components/schemas/AEJWEPaymentPII'
            PaymentPurposeCode:
              $ref: '#/components/schemas/AEPaymentPurposeCode'
            DebtorReference:
              $ref: '#/components/schemas/AEDebtorReference'
            CreditorReference:
              $ref: '#/components/schemas/AECreditorReference'
            OpenFinanceBilling:
              $ref: '#/components/schemas/AEServiceInitiationOpenFinancePaymentBilling'
    AEFilePaymentRequest:
      description: |
        File Payment Request Schema
      type: object
      additionalProperties: false
      required:
        - Data
      properties:
        Data:
          type: object
          additionalProperties: false
          required:
            - ConsentId
            - PaymentPurposeCode
          properties:
            ConsentId:
              $ref: '#/components/schemas/AEPushedAuthorizationRequests.AEConsentId'
            Instruction:
              $ref: '#/components/schemas/AEPushedAuthorizationRequests.AEBankServiceInitiationFilePaymentConsent'
            PaymentPurposeCode:
              $ref: '#/components/schemas/AEPaymentPurposeCode'
            DebtorReference:
              $ref: '#/components/schemas/AEDebtorReference'
    AEBankServiceInitiationRichAuthorizationRequests.AECreditorAgentProperties:
      type: object
      required:
        - SchemeName
        - Identification
      properties:
        SchemeName:
          type: string
          description: >
            The identification scheme for uniquely identifying the Agent.

            * BICFI: The BIC/SWIFT Code

            * Other: Identifier based on non-SWIFT payment system or local market scheme.
          enum:
            - BICFI
            - Other
        Identification:
          description: Identifier that can be the BIC/SWIFT code or target payment scheme identifier.
          type: string
        Name:
          description: Name by which an agent is known and which is usually used to identify that agent.
          type: string
          minLength: 1
          maxLength: 140
        PostalAddress:
          $ref: '#/components/schemas/AEAddress'
      description: >-
        Properties of the Creditor Agent, which provides information on the Financial Institution that holds the
        Creditor Account.
      additionalProperties: false
    AEPaymentConsentRefundResponse:
      description: |
        Payment Consent Refund Response Schema
      type: object
      additionalProperties: false
      required:
        - Data
        - Links
      properties:
        Data:
          type: object
          additionalProperties: false
          required:
            - ConsentId
            - RefundAccount
          properties:
            ConsentId:
              $ref: '#/components/schemas/AEPushedAuthorizationRequests.AEConsentId'
            BaseConsentId:
              $ref: '#/components/schemas/AEPushedAuthorizationRequests.AEBaseConsentId'
            RefundAccount:
              $ref: '#/components/schemas/AEDebtorAccount'
        Links:
          $ref: '#/components/schemas/AELinksRelatedPayment'
    AEPaymentIdResponse:
      description: |
        Payment Id Response Schema
      type: object
      additionalProperties: false
      required:
        - Data
        - Links
      properties:
        Data:
          type: object
          additionalProperties: false
          required:
            - PaymentId
            - ConsentId
            - Status
            - StatusUpdateDateTime
            - Instruction
            - CreationDateTime
            - PaymentPurposeCode
            - OpenFinanceBilling
          properties:
            PaymentId:
              $ref: '#/components/schemas/AEPaymentId'
            ConsentId:
              $ref: '#/components/schemas/AEPushedAuthorizationRequests.AEConsentId'
            PaymentTransactionId:
              $ref: '#/components/schemas/AEPaymentTransactionId'
            Status:
              $ref: '#/components/schemas/AEPaymentStatus'
            StatusUpdateDateTime:
              $ref: '#/components/schemas/AEStatusUpdateDateTime'
            RejectReasonCode:
              items:
                $ref: '#/components/schemas/AERejectReason'
              type: array
              minItems: 1
            CreationDateTime:
              $ref: '#/components/schemas/AECreationDateTime'
            Charges:
              $ref: '#/components/schemas/AECharges'
            ExchangeRate:
              $ref: '#/components/schemas/AEExchangeRateInformation'
            CurrencyRequest:
              $ref: '#/components/schemas/AECurrencyRequest'
            Instruction:
              $ref: '#/components/schemas/AEPaymentInstruction'
            PaymentPurposeCode:
              $ref: '#/components/schemas/AEPaymentPurposeCode'
            DebtorReference:
              $ref: '#/components/schemas/AEDebtorReference'
            OpenFinanceBilling:
              $ref: '#/components/schemas/AEServiceInitiationOpenFinancePaymentBilling'
        Links:
          $ref: '#/components/schemas/AELinksRelatedConsent'
        Meta:
          $ref: '#/components/schemas/AEMeta'
    AEFilePaymentIdResponse:
      description: |
        Payment Id Response Schema
      type: object
      additionalProperties: false
      required:
        - Data
        - Links
      properties:
        Data:
          type: object
          additionalProperties: false
          required:
            - PaymentId
            - ConsentId
            - Status
            - StatusUpdateDateTime
            - CreationDateTime
            - Instruction
            - PaymentPurposeCode
          properties:
            PaymentId:
              $ref: '#/components/schemas/AEPaymentId'
            ConsentId:
              $ref: '#/components/schemas/AEPushedAuthorizationRequests.AEConsentId'
            Status:
              $ref: '#/components/schemas/AEFilePaymentStatus'
            StatusUpdateDateTime:
              $ref: '#/components/schemas/AEStatusUpdateDateTime'
            RejectReasonCode:
              items:
                $ref: '#/components/schemas/AERejectReason'
              type: array
              minItems: 1
            CreationDateTime:
              $ref: '#/components/schemas/AECreationDateTime'
            Charges:
              $ref: '#/components/schemas/AECharges'
            Instruction:
              $ref: '#/components/schemas/AEPushedAuthorizationRequests.AEBankServiceInitiationFilePaymentConsent'
            PaymentPurposeCode:
              $ref: '#/components/schemas/AEPaymentPurposeCode'
            OpenFinanceBilling:
              $ref: '#/components/schemas/AEServiceInitiationOpenFinanceFilePaymentBilling'
        Links:
          $ref: '#/components/schemas/AELinksRelatedConsent'
        Meta:
          $ref: '#/components/schemas/AEMeta'
    AEPaymentInstruction:
      type: object
      additionalProperties: false
      required:
        - Amount
      description: >-
        The Initiation payload is sent by the initiating party to the LFI. It is used to request movement of funds from
        the debtor account to a creditor for a single payment.
      properties:
        Amount:
          $ref: '#/components/schemas/AEActiveCurrencyAmount'
    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'
    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
    AEExternalAccountIdentificationCode:
      description: Name of the identification scheme, in a coded form as published in an external list.
      type: string
      enum:
        - IBAN
    AEBankServiceInitiationRichAuthorizationRequests.AECreditorExternalAccountIdentificationCode:
      type: string
      enum:
        - IBAN
        - AccountNumber
      description: >-
        Name of the identification scheme, in a coded form as published in an external list. For international payments
        TPP may use `IBAN`, but must use `AccountNumber` where a local scheme is used to identify the Creditor Account.
    AEIdentification:
      description: |
        Identification for the account assigned by the LFI based on the Account Scheme Name. 
        This identification is known by the User account owner.
      type: string
      minLength: 1
    AEBankServiceInitiationRichAuthorizationRequests.AEName:
      type: object
      properties:
        en:
          type: string
          maxLength: 70
          description: English value of the string
        ar:
          type: string
          maxLength: 70
          description: Arabic value of the string
      description: The Account Holder Name is the name or names of the Account owner(s) represented at the account level
      additionalProperties: false
    AETradingName:
      type: object
      description: |
        The Trading Brand Name (if applicable) for the Creditor. 
        Applicable to Payments.
      properties:
        en:
          type: string
          description: English value of the string
          maxLength: 70
        ar:
          type: string
          description: Arabic value of the string
          maxLength: 70
      additionalProperties: false
    AECreditorReference:
      description: A Creditor Reference is a note for a given Creditor or Creditor LFI that supports reconciliation of 
        a given payment instruction.
      type: string
      minLength: 1
      maxLength: 35
    AEDebtorReference:
      description: A Debtor Reference is a note is for the reference of a given User that may be available as 
        additional information in relation to a given payment instruction.
      type: string
      minLength: 1
      maxLength: 35
    AEExternalPaymentChargeTypeCode:
      description: Charge type, in a coded form.
      type: string
      enum:
        - VAT
        - Fees
    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'
    AEPatchPaymentConsentSigned:
      description: |
        Payment Patch Consent Signed Schema
      allOf:
        - $ref: '#/components/schemas/AEJwt'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/AEPatchPaymentConsent'
          required:
            - message
    AEPatchPaymentConsent:
      description: Patch Payment Consent
      type: object
      properties:
        Data:
          type: object
          description: Primary data for the resource
          required:
            - Status
          properties:
            Status:
              $ref: '#/components/schemas/AEPatchConsentStatus'
            RevokedBy:
              $ref: '#/components/schemas/AERevokedByPatchConsent'
          additionalProperties: false
        Subscription:
          $ref: '#/components/schemas/AEEventNotification'
    AERisk:
      additionalProperties: false
      description: >
        The Risk section is sent by the TPP to the LFI. It is used to specify additional details for risk/fraud scoring
        regarding Payments.
      type: object
      properties:
        DebtorIndicators:
          $ref: '#/components/schemas/AEDebtorIndicators'
        DestinationDeliveryAddress:
          type: object
          description: |
            Destination Delivery Address
          properties:
            RecipientType:
              type: string
              description: The recipient of the goods whether an individual or a corporation.
              enum:
                - Individual
                - Corporate
            RecipientName:
              type: object
              description: The name of the recipient of the goods, whether an individual or a corporation.
              properties:
                en:
                  type: string
                  description: English value of the string
                ar:
                  type: string
                  description: Arabic value of the string
              additionalProperties: false
            NationalAddress:
              $ref: '#/components/schemas/AEAddress'
          additionalProperties: false
        TransactionIndicators:
          $ref: '#/components/schemas/AETransactionIndicators'
        CreditorIndicators:
          $ref: '#/components/schemas/AECreditorIndicators'
    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}$
    AEPaymentTransactionId:
      type: string
      description: >
        This is an end to end TransactionId that is generated by the underlying payment rails when it is sent from an
        Originating LFI to a Receiving LFI.

        For Aani Core transactions, this is the Aani Core generated TransactionId.


        This is not the same as the TransactionID in the Account Information Transactions API.


        The PaymentTransactionId must be populated if the payment is processed by the LFI.
      minimum: 1
      maximum: 40
    AEDebtorAccount:
      description: Unambiguous identification of the account of the debtor to which a debit entry will be made.
      type: object
      required:
        - SchemeName
        - Identification
        - Name
      properties:
        SchemeName:
          $ref: '#/components/schemas/AEExternalAccountIdentificationCode'
        Identification:
          $ref: '#/components/schemas/AEIdentification'
        Name:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEName'
    AERevokedByPatchConsent:
      description: |
        Denotes the Identifier of the revocation.

        | Identifier| Description|
        |-----------|------------|
        | TPP | Revoked by TPP without User initiation|
        | TPP.InitiatedByUser | Initiated by User via the TPP|
      type: string
      enum:
        - TPP
        - TPP.InitiatedByUser
    AEAddress:
      description: One-or-more addresses related to a given subject.
      type: array
      minItems: 1
      items:
        description: Address properties based on ISO 20022 `PostalAddress27` definition
        type: object
        required:
          - AddressType
          - AddressLine
          - Country
        properties:
          AddressType:
            description: The type of address.
            type: string
            enum:
              - Billing
              - Business
              - Correspondence
              - DeliveryTo
              - MailTo
              - POBox
              - Postal
              - Permanent
              - Residential
              - Statement
              - Other
          AddressLine:
            description: >-
              Information that locates and identifies a specific address for a transaction entry, that is presented in
              free format text.
            type: array
            minItems: 1
            maxItems: 7
            items:
              type: string
              minLength: 1
              maxLength: 70
          BuildingNumber:
            description: The unit, apartment, or villa number within a building or community
            type: string
            minLength: 1
            maxLength: 16
          BuildingName:
            description: Name of the building or house.
            type: string
            minLength: 1
            maxLength: 140
          Floor:
            description: Floor or storey within a building.
            type: string
            minLength: 1
            maxLength: 70
          StreetName:
            description: The name of the street or road where the property is located.
            type: string
            minLength: 1
            maxLength: 140
          DistrictName:
            description: The district, community, or neighbourhood where the property is located.
            type: string
            minLength: 1
            maxLength: 140
          PostBox:
            description: The P.O. Box number assigned to the recipient for mail delivery.
            type: string
            minLength: 1
            maxLength: 16
          TownName:
            description: Name of a built-up area, such as a town or city.
            type: string
            minLength: 1
            maxLength: 140
          CountrySubDivision:
            description: Country subdivision, such as state or province. Where the address is in the UAE this is the 
              Emirate where the address is registered.
            anyOf:
              - type: string
                enum:
                - AbuDhabi
                - Ajman
                - Dubai
                - Fujairah
                - RasAlKhaimah
                - Sharjah
                - UmmAlQuwain
              - type: string
          Country:
            description: The country associated with the address, represented using the ISO 3166-1 alpha-2 country code.
            type: string
            pattern: ^[A-Z]{2}$
        additionalProperties: false
    AEDebtorIndicators:
      type: object
      description: |
        Debtor (User) Indicators
      properties:
        Authentication:
          type: object
          description: The authentication method used by the User to access their account with the TPP
          properties:
            AuthenticationChannel:
              description: Channel on which the User was authenticated
              type: string
              enum:
                - App
                - Web
            PossessionFactor:
              type: object
              description: The User's possession, that only the User possesses
              properties:
                IsUsed:
                  type: boolean
                Type:
                  type: string
                  enum:
                    - FIDO2SecurityKey
                    - Passkey
                    - OTPDevice
                    - OTPApp
                    - SMSOTP
                    - EmailOTP
                    - PushNotification
                    - WebauthnToken
                    - SecureEnclaveKey
                    - HardwareOTPKey
                    - TrustedDevice
                    - Other
              additionalProperties: false
            KnowledgeFactor:
              type: object
              description: The User's knowledge, that only the User knows
              properties:
                IsUsed:
                  type: boolean
                Type:
                  type: string
                  enum:
                    - PIN
                    - Password
                    - SecurityQuestion
                    - SMSOTP
                    - EmailOTP
                    - OTPPush
                    - Other
              additionalProperties: false
            InherenceFactor:
              type: object
              description: The User's inherance, that is unique to the User's physical characteristics
              properties:
                IsUsed:
                  type: boolean
                Type:
                  type: string
                  enum:
                    - Biometric
                    - Fingerprint
                    - FaceRecognition
                    - IrisScan
                    - VoiceRecognition
                    - FIDOBiometric
                    - DeviceBiometrics
                    - Other
              additionalProperties: false
            ChallengeOutcome:
              type: string
              description: >-
                The result of multi-factor authentication performed by the TPP, with NotPerformed indication the User
                was not required to authenticate before consenting to the requested payment
              enum:
                - Pass
                - Fail
                - NotPerformed
            AuthenticationFlow:
              type: string
              enum:
                - MFA
                - Other
            AuthenticationValue:
              type: string
              description: Cryptographic proof of authentication where supported by the device and protocol.
            ChallengeDateTime:
              type: string
              format: date-time
          additionalProperties: false
        UserName:
          type: object
          description: The Name of the User initiating the Payment
          properties:
            en:
              type: string
              description: English value of the string
            ar:
              type: string
              description: Arabic value of the string
          additionalProperties: false
        GeoLocation:
          type: object
          description: GPS to identify and track the whereabouts of the connected electronic device.
          required:
            - Latitude
            - Longitude
          properties:
            Latitude:
              type: string
              description: latitude
            Longitude:
              type: string
              description: longitude
          additionalProperties: false
        DeviceInformation:
          type: object
          description: Detailed device information
          properties:
            DeviceId:
              type: string
              description: IMEISV number of the connected electronic device
            AlternativeDeviceId:
              type: string
              description: Alternative identifier for the connected electronic device
            DeviceOperatingSystem:
              type: string
              description: Device operating system
            DeviceOperatingSystemVersion:
              type: string
              description: Device operating system version
            DeviceBindingId:
              type: string
              description: An identifier that associates a device uniquely with a specific application
            LastBindingDateTime:
              type: string
              format: date-time
              description: Date and time when the device was last bound to the application
            BindingDuration:
              type: string
              format: duration
              description: ISO 8601 duration since device was last bound (e.g., P30D for 30 days)
            BindingStatus:
              type: string
              description: Current status of the device binding
              enum:
                - Active
                - Expired
                - Revoked
                - Suspended
            DeviceType:
              type: string
              description: Type of device used
              enum:
                - Mobile
                - Desktop
                - Tablet
                - Wearable
                - Other
            DeviceManufacturer:
              type: object
              properties:
                Model:
                  type: string
                  description: Device model name
                  maxLength: 50
                Manufacturer:
                  type: string
                  description: Device manufacturer
                  maxLength: 50
              additionalProperties: false
            DeviceLanguage:
              type: string
              description: Device language
            DeviceLocalDateTime:
              type: string
              description: Device local time
            ConnectionType:
              type: string
              description: Type of connection to the internet
              enum:
                - WiFi
                - Cellular
                - Other
            ScreenInformation:
              type: object
              properties:
                PixelDensity:
                  type: number
                  description: Screen pixel density
                Orientation:
                  type: string
                  enum:
                    - Portrait
                    - Landscape
              additionalProperties: false
            BatteryStatus:
              type: object
              properties:
                Level:
                  type: number
                  minimum: 0
                  maximum: 100
                IsCharging:
                  type: boolean
              additionalProperties: false
            TouchSupport:
              type: object
              properties:
                Supported:
                  type: boolean
                MaxTouchPoints:
                  type: integer
                  minimum: 0
              additionalProperties: false
            MotionSensors:
              type: object
              properties:
                Status:
                  type: string
                  enum:
                    - InMotion
                    - Stationary
                Accelerometer:
                  type: boolean
                Gyroscope:
                  type: boolean
              additionalProperties: false
            DeviceEnvironmentContext:
              type: array
              description: List of device environment context
              items:
                type: string
                enum:
                  - VPNDetected
                  - EmulatorDetected
          additionalProperties: false
        BiometricCapabilities:
          type: object
          description: Device biometric capabilities
          properties:
            SupportsBiometric:
              type: boolean
              description: Whether device supports biometric authentication
            BiometricTypes:
              type: array
              description: Types of biometric authentication supported
              items:
                type: string
                enum:
                  - Fingerprint
                  - FacialRecognition
                  - Iris
                  - VoicePrint
                  - Other
          additionalProperties: false
        AppInformation:
          type: object
          description: Mobile application specific information
          properties:
            AppVersion:
              type: string
              description: Version of the mobile application
            PackageName:
              type: string
              description: Application package identifier
            BuildNumber:
              type: string
              description: Application build number
          additionalProperties: false
        BrowserInformation:
          type: object
          description: Browser-specific information
          properties:
            UserAgent:
              type: string
              description: Complete browser user agent string
            IsCookiesEnabled:
              type: boolean
              description: Whether cookies are enabled in the browser
            AvailableFonts:
              type: array
              description: List of available fonts
              items:
                type: string
            Plugins:
              type: array
              description: List of installed browser plugins
              items:
                type: string
            PixelRatio:
              type: number
              description: Device pixel ratio for scaling
          additionalProperties: false
        UserBehavior:
          type: object
          description: User behavior indicators
          properties:
            ScrollBehavior:
              type: object
              properties:
                Direction:
                  type: string
                  enum:
                    - Up
                    - Down
                    - Both
                Speed:
                  type: number
                  description: Average scroll speed in pixels per second
                Frequency:
                  type: number
                  description: Number of scroll events per minute
              additionalProperties: false
          additionalProperties: false
        AccountRiskIndicators:
          type: object
          description: Risk indicators related to the account
          properties:
            UserOnboardingDateTime:
              type: string
              format: date-time
              description: The exact date and time when the User account was activated with the TPP.
            LastAccountChangeDate:
              type: string
              format: date
              description: Date that the User's account was last changed
            LastPasswordChangeDate:
              type: string
              format: date
              description: Date of the last password change by the User
            SuspiciousActivity:
              type: string
              description: Indicates any suspicious activity associated with the account
              enum:
                - NoSuspiciousActivity
                - SuspiciousActivityDetected
            TransactionHistory:
              type: object
              properties:
                LastDay:
                  type: integer
                  description: Total transactions made by the account in the last 24 hours
                  minimum: 0
                LastYear:
                  type: integer
                  description: Total transactions made by the account in the past year
                  minimum: 0
              additionalProperties: false
          additionalProperties: false
        SupplementaryData:
          type: object
          description: >
            Additional information that cannot be captured in the structured fields and/or any other specific block

            This may include information that is not available in the structured fields, such as a user's behavioural
            data

            like their typing speed and typing patterns.
      additionalProperties: false
    AETransactionIndicators:
      type: object
      description: |
        Transaction Indicators
      properties:
        IsCustomerPresent:
          description: This field differentiates between automatic and manual payment initiation.
          type: boolean
        IsContractPresent:
          description: Indicates if the Creditor has a contractual relationship with the TPP.
          type: boolean
        Channel:
          description: Where the payment has been initiated from.
          type: string
          enum:
            - Web
            - Mobile
        ChannelType:
          type: string
          description: The channel through which the transaction is being conducted
          enum:
            - ECommerce
            - InStore
            - InApp
            - Telephone
            - Mail
            - RecurringPayment
            - Other
        SubChannelType:
          type: string
          description: More specific classification of the transaction channel
          enum:
            - WebBrowser
            - MobileApp
            - SmartTV
            - WearableDevice
            - POSTerminal
            - ATM
            - KioskTerminal
            - Other
        PaymentProcess:
          type: object
          description: Metrics related to the payment process duration and attempts
          properties:
            TotalDuration:
              type: integer
              description: Total time in seconds from payment initiation to completion
              minimum: 0
            CurrentSessionAttempts:
              type: integer
              description: Number of payment attempts in the current session
              minimum: 1
            CurrentSessionFailedAttempts:
              type: integer
              description: Number of failed payment attempts in the current session
              minimum: 0
            Last24HourAttempts:
              type: integer
              description: Number of payment attempts in the last 24 hours
              minimum: 0
            Last24HourFailedAttempts:
              type: integer
              description: Number of failed payment attempts in the last 24 hours
              minimum: 0
          additionalProperties: false
        MerchantRisk:
          type: object
          description: Risk indicator details provided by the merchant
          properties:
            DeliveryTimeframe:
              type: string
              description: Timeframe for the delivery of purchased items
              enum:
                - ElectronicDelivery
                - SameDayShipping
                - OvernightShipping
                - MoreThan1DayShipping
            ReorderItemsIndicator:
              type: string
              description: Indicates if the transaction is a reorder
              enum:
                - FirstTimeOrder
                - Reorder
            PreOrderPurchaseIndicator:
              type: string
              description: Indicates if this is a pre-ordered item
              enum:
                - MerchandiseAvailable
                - FutureAvailability
            IsGiftCardPurchase:
              type: boolean
              description: Indicates if the transaction includes a gift card
            IsDeliveryAddressMatchesBilling:
              type: boolean
              description: Indicates if delivery address matches billing address
            AddressMatchLevel:
              type: string
              description: Level of match between delivery and billing addresses
              enum:
                - FullMatch
                - PartialMatch
                - NoMatch
                - NotApplicable
          additionalProperties: false
        SupplementaryData:
          type: object
          description: |
            Additional information that cannot be captured in the structured fields and/or any other specific block
      additionalProperties: false
    AECreditorIndicators:
      type: object
      description: |
        Creditor Indicators
      properties:
        AccountType:
          $ref: '#/components/schemas/AEAccountTypeCode'
        IsCreditorPrePopulated:
          $ref: '#/components/schemas/AEIsCreditorPrePopulated'
        TradingName:
          $ref: '#/components/schemas/AETradingName'
        IsVerifiedByTPP:
          $ref: '#/components/schemas/AEIsVerifiedbyTPP'
        AdditionalAccountHolderIdentifiers:
          $ref: '#/components/schemas/AEAdditionalAccountHolderIdentifiers'
        MerchantDetails:
          type: object
          description: >
            Details of the Merchant involved in the transaction.

            Merchant Details are specified only for those merchant categories that are generally expected to originate
            retail financial transactions
          properties:
            MerchantId:
              description: MerchantId
              type: string
              minLength: 8
              maxLength: 20
            MerchantName:
              description: Name by which the merchant is known.
              type: string
              minLength: 1
              maxLength: 350
            MerchantSICCode:
              description: >
                SIC code stands for standard industrial classification (SIC) code.

                This four digit-number identifies a very specific short descriptor of the type of business a company is
                engaged in.

                SIC can be obtained from the Chamber of Commerce.
              type: string
              minLength: 3
              maxLength: 4
            MerchantCategoryCode:
              description: >
                Category code values are used to enable the classification of merchants into specific categories based
                on the type of business, trade or services supplied. 

                Category code conforms to ISO 18245, related to the type of services or goods the merchant provides for
                the transaction."
              type: string
              minLength: 3
              maxLength: 4
          additionalProperties: false
        IsCreditorConfirmed:
          description: Creditor account details have been confirmed successfully using Confirmation of Payee
          type: boolean
        SupplementaryData:
          type: object
          description: |
            Additional information that cannot be captured in the structured fields and/or any other specific block
      additionalProperties: false
    AEAccountTypeCode:
      description: Specifies the type of account (Retail, SME or Corporate).
      type: string
      enum:
        - Retail
        - SME
        - Corporate
    AEIsCreditorPrePopulated:
      description: Is Creditor populated
      type: boolean
    AEIsVerifiedbyTPP:
      description: The TPP has onboarded the Creditor
      type: boolean
    AEAdditionalAccountHolderIdentifiers:
      type: array
      items:
        type: object
        description: Provides the details to identify an account.
        required:
          - SchemeName
          - Identification
        properties:
          SchemeName:
            $ref: '#/components/schemas/AERiskExternalAccountIdentificationCode'
          Identification:
            $ref: '#/components/schemas/AEIdentification'
          Name:
            $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEName'
        additionalProperties: false
    AERiskExternalAccountIdentificationCode:
      description: Name of the identification scheme, in a coded form as published in an external list.
      type: string
      enum:
        - EmiratesID
        - TradeLicenceNumber
    AECurrencyRequest:
      description: >
        The details of the non-local currency or FX request that has been agreed between the User and the TPP.

        The requested ChargeBearer and ExchangeRateInformation are included in this object may be overwritten by the LFI
        in the returned 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.
          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
        FxQuoteId:
          description: >-
            Required where the consent or payment initiation request relates to a previously quoted FX trade. The TPP
            must provide the `QuoteId` value where a long-lived consent exists, meaning that each payment initiation
            request will relate to a different `QuoteId` value.
          type: string
          minLength: 1
          maxLength: 128
    AEChargeBearerType1Code:
      description: Specifies which party/parties will bear the charges associated with the processing of the payment transaction.
      type: string
      enum:
        - BorneByCreditor
        - BorneByDebtor
        - Shared
    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
    AEIdempotencyKeyQuery:
      description: |
        Response to a query for a given payment resource using `x-idempotency-key`
      type: object
      required:
        - Data
        - Links
      properties:
        Data:
          description: Data object. This will be empty for this response
          type: object
          additionalProperties: false
        Links:
          $ref: '#/components/schemas/AELinksSelf'
      additionalProperties: false
    AEServiceInitiationOpenFinancePaymentBilling:
      type: object
      required:
        - Type
      properties:
        Type:
          enum:
            - Collection
            - LargeValueCollection
            - PushP2P
            - PullP2P
            - Me2Me
          description: The type payment for billing
          type: string
        MerchantId:
          description: MerchantId
          type: string
          minLength: 8
          maxLength: 20
      description: Billing parameters specified by the TPP for a payment initiation
      additionalProperties: false
    AEServiceInitiationOpenFinanceFilePaymentBilling:
      type: object
      properties:
        NumberOfSuccessfulTransactions:
          type: integer
          description: "Number of individual transactions successfully executed by the LFI.\t\nThis is returned by the LFI after the file is fully processed.\n"
      description: Billing parameters specified by the LFI
      additionalProperties: false

    AEPushedAuthorizationRequests.AEConsentId:
      type: string
      minLength: 1
      maxLength: 128
      description: Unique identification assigned by the TPP to identify the consent resource.
    AEPushedAuthorizationRequests.AEBaseConsentId:
      type: string
      minLength: 1
      maxLength: 128
      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.

    ## Authorization Endpoints Schema Objects

    AEBankServiceInitiationRichAuthorizationRequests.IsSingleAuthorization:
      type: boolean
      description: Specifies to the LFI that the consent authorization must be completed by a single authorizer at the LFI.

    AEBankServiceInitiationRichAuthorizationRequests.AuthorizationExpirationDateTime:
      type: string
      format: date-time
      description: The date and time by which a Consent (in AwaitingAuthorization status) must be Authorized by the User.

    AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationConsentPermissionCodes:
      type: string
      enum:
        - ReadAccountsBasic
        - ReadAccountsDetail
        - ReadBalances
        - ReadRefundAccount

    AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationSingleInstantPayment:
      type: object
      required:
        - Type
        - Amount
      properties:
        Type:
          type: string
          enum:
            - SingleInstantPayment
          description: The Payment Type
        Amount:
          $ref: '#/components/schemas/AEStandardModels.AEAmountAndCurrency'
      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.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEActiveOrHistoricAmount:
      type: string
      pattern: ^\d{1,16}\.\d{2}$
      description: >-
        A number of monetary units specified in an active currency where the unit of currency is explicit and compliant
        with ISO 4217.
      example: '100.00'

    AEBankServiceInitiationRichAuthorizationRequests.AEActiveOrHistoricCurrencyCode:
      type: string
      pattern: ^[A-Z]{3,3}$
      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'.

    AEBankServiceInitiationRichAuthorizationRequests.AEPeriodTypeMaximumCumulativeValueOfPayments:
      type: object
      required:
        - Amount
        - Currency
      properties:
        Amount:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEActiveOrHistoricAmount'
        Currency:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEActiveOrHistoricCurrencyCode'
      description: The maximum cumulative payment value of all payment initiations per Period Type.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEPeriodType:
      type: string
      enum:
        - Day
        - Week
        - Month
        - Year
      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.|

    AEBankServiceInitiationRichAuthorizationRequests.AEPeriodStartDate:
      type: string
      format: date
      description: Specifies the start date of when a payment schedule begins.

    AEBankServiceInitiationRichAuthorizationRequests.AEMaximumIndividualAmount:
      type: object
      required:
        - Amount
        - Currency
      properties:
        Amount:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEActiveOrHistoricAmount'
        Currency:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEActiveOrHistoricCurrencyCode'
      description: This is the Maximum amount a variable payment can take per period.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationVariableOnDemand:
      type: object
      required:
        - Type
        - PeriodType
        - PeriodStartDate
        - Controls
      properties:
        Type:
          type: string
          enum:
            - VariableOnDemand
        PeriodType:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEPeriodType'
        PeriodStartDate:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEPeriodStartDate'
        Controls:
          type: object
          properties:
            MaximumIndividualAmount:
              $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEMaximumIndividualAmount'
            MaximumCumulativeValueOfPaymentsPerPeriod:
              $ref: >-
                #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEPeriodTypeMaximumCumulativeValueOfPayments
            MaximumCumulativeNumberOfPaymentsPerPeriod:
              type: integer
          minProperties: 1
          additionalProperties: false
      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.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationFixedOnDemand:
      type: object
      required:
        - Type
        - PeriodType
        - PeriodStartDate
        - Amount
        - Controls
      properties:
        Type:
          type: string
          enum:
            - FixedOnDemand
        PeriodType:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEPeriodType'
        PeriodStartDate:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEPeriodStartDate'
        Amount:
          $ref: '#/components/schemas/AEStandardModels.AEAmountAndCurrency'
        Controls:
          type: object
          properties:
            MaximumCumulativeValueOfPaymentsPerPeriod:
              $ref: >-
                #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEPeriodTypeMaximumCumulativeValueOfPayments
            MaximumCumulativeNumberOfPaymentsPerPeriod:
              type: integer
          minProperties: 1
          description: Controls that apply to the payment schedule.
          additionalProperties: false
      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
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationVariablePeriodicSchedule:
      type: object
      required:
        - Type
        - PeriodType
        - PeriodStartDate
        - MaximumIndividualAmount
      properties:
        Type:
          type: string
          enum:
            - VariablePeriodicSchedule
        PeriodType:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEPeriodType'
        PeriodStartDate:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEPeriodStartDate'
        MaximumIndividualAmount:
          allOf:
            - $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEMaximumIndividualAmount'
          description: This is the Maximum amount a variable payment can take per period.
      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.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationFixedPeriodicSchedule:
      type: object
      required:
        - Type
        - PeriodType
        - PeriodStartDate
        - Amount
      properties:
        Type:
          type: string
          enum:
            - FixedPeriodicSchedule
        PeriodType:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEPeriodType'
        PeriodStartDate:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEPeriodStartDate'
        Amount:
          $ref: '#/components/schemas/AEStandardModels.AEAmountAndCurrency'
      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.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationVariableSchedule:
      type: object
      required:
        - PaymentExecutionDate
        - MaximumIndividualAmount
      properties:
        PaymentExecutionDate:
          type: string
          format: date
          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
        MaximumIndividualAmount:
          allOf:
            - $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEMaximumIndividualAmount'
          description: This is the Maximum amount a variable payment can take per period.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationVariableDefinedSchedule:
      type: object
      required:
        - Type
        - Schedule
      properties:
        Type:
          type: string
          enum:
            - VariableDefinedSchedule
          description: The Periodic Schedule Type
        Schedule:
          type: array
          items:
            $ref: >-
              #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationVariableSchedule
          minItems: 1
          maxItems: 53
      description: Payment Schedule denoting a list of pre-defined future dated payments all with variable amounts and dates.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationFixedSchedule:
      type: object
      required:
        - PaymentExecutionDate
        - Amount
      properties:
        PaymentExecutionDate:
          type: string
          format: date
          description: |-
            Used to specify the expected payment execution date/time.
            All dates in the JSON payloads are represented in ISO 8601 date format, for example is: 2023-04-05
        Amount:
          $ref: '#/components/schemas/AEStandardModels.AEAmountAndCurrency'
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationFixedDefinedSchedule:
      type: object
      required:
        - Type
        - Schedule
      properties:
        Type:
          type: string
          enum:
            - FixedDefinedSchedule
          description: The Periodic Schedule Type
        Schedule:
          type: array
          items:
            $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationFixedSchedule'
          minItems: 1
          maxItems: 53
      description: Payment Schedule denoting a list of pre-defined future dated payments all with fixed amounts and dates.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationLongLivedPaymentConsentPeriodicSchedule:
      oneOf:
        - $ref: >-
            #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationVariableOnDemand
        - $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationFixedOnDemand'
        - $ref: >-
            #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationVariablePeriodicSchedule
        - $ref: >-
            #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationFixedPeriodicSchedule
        - $ref: >-
            #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationVariableDefinedSchedule
        - $ref: >-
            #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationFixedDefinedSchedule
      discriminator:
        propertyName: Type
        mapping:
          FixedDefinedSchedule: >-
            #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationFixedDefinedSchedule
          VariableDefinedSchedule: >-
            #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationVariableDefinedSchedule
          FixedPeriodicSchedule: >-
            #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationFixedPeriodicSchedule
          VariablePeriodicSchedule: >-
            #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationVariablePeriodicSchedule
          FixedOnDemand: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationFixedOnDemand'
          VariableOnDemand: >-
            #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationVariableOnDemand
      description: The definition for a schedule

    AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationLongLivedPaymentConsent:
      type: object
      required:
        - PeriodicSchedule
      properties:
        MaximumCumulativeValueOfPayments:
          allOf:
            - $ref: >-
                #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEPeriodTypeMaximumCumulativeValueOfPayments
          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.
        MaximumCumulativeNumberOfPayments:
          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.    
        PeriodicSchedule:
          $ref: >-
            #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationLongLivedPaymentConsentPeriodicSchedule
      description: A Consent definition for defining Multi Payments
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AERequestedExecutionDate:
      type: string
      format: date
      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.

    AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationFilePaymentConsent:
      type: object
      required:
        - FileType
        - FileHash
        - NumberOfTransactions
        - ControlSum
      properties:
        FileType:
          type: string
          minLength: 1
          maxLength: 40
          description: Specifies the payment file type
        FileHash:
          type: string
          minLength: 1
          maxLength: 44
          description: A base64 encoding of a SHA256 hash of the file to be uploaded.
        FileReference:
          $ref: '#/components/schemas/AEBankServiceInitiation.AEReference'
        NumberOfTransactions:
          type: integer
          description: Number of individual transactions contained in the payment information group.
        ControlSum:
          type: string
          pattern: ^\d{1,16}\.\d{2}$
          description: Total of all individual amounts included in the group, irrespective of currencies.
        RequestedExecutionDate:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AERequestedExecutionDate'
      description: Bulk/Batch Control Parameters.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequestsV21.AEBankServiceInitiationControlParametersProperties:
      type: object
      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
          properties:
            SinglePayment:
              $ref: >-
                #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationSingleInstantPayment
            MultiPayment:
              $ref: >-
                #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationLongLivedPaymentConsent
            FilePayment:
              $ref: >-
                #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationFilePaymentConsent
          description: |-
            The various payment types that can be initiated:

            * A Single Payment

            * A Multi-Payment
            
            * A Combined Payment (one SinglePayment and one MultiPayment)
          additionalProperties: false
      additionalProperties: false

    AEBankServiceInitiationConsentStatusV21.AEBankServiceInitiationConsentProperties:
      type: object
      required:
        - Data
        - Links
      properties:
        Data:
          type: object
          properties:
            ConsentId:
              $ref: '#/components/schemas/AEPushedAuthorizationRequests.AEConsentId'
            BaseConsentId:
              $ref: '#/components/schemas/AEPushedAuthorizationRequests.AEBaseConsentId'
            IsSingleAuthorization:
              $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.IsSingleAuthorization'
            AuthorizationExpirationDateTime:
              $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AuthorizationExpirationDateTime'
            Permissions:
              type: array
              items:
                $ref: >-
                  #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEBankServiceInitiationConsentPermissionCodes
              description: Permission codes granted by the User to the TPP, allowing the TPP to check execute a balance check.
            ExpirationDateTime:
              $ref: '#/components/schemas/AEPushedAuthorizationRequests.AEConsentExpirationDateTime'
            Status:
              $ref: '#/components/schemas/AEConsentStatus.AEConsentStatusCodes'
            RevokedBy:
              $ref: '#/components/schemas/AEConsentStatus.AERevokedByCodes'
            CreationDateTime:
              $ref: '#/components/schemas/AEConsentStatus.AECreationDateTime'
            StatusUpdateDateTime:
              $ref: '#/components/schemas/AEConsentStatus.AEStatusUpdateDateTime'
            Charges:
              type: array
              items:
                $ref: '#/components/schemas/AEBankServiceInitiation.AECharges'
              minItems: 1
            ExchangeRate:
              $ref: '#/components/schemas/AEConsentStatus.AEExchangeRateInformation'
            CurrencyRequest:
              $ref: '#/components/schemas/AEBankServiceInitiation.AECurrencyRequest'
            ControlParameters:
              $ref: >-
                #/components/schemas/AEBankServiceInitiationRichAuthorizationRequestsV21.AEBankServiceInitiationControlParametersProperties
            DebtorReference:
              $ref: '#/components/schemas/AEBankServiceInitiation.AEDebtorReference'
            CreditorReference:
              $ref: '#/components/schemas/AEBankServiceInitiation.AECreditorReference'
            PaymentPurposeCode:
              $ref: '#/components/schemas/AEBankServiceInitiation.AEPaymentPurposeCode'
            SponsoredTPPInformation:
              $ref: '#/components/schemas/AEPushedAuthorizationRequests.AESponsoredTPPInformation'
            PaymentConsumption:
              $ref: '#/components/schemas/AEConsentStatus.AEPaymentConsumption'
            OpenFinanceBilling:
              $ref: '#/components/schemas/AEConsentStatus.AEBankServiceInitiationOpenFinanceBilling'
          required:
            - ConsentId
            - ExpirationDateTime
            - Status
            - CreationDateTime
            - StatusUpdateDateTime
            - ControlParameters
            - PaymentPurposeCode
          additionalProperties: false
        Subscription:
          $ref: '#/components/schemas/AEStandardModels.AEEventNotification'
        Links:
          $ref: '#/components/schemas/AEConsentStatus.AELinksRelatedPayment'
        Meta:
          $ref: '#/components/schemas/AEConsentStatus.AEMetaMultiAuthorization'
      description: Status of the Authorization Request, qualified with additional information held by the API Hub.
      additionalProperties: false
    AEConsentStatus.AEBankServiceInitiationOpenFinanceBilling:
      type: object
      properties:
        IsLargeCorporate:
          type: boolean
          description: Customer has more than 100 million AED turnover.
      description: Billing parameters specified by the LFI.
      additionalProperties: false
    AEConsentStatus.AEConsentStatusCodes:
      type: string
      enum:
        - AwaitingAuthorization
        - Authorized
        - Rejected
        - Revoked
        - Expired
        - Consumed
        - Suspended
      description: |2-
         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.|
    AEConsentStatus.AECreationDateTime:
      type: string
      format: date-time
      description: >-
        Date and time at which the Consent 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, for example: 2023-04-05T10:43:07+00:00
    AEConsentStatus.AEExchangeRateInformation:
      type: object
      required:
        - UnitCurrency
        - RateType
      properties:
        UnitCurrency:
          type: string
          pattern: ^[A-Z]{3,3}$
          description: >-
            Currency in which the rate of exchange is expressed in a currency exchange. In the example 1GBP = xxxCUR,
            the unit currency is GBP.
        ExchangeRate:
          type: number
          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.
        RateType:
          $ref: '#/components/schemas/AEBankServiceInitiation.AERateType'
        ContractIdentification:
          type: string
          minLength: 1
          maxLength: 256
          description: >-
            Unique and unambiguous reference to the foreign exchange contract agreed between the initiating
            party/creditor and the debtor agent.
        ExpirationDateTime:
          type: string
          format: date-time
          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, for example: 2017-04-05T10:43:07+00:00
      description: >-
        Further detailed information on the exchange rate that has been used in the payment transaction - returned by
        the LFI.
      additionalProperties: false
    AEConsentStatus.AELinksRelatedPayment:
      type: object
      required:
        - Self
        - Related
      properties:
        Self:
          type: string
          format: url
        Related:
          type: array
          items:
            type: string
          description: >-
            A link to the related payments resource:


            - For a Single Payment, this Array must 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.
      description: Links relevant to the consent.
      additionalProperties: false
    AEConsentStatus.AEMetaMultiAuthorization:
      type: object
      properties:
        MultipleAuthorizers:
          type: object
          properties:
            TotalRequired:
              type: integer
              description: The total number of Authorizers required to process the request.
            Authorizations:
              type: array
              items:
                type: object
                properties:
                  AuthorizerId:
                    type: string
                    description: Authorizer identifier, as assigned by the LFI.
                  AuthorizerType:
                    type: string
                    description: The Type of Authorizer. For example, Financial, Management, etc.
                  AuthorizationDate:
                    type: string
                    format: date-time
                    description: |2-
                        The date and of when the Authorization occurred. All dates in the JSON payloads are represented in ISO 8601 date-time format. 
                        
                        All date-time fields in responses must include the timezone for example: 2023-04-05T10:43:07+00:00      
                  AuthorizationStatus:
                    type: string
                    enum:
                      - Pending
                      - Approved
                      - Rejected
                    description: The Status reflecting the Authorizer's final decision regarding the request.
                additionalProperties: false
          description: Multiple Authorizers Schema
          additionalProperties: false
      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.
      additionalProperties: false
    AEConsentStatus.AEPaymentConsumption:
      type: object
      required:
        - CumulativeNumberOfPayments
        - CumulativeValueOfPayments
      properties:
        CumulativeNumberOfPayments:
          type: integer
          description: >-
            The cumulative number of payment instructions initiated under the consent schedule, excluding instructions
            in a Rejected state.
        CumulativeValueOfPayments:
          allOf:
            - $ref: '#/components/schemas/AEStandardModels.AEAmountAndCurrency'
          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.
        CumulativeNumberOfPaymentsInCurrentPeriod:
          type: integer
          description: >-
            The cumulative number of payment instructions in the current period initiated under the consent schedule,
            excluding instructions in a Rejected state.
        CumulativeValueOfPaymentsInCurrentPeriod:
          allOf:
            - $ref: '#/components/schemas/AEStandardModels.AEAmountAndCurrency'
          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.
      description: Data to track the consumption of Payments in relation to an authorized Consent Schedule
      additionalProperties: false
    AEConsentStatus.AERevokedByCodes:
      type: string
      enum:
        - LFI
        - TPP
        - LFI.InitiatedByUser
        - TPP.InitiatedByUser
      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|
    AEConsentStatus.AEStatusUpdateDateTime:
      type: string
      format: date-time
      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, for example: 2023-04-05T10:43:07+00:00

    AEPushedAuthorizationRequests.AEConsentExpirationDateTime:
      type: string
      format: date-time
      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, for example: 2023-04-05T10:43:07+00:00

    AEBankServiceInitiation.AECurrencyRequest:
      type: object
      required:
        - ExtendedPurpose
        - CurrencyOfTransfer
      properties:
        InstructionPriority:
          allOf:
            - $ref: '#/components/schemas/AEBankServiceInitiation.AEInstructionPriority'
          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.
        ExtendedPurpose:
          type: string
          minLength: 1
          maxLength: 140
          description: Specifies the purpose of an international payment.
        ChargeBearer:
          $ref: '#/components/schemas/AEBankServiceInitiation.AEChargeBearerType1Code'
        CurrencyOfTransfer:
          type: string
          pattern: ^[A-Z]{3,3}$
          description: >-
            Specifies the currency of the to be transferred amount, which is different from the currency of the debtor's
            account.
        DestinationCountryCode:
          type: string
          pattern: '[A-Z]{2,2}'
          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).
        ExchangeRateInformation:
          $ref: '#/components/schemas/AEBankServiceInitiation.AEExchangeRateInformation'
        FxQuoteId:
          type: string
          minLength: 1
          maxLength: 128
          description: >-
            Required where the consent or payment initiation request relates to a previously quoted FX trade. The TPP
            must provide the `QuoteId` value where the payment type is a single instant payment, or omit and provide in
            the payment initiation request where a long-lived consent exists.
      description: >-
        The details of the non-local currency or FX request that has been agreed between the User and the TPP. The
        requested ChargeBearer and ExchangeRateInformation included in this object may be superseded by updated
        information supplied by the LFI.
      additionalProperties: false
    AEBankServiceInitiation.AEDebtorReference:
      type: string
      minLength: 1
      maxLength: 35
      description: >-
        A Debtor Reference is a note is for the reference of a given User that may be available as additional
        information in relation to a given payment instruction.
    AEBankServiceInitiation.AEExchangeRateInformation:
      type: object
      required:
        - UnitCurrency
        - RateType
      properties:
        UnitCurrency:
          type: string
          pattern: ^[A-Z]{3,3}$
          description: >-
            Currency in which the rate of exchange is expressed in a currency exchange. In the example 1GBP = xxxCUR,
            the unit currency is GBP.
        ExchangeRate:
          type: number
          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.
        RateType:
          $ref: '#/components/schemas/AEBankServiceInitiation.AERateType'
        ContractIdentification:
          type: string
          minLength: 1
          maxLength: 256
          description: >-
            Unique and unambiguous reference to the foreign exchange contract agreed between the initiating
            party/creditor and the debtor agent.
      description: Provides details on the currency exchange rate and contract.
      additionalProperties: false
    AEBankServiceInitiation.AEExternalPaymentChargeTypeCode:
      type: string
      enum:
        - VAT
        - Fees
      description: Charge type, in a coded form.
    AEBankServiceInitiation.AEInstructionPriority:
      type: string
      enum:
        - Normal
        - Urgent
      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.
    AEBankServiceInitiation.AEPaymentPurposeCode:
      type: string
      minLength: 1
      maxLength: 3
      pattern: ^[A-Z]{3}$
      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.
    AEBankServiceInitiation.AERateType:
      type: string
      enum:
        - Actual
        - Agreed
        - Indicative
      description: Specifies the type used to complete the currency exchange.
    AEBankServiceInitiation.AEReference:
      type: string
      minLength: 1
      maxLength: 35
      description: A reason or reference in relation to a payment.
    AEPushedAuthorizationRequests.AEBankServiceInitiationFilePaymentConsent:
      type: object
      required:
        - FileType
        - FileHash
        - NumberOfTransactions
        - ControlSum
      properties:
        FileType:
          type: string
          minLength: 1
          maxLength: 40
          description: Specifies the payment file type
        FileHash:
          type: string
          minLength: 1
          maxLength: 44
          description: A base64 encoding of a SHA256 hash of the file to be uploaded.
        FileReference:
          $ref: '#/components/schemas/AEBankServiceInitiation.AEReference'
        NumberOfTransactions:
          type: integer
          description: Number of individual transactions contained in the payment information group.
        ControlSum:
          type: string
          pattern: ^\d{1,16}\.\d{2}$
          description: Total of all individual amounts included in the group, irrespective of currencies.
        RequestedExecutionDate:
          $ref: '#/components/schemas/AEPushedAuthorizationRequests.AERequestedExecutionDate'
      description: Bulk/Batch Control Parameters.
      additionalProperties: false

    AEBankServiceInitiation.AECreditorReference:
      type: string
      minLength: 1
      maxLength: 35
      description: >-
        A Creditor Reference is a note for a given Creditor or Creditor LFI that supports reconciliation of a given
        payment instruction.

    AEPushedAuthorizationRequests.AESponsoredTPPInformation:
      type: object
      required:
        - Name
        - Identification
      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
      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 Finance API integrations.
      additionalProperties: false

    AEBankServiceInitiation.AEChargeBearerType1Code:
      type: string
      enum:
        - BorneByCreditor
        - BorneByDebtor
        - Shared
      description: Specifies which party/parties will bear the charges associated with the processing of the payment transaction.
    AEBankServiceInitiation.AECharges:
      type: object
      required:
        - ChargeBearer
        - Type
        - Amount
      properties:
        ChargeBearer:
          $ref: '#/components/schemas/AEBankServiceInitiation.AEChargeBearerType1Code'
        Type:
          $ref: '#/components/schemas/AEBankServiceInitiation.AEExternalPaymentChargeTypeCode'
        Amount:
          $ref: '#/components/schemas/AEStandardModels.AEActiveCurrencyAmount'
      description: Charges related to the consented payment instruction.
      additionalProperties: false
    AEPushedAuthorizationRequests.AERequestedExecutionDate:
      type: string
      format: date
      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.
    AEStandardModels.AEActiveOrHistoricCurrencyCode:
      type: string
      pattern: ^[A-Z]{3,3}$
      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'.
    AEStandardModels.AEActiveOrHistoricAmount:
      type: string
      pattern: ^\d{1,16}\.\d{2}$
      description: >-
        A number of monetary units specified in an active currency where the unit of currency is explicit and compliant
        with ISO 4217.
      example: '100.00'
    AEStandardModels.AEEventNotification:
      type: object
      required:
        - Webhook
      properties:
        Webhook:
          type: object
          properties:
            Url:
              type: string
            IsActive:
              type: boolean
          description: A Webhook Schema
          additionalProperties: false
      description: A Webhook Subscription Schema
      additionalProperties: false
    AEStandardModels.AEActiveCurrencyAmount:
      type: object
      required:
        - Amount
        - Currency
      properties:
        Amount:
          $ref: '#/components/schemas/AEStandardModels.AEActiveOrHistoricAmount'
        Currency:
          $ref: '#/components/schemas/AEStandardModels.AEActiveOrHistoricCurrencyCode'
      description: An Amount qualified by an active Currency.
      additionalProperties: false
    AEStandardModels.AEAmountAndCurrency:
      type: object
      required:
        - Currency
        - Amount
      properties:
        Currency:
          $ref: '#/components/schemas/AEStandardModels.AEActiveOrHistoricCurrencyCode'
        Amount:
          $ref: '#/components/schemas/AEStandardModels.AEActiveOrHistoricAmount'
      description: An Amount qualified by Currency
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AECreditorProperties:
      type: object
      properties:
        Name:
          type: string
          minLength: 1
          maxLength: 140
        PostalAddress:
          $ref: '#/components/schemas/AEAddress'
      description: Party to which an amount of money is due.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEIdentification:
      type: string
      minLength: 1
      description: |-
        Identification for the account assigned by the LFI based on the Account Scheme Name.
        This identification is known by the User account owner.

    AEBankServiceInitiationRichAuthorizationRequests.AETradingName:
      type: object
      properties:
        en:
          type: string
          maxLength: 70
          description: English value of the string
        ar:
          type: string
          maxLength: 70
          description: Arabic value of the string
      description: |-
        The Trading Brand Name (if applicable) for the Creditor.
        Applicable to Payments.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AECreditorAccountTypeCodes:
      type: string
      enum:
        - Individual
        - Merchant
        - Business
        - Charity
        - GovernmentBody
        - Other
      description: The Creditor (Payee) Type, based on an allowed list. This value is populated by TPPs to inform the 
        User of the type of Creditor being authorized, which facilitates providing information during the Consent 
        journey.

    AEBankServiceInitiationRichAuthorizationRequests.AEDomesticCreditorAccountProperties:
      type: object
      required:
        - SchemeName
        - Identification
        - Name
      properties:
        SchemeName:
          type: string
          enum:
            - IBAN
          description: Domestic payment scheme, restricted to `IBAN`
        Identification:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEIdentification'
        Name:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEName'
        TradingName:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AETradingName'
        Type:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AECreditorAccountTypeCodes'
      description: Unambiguous identification of the account of the creditor to which a credit entry will be posted.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEDomesticCreditor:
      type: object
      required:
        - CreditorAccount
      properties:
        CreditorAgent:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AECreditorAgentProperties'
        Creditor:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AECreditorProperties'
        CreditorAccount:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEDomesticCreditorAccountProperties'
        ConfirmationOfPayeeResponse:
          type: string
          pattern: ^.+\..+\..+$
          description: |-
            Response from Confirmation of Payee operation, when executed for the Creditor Account.

            This is JSON Web Signature returned by the Payee Confirmation operation at the Confirmation of Payee API.

            The value must be the full JWS string, including the header and signature, without decoding to an object.

            If Confirmation of Payee is not performed this property can be omitted
      description: Identification elements for a Creditor for a domestic payment instruction.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorAccountProperties:
      type: object
      required:
        - SchemeName
        - Identification
        - Name
      properties:
        SchemeName:
          $ref: >-
            #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AECreditorExternalAccountIdentificationCode
        Identification:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEIdentification'
        Name:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEName'
        TradingName:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AETradingName'
        Type:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AECreditorAccountTypeCodes'
        AccountType:
          type: string
          enum:
            - Savings
            - Current
            - Checking
            - Prepaid
          description: >-
            The type of the Creditor account. This is distinct from `Type`, which classifies the payee segment
            (e.g. Individual, Merchant).
      description: Unambiguous identification of the account of the creditor to which a credit entry will be posted.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditor:
      type: object
      required:
        - CreditorAccount
      properties:
        CreditorAgent:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorAgentProperties'
        Creditor:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorParty'
        CreditorAccount:
          $ref: >-
            #/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorAccountProperties
      description: >-
        Identification elements for a Creditor for an international payment instruction. Please note that Confirmation
        of Payee is **NOT** required or expected for International Payments, as non-domestic Creditor accounts are not
        supported.
      additionalProperties: false

    AEBankServiceInitiation.AEDomesticPaymentPIIProperties:
      title: Domestic Payment PII Schema Object
      type: object
      additionalProperties: false
      description: Elements of Personal Identifiable Information data
      properties:
        Initiation:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEDomesticCreditor'
        Risk:
          $ref: '#/components/schemas/AERisk'

    AEBankServiceInitiation.AEInternationalPaymentPIIProperties:
      title: International Payment PII Schema Object
      type: object
      properties:
        Initiation:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditor'
        Risk:
          $ref: '#/components/schemas/AERisk'
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorParty:
      oneOf:
        - $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalIndividualCreditor'
        - $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalOrganisationCreditor'
      discriminator:
        propertyName: IdentityType
        mapping:
          Individual: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalIndividualCreditor'
          Organization: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalOrganisationCreditor'
      description: >-
        Party to which an amount of money is due, for an international payment. The Creditor is either an Individual
        (natural person) or an Organization, selected by the `IdentityType` discriminator.

    AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorName:
      type: object
      properties:
        en:
          type: string
          minLength: 1
          maxLength: 70
          description: English value of the Creditor name.
        ar:
          type: string
          minLength: 1
          maxLength: 70
          description: Arabic value of the Creditor name.
        ls:
          type: string
          minLength: 1
          maxLength: 70
          description: Local script value of the Creditor name.
      description: The Creditor name, represented in English (`en`), Arabic (`ar`) and/or local script (`ls`).
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorNameComponent:
      type: object
      properties:
        en:
          type: string
          minLength: 1
          maxLength: 35
          description: English value of the name component.
        ar:
          type: string
          minLength: 1
          maxLength: 35
          description: Arabic value of the name component.
        ls:
          type: string
          minLength: 1
          maxLength: 35
          description: Local script value of the name component.
      description: >-
        A component of the Creditor's name (e.g. first, middle or last name), represented in English (`en`),
        Arabic (`ar`) and/or local script (`ls`).
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEInternationalIndividualCreditor:
      type: object
      required:
        - IdentityType
      properties:
        IdentityType:
          type: string
          enum:
            - Individual
          description: Discriminator indicating the Creditor is an individual (natural person).
        Name:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorName'
        FirstName:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorNameComponent'
        MiddleName:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorNameComponent'
        LastName:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorNameComponent'
        RelationshipToSender:
          type: string
          enum:
            - Self
            - Spouse
            - Parent
            - Child
            - Sibling
            - Relative
            - Friend
            - Dependent
            - Employer
            - Employee
            - Business
            - Other
          description: The Creditor's relationship to the sender (Debtor).
        DateOfBirth:
          type: string
          format: date
          pattern: ^\d{4}-\d{2}-\d{2}$
          description: The Creditor's date of birth, in YYYY-MM-DD format.
        Occupation:
          type: string
          minLength: 1
          maxLength: 70
          description: The Creditor's occupation. Free-text, as values are driven by varying regulator requirements.
        Nationality:
          type: string
          pattern: ^[A-Z]{2}$
          description: The Creditor's nationality, as an ISO 3166-1 alpha-2 country code.
        Gender:
          type: string
          enum:
            - Male
            - Female
            - Other
          description: The Creditor's gender.
        CountryOfBirth:
          type: string
          pattern: ^[A-Z]{2}$
          description: The Creditor's country of birth, as an ISO 3166-1 alpha-2 country code.
        SourceOfIncome:
          type: string
          minLength: 1
          maxLength: 256
          description: The Creditor's source of income.
        SourceOfFunds:
          type: string
          minLength: 1
          maxLength: 256
          description: >-
            The Creditor's source of funds. Free-text; populated where Enhanced Due Diligence (e.g. by a
            correspondent bank) requires further information about the transaction.
        MobileNumber:
          type: string
          pattern: ^\+[1-9]\d{1,14}$
          description: The Creditor's mobile number, in E.164 format.
        Email:
          type: string
          pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
          description: The Creditor's email address.
        PostalAddress:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalAddress'
        Evidence:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorEvidence'
      description: Identification elements for an individual (natural person) international Creditor.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEInternationalOrganisationCreditor:
      type: object
      required:
        - IdentityType
      properties:
        IdentityType:
          type: string
          enum:
            - Organization
          description: Discriminator indicating the Creditor is an organisation.
        Name:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorName'
        AnyBIC:
          type: string
          pattern: ^[A-Z]{6}[A-Z0-9]{2}(?:[A-Z0-9]{3})?$
          description: The organisation's Business Identifier Code (BIC), per ISO 9362.
        LEI:
          type: string
          pattern: ^[A-Z0-9]{18}[0-9]{2}$
          description: The organisation's Legal Entity Identifier (LEI), per ISO 17442.
        Identification:
          type: string
          minLength: 1
          maxLength: 35
          description: >-
            Other organisation identifier, used in the edge cases where neither `AnyBIC` nor `LEI` is available.
            The identification scheme is given in `SchemeName`.
        SchemeName:
          type: string
          minLength: 1
          maxLength: 35
          description: >-
            Name of the identification scheme used for `Identification` (e.g. TradeLicence, TaxID, DUNS). Free-text,
            as there is no definitive scheme list for these edge cases.
        MobileNumber:
          type: string
          pattern: ^\+[1-9]\d{1,14}$
          description: The Creditor's mobile number, in E.164 format.
        Email:
          type: string
          pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
          description: The Creditor's email address.
        PostalAddress:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalAddress'
      description: Identification elements for an organisation international Creditor.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorEvidence:
      type: array
      minItems: 1
      description: >-
        Identity documents evidencing the Creditor's identity. Applicable to individual Creditors.
      items:
        type: object
        properties:
          Type:
            type: string
            enum:
              - Passport
              - DrivingPermit
              - IdCard
              - ResidencePermit
            description: The type of identity document.
          DocumentNumber:
            type: string
            minLength: 1
            maxLength: 35
            description: The document number.
          PersonalNumber:
            type: string
            minLength: 1
            maxLength: 35
            description: A personal number contained in the document.
          SerialNumber:
            type: string
            minLength: 1
            maxLength: 35
            description: A serial number contained in the document.
          CalendarType:
            type: string
            enum:
              - IslamicCalendar
              - GregorianCalendar
            description: The calendar used for the document's issuance and expiry dates.
          DateOfIssuance:
            type: string
            format: date
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: The date the document was issued, in YYYY-MM-DD format.
          DateOfExpiry:
            type: string
            format: date
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: The date the document expires, in YYYY-MM-DD format.
          Issuer:
            type: object
            required:
              - Name
              - CountryCode
              - Jurisdiction
            properties:
              Name:
                type: string
                minLength: 1
                maxLength: 140
                description: Name of the authority that issued the document.
              CountryCode:
                type: string
                pattern: ^[A-Z]{2}$
                description: Country that issued the document, as an ISO 3166-1 alpha-2 country code.
              Jurisdiction:
                type: string
                minLength: 1
                maxLength: 140
                description: The jurisdiction under which the document was issued.
            description: >-
              The authority that issued the document. When the `Issuer` object is present, `Name`, `CountryCode` and
              `Jurisdiction` are mandatory.
            additionalProperties: false
        additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEInternationalCreditorAgentProperties:
      type: object
      required:
        - SchemeName
        - Identification
      properties:
        SchemeName:
          type: string
          description: >
            The identification scheme for uniquely identifying the Agent.

            * BICFI: The BIC/SWIFT Code

            * Other: Identifier based on non-SWIFT payment system or local market scheme.
          enum:
            - BICFI
            - Other
        Identification:
          description: Identifier that can be the BIC/SWIFT code or target payment scheme identifier.
          type: string
        Name:
          description: Name by which an agent is known and which is usually used to identify that agent.
          type: string
          minLength: 1
          maxLength: 140
        PostalAddress:
          $ref: '#/components/schemas/AEBankServiceInitiationRichAuthorizationRequests.AEInternationalAddress'
        Branch:
          type: object
          required:
            - Identification
          properties:
            Identification:
              type: string
              minLength: 1
              maxLength: 35
              description: Identification of the specific branch of the financial institution.
            Name:
              type: string
              minLength: 1
              maxLength: 140
              description: Name of the specific branch of the financial institution.
          description: >-
            The specific branch of the financial institution that holds the Creditor Account. When the `Branch`
            object is present, `Identification` is mandatory.
          additionalProperties: false
      description: >-
        Properties of the Creditor Agent for an international payment, which provides information on the Financial
        Institution that holds the Creditor Account.
      additionalProperties: false

    AEBankServiceInitiationRichAuthorizationRequests.AEInternationalAddress:
      description: >-
        One-or-more addresses related to an international Creditor or Creditor Agent, based on the ISO 20022
        `PostalAddress27` definition and extended for SWIFT SR2026.
      type: array
      minItems: 1
      items:
        type: object
        required:
          - AddressType
          - AddressLine
          - TownName
          - Country
        properties:
          AddressType:
            description: The type of address.
            type: string
            enum:
              - Billing
              - Business
              - Correspondence
              - DeliveryTo
              - MailTo
              - POBox
              - Postal
              - Permanent
              - Residential
              - Statement
              - Other
          Department:
            description: Identification of a division of a large organisation or building.
            type: string
            minLength: 1
            maxLength: 70
          SubDepartment:
            description: Identification of a sub-division of a large organisation or building.
            type: string
            minLength: 1
            maxLength: 70
          AddressLine:
            description: >-
              Information that locates and identifies a specific address for a transaction entry, that is presented in
              free format text.
            type: array
            minItems: 1
            maxItems: 7
            items:
              type: string
              minLength: 1
              maxLength: 70
          BuildingNumber:
            description: The unit, apartment, or villa number within a building or community
            type: string
            minLength: 1
            maxLength: 16
          Room:
            description: Building room number.
            type: string
            minLength: 1
            maxLength: 16
          BuildingName:
            description: Name of the building or house.
            type: string
            minLength: 1
            maxLength: 140
          Floor:
            description: Floor or storey within a building.
            type: string
            minLength: 1
            maxLength: 70
          PostBox:
            description: The P.O. Box number assigned to the recipient for mail delivery.
            type: string
            minLength: 1
            maxLength: 16
          PostCode:
            description: Identifier consisting of a group of letters and/or numbers added to a postal address.
            type: string
            minLength: 1
            maxLength: 16
          StreetName:
            description: The name of the street or road where the property is located.
            type: string
            minLength: 1
            maxLength: 140
          TownLocationName:
            description: Specific location name within the town.
            type: string
            minLength: 1
            maxLength: 70
          TownName:
            description: Name of a built-up area, such as a town or city.
            type: string
            minLength: 1
            maxLength: 70
          DistrictName:
            description: The district, community, or neighbourhood where the property is located.
            type: string
            minLength: 1
            maxLength: 140
          CountrySubDivision:
            description: Country subdivision, such as state or province. Where the address is in the UAE this is the
              Emirate where the address is registered.
            anyOf:
              - type: string
                enum:
                - AbuDhabi
                - Ajman
                - Dubai
                - Fujairah
                - RasAlKhaimah
                - Sharjah
                - UmmAlQuwain
              - type: string
          Country:
            description: The country associated with the address, represented using the ISO 3166-1 alpha-2 country code.
            type: string
            pattern: ^[A-Z]{2}$
        additionalProperties: false

  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-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
    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-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-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-idempotency-key:
      name: x-idempotency-key
      in: header
      description: |
        Ensures the LFI processes the resource successfully only once per x-idempotency-key

        The TPP must not change the request body while using the same x-idempotency-key, changes to the request body 
        will not result any action on the end resource. 

        The OFP will treat a request as idempotent if it had received the first request with the same x-idempotency-key 
        from the same TPP in the preceding 24 hours.
      required: true
      schema:
        type: string
        maxLength: 40
        pattern: ^(\S*)$
      example: 78dae4513b8847f98e2d4173b4ed0eb6
    PaymentId:
      name: PaymentId
      in: path
      description: Unique identification as assigned by the LFI to uniquely identify the payment resource.
      schema:
        type: string
        minLength: 1
        maxLength: 40
      required: true
      example: 83b47199-90c2-4c05-9ef1-aeae68b0fc7c
    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
    baseConsentId:
      in: query
      name: baseConsentId
      required: false
      description: A Base Consent ID value that defines a group of linked consents. This parameter **must not** be 
        supplied if `combinedConsentGroupId` parameter is supplied.
      schema:
        type: string
      allowEmptyValue: false
      example: abc-19877d98-ab0e-4758-92a7-vvffr1234abv
    x-consent-id:
      name: x-consent-id
      in: header
      description: The Consent ID relating to the Payment Initiation Request, required where a given payment 
        instruction is part of a Combined Consent Group to ensure the payment is correctly executed against the correct
        consent. TPPs must replay the value they assigned to the consent in the Rich Authorization Request.
      required: false
      schema:
        type: string
        format: uuid
  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.
    UserOAuth2Security:
      type: oauth2
      description: >-
        [OAuth2 PAR flow](https://datatracker.ietf.org/doc/html/rfc9126), it is required when the User needs to perform
        SCA with the LFI when a TPP wants to access an LFI resource owned by the User. **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:
        authorizationCode:
          authorizationUrl: https://authserver.example/authorization
          tokenUrl: https://authserver.example/token
          scopes:
            openid: Activates OpenID Connect Support
            payments: Ability for initiating payments. This is a parameterized scope with the ConsentId
            accounts: Ability for accessing account information.
    LFIWebhookSecurity:
      type: http
      description: >-
        The LFI generates a Self Signed JWT Authorization Token for Client Authentication with the TPP. **Please refer
        to Self-Signed JWT Authorization Token Specification in the UAE Standard API User Guide**
      scheme: bearer
      bearerFormat: JWT
  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: 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: 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: An Internal Server error has occurred. Please retry in 60 seconds.
