/buxfer-ts-client

An easy-to-use TypsScript client library to Buxfer API.

Primary LanguageTypeScriptMIT LicenseMIT

buxfer-ts-client

License NPM

buxfer-ts-client is an easy-to-use Type Script client library to Buxfer API.


Features

  • Full API support
  • Tested on Windows 11.

Usage

// Creating client.
let client = new BuxferApiClient("<your user>", "<your password>");

// Getting all accounts.
let accounts = await client.getAccounts();

// Getting all budgets.
let budgets = await client.getBudgets();

// Getting all contacts.
let contacts = await client.getContacts();

// Getting all groups.
let groups = await client.getGroups();

// Getting all loans.
let loans = await client.getLoans();

// Getting all reminders.
let reminders = await client.getReminders();

// Upload a statement.
-TODO;
// let statement = new Statement();
// statement.AccountId = "<account id>";
// statement.Text = "<Quicken, MS Money, OFX, QIF, QFX, Excel, CSV file content>";
// bool uploaded = client.uploadStatement(statement);

// Getting all tags.
let tags = await client.getTags();

// Getting last 100 transactions.
let lastTransactions = await client.getTransactions();

// Getting transactions by supported query parameters
let queryParams = new GetTransactionsQueryParameters();
queryParams.startDate = "2024-01-01";
queryParams.endDate = "2024-02-01";
let dbTransactions = await buxferClient.getTransactions(queryParams);

// Add a transaction.

// Populate new Buxfer transactions to be added
const nowDate = format(new Date(), "yyyy-MM-dd");
const mockTrx: BuxferTransaction = {
    description: "mock",
    amount: 12345,
    date: nowDate,
    type: "income",
    status: "cleared",
    accountId: 1398435
}
// Add new mock transaction to DB
let response: AddTransactionsResponse = await buxferClient.addTransactions(new Array(mockTrx), true);
const mockTrxId = response.addedTransactionIds[0];

Roadmap

  • Support automatic paginator to retrieve more than 100 transactions at a time by the client getter signatures
  • Support status update transactions using the POST transaction_edit API
  • Integrate with moneyman application.

FAQ

Having troubles?


How to improve it?

Create a fork of buxfer-ts-client.

Did you change it? Submit a pull request.

License

Licensed under the The MIT License (MIT). In others words, you can use this library for development any kind of software: open source, commercial, proprietary and alien.

Change Log

1.0.0 First version.