openapi: 3.0.0
info:
  title: Query eLoad Transaction
  description: Retrieve transaction information by external transaction ID.
paths:
  /api/rest:
    post:
      summary: queryeLoadTransaction
      description: Retrieve transaction information by external transaction ID.
      operationId: queryeLoadTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                access_token:
                  type: string
                  maxLength: 500
                method:
                  type: string
                  maxLength: 64
                version:
                  type: string
                  maxLength: 10
                content:
                  type: object
                  properties:
                    msgId:
                      type: string
                      maxLength: 30
                      description: Unique Message ID generated by 3rd party system.
                      example: AAA202503201230450001
                    msisdn:
                      type: string
                      description: >-
                        Agent USSD MSISDN. Mandatory when contact channel is
                        UMB.
                      example: '601112345678'
                    numTxn:
                      type: string
                      description: >-
                        Number of latest transaction(s) returned. Expected Value
                        5 (Max 10). Mandatory when msisdn has value.
                      example: '5'
                    extTxnNbr:
                      type: string
                      description: >-
                        External system transaction ID. Mandatory when msisdn,
                        numTxn, and txnNbr parameters are blank.
                      example: EXT1234567890
                    txnNbr:
                      type: string
                      description: >-
                        Transaction number generated from eLoad. Mandatory when
                        msisdn, numTxn, and extTxnNbr parameters are blank.
                      example: TXN9876543210
      responses:
        '200':
          description: Transaction query result
          content:
            application/json:
              schema:
                type: object
                properties:
                  res_code:
                    type: string
                    maxLength: 10
                    example: '00000'
                  res_message:
                    type: string
                    maxLength: 255
                    example: Operation success
                  result:
                    type: object
                    properties:
                      resultCode:
                        type: string
                        maxLength: 60
                        example: DBEP0000
                      resultMsg:
                        type: string
                        maxLength: 255
                        example: Success
                      transactions:
                        type: array
                        items:
                          type: object
                          properties:
                            extTxnNbr:
                              type: string
                              example: EXT1234567890
                            txnNbr:
                              type: string
                              example: TXN9876543210
                            txnType:
                              type: string
                              description: >-
                                Transaction Type Expected Value Payment,
                                Deposit, Credit, Transfer
                              example: Payment
                            txnStatus:
                              type: string
                              description: >-
                                Transaction status Expected Value Reserve,
                                Commit, Rollback, Success, Reverse
                              example: Success
                            txnTime:
                              type: string
                              description: >-
                                Date and time of the transaction. Expected
                                Format YYYY-MM-DD HH:MM:SS
                              example: '2025-03-20 12:45:30'
                            fromOrgCode:
                              type: string
                              description: Source Organization Code
                              example: ORG12345
                            toOrgCode:
                              type: string
                              description: Destination Organization Code
                              example: ORG67890
                            fromEloadBeforeAmount:
                              type: number
                              description: >-
                                The balance before transaction deducted.
                                Expected Format 0.00
                              example: 100
                            fromEloadAfterAmount:
                              type: number
                              description: >-
                                The balance after transaction deducted. Expected
                                Format 0.00
                              example: 80
                            toEloadBeforeAmount:
                              type: number
                              description: >-
                                The balance before transaction deducted.
                                Expected Format 0.00
                              example: 50
                            toEloadAfterAmount:
                              type: number
                              description: >-
                                The balance after transaction deducted. Expected
                                Format 0.00
                              example: 70
                            amount:
                              type: string
                              description: Amount to be deducted. Expected Format 0.00
                              example: '20.00'
                            channel:
                              type: string
                              example: Online
                            isReversed:
                              type: string
                              example: 'No'
                            revTxnNbr:
                              type: string
                              example: REV1234567890
                            revTxnType:
                              type: string
                              example: Reverse
                            revTxnStatus:
                              type: string
                              example: Rollback
                            revTxnTime:
                              type: string
                              example: '2025-03-20 13:00:00'
                            revOrgCode:
                              type: string
                              example: ORG54321
                            revFromEloadBeforeAmount:
                              type: number
                              example: 80
                            revToEloadBeforeAmount:
                              type: number
                              example: 70
                            revAmount:
                              type: string
                              example: '20.00'
                            revChannel:
                              type: string
                              example: Online
      x-validation-rules:
        - rule: MSISDN is USSD enabled.
          resultCode: DBEP0651
        - rule: extTxnNbr or txnNbr transaction exists.
          resultCode: DBEP0657
        - rule: >-
            When "numTxn" parameter passed in, value must not be higher than 10
            (Configurable).
          resultCode: DBEP0660
      x-error-codes:
        - code: DBEP0000
          message: Success
        - code: DBEP0651
          message: MSISDN is not USSD enabled.
        - code: DBEP0657
          message: Transaction not found.
        - code: DBEP0660
          message: Total of transactions queried exceeded.
        - code: DBEP9999
          message: Other errors.
components: {}
