---
openapi: 3.0.3
info:
  title: NBB Virtual Account Suite
  description: These are the APIs that the NBB platform provides for managing Ledgers
  termsOfService: http://swagger.io/terms/
  contact:
    email: aqeel.habib@nbbonline.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
externalDocs:
  description: Find out more about NBB
  url: https://www.nbbonline.com
servers:
- url: https://gateway.finhub.ai/fhlqm/1.0.0
- url: http://gateway.finhub.ai/fhlqm/1.0.0
tags:
- name: Ledger Introduction
  description: Typical Marketplace Journey <img src='https://docs.google.com/drawings/d/e/2PACX-1vQyASz6n9KkyDfo_JzYWRpkWTeor9XvMwMj0a1zp79LfYF0WghvnzYarknR61nafNoEn40Fttux1fMF/pub?w=946&h=452'>
- name: Ledger Account Management
  description: APIs to manage ledger accounts<img src='https://docs.google.com/drawings/d/e/2PACX-1vSHqqtY5SZvVNA90FqJM-3vD54cKihCU6bQ5R_6Ej_7Xur0WwOwZ-OiiCKyv5fG_Zl485WaOB0xA4W9/pub?w=936&h=449'>
- name: Ledger Lien Management
  description: APIs to mark/realize/cancel lien on ledger accounts
- name: Ledger Account Transaction Management
  description: APIs to manage the transactions of the ledger accounts - both to Ledger as well to Physical  <img src='https://docs.google.com/drawings/d/e/2PACX-1vTYcp3mAG4kdVUA-5dx0qx7ZUBP0hMkJnKZTWcnpJAfAhznBGFkOVaVu7t4DH-rHoh7_O8rIl7LYl04/pub?w=944&h=457'> <image src='https://docs.google.com/drawings/d/e/2PACX-1vQeiyTQFA3aa3pOJZeITcDmYOu8IEU-0W_wK5z7rwrfY9FEncjIEWTngHelxd1fk9lmEkdf0SfSANUO/pub?w=964&h=635'>
paths:
  /api/ledger/accounts:
    get:
      tags:
      - Ledger Account Management
      summary: Fetch Ledger Accounts
      operationId: fetchLedgerAccounts
      parameters:
      - name: filter
        in: query
        description: Fields that are required as part of response
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: select
        in: query
        description: Fields that are required as part of response
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: page
        in: query
        description: Page number of the response payload
        required: false
        style: form
        explode: true
        schema:
          type: integer
      - name: pageCount
        in: query
        description: Number of records to return per page
        required: false
        style: form
        explode: true
        schema:
          type: integer
      responses:
        "200":
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/fetchLedgerAccountDetails'
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
    post:
      tags:
      - Ledger Account Management
      summary: Create a ledger account
      operationId: createLedgerAccount
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ledgerAccountRequest'
        required: true
      responses:
        "200":
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledgerAccountResponse'
        "400":
          description: Functional Validation Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400_4'
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
      x-codegen-request-body-name: body
  /api/ledger/accounts/{ledgerAccountId}:
    get:
      tags:
      - Ledger Account Management
      summary: Fetch Ledger Account
      operationId: fetchLedgerAccount
      parameters:
      - name: ledgerAccountId
        in: path
        description: The ledgerAccountId that needs to be fetched
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: filter
        in: query
        description: Fields that are required as part of response
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: select
        in: query
        description: Fields that are required as part of response
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: page
        in: query
        description: Page number of the response payload
        required: false
        style: form
        explode: true
        schema:
          type: integer
      - name: pageCount
        in: query
        description: Number of records to return per page
        required: false
        style: form
        explode: true
        schema:
          type: integer
      responses:
        "200":
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledgerAccountResponse'
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
    put:
      tags:
      - Ledger Account Management
      summary: Amend Ledger Account
      operationId: amendLedgerAccount
      parameters:
      - name: ledgerAccountId
        in: path
        description: The ledgerAccountId that needs to be amended
        required: true
        style: simple
        explode: false
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ledgerAccountAmend'
        required: true
      responses:
        "200":
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledgerAccountResponse'
        "400":
          description: Functional Validation Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400_5'
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
      x-codegen-request-body-name: body
    delete:
      tags:
      - Ledger Account Management
      summary: Delete Ledger Account
      operationId: deleteLedgerAccount
      parameters:
      - name: ledgerAccountId
        in: path
        description: The ledgerAccountId that needs to be deleted
        required: true
        style: simple
        explode: false
        schema:
          type: string
      responses:
        "200":
          description: Successful Response
          content: {}
        "400":
          description: Functional Validation Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400_6'
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  /api/ledger/transaction:
    post:
      tags:
      - Ledger Account Transaction Management
      summary: Initiate a Ledger to Ledger transaction
      operationId: initiateLedgerToLedgerTransaction
      parameters:
      - name: Content-Type
        in: header
        description: content type along with the version of the API being invoked
        required: true
        style: simple
        explode: false
        schema:
          type: string
          default: application/json;version=1
      - name: Authorization
        in: header
        description: Auth token to access the endpoint for the ledger
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: X-LQM-TrackingId
        in: header
        description: Tracking ID to trace the request for logging/debugging purposes
        required: false
        style: simple
        explode: false
        schema:
          type: string
      requestBody:
        description: Split enabled transaction request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/transactionRequest'
        required: true
      responses:
        "200":
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transactionResponse'
        "400":
          description: Functional Validation Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transactionErrorResponse'
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
      x-codegen-request-body-name: body
  /api/ledger/entries:
    get:
      tags:
      - Ledger Account Transaction Management
      summary: Fetch Ledger Account Entries
      operationId: fetchLedgerAccountEntries
      parameters:
      - name: Content-Type
        in: header
        description: content type along with the version of the API being invoked
        required: true
        style: simple
        explode: false
        schema:
          type: string
          default: application/json;version=1
      - name: Authorization
        in: header
        description: Auth token to access the endpoint for the ledger
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: X-LQM-TrackingId
        in: header
        description: Tracking ID to trace the request for logging/debugging purposes
        required: false
        style: simple
        explode: false
        schema:
          type: string
      - name: filter
        in: query
        description: JSON string of filter parameters to fetch
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: select
        in: query
        description: Fields that are required as part of response
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: sort
        in: query
        description: Fields on which sorting needs to be applied
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: page
        in: query
        description: Page number of the response payload
        required: false
        style: form
        explode: true
        schema:
          type: integer
      - name: pageCount
        in: query
        description: Number of records to return per page
        required: false
        style: form
        explode: true
        schema:
          type: integer
      responses:
        "200":
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/fetchLedgerEntries'
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  /api/ledger/payments:
    get:
      tags:
      - Ledger Account Transaction Management
      summary: Fetch Payments made from a ledger
      operationId: getPayments
      parameters:
      - name: Content-Type
        in: header
        description: content type along with the version of the API being invoked
        required: true
        style: simple
        explode: false
        schema:
          type: string
          default: application/json;version=1
      - name: Authorization
        in: header
        description: Auth token to access the endpoint for the ledger
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: X-LQM-TrackingId
        in: header
        description: Tracking ID to trace the request for logging/debugging purposes
        required: false
        style: simple
        explode: false
        schema:
          type: string
      - name: filter
        in: query
        description: JSON string of filter parameters to fetch
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: select
        in: query
        description: Fields that are required as part of response
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: sort
        in: query
        description: Fields on which sorting needs to be applied
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: page
        in: query
        description: Page number of the response payload
        required: false
        style: form
        explode: true
        schema:
          type: integer
      - name: pageCount
        in: query
        description: Number of records to return per page
        required: false
        style: form
        explode: true
        schema:
          type: integer
      - name: totalCount
        in: query
        description: Whether total count matching the filter criteria needs to be returned in the response
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      responses:
        "200":
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paymentFetchResponse'
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
    post:
      tags:
      - Ledger Account Transaction Management
      summary: Initiate a Ledger to Physical Account Payment
      operationId: initiateLedgerToPhysicalPayment
      parameters:
      - name: Content-Type
        in: header
        description: content type along with the version of the API being invoked
        required: true
        style: simple
        explode: false
        schema:
          type: string
          default: application/json;version=1
      - name: Authorization
        in: header
        description: Auth token to access the endpoint for the ledger
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: X-LQM-TrackingId
        in: header
        description: Tracking ID to trace the request for logging/debugging purposes
        required: false
        style: simple
        explode: false
        schema:
          type: string
      requestBody:
        description: Split enabled transaction request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/paymentRequest'
        required: true
      responses:
        "200":
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paymentResponse'
        "400":
          description: Functional Validation Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transactionErrorResponse'
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
      x-codegen-request-body-name: body
  /api/ledger/lien:
    get:
      tags:
      - Ledger Lien Management
      summary: Lien Fetch API
      description: API to fetch marked Liens
      operationId: lienFetch
      parameters:
      - name: filter
        in: query
        description: JSON string of filter parameters to fetch
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: select
        in: query
        description: Fields that are required as part of response
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: sort
        in: query
        description: Fields on which sorting needs to be applied
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: page
        in: query
        description: Page number of the response payload
        required: false
        style: form
        explode: true
        schema:
          type: integer
      - name: pageCount
        in: query
        description: Number of records to return per page
        required: false
        style: form
        explode: true
        schema:
          type: integer
      - name: totalCount
        in: query
        description: Whether total count matching the filter criteria needs to be returned in the response
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      - name: Authorization
        in: header
        description: Bearer Token generated using login API of NBB Virtual Account Suite
        required: true
        style: simple
        explode: false
        schema:
          type: string
      responses:
        "200":
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/lienFetchResponse'
        "400":
          description: Functional Validation Failure
          content: {}
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  /api/ledger/lien/mark:
    post:
      tags:
      - Ledger Lien Management
      summary: Lien Marking API
      description: API to mark lien on a ledger
      operationId: lienMark
      parameters:
      - name: Content-Type
        in: header
        description: content type along with the version of the API being invoked
        required: true
        style: simple
        explode: false
        schema:
          type: string
          default: application/json;version=1
      - name: Authorization
        in: header
        description: Auth token to access the endpoint for the ledger
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: X-LQM-TrackingId
        in: header
        description: Tracking ID to trace the request for logging/debugging purposes
        required: false
        style: simple
        explode: false
        schema:
          type: string
      requestBody:
        description: Split enabled transaction request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/lienMarkRequest'
        required: true
      responses:
        "200":
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/lienMarkResponse'
        "400":
          description: Functional Validation Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transactionErrorResponse'
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
      x-codegen-request-body-name: body
  /api/ledger/lien/realize/LIEN1201:
    post:
      tags:
      - Ledger Lien Management
      summary: Lien Realize API
      description: API to realize an already marked lien
      operationId: lienRealize
      parameters:
      - name: Content-Type
        in: header
        description: content type along with the version of the API being invoked
        required: true
        style: simple
        explode: false
        schema:
          type: string
          default: application/json;version=1
      - name: Authorization
        in: header
        description: Auth token to access the endpoint for the ledger
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: X-LQM-TrackingId
        in: header
        description: Tracking ID to trace the request for logging/debugging purposes
        required: false
        style: simple
        explode: false
        schema:
          type: string
      responses:
        "200":
          description: Successful Response
          content: {}
        "400":
          description: Functional Validation Failure
          content: {}
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  /api/ledger/lien/cancel/LIEN1201:
    post:
      tags:
      - Ledger Lien Management
      summary: Lien Cancel API
      description: API to cancel a marked Lien
      operationId: lienCancel
      parameters:
      - name: Content-Type
        in: header
        description: content type along with the version of the API being invoked
        required: true
        style: simple
        explode: false
        schema:
          type: string
          default: application/json;version=1
      - name: Authorization
        in: header
        description: Auth token to access the endpoint for the ledger
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: X-LQM-TrackingId
        in: header
        description: Tracking ID to trace the request for logging/debugging purposes
        required: false
        style: simple
        explode: false
        schema:
          type: string
      responses:
        "200":
          description: Successful Response
          content: {}
        "400":
          description: Functional Validation Failure
          content: {}
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
components:
  schemas:
    inline_response_400_errors:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
    inline_response_400_4:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/inline_response_400_errors'
      example: "{errors=[{message=Invalid Type, code=LQM_ERR_INVALID_TYPE}]}"
    fetchLedgerAccountDetails:
      type: array
      items:
        $ref: '#/components/schemas/fetchLedgerAccountDetails_inner'
    ledgerAccountRequest:
      type: object
      properties:
        ledgerId:
          type: string
        parentLedgerAccountId:
          type: string
        status:
          type: string
          enum:
          - Active
          - Inactive
        type:
          type: string
          enum:
          - Wallet
          - Invoice
          - Points
          - Crypto
          - Transaction
        name:
          type: string
        email:
          type: string
          format: email
        mobileNb:
          type: string
        limits:
          type: array
          items:
            $ref: '#/components/schemas/ledgerAccountRequest_limits'
        minBalance:
          type: number
        maxBalance:
          type: number
        attributes:
          $ref: '#/components/schemas/ledgerAccountRequest_attributes'
      example:
        ledgerId: UBEREATS
        parentLedgerAccountId: ""
        status: Active
        type: Wallet
        name: Jane Doe
        email: jane.doe@mail.com
        mobileNb: ""
        limits:
        - frequency: Daily
          applicable: Debit
          totalAmount: 1000
          nbOfEntries: 100
        - frequency: Daily
          applicable: Credit
          totalAmount: 1000
          nbOfEntries: 10
        minBalance: 100
        maxBalance: 10000
        attributes:
          identifier: "12312313133334"
    ledgerAccountResponse:
      type: object
      properties:
        ledgerAccountId:
          type: string
        ledgerId:
          type: string
        parentLedgerAccountId:
          type: string
        status:
          type: string
          enum:
          - Active
          - Inactive
        balances:
          $ref: '#/components/schemas/ledgerAccountResponse_balances'
        type:
          type: string
          enum:
          - Wallet
          - Invoice
          - Points
          - Crypto
          - Transaction
        name:
          type: string
        email:
          type: string
          format: email
        mobileNb:
          type: string
        minBalance:
          type: number
        maxBalance:
          type: number
        _metadata:
          $ref: '#/components/schemas/ledgerAccountResponse__metadata'
      example:
        ledgerAccountId: BH45BHD12312313133334
        ledgerId: UBEREATS
        parentLedgerAccountId: ""
        status: Active
        balances:
          available: 0
          ledger: 0
          notional: 0
        type: Wallet
        name: Jane Doe
        email: jane.doe@mail.com
        mobileNb: ""
        limits:
        - frequency: Daily
          applicable: Debit
          totalAmount: 1000
          utilizedTotalAmount: 0
          nbOfEntries: 100
          utilizedTotalNbOfEntries: 0
        - frequency: Daily
          applicable: Credit
          totalAmount: 1000
          utilizedTotalAmount: 0
          nbOfEntries: 10
          utilizedTotalNbOfEntries: 0
        minBalance: 100
        maxBalance: 10000
        attributes:
          key:
            identifier: 120120301210
        _metadata:
          lastUpdated: 2024-02-05T10:20:39.606Z
          createdAt: 2024-02-05T10:20:39.606Z
          deleted: false
    ledgerAccountAmend:
      type: object
      properties:
        status:
          type: string
          enum:
          - Active
          - Inactive
        email:
          type: string
          format: email
        mobileNb:
          type: string
        minBalance:
          type: number
        maxBalance:
          type: number
      example:
        status: Inactive
        email: jane.doe@mail.com
        mobileNb: ""
        limits:
        - frequency: Daily
          applicable: Debit
          totalAmount: 1000
          nbOfEntries: 100
        - frequency: Daily
          applicable: Credit
          totalAmount: 1000
          nbOfEntries: 10
        minBalance: 100
        maxBalance: 10000
    inline_response_400_5:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/inline_response_400_errors'
      example: "{errors=[{message=Status Invalid, code=LQM_LEDGER_ACCOUNT_VALIDATION}]}"
    inline_response_400_6:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/inline_response_400_errors'
      example: "{errors=[{message=Status Invalid, code=LQM_LEDGER_ACCOUNT_VALIDATION}]}"
    lienFetchResponse_data:
      type: object
      properties:
        lienId:
          type: string
        amount:
          type: string
        status:
          type: string
          enum:
          - ACTC
          - ACSC
          - CANC
        remarks:
          type: string
        ledgerEntryId:
          type: string
        paymentId:
          type: string
        _metadata:
          $ref: '#/components/schemas/ledgerAccountResponse__metadata'
    lienFetchResponse:
      type: array
      example:
      - lienId: LIEN1201
        amount: 2000
        status: ACTC
        remarks: Lien for Order ID 20001
        ledgerEntryId: LE1200012
        paymentId: PAY102010111
        _metadata:
          lastUpdated: 2024-02-05T10:20:39.606Z
          createdAt: 2024-02-05T10:20:39.606Z
          deleted: false
      - lienId: LIEN1202
        amount: 2000
        status: ACSC
        remarks: Lien for Order ID 20002
        ledgerEntryId: LE1200012
        paymentId: PAY102010111
        _metadata:
          lastUpdated: 2024-02-05T10:20:39.606Z
          createdAt: 2024-02-05T10:20:39.606Z
          deleted: false
      - lienId: LIEN1203
        amount: 2000
        status: CANC
        remarks: Lien for Order ID 20003
        ledgerEntryId: LE1200012
        paymentId: PAY102010111
        _metadata:
          lastUpdated: 2024-02-05T10:20:39.606Z
          createdAt: 2024-02-05T10:20:39.606Z
          deleted: false
      items:
        $ref: '#/components/schemas/lienFetchResponse_data'
    lienMarkRequest:
      type: object
      properties:
        ledgerAccountId:
          type: string
        amount:
          type: number
        attributes:
          type: object
        expiresAt:
          type: string
        remarks:
          type: string
      example:
        ledgerAccountId: BH48BHD12312312312355
        amount: 10
        attributes: {}
        expiresAt: 2024-02-02T20:00:00
        remarks: Lien for order placed - O121021
    lienMarkResponse:
      type: object
      properties:
        lienId:
          type: string
          description: Lien ID generated
        _metadata:
          $ref: '#/components/schemas/ledgerAccountResponse__metadata'
      example:
        lienId: LIEN12000111
        _metadata:
          lastUpdated: 2024-02-05T10:20:39.606Z
          createdAt: 2024-02-05T10:20:39.606Z
          deleted: false
    transactionErrorResponse:
      type: object
      properties:
        platformRefNo:
          type: string
          description: Client provided unique reference number
        errors:
          type: array
          items:
            $ref: '#/components/schemas/inline_response_400_errors'
      example:
        platformRefNo: ORDER1
        errors:
        - code: LQM_ERR_AMOUNT_VALIDATION
          message: Amount mismatch between control sum and individual credits
    fetchLedgerEntries:
      type: object
      properties:
        ledgerAccountId:
          type: string
        indicator:
          type: string
        amount:
          type: number
        status:
          type: string
          enum:
          - ACTC
          - ACSC
          - RJCT
          - CANC
        attributes:
          type: object
        lienId:
          type: object
        paymentId:
          type: object
        _metadata:
          $ref: '#/components/schemas/ledgerAccountResponse__metadata'
      example:
      - ledgerAccountId: BH51BHD12312312312354
        indicator: Debit
        amount: 20
        runningBalance: 20
        status: ACSP
        lienId: LIEN120102
        paymentId: PAY102010111
        attributes: {}
        _metadata:
          lastUpdated: 2024-02-05T10:20:39.606Z
          createdAt: 2024-02-05T10:20:39.606Z
          deleted: false
    transactionRequest:
      type: object
      properties:
        lienId:
          type: string
        ledgerEntries:
          type: array
          items:
            $ref: '#/components/schemas/transactionRequest_ledgerEntries'
      example:
        lienId: ""
        ledgerEntries:
        - ledgerAccountId: BH51BHD12312312312354
          indicator: Debit
          amount: 20
          attributes: {}
        - ledgerAccountId: BH45BHD12312312312356
          indicator: Credit
          amount: 20
          attributes: {}
    transactionResponse:
      type: array
      example:
      - ledgerAccountId: BH51BHD12312312312354
        indicator: Debit
        amount: 20
        runningBalance: 130
        ledgerEntryId: LE120011
        _metadata:
          lastUpdated: 2024-02-05T10:20:39.606Z
          createdAt: 2024-02-05T10:20:39.606Z
          deleted: false
      - ledgerAccountId: BH45BHD12312312312356
        indicator: Debit
        amount: 20
        runningBalance: 10
        ledgerEntryId: LE120011
        _metadata:
          lastUpdated: 2024-02-05T10:20:39.606Z
          createdAt: 2024-02-05T10:20:39.606Z
          deleted: false
      items:
        $ref: '#/components/schemas/transactionResponse_inner'
    paymentRequest:
      type: object
      properties:
        category:
          type: string
        paymentInfo:
          $ref: '#/components/schemas/paymentRequest_paymentInfo'
        creditTransactionInfo:
          type: array
          items:
            $ref: '#/components/schemas/paymentRequest_creditTransactionInfo'
      example:
        category: Ride
        paymentInfo:
          ledgerAccountId: BH51BHD12312312312354
          platformRefNo: VENDORPAY1
          instructedControlSum: 10
        creditTransactionInfo:
        - fragmentPlatformRefNo: PAY1
          account:
            iban: BH54MBOB2101020120120111
          amount: 10
          transactionAttributes:
            goods: officesupplies
    paymentResponse:
      type: object
      properties:
        paymentId:
          type: string
        status:
          type: string
          enum:
          - ACTC
          - ACSC
          - RJCT
          - CANC
        category:
          type: string
        paymentInfo:
          $ref: '#/components/schemas/paymentRequest_paymentInfo'
        creditTransactionInfo:
          type: array
          items:
            $ref: '#/components/schemas/paymentRequest_creditTransactionInfo'
        _metadata:
          $ref: '#/components/schemas/ledgerAccountResponse__metadata'
      example:
        paymentId: PAY1020121
        status: ACTC
        category: Ride
        paymentInfo:
          ledgerAccountId: BH51BHD12312312312354
          platformRefNo: VENDORPAY1
          instructedControlSum: 10
        creditTransactionInfo:
          fragmentPlatformRefNo: PAY1
          account:
            iban: BH54MBOB2101020120120111
          amount: 10
          transactionAttributes:
            goods: officesupplies
        _metadata:
          lastUpdated: 2024-02-05T10:20:39.606Z
          createdAt: 2024-02-05T10:20:39.606Z
          deleted: false
    paymentFetchResponse:
      type: array
      items:
        $ref: '#/components/schemas/paymentResponse'
    fetchLedgerAccountDetails_inner:
      type: object
      properties:
        ledgerAccountId:
          type: string
        ledgerId:
          type: string
        parentLedgerAccountId:
          type: string
        status:
          type: string
          enum:
          - Active
          - Inactive
        balances:
          required:
          - available
          - ledger
          - notional
          type: object
          properties:
            available:
              type: number
            ledger:
              type: number
            notional:
              type: number
        type:
          type: string
          enum:
          - Wallet
          - Invoice
          - Points
          - Crypto
          - Transaction
        name:
          type: string
        email:
          type: string
          format: email
        mobileNb:
          type: string
        minBalance:
          type: number
        maxBalance:
          type: number
        _metadata:
          type: object
          properties:
            lastUpdated:
              type: string
              format: date-time
            createdAt:
              type: string
              format: date-time
            deleted:
              type: boolean
      example:
        ledgerAccountId: BH45BHD12312312312356
        ledgerId: UBEREATS
        parentLedgerAccountId: ""
        status: Active
        balances:
          available: 0
          ledger: 0
          notional: 0
        type: Wallet
        name: Jane Doe
        email: jane.doe@mail.com
        mobileNb: ""
        limits:
        - frequency: Daily
          applicable: Debit
          totalAmount: 1000
          utilizedTotalAmount: 0
          nbOfEntries: 100
          utilizedTotalNbOfEntries: 0
        - frequency: Daily
          applicable: Credit
          totalAmount: 1000
          utilizedTotalAmount: 0
          nbOfEntries: 10
          utilizedTotalNbOfEntries: 0
        minBalance: 100
        maxBalance: 10000
        attributes: {}
        _metadata:
          lastUpdated: 2024-02-05T10:20:39.606Z
          createdAt: 2024-02-05T10:20:39.606Z
          deleted: false
    ledgerAccountRequest_limits:
      required:
      - applicable
      - frequency
      - nbOfEntries
      - totalAmount
      type: object
      properties:
        frequency:
          type: string
          enum:
          - Individual
          - Daily
          - Monthly
          - Yearly
        applicable:
          type: string
          enum:
          - Debit
          - Credit
        totalAmount:
          type: number
        nbOfEntries:
          type: integer
    ledgerAccountRequest_attributes:
      type: object
      properties:
        identifier:
          type: string
    ledgerAccountResponse_balances:
      required:
      - available
      - ledger
      - notional
      type: object
      properties:
        available:
          type: number
        ledger:
          type: number
        notional:
          type: number
    ledgerAccountResponse__metadata:
      type: object
      properties:
        lastUpdated:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        deleted:
          type: boolean
    transactionRequest_ledgerEntries:
      type: object
      properties:
        ledgerAccountId:
          type: string
        indicator:
          type: string
        amount:
          type: number
        attributes:
          type: object
    transactionResponse_inner:
      type: object
      properties:
        ledgerAccountId:
          type: string
        indicator:
          type: string
        amount:
          type: number
        runningBalance:
          type: number
        attributes:
          type: string
        ledgerEntryId:
          type: string
        _metadata:
          type: object
          properties:
            lastUpdated:
              type: string
              format: date-time
            createdAt:
              type: string
              format: date-time
            deleted:
              type: boolean
    paymentRequest_paymentInfo:
      type: object
      properties:
        ledgerAccountId:
          type: string
        platformRefNo:
          type: string
        instructedControlSum:
          type: number
      additionalProperties: false
    paymentRequest_account:
      type: object
      properties:
        iban:
          type: string
      additionalProperties: false
    paymentRequest_transactionAttributes:
      type: object
      properties:
        goods:
          type: string
    paymentRequest_creditTransactionInfo:
      type: object
      properties:
        fragmentPlatformRefNo:
          type: string
        account:
          $ref: '#/components/schemas/paymentRequest_account'
        amount:
          type: number
        transactionAttributes:
          $ref: '#/components/schemas/paymentRequest_transactionAttributes'
  securitySchemes:
    petstore_auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://petstore3.swagger.io/oauth/authorize
          scopes:
            write:pets: modify pets in your account
            read:pets: read your pets
    api_key:
      type: apiKey
      name: api_key
      in: header
