# Account Details Retrieves the account details and balance. This endpoint requires authentication and returns comprehensive information for the specified account. The returned data includes: - Number: The human-readable account number assigned by the bank. - Label: A label provided by the account owner. - Owners: The list of users who own this account. - Type: The type of account. - Balance: The account's balance including currency and amount. - Account Attributes: Additional account information specific to Bermuda Commercial Bank. ### Content Negotiation Clients must use the HTTP Accept header to indicate the desired response format: - Set Accept: application/json for JSON responses (default). - Set Accept: text/csv for CSV responses. If the Accept header is omitted, application/json is assumed. ### Base URL: All API requests use the versioned base URL: https://api.bcb.bm/v1/accounts ### Sample Request in JavaScript: javascript async function getAccountDetails(accountNumber) { try { const response = await fetch(https://api.bcb.bm/v1/accounts/${accountNumber}, { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', 'Accept': 'application/json' } }); if (!response.ok) { const errorData = await response.json(); throw new Error(Error: ${errorData.message || 'Unknown error'}); } const data = await response.json(); console.log('Account details:', data); // Example processing of the returned object const accountId = data.id; const accountNumber = data.number; const accountBalance = data.balance.amount; const accountCurrency = data.balance.currency; const accountStatus = data.accountAttributes.find(attr => attr.name === 'STATUS')?.value; console.log('Account ID:', accountId); console.log('Account Number:', accountNumber); console.log('Account Balance:', accountBalance); console.log('Account Currency:', accountCurrency); console.log('Account Status:', accountStatus); // Process all account attributes console.log('Account Attributes:'); data.accountAttributes.forEach(attribute => { console.log(${attribute.name}: ${attribute.value}); }); // Additional processing based on account status if (accountStatus === 'ACTIVE') { console.log('The account is active.'); } else { console.log('The account is not active.'); } } catch (error) { console.error('There was a problem with the fetch operation:', error.message); } } // Example usage: getAccountDetails('YOUR_ACCOUNT_NUMBER'); Required Permission: get-account This endpoint requires the permission claim get-account to be present in the JWT token. These permissions are embedded in the token during the authentication process and cannot be modified afterward. The token must be obtained with the appropriate permissions to access this endpoint. Endpoint: GET /v1/accounts/{accountNumber} Version: v1 Security: Authorization, Feature Permissions ## Path parameters: - `accountNumber` (string, required) The human-readable account number assigned by the bank. ## Response 200 fields (application/json): - `accountId` (string, required) A unique ID of the account, composed of account number and CIF - `cif` (string, required) 11-digit ID of the account holder - `currency` (string, required) Identification of the currency in which the account is held - `accountSubType` (string, required) Specifies the sub type of account (product) - `accountNumber` (string, required) Account number - `status` (string, required) Specifies the status of the account - `availableBalance` (object, required) Account balance - `availableBalance.currency` (string, required) Currency ISO code - `availableBalance.amount` (string, required) Amount - `accountType` (string,null) Specifies the type of account (personal/business) - `nickname` (string,null) The nickname of the account, assigned by the account owner - `owners` (array, required) Ownership details of an account object - `owners.displayName` (string, required) Account owner name - `owners.accountHolderType` (string, required) Type of account holder (Primary/Joint) - `accountAttributes` (array, required) Additional details or characteristics associated with an account object - `accountAttributes.name` (string, required) Key or identifier of the account attribute. - `accountAttributes.value` (string, required) Actual data associated with the attribute name - `openingDate` (string,null) Date when the account was opened - `balanceEffectiveDate` (string,null) Date when the balance was last updated - `accountRoutings` (array) Routing details for the account - `accountRoutings.scheme` (string, required) Scheme value - `accountRoutings.address` (string, required) Address value ## Response 400 fields (application/json): - `error` (string, required) Error code or type that identifies the specific error condition - `message` (string, required) Human-readable error message that describes the error condition ## Response 401 fields (application/json): - `error` (string, required) Error code or type that identifies the specific error condition - `message` (string, required) Human-readable error message that describes the error condition ## Response 403 fields (application/json): - `error` (string, required) Error code or type that identifies the specific error condition - `message` (string, required) Human-readable error message that describes the error condition ## Response 404 fields (application/json): - `error` (string, required) Error code or type that identifies the specific error condition - `message` (string, required) Human-readable error message that describes the error condition ## Response 429 fields (application/json): - `error` (string, required) Error code or type that identifies the specific error condition - `message` (string, required) Human-readable error message that describes the error condition ## Response 500 fields (application/json): - `error` (string, required) Error code or type that identifies the specific error condition - `message` (string, required) Human-readable error message that describes the error condition