👤 Saudi Citizen & Resident Profile

Nafath: PENDING

10 Demo Users in KSA (Password & PIN: 123456): 3 Banks Each

💸 sarie & mada Real-Time Payments

📡 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

Listening: 0501234567
⚡ SSE stream connected. Any payment sent (Remitter Debit) or received (Beneficiary Credit) will instantly stream updated balances and push notifications here.

🏪 Saudi Merchant Terminal & POS

ZATCA & SAMA COMPLIANT

Tamimi Markets (أسواق التميمي)

SA0310000009999000011101

CR: 1010223344 • VAT: 300055443300003
Settlement Mode ⚡ Instant Settlement: ACTIVE
Settlement Bank Balance (CBS)
SAR 0.00
Unsettled Escrow: SAR 0.00
🔐 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 SCHEME

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

📊 SAMA Real-Time Transaction & Service Monitoring Command Center

مركز المراقبة والتحكم اللحظي لمقسم المدفوعات السعودي • sarie (سريع) • mada (مدى) • SADAD (سداد) • Nafath (نفاذ) • CBS Settlement

REAL-TIME SSE STREAMING
Cumulative Switch Volume 💰
SAR 0.00
SAR (ر.س) Avg ticket: SAR 0.00
Transactions Processed ⚡
0
100.0% SUCCESS Failed: 0
Switch SLA Latency ⏱️
< 0.95 ms
SAMA SLA: < 3.0s Compliance: 100%
Throughput & Capacity 🚀
0.0 TPS
Peak Capacity: 5,000 TPS • ISO 20022 Engine
🏛️ SAMA Central Services & Infrastructure Health (حالة الخدمات والأنظمة التابعة للمقسم)
🏦 Connected Saudi Commercial Banks & CBS Liquidity (البنوك السعودية المشاركة وسيولة التسوية)

📈 Real-Time Scheme Distribution & Volume Share (توزيع العمليات حسب أنظمة المدفوعات)

Proportional volume share in SAR
sarie Instant (سريع): 0 txns (SAR 0.00)
mada QR & POS (مدى): 0 txns (SAR 0.00)
SADAD Invoicing (سداد): 0 txns (SAR 0.00)
Settlement & Refunds (تسويات): 0 txns (SAR 0.00)

⚡ Live SAMA Switch Transaction Feed & ISO 20022 Audit Stream

0 Transactions
Showing 0 of 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 CYBERSECURITY

Protects 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

sarie (سريع) Instant Payments:

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

mada (مدى) QR Specification:

Standardized QR format for merchant acquiring and point-of-sale in Saudi Arabia with instant settlement.

Nafath (نفاذ) Digital Identity:

Unified digital authentication matching National ID / Iqama with random 2-digit confirmation prompts in the Nafath mobile app.

SADAD (سداد) National Invoicing:

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 Cluster & Database ksa_switch (PostgreSQL 18.3) qt-postgresql-sandbox.cho0kak8uejo.ap-south-2.rds.amazonaws.com:5432
Allocated Storage on AWS RDS
9.6 MB (AWS RDS Cluster Size)
Continuous WAL (Multi-AZ Archiving Active)
Database Engine & Security PostgreSQL 18.3 (AWS RDS) TLSv1.3 Encrypted • AWS RDS CA
Switch Cumulative Volume SAR 0.00 Currency: Saudi Riyal (ر.س)

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.

0 Users
User / Mobile Primary IBAN / Alias Nafath KYC SAMA sarie P2P QR Action

⚡ Transactional Data Cleanup (حذف العمليات)

Clear double-entry ledger transactions, settlements, and reset balances.

💳 Transactions Ledger & Escrow Cleanup

Purges all switch transactions (0), merchant settlements, dynamic QR orders, and resets merchant escrow to SAR 0.00.

  • ✓ Purges Central Switch Ledger (transactions table in PostgreSQL)
  • ✓ Purges Merchant Settlements & Payouts (settlements table)
  • ✓ 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

Reset CBS Demo Balances Only

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.

📄 OpenAPI JSON 🚀 Open Swagger UI ↗
POST /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 / قطة الغداء"
}
POST /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"
}
POST /api/v1/payments/sadad/pay Pay SADAD Electronic Bill (سداد)
{
  "billNumber": "1000293847",
  "remitterIban": "SA0310000001099887766554",
  "pin": "1234"
}
POST /api/v1/kyc/nafath/initiate Initiate Nafath National SSO Authentication (نفاذ)
{
  "nationalId": "1098765432",
  "mobileNumber": "0501234567"
}
POST /api/v1/payments/m2p/refund sarie Merchant Refund (Reversal to Customer IBAN)
{
  "merchantId": "MERCH_123456",
  "originalRrn": "627017043068",
  "refundAmount": 100.00,
  "refundReason": "Customer return"
}
POST /api/v1/payments/m2b/settle Merchant Instant Settlement to Saudi IBAN
{
  "merchantId": "MERCH_123456",
  "amount": 500.00
}
GET /api/v1/demo/users List all registered users with linked accounts and aliases
// Response 200 OK
{
  "success": true,
  "count": 2,
  "users": [ ... ]
}
DELETE /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_..." }
DELETE /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
POST /api/v1/demo/reset Factory Reset Demo Switch (removes users + transactions + restores seed)
// Example: POST /api/v1/demo/reset
{}
GET /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, ...
  }
}
POST /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
POST /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
GET /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
  }
}
POST /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": [ ... ]
}
GET /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);
};
POST /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" }
  }
}
GET /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
GET /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": [ ... ]
}