m8ty_client_ais
Package overview
Section titled “Package overview”m8ty_client_ais solves this by providing typed access to account information, transactions, bank connections, cashflow, trends, and supporting bank data, enabling a unified account-management experience.
Account information service covers all the aspects of accounts, transactions, bank management, and analytics.
Before you start
Section titled “Before you start”Check the documentation of the m8ty_client_ais library to get an idea about the available models and their properties.
Import all needed libraries
Section titled “Import all needed libraries” import 'package:dio/dio.dart'; import 'package:m8ty_client_ais/m8ty_client_ais.dart'; import 'package:m8ty_client_common/m8ty_client_common.dart'; import 'package:built_collection/built_collection.dart';Client Setup
Section titled “Client Setup”final client = M8tyClientAis();client.setOAuthToken('ApiOAuth2', oauthToken);- Default base URL is
https://api.m8ty.eu/api/v1; override withbasePathOverrideonly for non-prod environments. - Catch
DioExceptionand handle status code plus response body frome.response.
API Surface
Section titled “API Surface”AccountsApi
Section titled “AccountsApi”| Method | Description |
|---|---|
listAllAccounts |
Retrieve all the user’s accounts |
searchAccounts |
Search for the user’s accounts |
getAccountById |
Fetch a single account |
removeAccount |
Remove an account from the server |
saveAccountAlias |
Update or insert customer defined alias for account name |
accountBalanceCashflow |
Cashflow balances of an account |
accountBalanceMonthly |
Monthly balances of an account |
accountBalanceTrends |
Trending balances of an account |
TransactionsApi
Section titled “TransactionsApi”| Method | Description |
|---|---|
searchTransactions |
Search for all transactions |
getTransactionById |
Get account transaction by ID |
getTransactionDetails |
Get transaction details for a specified transaction |
getTransactionsForecast |
Search for all future expected transactions |
getSwiftGpiTransactionStatus |
Get Swift GPI data for given end-to-end reference |
submitTransactionResearchRequest |
Request additional investigation for a transaction |
BankManagementApi
Section titled “BankManagementApi”| Method | Description |
|---|---|
fetchAllBankConnections |
Get all imported bank connections |
importBankConnection |
Import a bank connection |
deleteImportedBankConnection |
Delete a bank connection |
importBankConnectionStatus |
Status of a bank connection |
BanksApi
Section titled “BanksApi”| Method | Description |
|---|---|
listBanks |
List of supported banks |
listBankGroupsForCountry |
List all bank groups by country |
listSupportedBankCountries |
List supported bank countries |
getBankByIdentification |
Retrieve bank details by identification type |
getBankHolidays |
Get holidays for the bank by country |
getExchangeRates |
Get exchange rates for given currencies |
AnalyticsApi
Section titled “AnalyticsApi”| Method | Description |
|---|---|
analyticsCategories |
Categories from analytics module |
How to perform different tasks
Section titled “How to perform different tasks”Here some examples how the dart client can be used
Get list of all bank accounts
Section titled “Get list of all bank accounts” final client = M8tyClientAis(); client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getAccountsApi(); final Response<AccountsResponseModel> allAccounts = await api.listAllAccounts( page: 1, size: 100, includeBankData: true, );Search accounts by using filter options
Section titled “Search accounts by using filter options”final accountRequestModel = AccountDataRequestModel((b) => b ..accountIBAN = "CH9300762011623852957" ..accountIsoCurrency = IsoCurrencyEnumModel.CHF);
final client = M8tyClientAis();client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getAccountsApi();final Response<AccountsResponseModel> allAccounts = await api.searchAccounts( accountDataRequestModel: accountRequestModel, page: 1, size: 100,);Get account balance cashflow
Section titled “Get account balance cashflow” final client = M8tyClientAis(); client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getAccountsApi();
try { final response = await api.accountBalanceCashflow( accountId: '1234', ); print('Cashflow: ${response.data}'); } on DioException catch (e) { throw Exception( 'Request failed (status: ${e.response?.statusCode}): ${e.response?.data}', ); }Get list of all transactions
Section titled “Get list of all transactions” final transactionsRequestModel = SearchTransactionRequestModel( (b) => b ..accountIds = ListBuilder(["accountId", "accountId2"]) ..bookingDateFrom = DateTime.now(), );
final client = M8tyClientAis(); client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getTransactionsApi(); final Response<SearchTransactionResponseModel> allTransactions = await api.searchTransactions( searchTransactionRequestModel: transactionsRequestModel, page: 1, size: 100, );Use google search options
Section titled “Use google search options” final transactionsRequestModel = SearchTransactionRequestModel( (b) => b ..accountIds = ListBuilder(["accountId", "accountId2"]) ..search = "Shell", );
final client = M8tyClientAis(); client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getTransactionsApi(); final Response<SearchTransactionResponseModel> allTransactions = await api.searchTransactions( searchTransactionRequestModel: transactionsRequestModel, page: 1, size: 100, );Fetch all bank connections
Section titled “Fetch all bank connections” final client = M8tyClientAis(); client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getBankManagementApi(); final response = await api.fetchAllBankConnections();© m8ty GmbH 2023 · m8ty.eu
