openapi: 3.0.0
info:
  title: Commit Reserved Transaction
  description: >
    Commits a previously reserved transaction that was made using the `setSale`
    API. This will finalize the transaction and make it official, based on the
    provided transaction details.
  version: 1.0.0
paths:
  /api/rest:
    post:
      summary: commitSale
      description: >
        Commits a previously reserved transaction that was made using the
        `setSale` API. This will finalize the transaction and make it official,
        based on the provided transaction details.
      operationId: commitSale
      x-consumption-style: synchronous
      x-transaction-processing-style: synchronous
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                access_token:
                  type: string
                  maxLength: 500
                  description: API Gateway access token
                  example: abc123xyz456
                method:
                  type: string
                  maxLength: 64
                  description: API name
                  example: commitSale
                version:
                  type: string
                  maxLength: 10
                  description: API version
                  example: 1.0.0
                content:
                  type: object
                  properties:
                    msgId:
                      type: string
                      maxLength: 30
                      description: >-
                        Unique Message ID generated by 3rd party system. Format
                        [AAAYYYYMMDDHH24MISSCCCC]
                      example: '0472023040112305999'
                    channel:
                      type: string
                      maxLength: 20
                      description: Fixed value for each channel (e.g., "047" for UMREX)
                      example: '047'
                    extOrderNbr:
                      type: string
                      description: >-
                        CRM order number that was submitted during the `setSale`
                        API
                      example: CRMORDER001
                  required:
                    - msgId
                    - channel
                    - extOrderNbr
              required:
                - access_token
                - method
                - version
                - content
      responses:
        '200':
          description: Commit successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  res_code:
                    type: string
                    maxLength: 10
                    example: '00000'
                    description: Response code
                  res_message:
                    type: string
                    maxLength: 255
                    example: Operation success
                    description: Response message
                  result:
                    type: object
                    description: PIN change result
                    properties:
                      resultCode:
                        type: string
                        maxLength: 60
                        example: DBEP0000
                        description: Success
                      resultMsg:
                        type: string
                        maxLength: 255
                        example: Success
                        description: Service result message
                      transactions:
                        type: array
                        items:
                          type: object
                          properties:
                            txnNbr:
                              type: string
                              example: TXN987654
                              description: The transaction number generated by eLoad
                            txnType:
                              type: string
                              enum:
                                - Payment
                                - Deposit
                              example: Payment
                              description: Transaction type
                            amount:
                              type: string
                              example: '50.00'
                              description: Amount to be processed (e.g., "50.00")
                            txnTime:
                              type: string
                              format: date-time
                              example: '2023-04-01T12:30:59Z'
                              description: >-
                                Date and time of the transaction (format ISO
                                8601)
                            eloadBeforeAmount:
                              type: string
                              example: '50.00'
                              description: The balance before the transaction is committed
                            eloadAfterAmount:
                              type: string
                              example: '100.00'
                              description: The balance after the transaction is committed
                            txnStatus:
                              type: string
                              enum:
                                - Success
                              example: Success
                              description: Transaction status (e.g., "Success")
                            extTxnNbr:
                              type: string
                              example: EXTTXN001
                              description: External system transaction ID, same as input
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  res_code:
                    type: string
                    example: '400'
                  res_message:
                    type: string
                    example: Invalid request data
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  res_code:
                    type: string
                    example: '500'
                  res_message:
                    type: string
                    example: Internal server error
components: {}
