Investec Programmable Banking Open API Wrapper
A Dart null-safe wrapper to be able to use the Investec OpenAPI from your Dart/Flutter projects
Investec developer documentation
Getting Started
Currently and Active WIP and has not been submitted to pub.dev yet.
Usage
Setup:
import 'package:http/http.dart' as http;
import 'investec_open_api/investec_open_api.dart';
final httpClient = http.Client();
final api = InvestecOpenAPI(
clientId: 'YOUR_CLIENT_ID',
secret: 'YOUR_SECRET',
httpClient: httpClient,
);
Available Methods:
api.getAccounts()
This returns a list of your accounts as well as some meta data
Sample API Response
{
"data": {
"accounts": [
{
"accountId": "123",
"accountNumber": "112233",
"accountName": "John Smith",
"referenceName": "Mr J Smith",
"productName": "Private Bank Account"
}
]
},
"links": {
"self": "mock-url"
},
"meta": {
"totalPages": 1
}
}
Sample resulting dart class
const accounts = AccountsEntity(
data: AccountsData(
accounts: [
AccountEntity(
accountId: '123',
accountNumber: '112233',
accountName: 'John Smith',
referenceName: 'Mr J Smith',
productName: 'Private Bank Account',
)
],
),
links: AccountsLinks(
self: 'mock-url',
),
meta: AccountsMeta(
totalPages: 1,
),
);
api.getAccountTransactions() (Unimplemented)
api.getAccountBalance()
Returns teh account balance details for a provided account number.
Sample API Response
{
"data": {
"accountId": "account-number",
"currentBalance": 1234.65,
"availableBalance": 9876.00,
"currency": "ZAR"
},
"links": {
"self": "mock-url"
},
"meta": {
"totalPages": 1
}
}
Sample resulting dart class
const accountBalanceFixture = AccountBalanceModel(
data: AccountBalanceDataModel(
accountId: 'account-number',
currentBalance: 1234.65,
availableBalance: 9876.00,
currency: 'ZAR',
),
links: AccountsLinks(
self: 'mock-url',
),
meta: AccountsMeta(
totalPages: 1,
),
);
Hope you find this useful! Please give a star and feel free to contribute or log issues and feature requests!
And if you want to say thanks, then go ahead:
Libraries
- core/endpoint_builder
- core/usecase
- data/models/access_token_model
- data/models/account_balance_model
- data/models/account_model
- data/models/accounts_model
- data/repositories/access_token_repository_impl
- data/repositories/account_balance_repository_impl
- data/repositories/accounts_repositories
- data/sources/access_token_remote_source
- data/sources/account_balance_remote_source
- data/sources/accounts_remote_source
- domain/entities/access_token_entity
- domain/entities/account_balance_entity
- domain/entities/account_entity
- domain/entities/accounts_entity
- domain/repositories/access_token_repository
- domain/repositories/account_balance_repository
- domain/repositories/accounts_repository
- domain/usecases/get_access_token_usecase
- domain/usecases/get_account_balance_usecase
- domain/usecases/get_accounts_usecase
- investec_open_api