# 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](02-login.md) and `MibLoginFlow.kt:150-184`. --- ## Select Profile — `sfunc=n`, `routePath: P47` **Key**: session key (from `sfunc=i` response) **Request**: ```json { "sfunc": "n", "xxid": "", "data": { "profileType": "", "profileId": "", "nonce": "", "appId": "", "sodium": "", "routePath": "P47", "xxid": "" } } ``` **Response**: ```json { "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`: ```json { "operatingProfiles": [ { "profileId": "", "customerProfileId": "", "annexId": "", "customerId": "", "name": "", "cifType": "Individual", "customerImage": "", "profileType": "0", "color": "" } ] } ``` | `profileType` | Meaning | |---|---| | `"0"` | Individual (personal) | | `"1"` | Sole Proprietor (business) | --- ## `accountBalance` Array Each element represents one account: ```json { "cif": "", "accountNumber": "", "accountBriefName": "", "template": "", "currencyCode": "", "currencyName": "", "accountTypeName": "", "transfer": "Y", "branchName": "", "availableBalance": "", "currentBalance": "", "blockedAmount": "", "settlementBalance": "", "mvrBalance": "", "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` ```json { "numAccounts": "", "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](02-login.md)     **Next →** [Transaction History](04-history.md)