> ## 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 Bank Account

> Validate account number and resolve account name for Banks in Kenya and Nigeria.



## OpenAPI

````yaml POST /account/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:
  /account/resolve:
    post:
      tags:
        - resolve
        - validate
      summary: Validate Bank Account
      description: >-
        Validate account number and resolve account name for Banks in Kenya and
        Nigeria.
      operationId: validateBankAccount
      requestBody:
        description: Resolve a Bank account number.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResolveAccountRequest'
        required: true
      responses:
        '200':
          description: Account resolved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResolveAccountResponse'
        '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'
        '422':
          description: Account not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
components:
  schemas:
    ResolveAccountRequest:
      type: object
      required:
        - accountNumber
        - currency
        - bankCode
        - paymentType
      properties:
        accountNumber:
          type: string
          description: Bank account number for Banks in Kenya and Nigeria.
        currency:
          type: string
          description: Currency of the account.
          enum:
            - NGN
            - KES
        paymentType:
          type: string
          description: Payment method type.
          enum:
            - bank
        bankCode:
          type: string
          enum:
            - '100004'
            - '100033'
            - '011'
            - '058'
            - '033'
            - '090267'
            - '110006'
          description: |-
            Required for bank method.

            | Code | Bank |
            |------|------|
            | 100004 | Opay |
            | 100033 | PalmPay |
            | 011 | First Bank PLC |
            | 058 | Guaranty Trust Bank |
            | 033 | United Bank for Africa |
            | 090267 | Kuda |
            | 110006 | Paystack |
    ResolveAccountResponse:
      type: object
      required:
        - accountId
        - accountName
      properties:
        accountId:
          type: string
        accountName:
          type: string
    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
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: integer
          format: int32
          description: Error code
        message:
          type: string
          description: Human-readable error message
        details:
          type: object
          description: Additional error details
          additionalProperties: true
    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}

````