Skip to content

m8ty_client_custodyaccount

m8ty_client_custodyaccount solves this by exposing custody accounts, positions, overviews, and transactions through typed APIs, enabling transparent custody and investment reporting in the app.

Custody Account information service covers all the aspects of custody accounts, transactions, and positions.

Check the documentation of the m8ty_client_custodyaccount library to get an idea about the available models and their properties.

import 'package:dio/dio.dart';
import 'package:m8ty_client_custodyaccount/m8ty_client_custodyaccount.dart';
import 'package:m8ty_client_common/m8ty_client_common.dart';
import 'package:built_collection/built_collection.dart';
final client = M8tyClientCustodyaccount();
client.setOAuthToken('ApiOAuth2', oauthToken);
Method Description
searchCustodyAccounts Search for the user’s custody accounts
fetchCustodyAccountById Retrieve a specific custody account
Method Description
searchCustodyPositions Search for all positions of a custody account
fetchCustodyPositionById Get a specific custody account position
getCustodyPositionsOverview Get positions overview for a single custody account
Method Description
searchCustodyTransactions Search for all transactions of a custody account
fetchCustodyTransactionById Get a specific custody account transaction

Here some examples how the dart client can be used

final client = M8tyClientCustodyaccount();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCustodyAccountsApi();
final custodyAccountSearchRequestModel = CustodyAccountSearchRequestModel((b) => b
..customerId = "1234"
..portfolioId = "78");
final Response<CustodyAccountSearchResponseModel> response = await api.searchCustodyAccounts(
custodyAccountSearchRequestModel: custodyAccountSearchRequestModel,
page: 1,
size: 100,
);
final client = M8tyClientCustodyaccount();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCustodyAccountsApi();
try {
final Response<CustodyAccountModel> response = await api.fetchCustodyAccountById(
custodyAccountId: "1234",
);
} on DioException catch (e) {
throw Exception(
'Request failed (status: ${e.response?.statusCode}): ${e.response?.data}',
);
}
final client = M8tyClientCustodyaccount();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCustodyPositionsApi();
final Response<CustodyPositionsSearchResponseModel> response = await api.searchCustodyPositions(
custodyAccountId: "123",
custodyPositionsSearchRequestModel: custodyPositionsSearchRequestModel,
);
final client = M8tyClientCustodyaccount();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCustodyPositionsApi();
final Response<CustodyPositionModel> response = await api.fetchCustodyPositionById(
custodyAccountId: "123",
custodyAccountTransactionId: "789",
);
final custodyTransactionSearchRequestModel = CustodyTransactionSearchRequestModel((b) => b
..orderId = "123"
..positionId = "789",
);
final client = M8tyClientCustodyaccount();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCustodyTransactionsApi();
final Response<CustodyTransactionSearchResponseModel> response = await api.searchCustodyTransactions(
custodyAccountId: "123",
custodyTransactionSearchRequestModel: custodyTransactionSearchRequestModel,
page: 1,
size: 100,
);
final client = M8tyClientCustodyaccount();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCustodyTransactionsApi();
final Response<CustodyPositionModel> response = await api.fetchCustodyTransactionById(
custodyAccountId: "123",
custodyAccountTransactionId: "789",
);