👤 Saudi Citizen & Resident Profile
Nafath: PENDINGSaudi National Bank (SNB / الأهلي)
IBAN: SA03 1000 0001 0998 8776 6554💸 sarie & mada Real-Time Payments
Personal P2P QR Code (SAMA sarie Standard)
رمز الاستجابة السريعة الشخصي للتحويل الفوري عبر سريع
SA0310...6554
📡 Live Balance & Push Notification Stream ● SSE Stream: ACTIVE
Direct server-push of real-time Debit/Credit alerts, bilingual SAMA Sarie SMS & Push notifications, and updated CBS balances
🏪 Saudi Merchant Terminal & POS
ZATCA & SAMA COMPLIANT🔐 Merchant Login & LocalStorage Session
⚡ No Headers Req
Calls POST /api/v1/merchant/login without Authorization, X-API-KEY, X-Signature, or Idempotency-Key. Receives and synchronizes credentials directly into browser localStorage.
Live mada / sarie QR Code (SAMA Standard)
🧾 Merchant Operations (عمليات التاجر)
1. Generate Dynamic mada Order QR
Generates an instant QR code with fixed bill amount in SAR and order reference.
2. Issue Real-Time sarie Refund (استرداد فوري)
Credits customer's Saudi bank account directly and debits merchant escrow.
3. Register New Saudi Merchant
🧾 SADAD Electronic Bill Payment (سداد)
SADAD NATIONAL SCHEMEPay utility, government, telecom, and merchant bills directly using the SADAD bill number.
📄 SADAD Invoicing for Merchants
Issue an official SADAD electronic invoice to your customer for instant payment.
📈 Real-Time Scheme Distribution & Volume Share (توزيع العمليات حسب أنظمة المدفوعات)
Proportional volume share in SAR⚡ Live SAMA Switch Transaction Feed & ISO 20022 Audit Stream
0 Transactions| Time | Scheme & ISO 20022 | sarie RRN (12-digit) | UTR / TxId | Remitter | Beneficiary / Merchant | Amount (SAR) | Latency | Status | Inspect |
|---|
🔐 Field-Level Encryption (AES-256-GCM)
SAMA CYBERSECURITYProtects Saudi National ID, Iqama, Saudi IBANs, and Commercial Registrations using authenticated AES-256-GCM with a 96-bit random IV and 128-bit authentication tag.
🛡️ SAMA & Saudi Payments Architecture
Supports quick transfers up to SAR 2,500 without beneficiary activation, and standard transfers up to SAR 20,000 using proxy identifiers (Mobile number, National ID, IBAN).
Standardized QR format for merchant acquiring and point-of-sale in Saudi Arabia with instant settlement.
Unified digital authentication matching National ID / Iqama with random 2-digit confirmation prompts in the Nafath mobile app.
Electronic bill presentment connecting government, utilities, and telecom operators for instant settlement.
🐘 Active Database Engine: PostgreSQL 18.3 (محرك قاعدة البيانات النشط)
ONLINE • AWS RDS (ap-south-2)PostgreSQL Relational Tables & Record Inventory (ksa_switch):
Live schema telemetry updated on every transaction🚨 Purge PostgreSQL Data & Reset Switch as Fresh (تنظيف قاعدة البيانات وبدء المقسم بحالة نظيفة)
Purges all registered users, device fingerprints, central switch ledger transactions, settlements, and temporary Nafath/SADAD sessions from the active AWS RDS PostgreSQL database. Restores standard CBS demo balances (SNB: SAR 45k, Al Rajhi: SAR 85k, Riyad: SAR 60k, Alinma: SAR 32k), runs table optimization, and resets the switch clean for a fresh demo.
👥 Registered Users Manager (إدارة المستخدمين)
Remove registered users to re-test onboarding, device binding, and Nafath eKYC.
| User / Mobile | Primary IBAN / Alias | Nafath KYC | SAMA sarie P2P QR | Action |
|---|
⚡ Transactional Data Cleanup (حذف العمليات)
Clear double-entry ledger transactions, settlements, and reset balances.
Purges all switch transactions (0), merchant settlements, dynamic QR orders, and resets merchant escrow to SAR 0.00.
- ✓ Purges Central Switch Ledger (
transactionstable in PostgreSQL) - ✓ Purges Merchant Settlements & Payouts (
settlementstable) - ✓ Resets Merchant Escrow Balances back to SAR 0.00
- ✓ Resets CBS Demo Bank Accounts (SNB: 45k, Al Rajhi: 85k, Riyad: 60k, Alinma: 32k)
- ✓ Runs PostgreSQL ANALYZE & clears Live SSE feeds
Restores initial SAR balances without deleting transactions.
📖 Complete SAMA KSA Switch REST API Reference
Interactive Explorer (SAR)⚡ Official SAMA Swagger UI & OpenAPI 3.0 Documentation v2.0.0
Explore and test all 40+ endpoints interactively including sarie P2P, mada QR, Nafath eKYC, and all 13 Merchant modules with live schema validation against AWS RDS PostgreSQL.
/api/v1/payments/p2p
Execute Real-time sarie Instant Transfer (سريع)
{
"remitterMobile": "0501234567",
"beneficiaryMobile": "0559876543", // Or beneficiaryIban: "SA0380000008..."
"amount": 450.00, // In SAR
"pin": "1234",
"note": "Lunch share / قطة الغداء"
}
/api/v1/payments/p2m
Execute mada QR Merchant Payment (مدى)
{
"remitterMobile": "0501234567",
"qrPayload": "sarie://pay?iban=SA031000...&pn=Tamimi&am=175.50&cu=SAR",
"amount": 175.50,
"pin": "1234"
}
/api/v1/payments/sadad/pay
Pay SADAD Electronic Bill (سداد)
{
"billNumber": "1000293847",
"remitterIban": "SA0310000001099887766554",
"pin": "1234"
}
/api/v1/kyc/nafath/initiate
Initiate Nafath National SSO Authentication (نفاذ)
{
"nationalId": "1098765432",
"mobileNumber": "0501234567"
}
/api/v1/payments/m2p/refund
sarie Merchant Refund (Reversal to Customer IBAN)
{
"merchantId": "MERCH_123456",
"originalRrn": "627017043068",
"refundAmount": 100.00,
"refundReason": "Customer return"
}
/api/v1/payments/m2b/settle
Merchant Instant Settlement to Saudi IBAN
{
"merchantId": "MERCH_123456",
"amount": 500.00
}
/api/v1/demo/users
List all registered users with linked accounts and aliases
// Response 200 OK
{
"success": true,
"count": 2,
"users": [ ... ]
}
/api/v1/demo/users/:userId
Remove a registered user by User ID or Mobile Number
// Example: DELETE /api/v1/demo/users/USR_0501234567
// Or POST /api/v1/demo/users/delete with { "userId": "USR_..." }
/api/v1/demo/transactions
Clear transactions ledger, settlements, and reset SAR balances
// Example: DELETE /api/v1/demo/transactions
// Or POST /api/v1/demo/transactions/clear
/api/v1/demo/reset
Factory Reset Demo Switch (removes users + transactions + restores seed)
// Example: POST /api/v1/demo/reset
{}
/api/v1/database/info
Get Active PostgreSQL RDS Cluster Info, Endpoint, Sizes & Live Table Inventory
// Response 200 OK
{
"success": true,
"engine": "PostgreSQL",
"engineVersion": "PostgreSQL 18.3 (AWS RDS)",
"database": "ksa_switch",
"host": "qt-postgresql-sandbox.cho0kak8uejo.ap-south-2.rds.amazonaws.com:5432",
"ssl": "TLS Active (AWS RDS)",
"sizeHuman": "9.6 MB",
"cumulativeVolumeSAR": 0.00,
"tableCounts": {
"users": 10, "transactions": 14, "bank_accounts": 30, "settlements": 2, ...
}
}
/api/v1/database/checkpoint
Execute PostgreSQL Maintenance & Query Planner ANALYZE
// Request: POST /api/v1/database/checkpoint
{}
// Response 200 OK: Executes ANALYZE in PostgreSQL, updates query planner statistics, returns refreshed telemetry
/api/v1/database/purge
Purge System Data (target: ALL | USERS | TRANSACTIONS) and Start Fresh
// Request: POST /api/v1/database/purge
{
"target": "ALL", // "ALL", "USERS", or "TRANSACTIONS"
"resetBalances": true
}
// Response 200 OK: Returns purge summary, reset balances, and fresh database statistics
/api/v1/monitoring/overview
Get Real-Time Switch Health, Participant Banks, SAMA SLA Latency & KPIs
// Response 200 OK
{
"success": true,
"timestamp": "2026-09-29T11:15:30.000Z",
"services": [
{ "id": "sarie_ips", "name": "sarie Instant IPS Rails (سريع)", "status": "UP", "slaLatencyMs": 0.85, ... },
{ "id": "mada_pos_qr", "name": "mada POS & QR Clearing (مدى)", "status": "UP", "slaLatencyMs": 0.92, ... }
],
"participantBanks": [
{ "bic": "NCBKSARI", "bankNameEn": "Saudi National Bank (SNB)", "cbsBalanceSAR": 1250000.00, "status": "CONNECTED" },
{ "bic": "RJHIKSARI", "bankNameEn": "Al Rajhi Bank", "cbsBalanceSAR": 980000.00, "status": "CONNECTED" }
],
"metrics": {
"totalTransactions": 28,
"totalVolumeSAR": 14250.00,
"successRatePct": "100.0",
"avgLatencyMs": "0.91",
"slaCompliancePct": "100.0",
"estimatedTPS": "4.2",
"peakCapacityTPS": 5000
}
}
/api/v1/monitoring/simulate
Simulate Live Traffic Burst (Generates real sarie/mada/SADAD txns with SSE stream broadcast)
// Request: POST /api/v1/monitoring/simulate
{
"count": 3 // Number of transactions to simulate (1 - 10)
}
// Response 200 OK
{
"success": true,
"simulatedCount": 3,
"messageEn": "Successfully simulated 3 real transactions across SAMA switch",
"messageAr": "تمت محاكاة 3 عمليات مالية حقيقية بنجاح عبر مقسم البنك المركزي",
"generated": [ ... ]
}
/api/v1/notifications/stream?mobile=:mobile&iban=:iban
Server-Sent Events (SSE) Stream of Real-Time Debit & Credit Alerts & Balances
// Client connects via EventSource:
const es = new EventSource('/api/v1/notifications/stream?mobile=0501234567');
es.onmessage = (e) => {
const data = JSON.parse(e.data);
// Events: 'CONNECTED' | 'DEBIT_ALERT' | 'CREDIT_ALERT' | 'DUAL_TRANSACTION_ALERT'
console.log(data.event, data.notification?.balance?.updatedBalance);
};
/api/v1/notifications/push
Push Transaction Details & Updated Balance to Remitter & Beneficiary
// Request: POST /api/v1/notifications/push
{
"rrn": "627017043068", // Transaction reference or RRN
"channels": ["SMS", "PUSH", "WEBHOOK"] // Optional delivery channels
}
// Response 200 OK:
{
"success": true,
"transaction": { "rrn": "627017043068", "amount": 450.00, "currency": "SAR" },
"remitter": {
"partyRole": "REMITTER",
"direction": "DEBIT",
"balance": { "previousBalance": 45000.00, "amountTransacted": 450.00, "updatedBalance": 44550.00 },
"smsEn": "sarie: SAR 450.00 debited from SA03...6554. Avail bal: SAR 44,550.00. RRN: 627017043068",
"deliveryStatus": { "sms": "DELIVERED", "push": "DELIVERED" }
},
"beneficiary": {
"partyRole": "BENEFICIARY",
"direction": "CREDIT",
"balance": { "previousBalance": 12000.00, "amountTransacted": 450.00, "updatedBalance": 12450.00 },
"smsEn": "sarie: SAR 450.00 credited to SA03...2233. Avail bal: SAR 12,450.00. RRN: 627017043068",
"deliveryStatus": { "sms": "DELIVERED", "push": "DELIVERED" }
}
}
/api/v1/notifications/transaction/:reference
Audit Dual-Party Notifications & Balances for a Specific Transaction
// Request: GET /api/v1/notifications/transaction/627017043068
// Response 200 OK: Returns dual-party transaction record, remitter/beneficiary balance transitions, and SMS logs
/api/v1/notifications/account/:identifier
Inquire Customer Account Live CBS Balance & Notification History
// Request: GET /api/v1/notifications/account/0501234567 (or Saudi IBAN)
// Response 200 OK:
{
"success": true,
"account": { "accountNumber": "...", "ibanMasked": "SA03...", "balance": 44550.00, "formattedBalance": "SAR 44,550.00" },
"notifications": [ ... ]
}