> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stablepay.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate MoMo Account

> Validate M-Pesa merchants (Till/Paybill) or resolve mobile money operators by phone number



## OpenAPI

````yaml POST /momo/resolve
openapi: 3.0.1
info:
  title: Stable Pay API
  description: The API for the Stable Pay Gateway
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.stablepay.ai
security:
  - bearerAuth: []
tags:
  - name: Transactions
    description: Operations related to payment transactions
  - name: Payouts
    description: Operations related to payouts
  - name: Identity
    description: Operations related to Stablepay ID management
  - name: Mpesa
    description: Operations related to Mpesa payouts
  - name: ForeignExchange
    description: Operations related to currency conversion
  - name: MoMo
    description: Operations related to Mobile Money
  - name: resolve
    description: Operations related to account resolution
  - name: validate
    description: Operations related to account validation
paths:
  /momo/resolve:
    post:
      tags:
        - resolve
        - validate
      summary: Resolve a Till, Paybill number, or Mobile Money operator
      description: >-
        Validate M-Pesa merchants (Till/Paybill) or resolve mobile money
        operators by phone number
      operationId: momoResolve
      requestBody:
        description: Resolve an M-Pesa Till/Paybill number or Mobile Money phone operator
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateRequest'
        required: true
      responses:
        '200':
          description: Validation request successfully processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateResponse'
        '400':
          description: Bad request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MomoBadRequestResponse'
        '401':
          description: Unauthorized - invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MomoInvalidKeys'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
components:
  schemas:
    ValidateRequest:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: Type of account to resolve
          enum:
            - paybill
            - till
            - momo
        accountNumber:
          type: string
          description: |-
            For M-Pesa Paybill: the Paybill business number (6 digits). 
             For M-Pesa Till: the Till number (6 digits). 

             Required for paybill and till type.
        phoneNumber:
          type: string
          description: 'For MoMo: Phone number with country code.'
          example: '+254727614739'
    ValidateResponse:
      type: object
      required:
        - valid
        - type
      properties:
        valid:
          type: boolean
          description: Whether the validation was successful
        type:
          type: string
          description: Type of account that was resolved
          enum:
            - paybill
            - till
            - momo
        accountName:
          type: string
          description: Resolved account name for M-Pesa Paybill or M-Pesa Till payment.
        accountNumber:
          type: string
          description: Validated account number for M-Pesa Paybill or M-Pesa Till payment.
        phoneNumber:
          type: string
          description: Validated phone number for MoMo payment.
        operators:
          type: array
          items:
            type: string
          description: Resolved mobile operators for MoMo payment.
          example:
            - safaricom
        message:
          type: string
          description: Additional information about the validation result
    MomoBadRequestResponse:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: object
          description: Details of the error.
        message:
          type: string
          description: Error message.
        statusCode:
          type: integer
          format: int32
          description: Error code
        details:
          type: object
          description: Additional error details, typically contains the request.
          additionalProperties: true
    MomoInvalidKeys:
      type: object
      required:
        - error
        - message
      properties:
        message:
          type: string
          description: API key is required to access this endpoint.
        error:
          type: string
          description: Missing Authorization Header
        details:
          type: string
          description: >-
            Please provide a valid API key in the Authorization header using
            Bearer scheme
        statusCode:
          type: integer
          format: int32
          description: Error code
    InternalServerError:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: integer
          format: int32
          description: Error code
        message:
          type: string
          description: Error message
        details:
          type: object
          description: Additional error details
          additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        API key authentication using Bearer scheme. 
         Format: Bearer {STA_xxxx}

````