This document describes all methods that are available on the YNAB Client object.
Returns authenticated user information
public function getUser(): UserResponseInterface;
Returns an instance of UserResponseInterface.
Returns budgets list with summary information.
public function getBudgets(bool $includeAccounts = false): BudgetSummaryResponseInterface;
Returns an instance of BudgetSummaryResponseInterface.
Returns a single budget with all related entities. This resource is effectively a full budget export.
public function getBudget(string $budgetId, ?int $lastKnowledgeOfServer = null): BudgetDetailResponseInterface;
Returns an instance of BudgetDetailResponseInterface.
Returns settings for a budget.
public function getBudgetSettings(string $budgetId): BudgetSettingsResponseInterface;
Returns an instance of BudgetSettingsResponseInterface.
The accounts for a budget.
Returns all accounts.
public function getAccounts(string $budgetId, ?int $lastKnowledgeOfServer = null): AccountsResponseInterface;
Returns an instance of AccountsResponseInterface.
Creates a new account. Requires an instance of SaveAccount describing the account to create.
public function createAccount(string $budgetId, SaveAccount $account): AccountResponseInterface;
Returns an instance of AccountResponseInterface.
Returns a single account.
public function getAccount(string $budgetId, string $accountId): AccountResponseInterface;
Returns an instance of AccountResponseInterface.
The categories for a budget.
Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
public function getCategories(string $budgetId, ?int $lastKnowledgeOfServer = null): CategoriesResponseInterface;
Returns an instance of CategoriesResponseInterface.
Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
public function getCategory(string $budgetId, string $categoryId): CategoryResponseInterface;
Returns an instance of CategoryResponseInterface.
Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
public function getCategoryForMonth(string $budgetId, string $month, string $categoryId): CategoryResponseInterface;
Returns an instance of CategoryResponseInterface.
Update a category for a specific month. Only budgeted amount can be updated. Requires an instance of SaveMonthCategory describing the category to be updated.
public function updateCategoryForMonth(string $budgetId, string $month, string $categoryId, SaveMonthCategory $category): SaveCategoryResponseInterface;
Returns an instance of SaveCategoryResponseInterface.
The payees for a budget
Returns all payees.
public function getPayees(string $budgetId, ?int $lastKnowledgeOfServer = null): PayeesResponseInterface;
Returns an instance of PayeesResponseInterface.
Returns a single payee.
public function getPayee(string $budgetId, string $payeeId): PayeeResponseInterface;
Returns an instance of PayeeResponseInterface.
When you enter a transaction and specify a payee on the YNAB mobile apps, the GPS coordinates for that location are stored, with your permission, so that the next time you are in the same place (like the Grocery store) we can pre-populate nearby payees for you! It’s handy and saves you time. This resource makes these locations available. Locations will not be available for all payees.
Returns all payee locations.
public function getPayeeLocations(string $budgetId): PayeeLocationsResponseInterface;
Returns an instance of PayeeLocationsResponseInterface.
Returns a single payee location.
public function getPayeeLocation(string $budgetId, string $payeeLocationId): PayeeLocationResponseInterface;
Returns an instance of PayeeLocationResponseInterface.
Returns all payee locations for a specified payee.
public function getLocationsForPayee(string $budgetId, string $payeeId): PayeeLocationsResponseInterface;
Returns an instance of PayeeLocationResponseInterface.
Each budget contains one or more months, which is where Ready to Assign, Age of Money and category (budgeted / activity / balances) amounts are available.
Returns all budget months.
public function getMonths(string $budgetId, ?int $lastKnowledgeOfServer = null): MonthSummariesResponseInterface;
Returns an instance of MonthSummariesResponseInterface.
Returns a single budget month.
public function getMonth(string $budgetId, string $month): MonthDetailResponseInterface;
Returns an instance of MonthDetailResponseInterface.
The transactions for a budget
Returns budget transactions.
public function getTransactions(string $budgetId, ?string $sinceDate = null, ?string $type = null, ?int $lastKnowledgeOfServer = null): TransactionsResponseInterface;
Returns an instance of TransactionsResponseInterface.
Creates a single transaction. Scheduled transactions cannot be created on this endpoint. Requires an instance of SaveTransaction describing the transaction to create.
public function createTransaction(string $budgetId, SaveTransaction $transaction): SaveTransactionsResponseInterface;
Returns an instance of SaveTransactionsResponseInterface.
Creates multiple transactions. Scheduled transactions cannot be created on this endpoint. Requires an array of instances of SaveTransaction describing the transactions to create.
public function createTransactions(string $budgetId, array $transactions): SaveTransactionsResponseInterface;
Returns an instance of SaveTransactionsResponseInterface.
Updates multiple transactions, by id or import_id. Requires an array of instances of UpdateTransaction describing the transactions to update.
public function updateTransactions(string $budgetId, array $transactions): SaveTransactionsResponseInterface;
Returns an instance of SaveTransactionsResponseInterface.
Imports available transactions on all linked accounts for the given budget. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking “Import” on each account in the web application or tapping the “New Transactions” banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported.
public function importTransactions(string $budgetId): TransactionsImportResponseInterface;
Returns an instance of TransactionsImportResponseInterface.
Returns a single transaction.
public function getTransaction(string $budgetId, string $transactionId): TransactionResponseInterface;
Returns an instance of TransactionResponseInterface.
Updates a single transaction. Requires an instance of SaveTransaction describing the transaction to update.
public function updateTransaction(string $budgetId, string $transactionId, SaveTransaction $transaction): TransactionResponseInterface;
Returns an instance of TransactionResponseInterface.
Returns all transactions for a specified account.
public function getAccountTransactions(string $budgetId, string $accountId, ?string $sinceDate = null, ?string $type = null, ?int $lastKnowledgeOfServer = null): TransactionsResponseInterface;
Returns an instance of TransactionsResponseInterface.
Returns all transactions for a specified category.
public function getCategoryTransactions(string $budgetId, string $categoryId, ?string $sinceDate = null, ?string $type = null, ?int $lastKnowledgeOfServer = null): HybridTransactionsResponseInterface;
Returns an instance of HybridTransactionsResponseInterface.
Returns all transactions for a specified payee.
public function getPayeeTransactions(string $budgetId, string $payeeId, ?string $sinceDate = null, ?string $type = null, ?int $lastKnowledgeOfServer = null): HybridTransactionsResponseInterface;
Returns an instance of HybridTransactionsResponseInterface.
The scheduled transactions for a budget
Returns all scheduled transactions.
public function getScheduledTransactions(string $budgetId, ?int $lastKnowledgeOfServer = null): ScheduledTransactionsResponseInterface;
Returns an instance of ScheduledTransactionsResponseInterface.
Returns a single scheduled transaction.
public function getScheduledTransaction(string $budgetId, string $scheduledTransactionId): ScheduledTransactionResponseInterface;
Returns an instance of ScheduledTransactionResponseInterface.