Library to access the Monzo API via .NET.
Install-Package Monzo.Framework
- Set up Environment variable:
export MONZO="<ACCESS_TOKEN>"
You can get your access token here if you have a Monzo Account.
All services in this library make use of the MonzoConfiguration
object. Each endpoint is also awaitable
.
// Construct Account Service
var accountService = Monzo.Framework.Factory.CreateAccountService();
// Get Accounts (awaitable)
var accounts = await accountService.GetAccountsAsync();
// Construct and retrieve Accounts and select one.
var accountService = Monzo.Framework.Factory.CreateAccountService();
var accounts = await accountService.GetAccountsAsync();
var account = accounts.AccountCollection.First();
// Construct Balance service and retrieve.
var balanceService = Monzo.Framework.Factory.CreateBalanceService();
var balance = await balanceService.GetBalanceAsync(account);
Transactions have multiple configurations. Each function can expand merchant information. You can currently retrieve:
- Single Transaction
- Multiple Transactions
- Multiple Transactions in a particular date period
// Retrieve Accounts and select one.
var accountService = Monzo.Framework.Factory.CreateAccountService();
var accounts = await accountService.GetAccountsAsync();
var account = accounts.AccountCollection.First();
// Construct transaction service.
var transactionService = Monzo.Framework.Factory.CreateTransactionService();
// Get Transactions for an account.
var transactionService = await transactionService.GetTransactionsAsync(account, false);
// Get a specific transaction by ID.
var transactionService = await transactionService.GetTransactionAsync("transaction_id", false);
// Get all transactions between 05/01/18 and 10/01/18 for an account.
var transactions = await transactionService.GetTransactionsByDateAsync(
account,
new DateTime(2018, 01, 05),
new DateTime(2018, 01, 10), false);
var potService = Monzo.Framework.Factory.CreatePotService();
var pots = await potService.GetPotsAsync()