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

# Verify OTP payment



## OpenAPI

````yaml POST /erp/verify-otp-payment
openapi: 3.1.0
info:
  title: StarPay API
  version: 1.0.0
  description: >
    StarPay API is a RESTful API that provides access to various functionalities
    of the StarPay system.

    This API allows users to manage product categories, including creating,
    updating, deleting, and retrieving product categories.

    The API uses JWT for thirdparty and supports various response formats.


    **Transaction status**


    Use **real-time** `GET /erp/api/txn-sse` (Server-Sent Events) to follow
    status updates for a `billRefNo`. If the SSE stream does not yield a usable
    result within **15 seconds**, call **`POST /erp/check-txn`** with the same
    `billRefNo` to poll the current transaction status.
servers:
  - url: https://starpayqa.starpayethiopia.com/v1/starpay-api
    description: Local server
security: []
tags:
  - name: erp
  - name: thirdparty
paths:
  /erp/verify-otp-payment:
    post:
      tags:
        - erp
      summary: Verify OTP payment
      operationId: verifyOtpPayment
      parameters:
        - in: header
          name: x-api-secret
          required: true
          description: API secret key.
          schema:
            type: string
            example: MFUxSN98EV5IUU+RhYZh2f866adcTa4F5HJ2dGI3t8+MH3cvfk/gAZ492TnxwdiI
        - in: header
          name: x-message-id
          required: true
          description: Message ID from account lookup when verifying OTP payment.
          schema:
            type: string
            example: >-
              0a162ea504918e1c85f64da9733b64bf25ff400394f8e1da6cdfb656e1338b9a8fe47e1b32429f13b1495b075857bf98
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyOtpPaymentRequest'
      responses:
        '200':
          description: OTP payment verified successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifyOtpPaymentResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    VerifyOtpPaymentRequest:
      type: object
      properties:
        otpCode:
          type: string
          example: '686435'
        accountNumber:
          type: string
          example: '5075361069011'
        billRefNo:
          type: string
          example: HY724Z749C
      required:
        - otpCode
        - accountNumber
        - billRefNo
    VerifyOtpPaymentResponse:
      type: object
      properties:
        status:
          type: string
          example: success
        timestamp:
          type: string
          format: date-time
        message:
          type: string
          example: Success
        data:
          $ref: '#/components/schemas/VerifyOtpPaymentResponseData'
      required:
        - status
        - timestamp
        - message
        - data
    VerifyOtpPaymentResponseData:
      type: object
      properties:
        transactionId:
          type: string
          format: uuid
        billRefNo:
          type: string
          example: HY724Z749C
        status:
          type: string
          example: PAID
        amount:
          type: number
          example: 100
        customerName:
          type: string
          example: Walk-in Customer
        customerPhoneNumber:
          type: string
          example: '+251944719460'
        merchantName:
          type: string
          example: kaldis hq
        merchantId:
          type: string
          example: 6992cc567b78d101f42345a6
        externalReference:
          type: string
          example: 075SMPC231670253
        paymentChannel:
          type: string
          example: OTP_ACCOUNT
        paidAt:
          type: string
          example: 25 Mar 2026, 1:56 PM
        redirectUrl:
          type: string
          example: ''
        paidAmount:
          type: number
          example: 100
      required:
        - transactionId
        - billRefNo
        - status
        - amount
        - customerName
        - customerPhoneNumber
        - merchantName
        - merchantId
        - externalReference
        - paymentChannel
        - paidAt
        - redirectUrl
        - paidAmount
    BadRequestError:
      type: object
      properties:
        status:
          type: string
          example: error
        timestamp:
          type: string
          example: '2025-05-07T07:31:30.824Z'
        path:
          type: string
          example: /v2/starpay-api/
        error:
          type: object
          properties:
            code:
              type: string
              example: BadRequestException
            message:
              type: string
              example: Missing required payload data, pk and payload is required
    thirdpartyError:
      type: object
      properties:
        message:
          type: string
          example: Something wrong
        status:
          type: string
          example: error
        timestamp:
          type: string
          example: '2025-05-07T07:31:30.824Z'
        path:
          type: string
          example: /v2/starpay-api/
        error:
          type: object
          properties:
            code:
              type: string
              example: GEN_004
            message:
              type: string
              example: An unexpected server error occurred.
    NotFoundError:
      type: object
      properties:
        message:
          type: string
          example: Something wrong
        status:
          type: string
          example: error
        timestamp:
          type: string
          example: '2025-05-07T07:31:30.824Z'
        path:
          type: string
          example: /v2/starpay-api/
        error:
          type: object
          properties:
            code:
              type: string
              example: ABC_001
            message:
              type: string
              example: not found
    serverError:
      type: object
      properties:
        message:
          type: string
          example: Something wrong
        status:
          type: string
          example: error
        timestamp:
          type: string
          example: '2025-05-07T07:31:30.824Z'
        path:
          type: string
          example: /v2/starpay-api/
        error:
          type: object
          properties:
            code:
              type: string
              example: GEN_004
            message:
              type: string
              example: An unexpected server error occurred.
  responses:
    BadRequest:
      description: Bad request.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/BadRequestError'
    Unauthorized:
      description: Unauthorized.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/thirdpartyError'
    NotFound:
      description: Not found.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/NotFoundError'
    ServerError:
      description: internal.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/serverError'

````