Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

kiran94/Monzo.Framework

Repository files navigation

Monzo.Framework 🚀

Build status AppVeyor tests NuGet Codacy Badge License: MIT

Library to access the Monzo API via .NET.

Setup

  1. Install-Package Monzo.Framework
  2. Set up Environment variable:
export MONZO="<ACCESS_TOKEN>"

You can get your access token here if you have a Monzo Account.

Usage

All services in this library make use of the MonzoConfiguration object. Each endpoint is also awaitable.

Accounts

// Construct Account Service
var accountService = Monzo.Framework.Factory.CreateAccountService();

// Get Accounts (awaitable)
var accounts = await accountService.GetAccountsAsync();

Balance

// 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

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);

Pots

var potService = Monzo.Framework.Factory.CreatePotService();
var pots = await potService.GetPotsAsync()

Releases

No releases published

Packages

No packages published

Languages