# Accounts & Balances Account numbers and balances are returned by the **Select Profile** call (`routePath: P47`). The login init call (`A41`) returns an empty `accountBalance` array — balances are only available after `P47`. --- ## 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 | Description | |---|---| | `accountNumber` | Full account number | | `accountBriefName` | Human-readable account label | | `currencyCode` | ISO 4217 numeric (e.g. `"462"` = MVR, `"840"` = USD) | | `currencyName` | ISO 4217 alpha (e.g. `"MVR"`, `"USD"`) | | `accountTypeName` | Account type (e.g. `"Saving Account"`) | | `availableBalance` | Spendable balance (decimal string) | | `currentBalance` | Ledger balance (decimal string) | | `blockedAmount` | Held/blocked funds — negative means funds are held | | `settlementBalance` | Balance including pending settlements | | `mvrBalance` | All balances converted to MVR for unified display | | `transfer` | `"Y"` if usable as transfer source | | `statusDesc` | Account status (e.g. `"Active"`) | | `cif` | Customer Information File number | | `template` | UI template ID | > 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)