### Setup the development environment Source: https://github.com/thedtvn/mbbank/blob/main/CONTRIBUTING.md Commands to clone the repository and install necessary dependencies using uv or pip. ```bash # Clone the repository git clone https://github.com/thedtvn/MBBank.git cd MBBank # Install dependencies with dev tools uv sync --group dev # Or with pip pip install -e ".[dev]" ``` -------------------------------- ### Install mbbank-lib Source: https://context7.com/thedtvn/mbbank/llms.txt Install the library from PyPI using pip. ```bash pip install mbbank-lib ``` -------------------------------- ### Install MBBank library Source: https://github.com/thedtvn/mbbank/blob/main/README.MD Installation commands for the library via PyPI or directly from the source repository. ```bash pip install mbbank-lib ``` ```bash pip install git+https://github.com/thedtvn/MBBank ``` -------------------------------- ### Initiate Account Transfer Source: https://context7.com/thedtvn/mbbank/llms.txt Starts a money transfer process. Requires subsequent OTP confirmation via the mobile app. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") # Get source account balance = mb.getBalance() src_account = balance.acct_list[0].acctNo # Initiate transfer transfer_ctx = mb.makeTransferAccountToAccount( src_account=src_account, dest_account="9876543210", bank_code="MB", # Bank code from getBankList amount=100000, # Amount in VND message="Payment for services" ) # Get available authentication methods auth_methods = transfer_ctx.get_auth_list() for idx, method in enumerate(auth_methods.authList): print(f"{idx + 1}. {method.name}") ``` -------------------------------- ### Get Account Balance Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves all main account and sub-account balances for the authenticated user. Includes error handling for potential exceptions. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") try: balance_info = mb.getBalance() if balance_info.acct_list: print(f"Found {len(balance_info.acct_list)} account(s)") for acct in balance_info.acct_list: print(f"Account: {acct.acctNo}") print(f"Alias: {acct.acctAlias}") print(f"Balance: {acct.currentBalance} {balance_info.currencyEquivalent}") print("-" * 40) except Exception as e: print(f"Error: {e}") ``` -------------------------------- ### Get User Information Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves current user profile information after authentication. Displays customer ID, name, and session ID. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") user = mb.userinfo() print(f"Customer ID: {user.cust.id}") print(f"Customer Name: {user.cust.name}") print(f"Session ID: {user.sessionId}") ``` -------------------------------- ### Get Card List Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves all cards associated with the account, including debit and credit cards. Handles cases where no cards are found and prints card details. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") try: cards = mb.getCardList() if not cards.cardList: print("No cards found.") else: print(f"{'Card Number':<20} | {'Type':<20} | {'Status'}") print("-" * 60) for card in cards.cardList: print(f"{card.cardNo:<20} | {card.cardModule:<20} | {card.cardStatus}") except Exception as e: print(f"Error: {e}") ``` -------------------------------- ### Get Card Transaction History Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves transaction history for a specific card within a date range. Requires card number and date range. ```python import datetime from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") # Get card number from card list cards = mb.getCardList() card_no = cards.cardList[0].cardNo to_date = datetime.datetime.now() from_date = to_date - datetime.timedelta(days=30) card_history = mb.getCardTransactionHistory( cardNo=card_no, from_date=from_date, to_date=to_date ) for tx in card_history.transactionList: print(f"Date: {tx.transactionDate}, Amount: {tx.amount}, Description: {tx.description}") ``` -------------------------------- ### Get Transaction History for Account Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves transaction history for a specific account within a date range (maximum 3 months). Requires account number and date range. ```python import datetime from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") # Get transactions for the last 30 days to_date = datetime.datetime.now() from_date = to_date - datetime.timedelta(days=30) # Get account number first balance = mb.getBalance() account_number = balance.acct_list[0].acctNo history = mb.getTransactionAccountHistory( accountNo=account_number, from_date=from_date, to_date=to_date ) print(f"{'Date':<20} | {'Amount':<15} | {'Description'}") print("-" * 80) for tx in history.transactionHistoryList: date = tx.transactionDate amount = tx.creditAmount or tx.debitAmount description = tx.description print(f"{str(date):<20} | {str(amount):<15} | {description}") ``` -------------------------------- ### Initialize MBBankAsync Class (Asynchronous) Source: https://context7.com/thedtvn/mbbank/llms.txt Asynchronous version of the MBBank client for use with asyncio. Demonstrates fetching balance within an async function. ```python import asyncio from mbbank import MBBankAsync async def main(): mb = MBBankAsync( username="your_username", password="your_password", proxy="http://127.0.0.1:8080", timeout=30.0 ) balance = await mb.getBalance() print(f"Balance: {balance.acct_list[0].currentBalance}") asyncio.run(main()) ``` -------------------------------- ### Initialize MBBank Class (Synchronous) Source: https://context7.com/thedtvn/mbbank/llms.txt The main entry point for synchronous operations. Handles authentication automatically when making API calls. Supports proxy and timeout configuration. ```python from mbbank import MBBank # Basic initialization mb = MBBank( username="your_username", password="your_password" ) # With proxy and timeout configuration mb = MBBank( username="your_username", password="your_password", proxy="http://127.0.0.1:8080", timeout=(10, 30), # (connect_timeout, read_timeout) retry_times=30 # Max captcha retry attempts ) ``` -------------------------------- ### Authenticate and fetch account balance Source: https://github.com/thedtvn/mbbank/blob/main/README.MD Initializes the MBBank client with credentials and retrieves account balance information. ```python import mbbank def main(): username = "YOUR_USERNAME" password = "YOUR_PASSWORD" try: mb = mbbank.MBBank(username=username, password=password) # Get balance information balance_info = mb.getBalance() if balance_info.acct_list: print(f"Login successful! Found {len(balance_info.acct_list)} account(s).") for acct in balance_info.acct_list: print(f"Account: {acct.acctNo} - Balance: {acct.currentBalance} {acct.currency}") else: print("Login successful, but no accounts found.") except Exception as e: print(f"An error occurred: {e}") if __name__ == "__main__": main() ``` -------------------------------- ### Run code quality checks Source: https://github.com/thedtvn/mbbank/blob/main/CONTRIBUTING.md Commands to verify code style, formatting, and type safety before submitting changes. ```bash ruff check . ruff format --check . ty check ``` -------------------------------- ### Handle library exceptions Source: https://context7.com/thedtvn/mbbank/llms.txt Demonstrates error handling for various API and library-specific failure scenarios. ```python from mbbank import MBBank from mbbank.errors import ( MBBankAPIError, MBBankError, CapchaError, BankNotFoundError, CryptoVerifyError ) mb = MBBank(username="your_username", password="your_password") try: balance = mb.getBalance() except MBBankAPIError as e: # API returned an error response print(f"API Error: {e.code} - {e.message}") except CapchaError as e: # Captcha processing failed after max retries print(f"Captcha Error: {e}") except BankNotFoundError as e: # Bank code not found in bank list print(f"Bank Not Found: {e}") except CryptoVerifyError as e: # Crypto verification required (HTTP 428) print(f"Crypto Verification Required: {e}") except MBBankError as e: # General library error print(f"Library Error: {e}") ``` -------------------------------- ### Retrieve Loyalty Information Source: https://context7.com/thedtvn/mbbank/llms.txt Fetches loyalty program rank and points for the user. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") loyalty = mb.getBalanceLoyalty() print(f"Loyalty Rank: {loyalty.balanceLoyalty.rank}") print(f"Points: {loyalty.balanceLoyalty.point}") ``` -------------------------------- ### Retrieve Supported Bank List Source: https://context7.com/thedtvn/mbbank/llms.txt Fetches a list of all banks supported for transfers. Results are cached. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") banks = mb.getBankList() print("Available Banks:") for bank in banks.listBank: print(f"Code: {bank.bankCode} | Name: {bank.bankName} | Type: {bank.typeTransfer}") ``` -------------------------------- ### Retrieve Interest Rates Source: https://context7.com/thedtvn/mbbank/llms.txt Fetches current saving interest rates for a specified currency. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") # Default currency is VND rates = mb.getInterestRate(currency="VND") for rate in rates.interestRateList: print(f"Term: {rate.term} months | Rate: {rate.interestRate}%") ``` -------------------------------- ### getBalanceLoyalty Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves loyalty program information including rank and points. ```APIDOC ## getBalanceLoyalty ### Description Retrieves loyalty program information including rank and points. ### Method GET ### Endpoint /api/loyalty/balance ### Response #### Success Response (200) - **balanceLoyalty** (object) - Loyalty program details. - **rank** (string) - The user's loyalty rank. - **point** (number) - The number of loyalty points. ### Request Example ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") loyalty = mb.getBalanceLoyalty() print(f"Loyalty Rank: {loyalty.balanceLoyalty.rank}") print(f"Points: {loyalty.balanceLoyalty.point}") ``` ``` -------------------------------- ### getBalance Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves all main account and sub-account balances for the authenticated user. ```APIDOC ## getBalance ### Description Retrieves all main account and sub-account balances for the authenticated user. ### Response #### Success Response (200) - **acct_list** (list) - List of account objects containing acctNo, acctAlias, and currentBalance. - **currencyEquivalent** (string) - The currency code for the balances. ``` -------------------------------- ### Retrieve Loan Account List Source: https://context7.com/thedtvn/mbbank/llms.txt Fetches all loan accounts associated with the authenticated user. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") loans = mb.getLoanList() for loan in loans.loanList: print(f"Loan Account: {loan.accountNo}") print(f"Outstanding Balance: {loan.outstandingBalance}") print(f"Interest Rate: {loan.interestRate}") print("-" * 40) ``` -------------------------------- ### getBankList Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves the list of all supported banks for transfers. Results are cached for performance. ```APIDOC ## getBankList ### Description Retrieves the list of all supported banks for transfers. Results are cached for performance. ### Method GET ### Endpoint /api/banks ### Response #### Success Response (200) - **listBank** (array) - List of supported banks. - **bankCode** (string) - The unique code for the bank. - **bankName** (string) - The name of the bank. - **typeTransfer** (string) - The type of transfer supported (e.g., "INTERNAL", "EXTERNAL"). ### Request Example ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") banks = mb.getBankList() print("Available Banks:") for bank in banks.listBank: print(f"Code: {bank.bankCode} | Name: {bank.bankName} | Type: {bank.typeTransfer}") ``` ``` -------------------------------- ### userinfo Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves current user profile information after authentication. ```APIDOC ## userinfo ### Description Retrieves current user profile information after authentication. ### Response #### Success Response (200) - **cust** (object) - Customer details including id and name. - **sessionId** (string) - The current active session ID. ``` -------------------------------- ### getLoanList Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves all loan accounts associated with the user. ```APIDOC ## getLoanList ### Description Retrieves all loan accounts associated with the user. ### Method GET ### Endpoint /api/loans ### Response #### Success Response (200) - **loanList** (array) - List of loan accounts. - **accountNo** (string) - The loan account number. - **outstandingBalance** (number) - The outstanding balance of the loan. - **interestRate** (string) - The interest rate for the loan. ### Request Example ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") loans = mb.getLoanList() for loan in loans.loanList: print(f"Loan Account: {loan.accountNo}") print(f"Outstanding Balance: {loan.outstandingBalance}") print(f"Interest Rate: {loan.interestRate}") print("-" * 40) ``` ``` -------------------------------- ### Perform money transfer with OTP Source: https://context7.com/thedtvn/mbbank/llms.txt Initiates a transfer and completes it using an OTP obtained from the MBBank mobile app. ```python selected_auth = auth_methods.authList[0] qr_content = transfer_ctx.get_qr_code() print(f"Scan this QR code in MBBank app: {qr_content}") # After scanning QR and getting OTP from app otp = input("Enter OTP from MBBank app: ") result = transfer_ctx.transfer(otp=otp, auth_type=selected_auth) print(f"Transfer successful: {result}") ``` -------------------------------- ### Retrieve Saving Account List Source: https://context7.com/thedtvn/mbbank/llms.txt Fetches all saving accounts associated with the authenticated user. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") savings = mb.getSavingList() print(f"{'Account No':<20} | {'Balance':<15} | {'Interest Rate'}") print("-" * 60) for acc in savings.savingList: print(f"{acc.accountNo:<20} | {acc.balance:<15} | {acc.interestRate}") ``` -------------------------------- ### makeTransferAccountToAccount Source: https://context7.com/thedtvn/mbbank/llms.txt Initiates a money transfer to another account. Requires OTP confirmation via MBBank mobile app. ```APIDOC ## makeTransferAccountToAccount ### Description Initiates a money transfer to another account. Requires OTP confirmation via MBBank mobile app. ### Method POST ### Endpoint /api/transfer/account-to-account ### Parameters #### Request Body - **src_account** (string) - Required - The source account number for the transfer. - **dest_account** (string) - Required - The destination account number. - **bank_code** (string) - Required - The bank code of the destination bank. - **amount** (number) - Required - The amount to transfer in VND. - **message** (string) - Optional - A message for the transfer. ### Response #### Success Response (200) - **transfer_ctx** (object) - Context for the transfer, containing authentication methods. - **authList** (array) - List of available authentication methods. - **name** (string) - The name of the authentication method. ### Request Example ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") balance = mb.getBalance() src_account = balance.acct_list[0].acctNo transfer_ctx = mb.makeTransferAccountToAccount( src_account=src_account, dest_account="9876543210", bank_code="MB", amount=100000, message="Payment for services" ) auth_methods = transfer_ctx.get_auth_list() for idx, method in enumerate(auth_methods.authList): print(f"{idx + 1}. {method.name}") ``` ``` -------------------------------- ### getInterestRate Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves current saving interest rates for a specific currency. ```APIDOC ## getInterestRate ### Description Retrieves current saving interest rates for a specific currency. ### Method GET ### Endpoint /api/interest-rates ### Parameters #### Query Parameters - **currency** (string) - Optional - The currency for which to retrieve interest rates (e.g., "VND"). Defaults to "VND". ### Response #### Success Response (200) - **interestRateList** (array) - List of interest rates. - **term** (string) - The term period in months. - **interestRate** (string) - The interest rate percentage. ### Request Example ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") rates = mb.getInterestRate(currency="VND") for rate in rates.interestRateList: print(f"Term: {rate.term} months | Rate: {rate.interestRate}%") ``` ``` -------------------------------- ### getSavingDetail Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves detailed information about a specific saving account. ```APIDOC ## getSavingDetail ### Description Retrieves detailed information about a specific saving account. ### Method GET ### Endpoint /api/savings/{accNo}/{accType} ### Parameters #### Path Parameters - **accNo** (string) - Required - The account number of the saving account. - **accType** (string) - Required - The type of the account (e.g., "OSA" for Online Saving Account, "SBA" for Saving Bank Account). ### Response #### Success Response (200) - **savingDetail** (object) - Detailed information about the saving account. - **accountNo** (string) - The account number. - **principalAmount** (number) - The principal amount of the saving. - **interestRate** (string) - The interest rate. - **maturityDate** (string) - The maturity date of the saving. ### Request Example ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") detail = mb.getSavingDetail( accNo="1234567890", accType="OSA" ) print(f"Account: {detail.savingDetail.accountNo}") print(f"Principal: {detail.savingDetail.principalAmount}") print(f"Interest Rate: {detail.savingDetail.interestRate}") print(f"Maturity Date: {detail.savingDetail.maturityDate}") ``` ``` -------------------------------- ### getSavingList Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves all saving accounts associated with the user. ```APIDOC ## getSavingList ### Description Retrieves all saving accounts associated with the user. ### Method GET ### Endpoint /api/savings ### Response #### Success Response (200) - **savingList** (array) - List of saving accounts. - **accountNo** (string) - The account number. - **balance** (number) - The current balance of the account. - **interestRate** (string) - The interest rate for the saving account. ### Request Example ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") savings = mb.getSavingList() print(f"{ 'Account No':<20} | {'Balance':<15} | {'Interest Rate'}") print("-" * 60) for acc in savings.savingList: print(f"{acc.accountNo:<20} | {acc.balance:<15} | {acc.interestRate}") ``` ``` -------------------------------- ### Retrieve Saving Account Detail Source: https://context7.com/thedtvn/mbbank/llms.txt Fetches detailed information for a specific saving account using account number and type. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") # accType: "OSA" (Online Saving Account) or "SBA" (Saving Bank Account) detail = mb.getSavingDetail( accNo="1234567890", accType="OSA" ) print(f"Account: {detail.savingDetail.accountNo}") print(f"Principal: {detail.savingDetail.principalAmount}") print(f"Interest Rate: {detail.savingDetail.interestRate}") print(f"Maturity Date: {detail.savingDetail.maturityDate}") ``` -------------------------------- ### Retrieve service token Source: https://context7.com/thedtvn/mbbank/llms.txt Obtains a token for external API integrations using valid MBBank credentials. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") token = mb.getServiceToken() print(f"Token Type: {token.type}") print(f"Token: {token.token}") # Use token for external service calls headers = {"Authorization": f"{token.type} {token.token}"} ``` -------------------------------- ### Retrieve Saved Beneficiaries Source: https://context7.com/thedtvn/mbbank/llms.txt Fetches all beneficiaries saved in the user's address book. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") saved = mb.getSavedBeneficiary() for ben in saved.beneficiaryList: print(f"Nickname: {ben.nickname} | Account: {ben.accountNo} | Bank: {ben.bankName}") ``` -------------------------------- ### getCardList Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves all cards associated with the account including debit and credit cards. ```APIDOC ## getCardList ### Description Retrieves all cards associated with the account including debit and credit cards. ### Response #### Success Response (200) - **cardList** (list) - List of card objects containing cardNo, cardModule, and cardStatus. ``` -------------------------------- ### Perform concurrent operations with Async API Source: https://context7.com/thedtvn/mbbank/llms.txt Uses the asynchronous API to fetch multiple data points concurrently and retrieve transaction history. ```python import asyncio import datetime from mbbank import MBBankAsync async def main(): mb = MBBankAsync( username="your_username", password="your_password" ) # Fetch multiple data concurrently balance_task = mb.getBalance() cards_task = mb.getCardList() loyalty_task = mb.getBalanceLoyalty() balance, cards, loyalty = await asyncio.gather( balance_task, cards_task, loyalty_task ) print(f"Balance: {balance.acct_list[0].currentBalance}") print(f"Cards: {len(cards.cardList)}") print(f"Loyalty Points: {loyalty.balanceLoyalty.point}") # Get transaction history to_date = datetime.datetime.now() from_date = to_date - datetime.timedelta(days=7) history = await mb.getTransactionAccountHistory( accountNo=balance.acct_list[0].acctNo, from_date=from_date, to_date=to_date ) for tx in history.transactionHistoryList: print(f"{tx.transactionDate}: {tx.creditAmount or tx.debitAmount}") asyncio.run(main()) ``` -------------------------------- ### Retrieve ATM card information Source: https://context7.com/thedtvn/mbbank/llms.txt Fetches card holder details for card-to-card transfers using a debit account number. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") # Get your account number balance = mb.getBalance() my_account = balance.acct_list[0].acctNo # Look up ATM card holder name card_info = mb.getATMAccountName( cardNumber="9704xxxxxxxxx", debitAccount=my_account ) print(f"Card Holder: {card_info.benName}") ``` -------------------------------- ### Retrieve Frequent Beneficiaries Source: https://context7.com/thedtvn/mbbank/llms.txt Fetches frequently used or recent transfer beneficiaries. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") # Get most frequently used transfer recipients beneficiaries = mb.getFavorBeneficiaryList( transactionType="TRANSFER", # or "PAYMENT" searchType="MOST" # or "LATEST" ) for ben in beneficiaries.beneficiaryList: print(f"Name: {ben.benName} | Account: {ben.benAccountNo}") ``` -------------------------------- ### Lookup Account by Phone Number Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves account details for internal MBBank accounts using a phone number. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") account = mb.getAccountByPhone(phone="0901234567") print(f"Account Number: {account.accountNo}") print(f"Account Name: {account.accountName}") ``` -------------------------------- ### getSavedBeneficiary Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves all saved beneficiaries from the user's address book. ```APIDOC ## getSavedBeneficiary ### Description Retrieves all saved beneficiaries from the user's address book. ### Method GET ### Endpoint /api/beneficiaries/saved ### Response #### Success Response (200) - **beneficiaryList** (array) - List of saved beneficiaries. - **nickname** (string) - The nickname of the beneficiary. - **accountNo** (string) - The account number of the beneficiary. - **bankName** (string) - The name of the beneficiary's bank. ### Request Example ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") saved = mb.getSavedBeneficiary() for ben in saved.beneficiaryList: print(f"Nickname: {ben.nickname} | Account: {ben.accountNo} | Bank: {ben.bankName}") ``` ``` -------------------------------- ### Retrieve Account Holder Name Source: https://context7.com/thedtvn/mbbank/llms.txt Looks up the account holder's name for a specific account number and bank. ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") # Get your account number first balance = mb.getBalance() my_account = balance.acct_list[0].acctNo # Look up recipient account name recipient = mb.getAccountName( accountNo="9876543210", bankCode="MB", # Bank code from getBankList debitAccount=my_account ) print(f"Recipient Name: {recipient.benName}") ``` -------------------------------- ### getAccountName Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves the account holder name for a given account number and bank. ```APIDOC ## getAccountName ### Description Retrieves the account holder name for a given account number and bank. ### Method GET ### Endpoint /api/accounts/name ### Parameters #### Query Parameters - **accountNo** (string) - Required - The account number to look up. - **bankCode** (string) - Required - The bank code of the recipient's bank. - **debitAccount** (string) - Required - The account number from which the lookup is initiated. ### Response #### Success Response (200) - **benName** (string) - The name of the beneficiary. ### Request Example ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") balance = mb.getBalance() my_account = balance.acct_list[0].acctNo recipient = mb.getAccountName( accountNo="9876543210", bankCode="MB", debitAccount=my_account ) print(f"Recipient Name: {recipient.benName}") ``` ``` -------------------------------- ### getFavorBeneficiaryList Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves frequently used or most recent transfer beneficiaries. ```APIDOC ## getFavorBeneficiaryList ### Description Retrieves frequently used or most recent transfer beneficiaries. ### Method GET ### Endpoint /api/beneficiaries/favorite ### Parameters #### Query Parameters - **transactionType** (string) - Required - The type of transaction (e.g., "TRANSFER", "PAYMENT"). - **searchType** (string) - Required - The type of search (e.g., "MOST" for most frequent, "LATEST" for most recent). ### Response #### Success Response (200) - **beneficiaryList** (array) - List of beneficiaries. - **benName** (string) - The name of the beneficiary. - **benAccountNo** (string) - The account number of the beneficiary. ### Request Example ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") beneficiaries = mb.getFavorBeneficiaryList( transactionType="TRANSFER", searchType="MOST" ) for ben in beneficiaries.beneficiaryList: print(f"Name: {ben.benName} | Account: {ben.benAccountNo}") ``` ``` -------------------------------- ### getCardTransactionHistory Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves transaction history for a specific card within a date range. ```APIDOC ## getCardTransactionHistory ### Description Retrieves transaction history for a specific card within a date range. ### Parameters #### Request Body - **cardNo** (string) - Required - The card number to fetch history for. - **from_date** (datetime) - Required - Start date for the history range. - **to_date** (datetime) - Required - End date for the history range. ### Response #### Success Response (200) - **transactionList** (list) - List of card transaction objects containing transactionDate, amount, and description. ``` -------------------------------- ### getTransactionAccountHistory Source: https://context7.com/thedtvn/mbbank/llms.txt Retrieves transaction history for a specific account within a date range (maximum 3 months). ```APIDOC ## getTransactionAccountHistory ### Description Retrieves transaction history for a specific account within a date range (maximum 3 months). ### Parameters #### Request Body - **accountNo** (string) - Required - The account number to fetch history for. - **from_date** (datetime) - Required - Start date for the history range. - **to_date** (datetime) - Required - End date for the history range. ### Response #### Success Response (200) - **transactionHistoryList** (list) - List of transaction objects containing transactionDate, creditAmount, debitAmount, and description. ``` -------------------------------- ### getAccountByPhone Source: https://context7.com/thedtvn/mbbank/llms.txt Looks up an MBBank account by phone number (internal MBBank accounts only). ```APIDOC ## getAccountByPhone ### Description Looks up an MBBank account by phone number (internal MBBank accounts only). ### Method GET ### Endpoint /api/accounts/phone/{phone} ### Parameters #### Path Parameters - **phone** (string) - Required - The phone number to look up the account. ### Response #### Success Response (200) - **accountNo** (string) - The account number. - **accountName** (string) - The name of the account holder. ### Request Example ```python from mbbank import MBBank mb = MBBank(username="your_username", password="your_password") account = mb.getAccountByPhone(phone="0901234567") print(f"Account Number: {account.accountNo}") print(f"Account Name: {account.accountName}") ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.