> ## 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.

# Create Payment

> Enable peer-to-peer transfers, pay merchants or off-ramp stablecoins across Africa.



## OpenAPI

````yaml POST /momo/payout
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/payout:
    post:
      tags:
        - Mpesa
        - MoMo
        - Momo
      summary: Create new MoMo Payout Request
      description: >-
        Enable peer-to-peer transfers, pay merchants or off-ramp stablecoins
        across Africa.
      operationId: createMpesaPayout
      requestBody:
        description: Create a new Payment.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MpesaPayoutRequest'
        required: true
      responses:
        '200':
          description: Payout request successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MpesaPayoutResponse'
        '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:
    MpesaPayoutRequest:
      type: object
      required:
        - amount
        - destination
        - accountNumber
        - currency
        - country
        - reference
        - accountName
      properties:
        amount:
          type: number
          description: >-
            The payment amount in local currency (ZAR, NGN, KES, GHS, UGX, TZS,
            ZMW, ETB). 

             Use Get FX API to obtain USDC/T amount to debit user. 

             Refer to Countries & Limits for mimimum and maximum amounts.
        destination:
          type: string
          description: >-
            Payment destination to either pay bills, pay merchants or mobile
            money.
          enum:
            - Bank Account
            - MoMo
            - Paybill
            - Till
          default: Paybill
        accountName:
          type: string
          description: >-
            The registered account name for Bank, MoMo or M-Pesa (Paybill /
            Till) payments.
        accountNumber:
          type: string
          description: |-
            Bank: Bank account number (10-16 digits). 

             MoMo: Mobile Money phone number ( phone code + phone number, no plus sign). 

             Paybill: M-Pesa Paybill business number (1-20 characters). 

             Till: M-Pesa Till number (6 digits). 
          minLength: 1
        businessNumber:
          type: string
          description: >-
            Only required for Paybill destination: M-Pesa Paybill business
            number (6 digits).
          minLength: 6
        reference:
          type: string
          description: Wallet issuers unique reference.
        currency:
          type: string
          description: Local currency type for the payout.
          enum:
            - ZAR
            - NGN
            - KES
            - UGX
            - GHS
            - TZS
            - ZMW
            - ETB
          default: KES
        country:
          type: string
          description: Country code (2 digit).
          enum:
            - ZA
            - NG
            - KE
            - GH
            - UG
            - TZ
            - ZM
            - ET
          default: KE
        code:
          type: string
          description: |-
            Payment code of the Bank or Mobile Network Operator. 

             Available Bank code options: Refer to Countries & Limits for available Bank codes per country. 

             Available MoMo code options: MPesa, MTN, Airtel, Tigo, Telebirr, CBE, Zamtel 

             Refer to Countries & Limits for available MoMo codes per country.
          enum:
            - MPesa
            - MTN
            - Airtel
            - Tigo
            - Telebirr
            - CBE
            - Zamtel
            - '100004'
          default: MPesa
    MpesaPayoutResponse:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
          description: Payout status.
        transactionId:
          type: string
          description: >-
            Transaction ID to query the transaction status using the Stablepay
            Get Payment Status webhook.
    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}

````