Files
thijooree/docs/mibapi/03-accounts.md
T
shihaam a8cd22cbe1
Auto Tag on Version Change / check-version (push) Failing after 13m32s
update docs
2026-06-13 21:30:12 +05:00

4.2 KiB

Accounts & Balances

Account numbers and balances are returned by the Select Profile call (routePath: P47). For multi-profile users the A41 login init call returns an empty accountBalance array and P47 must be called for each profile to enumerate accounts.

Single-profile fast-path: when the account has exactly one operating profile, the server returns profileSelected: true, selectedProfileId, and a populated accountBalance array directly in the A41 response. In that case the P47 call is skipped — see 02-login.md and MibLoginFlow.kt:150-184.


Select Profile — sfunc=n, routePath: P47

Key: session key (from sfunc=i response)

Request:

{
  "sfunc": "n",
  "xxid": "<session xxid>",
  "data": {
    "profileType": "<profileType from A41 operatingProfiles>",
    "profileId": "<profileId from A41 operatingProfiles>",
    "nonce": "<computed nonce>",
    "appId": "<appId>",
    "sodium": "<random 20-bit int>",
    "routePath": "P47",
    "xxid": "<session xxid>"
  }
}

Response:

{
  "success": true,
  "reasonCode": "101",
  "reasonText": "Profile Selected!",
  "landingPage": "0",
  "accountBalance": [ ... ],
  "accessRights": { ... },
  "services": []
}

To switch between profiles (personal ↔ business), call P47 again with the other profile's profileId and profileType.


Profiles (from A41 response)

The A41 login init response includes operatingProfiles:

{
  "operatingProfiles": [
    {
      "profileId": "<profile ID>",
      "customerProfileId": "<customer profile ID>",
      "annexId": "<annex ID>",
      "customerId": "<customer ID>",
      "name": "<display name>",
      "cifType": "Individual",
      "customerImage": "<image hash>",
      "profileType": "0",
      "color": "<hex color>"
    }
  ]
}
profileType Meaning
"0" Individual (personal)
"1" Sole Proprietor (business)

accountBalance Array

Each element represents one account:

{
  "cif": "<CIF number>",
  "accountNumber": "<full account number>",
  "accountBriefName": "<short label, e.g. 'SAR MVR - Savings'>",
  "template": "<display template ID>",
  "currencyCode": "<ISO 4217 numeric>",
  "currencyName": "<ISO 4217 alpha>",
  "accountTypeName": "<account type label>",
  "transfer": "Y",
  "branchName": "<branch name>",
  "availableBalance": "<decimal string>",
  "currentBalance": "<decimal string>",
  "blockedAmount": "<decimal string, may be negative>",
  "settlementBalance": "<decimal string>",
  "mvrBalance": "<MVR equivalent>",
  "statusDesc": "Active"
}
Field Consumed Description
accountNumber yes Full account number
accountBriefName yes Human-readable account label
currencyName yes ISO 4217 alpha (e.g. "MVR", "USD")
accountTypeName yes Account type (e.g. "Saving Account")
availableBalance yes Spendable balance (decimal string)
currentBalance yes Ledger balance (decimal string)
blockedAmount yes Held/blocked funds. Server value is signed (negative = held). The app normalizes to a positive magnitude via absBlockedAmount() (MibLoginFlow.kt:172, 194-197).
mvrBalance yes All balances converted to MVR for unified display
statusDesc yes Account status (e.g. "Active")
currencyCode server-only ISO 4217 numeric (e.g. "462" = MVR, "840" = USD) — present in payload but not read by the app
transfer server-only "Y" if usable as transfer source
cif server-only Customer Information File number
template server-only UI template ID
branchName server-only Branch name
settlementBalance server-only Balance including pending settlements

All balance fields are decimal strings, not numbers — parse with Decimal for precision.


accessRights

{
  "numAccounts": "<number of accounts>",
  "packageRights": "[1,2,3,4,6,7,8,9,10,11,12]",
  "roleRights": "[]"
}

packageRights is a JSON array encoded as a string — parse it separately.


 


← Login Flow     Next → Transaction History