This is an PHP client for the Moneyhub API. It currently supports the following features:
- Registering users
- Deleting users
- Generating authorisation urls for new and existing users
- Getting access tokens and refresh tokens from an authorisation code
- Refreshing access tokens
- Deleting user connections
- Getting access tokens with client credentials
- CRUD actions for accounts
- CRUD actions for transactions
- Generate authorisation url for payments
- Add Payees
- Get Payees and payments
- Get categories
- CRUD actions on projects
- CRUD actions on transaction attachments
- CRUD actions on transaction splits
- Get a tax return for a subset of transactions
- Get the regular transactions on an account
- Get beneficiaries
composer require geniusee-software/geniusee-moneyhub-php-sdk
Currently this library supports client_secret_basic
authentication.
JSON example for client_secret_basic
{
"clientId": "clientId",
"clientSecret": "clientSecret",
"responseType": "code"
}
make psalm - run psalm
make test - run unit tests
make style-fix - run cs-fixer
This module exposes a factory function that accepts the following configuration:
$factory = new MoneyHubFactory('path_to_config');
Now supports php, json file formats.
Accounts API Moneyhub docs - https://docs.moneyhubenterprise.com/reference/get_accounts
$factory->accounts();
$factory->accounts()->delete(string $userid, string $accountId);
$factory->accounts()->all(string $userId): AccountBalanceCollection;
$factory->accounts()->addNewBalanceForAnAccount(string $userId, string $accountId): AccountBalanceCollection;
$factory->accounts()->one(string $userId, string $accountId): Account;
$factory->accounts()->retrieveTheHistoricalBalancesForAnAccount(
string $userId,
string $accountId
): AccountBalanceCollection;
$factory->accounts()->updateSingleAccount(string $userId, string $accountId): Account;
To add our scopes you can use withScopes method
$factory->accounts()->withScopes();
Additional methods
$factory->accounts()->withGrantType();
$factory->accounts()->withParams();
$factory->accounts()->withBodyParams();
Counterparties API Moneyhub docs - https://docs.moneyhubenterprise.com/reference/get_accounts-accountid-counterparties
$factory->transactions();
$factory->transactions()->all(string $userId): TransactionCollection;
$factory->transactions()->one(string $userId, string $transactionId): Transaction;
$factory->transactions()->createSingleTransaction(string $userId): Transaction;
$factory->transactions()->createMultipleTransactions(string $userId): array;
$factory->transactions()->updateSingleTransaction(string $userId, string $transactionId): Transaction
$factory->transactions()->transactionAttachments(string $userId, string $transactionId): TransactionAttachmentCollection;
$factory->transactions()->retrieveTransactionAttachments(
string $userId,
string $transactionId,
string $fileId
): array;
$factory->transactions()->retrieveTransactionSplit(
string $userId,
string $transactionId,
): array;
$factory->transactions()->splitTransaction(
string $userId,
string $transactionId,
): TransactionSplit;
$factory->transactions()->pathSplitTransaction(
string $userId,
string $transactionId,
string $splitId,
): array;
$factory->transactions()->mergeSplitTransaction(string $userId,string $transactionId): void;
$factory->transactions()->deleteTransactionAttachments(string $userId,string $transactionId, string $fileId): void;
$factory->transactions()->delete(string $userid, string $transactionId): void;
Additional methods
$factory->transactions()->withGrantType();
$factory->transactions()->withParams();
$factory->transactions()->withBodyParams();
$factory->transactions()->withScopes();
Notification Thresholds API Moneyhub docs - https://docs.moneyhubenterprise.com/reference/get_accounts-accountid-notification-thresholds
$factory->notificationThresholds();
$factory->notificationThresholds()->all(string $userId, string $accountId): NotificationThresholdsCollection;
$factory->notificationThresholds()->create(string $userId, string $accountId): NotificationThreshold;
$factory->notificationThresholds()->update(string $userId, string $accountId, string $thresholdId): NotificationThreshold;
$factory->notificationThresholds()->delete(string $userId, string $accountId, string $thresholdId): void;
Additional methods
$factory->notificationThresholds()->withGrantType();
$factory->notificationThresholds()->withParams();
$factory->notificationThresholds()->withBodyParams();
$factory->notificationThresholds()->withScopes();
Transactions API Moneyhub docs - https://docs.moneyhubenterprise.com/reference/get_transactions
$factory->transactions();
$factory->transactions()->all(string $userId): TransactionCollection;
$factory->transactions()->one(string $userId, string $transactionId): Transaction;
$factory->transactions()->createSingleTransaction(string $userId): Transaction;
$factory->transactions()->createMultipleTransactions(string $userId): array;
$factory->transactions()->updateSingleTransaction(string $userId, string $transactionId): Transaction;
$factory->transactions()->transactionAttachments(string $userId, string $transactionId): TransactionAttachmentCollection;
$factory->transactions()->retrieveTransactionAttachments(
string $userId,
string $transactionId,
string $fileId
): TransactionAttachment;
$factory->transactions()->retrieveTransactionSplit(
string $userId,
string $transactionId,
): array;
$factory->transactions()->splitTransaction(
string $userId,
string $transactionId,
): TransactionSplit;
$factory->transactions()->pathSplitTransaction(
string $userId,
string $transactionId,
string $splitId,
): array;
$factory->transactions()->mergeSplitTransaction(
string $userId,
string $transactionId,
): void;
$factory->transactions()->deleteTransactionAttachments(
string $userId,
string $transactionId,
string $fileId
): void;
$factory->transactions()->delete(string $userid, string $transactionId): void
Additional methods
$factory->transactions()->withGrantType();
$factory->transactions()->withParams();
$factory->transactions()->withBodyParams();
$factory->transactions()->withScopes();
Categories API Moneyhub docs - https://docs.moneyhubenterprise.com/reference/get_categories
$factory->categories();
$factory->categories()->all(string $userId): CategoriesCollection;
$factory->categories()->one(string $userId, string $categoryId): Category;
$factory->categories()->allCategoryGroups(string $userId): CategoriesGroupCollection;
$factory->categories()->create(string $userId): Category;
Additional methods
$factory->categories()->withGrantType();
$factory->categories()->withParams();
$factory->categories()->withBodyParams();
$factory->categories()->withScopes();
Projects API Moneyhub docs - https://docs.moneyhubenterprise.com/reference/get_projects
$factory->projects();
$factory->projects()->all(string $userId): ProjectsCollection;
$factory->projects()->one(string $userId, string $projectId): Project;
$factory->projects()->createSingleProject(string $userId): Project;
$factory->projects()->updateSingleProject(string $userId, string $projectId): Project;
$factory->projects()->delete(string $userid, string $accountId): void;
Additional methods
$factory->projects()->withGrantType();
$factory->projects()->withParams();
$factory->projects()->withBodyParams();
$factory->projects()->withScopes();
Tax API Moneyhub docs - https://docs.moneyhubenterprise.com/reference/get_tax
$factory->tax();
$factory->tax()->retrieveTransactions(
string $userId,
string $startDate,
string $endDate,
?string $projectId = null,
?string $accountId = null
): TaxesCollection;
Additional methods
$factory->tax()->withScopes();
Users API Moneyhub docs - https://docs.moneyhubenterprise.com/reference/get_users
$factory->users();
$factory->users()->all(): UsersCollection;
$factory->users()->one(string $moneyHubUserId): User;
$factory->users()->create(string $clientUserId): User;
$factory->users()->delete(string $moneyHubUserId): void;
Additional methods
$factory->users()->withGrantType();
$factory->users()->withParams();
$factory->users()->withBodyParams();
$factory->users()->withScopes();
Sync API Moneyhub docs - https://docs.moneyhubenterprise.com/reference/post_sync-connectionid
$factory->sync();
$factory->sync()-ЮsyncAnExistingConnection(string $userId, string $connectionId): SyncDto;
Additional methods
$factory->sync()->withScopes();