M-Pesa (Safaricom Daraja) Dynamic QR API

The Dynamic QR API from M-Pesa (Safaricom Daraja) — 1 operation(s) for dynamic qr.

Operations 1

POST /mpesa/qrcode/v1/generate Generate a dynamic M-Pesa QR code. #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mpesa-dynamic-qr-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mpesa-dynamic-qr-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: M-Pesa Daraja Account Balance Dynamic QR API
  description: 'Safaricom Daraja REST APIs for the M-Pesa mobile-money platform in Kenya: authorization, M-Pesa Express (STK Push), C2B, B2C, B2B, B2B Express Checkout, transaction status, account balance, reversal, dynamic QR, tax remittance and standing orders (M-Pesa Ratiba). Modeled from public Daraja documentation.'
  version: '1.0'
  termsOfService: https://developer.safaricom.co.ke/
  contact:
    name: Safaricom Daraja Support
    url: https://developer.safaricom.co.ke/
servers:
- url: https://api.safaricom.co.ke
  description: Production
- url: https://sandbox.safaricom.co.ke
  description: Sandbox
security:
- bearerAuth: []
tags:
- name: Dynamic QR
paths:
  /mpesa/qrcode/v1/generate:
    post:
      operationId: dynamicQR
      tags:
      - Dynamic QR
      summary: Generate a dynamic M-Pesa QR code.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DynamicQRRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
components:
  schemas:
    DynamicQRRequest:
      type: object
      properties:
        MerchantName:
          type: string
        RefNo:
          type: string
        Amount:
          type: integer
        TrxCode:
          type: string
          description: BG=Buy Goods, PB=Paybill, WA=Withdraw, SB=Send to Business, SM=Send Money.
        CPI:
          type: string
          description: Credit Party Identifier (till/paybill/agent number).
        Size:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: OAuth access token from /oauth/v1/generate
    basicAuth:
      type: http
      scheme: basic