v3.2 Released 300+ REST Endpoints 6 SDK Languages

Build on the
Zung.ai
platform.

The complete developer reference for the Zung.ai MFI Banking OS. 300+ REST endpoints, webhooks, SDKs in 6 languages, and step-by-step integration guides for every major MFI workflow.

300+API Endpoints
6SDK Languages
40+Webhook Events
99.99%API Uptime SLA
loan_origination.js
members.py
webhook.php
Run
// Zung.ai API — Loan Origination
import { ZungClient } from '@zung/sdk';

const zung = new ZungClient({
  apiKey: process.env.ZUNG_API_KEY,
  institution: 'inst_faulu_ke_001'
});
// Originate a new loan with AI scoring
const loan = await zung.loans.originate({
  memberId:  'mem_fatuma_n_8821',
  product:   'business_loan',
  amount:    8000,
  currency: 'KES',
  aiScore:  true,
  disburse: 'mpesa'
});
200 OK — Response
{
  "loanId":      "loan_0x8821_ke",
  "status":     "disbursed",
  "aiScore":    82,
  "mpesaRef":   "QHX7821KE",
  "disbursedAt": "2026-06-24T09:14:22Z",
  "decision":   "auto_approved"
}
Quick start

From zero to first API call in 3 minutes

Install the SDK
Add the Zung SDK to your project
Available for Node.js, Python, PHP, Ruby, Go, and Java. Pick your language and install in one command.
npm install @zung/sdk
All 6 languages →
Get your API key
Authenticate with your institution key
Generate your API key from the Zung Developer Hub. Sandbox keys are available instantly — no approval required.
ZUNG_API_KEY=sk_live_••••••••••
Open Developer Hub ↗
Make your first call
Fetch a member's loan portfolio
One authenticated request returns the complete loan portfolio for any member — with AI score, PAR status, and repayment history.
zung.members.get('mem_id')
See full example →
API Reference

300+ REST endpoints, one base URL

All endpoints follow REST conventions. Base URL: https://api.zung.ai/v3

Full reference ↗
Members 28 endpoints
Create, read, update, and manage member profiles, KYC status, documents, and financial history.
GET /v3/members/{member_id} Get member profile
Returns the complete member profile including KYC status, loan history, savings summary, AI credit score, and engagement data.
ParameterTypeRequiredDescription
member_idstringrequiredUnique member identifier (prefix mem_)
includestring[]optionalFields to include: loans, savings, ai_score, kyc
as_atISO 8601optionalReturn member state at a specific point in time
POST /v3/members Create new member
Onboard a new member with full KYC data, contact details, and optional immediate AI credit assessment.
Body fieldTypeRequiredDescription
first_namestringrequiredMember's first name
last_namestringrequiredMember's surname
phoneE.164requiredPhone number in E.164 format e.g. +254712345678
id_typeenumrequirednational_id | passport | aadhaar | nin
ai_scorebooleanoptionalRun AI credit assessment on creation. Default: false
POST /v3/loans/originate Originate loan with AI
Originate a new loan with optional AI credit scoring, bureau checks, and instant M-Pesa disbursement. Returns within 8 seconds when AI scoring is enabled.
Body fieldTypeRequiredDescription
member_idstringrequiredMember receiving the loan
amountnumberrequiredLoan amount in smallest currency unit
currencyISO 4217requirede.g. KES, NGN, INR, BDT
ai_scorebooleanoptionalRun Zung AI credit scoring before decision
disburseenumoptionalmpesa | mtn | airtel | bank | wallet
GET /v3/portfolio/par Portfolio at Risk report
Returns live PAR30, PAR60, and PAR90 metrics across your entire loan portfolio, with drill-down by product, branch, loan officer, and member segment.
Official SDKs

6 languages. One consistent API.

Every SDK wraps the full REST API with idiomatic patterns, typed request/response models, automatic retries, and built-in pagination handling.

🟨
JavaScript / TypeScript
@zung/sdk · v3.2.1 · Recommended
Full TypeScript support with auto-generated types for every request and response. Works in Node.js 18+ and modern browsers. Tree-shakeable ESM.
npm install @zung/sdk
🐍
Python
zung-python · v3.2.0
Supports Python 3.9+. Async-first with asyncio support. Pydantic models for all types. Works with Django, FastAPI, and Flask.
pip install zung-python
🐘
PHP
zung/zung-php · v3.2.0
Composer package for PHP 8.1+. Built for Laravel and Symfony with service provider auto-discovery. PSR-18 HTTP client compatibility.
composer require zung/sdk
🦫
Go
github.com/zung-ai/go-sdk · v3.2
Idiomatic Go client with context support, structured logging, and zero external dependencies. Fully concurrency-safe.
go get github.com/zung-ai/go-sdk
💎
Ruby
zung-ruby · v3.2.0
RubyGems package for Ruby 3.1+. Rails integration with generators for common MFI workflows. Faraday adapter with automatic retry logic.
gem install zung
Java / Kotlin
ai.zung:zung-java · v3.2.0
Maven and Gradle compatible. Java 17+ and Kotlin 1.9+. Spring Boot auto-configuration included. Supports reactive programming with Project Reactor.
implementation 'ai.zung:zung-java:3.2.0'
Code examples

Common MFI workflows, in code

// Originate a loan with AI scoring + M-Pesa disbursement
import { ZungClient } from '@zung/sdk';

const zung = new ZungClient({
  apiKey: process.env.ZUNG_API_KEY
});

const loan = await zung.loans.originate({
  memberId:  'mem_fatuma_n_8821',
  product:   'business_loan',
  amount:    800000,  // KES in cents
  currency:  'KES',
  aiScore:   true,
  bureau:    'crb_kenya',
  disburse:  'mpesa',
  notify:    true
});

console.log(loan.status);   // 'disbursed'
console.log(loan.aiScore);  // 82
console.log(loan.mpesaRef); // 'QHX7821KE'
200 OK · 1,840ms
{
  "loanId":        "loan_0x8821_ke",
  "status":        "disbursed",
  "memberId":      "mem_fatuma_n_8821",
  "amount":        800000,
  "currency":      "KES",
  "aiScore":       82,
  "aiDecision":    "auto_approved",
  "bureauResult":  "clear",
  "mpesaRef":      "QHX7821KE",
  "mpesaPhone":    "+254712345678",
  "product":       "business_loan",
  "term":          12,
  "interestRate":  1.5,
  "disbursedAt":   "2026-06-24T09:14:22Z",
  "firstDueDate":  "2026-07-24",
  "notified":      true
}
Webhooks

40+ real-time events

Register an HTTPS endpoint and receive event payloads the moment anything changes in your institution. Signed with HMAC-SHA256. Automatic retry with exponential backoff.

All events signed · Retry on failure
loan.disbursed
Triggered the moment a loan is disbursed to a member's wallet or bank account via any payment rail.
{ loanId, memberId, amount, rail, mpesaRef, timestamp }
repayment.received
Fired when a repayment is received and matched to a loan account — via STK Push, manual, or bank.
{ repaymentId, loanId, amount, channel, balance, timestamp }
loan.par_flagged
Emitted when a loan crosses a PAR threshold (30, 60, or 90 days). Includes AI-recommended action.
{ loanId, parDays, aiAction, memberId, outstanding }
member.kyc_verified
Fired when a member completes KYC verification — biometric, document, or bureau-based.
{ memberId, kycMethod, verifiedAt, riskLevel }
ai.score_computed
Emitted when the AI credit engine completes a member score computation with full SHAP breakdown.
{ memberId, score, grade, shapValues, model, timestamp }
savings.deposit
Triggered when a savings deposit is recorded for a member account from any channel.
{ depositId, memberId, amount, balance, channel, timestamp }
payment.failed
Fired when a disbursement or collection attempt fails. Includes error code and recommended retry strategy.
{ txId, loanId, errorCode, retryAt, channel, reason }
aml.alert_raised
Emitted when the AML engine raises an alert against a member, transaction, or counterparty.
{ alertId, memberId, matchType, riskScore, action }
compliance.report_filed
Triggered when an automated regulatory report is generated and submitted for your institution.
{ reportId, type, jurisdiction, period, status }
Integration guides

Step-by-step for every major MFI workflow

All guides ↗
Member Onboarding + eKYC
End-to-end member creation with document verification, biometric matching, and bureau cross-check. Covers all 8 supported ID types.
12 min read
Read guide
M-Pesa STK Push Collections
Configure and receive real-time M-Pesa repayments via STK Push. Covers IPN callbacks, duplicate detection, and automatic loan reconciliation.
18 min read
Read guide
AI Credit Scoring Integration
Integrate Zung's AI credit engine into your loan origination flow. Includes SHAP explanation rendering, thin-file handling, and override policies.
22 min read
Read guide
AML Screening + FATF Compliance
Configure PEP, sanctions, and adverse media screening at member onboarding and at each transaction. Covers STR generation and regulator escalation.
15 min read
Read guide
PAR Dashboard with Webhooks
Build a live PAR monitoring dashboard using the Portfolio API and webhook events. Covers real-time PAR tracking, delinquency alerts, and branch drill-down.
25 min read
Read guide
WhatsApp + USSD Banking
Deploy Zung's conversational AI across WhatsApp Business API and USSD menus. Members can check balances, make repayments, and apply for loans without a smartphone.
20 min read
Read guide
OpenAPI Specification
Machine-readable.
Import anywhere.
The complete Zung.ai API is described in a single OpenAPI 3.0 spec file. Import into Postman, Insomnia, Stoplight, or any OpenAPI-compatible tool. Use it to generate clients in any language.
OpenAPI 3.0.3 — full specification
300+ paths with full request / response schemas
JSON Schema validation for every request body
Postman collection auto-generated from spec
Updated automatically with every API release
openapi.yaml · v3.2
openapi: "3.0.3"
info:
  title: Zung.ai Platform API
  version: "3.2.0"
  contact:
    email: dev@mfidoc.com
servers:
  - url: https://api.zung.ai/v3
    description: Production
  - url: https://sandbox.zung.ai/v3
    description: Sandbox
paths:
  /members:
    get:
      summary: List members
      tags: [Members]
    ... # 300+ more endpoints
Support & Community

We're here when you get stuck

Developer Email
Direct line to the Zung platform team. Questions on integration architecture, auth, webhooks, or the API — we respond within 4 hours on business days.
dev@mfidoc.com
Response within 4 business hours
Send email
Zung Developer Hub
Interactive API explorer, sandbox credentials, webhook tester, full endpoint search, and live request/response playground. No setup required.
app.zung.ai/store/developer-hub
Sandbox access · No approval needed
Open Dev Hub
Documentation
Comprehensive guides, code examples, integration walkthroughs, architecture diagrams, and migration guides — all indexed and searchable.
mfidoc.com · Current site
Updated with every API release
Quick start
Developer support
dev@mfidoc.com
Integration help & API questions
Plugin submissions
mfimarket.com/developers
List your plugin on MFI Market
Powered by
zung.ai
AI-native core banking platform
Legal & Developer Disclaimer
🖥 Developer Documentation ⚡ Powered by zung.ai 🔑 API Infrastructure 🏛 MFI-Licensed Operations
Developer Documentation Only
mfidoc.com is a technical documentation and API reference platform — not a financial service provider, payment processor, or regulated institution. Documentation, code examples, SDK guides, and API references are provided to assist licensed MFIs and authorised developers in integrating with the zung.ai platform. mfidoc.com does not itself provide access to live financial systems — all API calls execute against the deploying institution's own zung.ai environment.
Regulatory Licensing — Held by Deploying MFIs
All financial operations executed via the Zung.ai API — including loan origination, savings management, payment collection, KYC verification, and AML screening — are conducted under the regulatory licences held by the MFI or SACCO deploying the platform. Developers integrating this API are responsible for ensuring their implementing institution holds the appropriate licences in their jurisdiction before going live. zung.ai and mfidoc.com do not hold financial service licences on behalf of API consumers.
Code Examples & SDK Samples
All code examples, API snippets, SDK samples, and webhook payloads in this documentation are provided for illustrative and integration guidance purposes only. Sample data (member IDs, loan references, M-Pesa codes, amounts) is fictitious. Production integrations must use real credentials issued via the Zung Developer Hub. Sandbox environments are available for testing — do not use production API keys in development environments.
  • Never commit live API keys to version control
  • Sandbox keys (sk_test_) are rate-limited and do not process real funds
  • Live keys (sk_live_) execute real financial transactions under the MFI's licence
zung.ai Enterprise Infrastructure
mfidoc.com documents the zung.ai enterprise core banking platform — an AI-native financial infrastructure layer for licensed MFIs and SACCOs in 180 countries. zung.ai is not a consumer-facing financial services provider.
  • API uptime SLAs apply to the zung.ai platform, not to mfidoc.com documentation availability
  • Platform integrity maintained via SHA-256 signed API packages
  • Member, borrower, and transaction data resides on the deploying MFI's own infrastructure — not on mfidoc.com or zung.ai shared servers
Important: mfidoc.com and zung.ai do not provide financial advice, credit assessment, investment recommendations, or regulated financial services to end users or borrowers. All financial transactions executed via the Zung.ai API are processed exclusively under the licences held by the MFI or SACCO operating the platform. Developers and integrating institutions are solely responsible for ensuring their implementation complies with all applicable financial services regulations, data protection laws (including GDPR, Kenya Data Protection Act, NDPR, PDPA), and KYC/AML obligations in their jurisdiction. API documentation is provided under a commercial licence agreement — access does not grant rights to the underlying platform without a signed zung.ai institutional agreement.
mfidoc.com · Developer Documentation & API Reference · Powered by zung.ai Enterprise Core Banking · API v3.2 · 300+ endpoints · 99.99% uptime SLA applies to zung.ai platform · All regulated financial services are operated exclusively by the licensed MFIs deploying the platform — not by mfidoc.com or zung.ai · Privacy Policy · Terms of Use · Developer Hub