- Java 100%
|
All checks were successful
Java CI with Maven / Build YNAB API Endpoints (push) Successful in 2m15s
|
||
|---|---|---|
| .forgejo/workflows | ||
| api | ||
| docs | ||
| gradle/wrapper | ||
| src | ||
| .gitignore | ||
| .openapi-generator-ignore | ||
| build.gradle | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| README.md | ||
| settings.gradle | ||
ynab
YNAB API Endpoints
- API version: 1.83.0
- Build date: 2026-04-26T18:05:30.720340+02:00[Europe/Stockholm]
- Generator version: 7.21.0
Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
Automatically generated by the OpenAPI Generator
Requirements
Building the API client library requires:
- Java 1.8+
- Maven (3.8.3+)/Gradle (7.2+)
Installation
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deploy
Refer to the OSSRH Guide for more information.
Maven users
Add this dependency to your project's POM:
<dependency>
<groupId>cm.xd.genapi</groupId>
<artifactId>ynab</artifactId>
<version>1.83.0</version>
<scope>compile</scope>
</dependency>
Gradle users
Add this dependency to your project's build file:
repositories {
mavenCentral() // Needed if the 'ynab' jar has been published to maven central.
mavenLocal() // Needed if the 'ynab' jar has been published to the local maven repo.
}
dependencies {
implementation "cm.xd.genapi:ynab:1.83.0"
}
Others
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/ynab-1.83.0.jartarget/lib/*.jar
Getting Started
Please follow the installation instruction and execute the following Java code:
// Import classes:
import cm.xd.genapi.ynab.ApiClient;
import cm.xd.genapi.ynab.ApiException;
import cm.xd.genapi.ynab.Configuration;
import cm.xd.genapi.ynab.auth.*;
import cm.xd.genapi.ynab.model.*;
import cm.xd.genapi.ynab.api.AccountsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.ynab.com/v1");
// Configure HTTP bearer authorization: bearer
HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer");
bearer.setBearerToken("BEARER TOKEN");
AccountsApi apiInstance = new AccountsApi(defaultClient);
String planId = "planId_example"; // String | The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan)
PostAccountWrapper data = new PostAccountWrapper(); // PostAccountWrapper | The account to create.
try {
AccountResponse result = apiInstance.createAccount(planId, data);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountsApi#createAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Documentation for API Endpoints
All URIs are relative to https://api.ynab.com/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AccountsApi | createAccount | POST /plans/{plan_id}/accounts | Create an account |
| AccountsApi | getAccountById | GET /plans/{plan_id}/accounts/{account_id} | Get an account |
| AccountsApi | getAccounts | GET /plans/{plan_id}/accounts | Get all accounts |
| CategoriesApi | createCategory | POST /plans/{plan_id}/categories | Create a category |
| CategoriesApi | createCategoryGroup | POST /plans/{plan_id}/category_groups | Create a category group |
| CategoriesApi | getCategories | GET /plans/{plan_id}/categories | Get all categories |
| CategoriesApi | getCategoryById | GET /plans/{plan_id}/categories/{category_id} | Get a category |
| CategoriesApi | getMonthCategoryById | GET /plans/{plan_id}/months/{month}/categories/{category_id} | Get a category for a specific plan month |
| CategoriesApi | updateCategory | PATCH /plans/{plan_id}/categories/{category_id} | Update a category |
| CategoriesApi | updateCategoryGroup | PATCH /plans/{plan_id}/category_groups/{category_group_id} | Update a category group |
| CategoriesApi | updateMonthCategory | PATCH /plans/{plan_id}/months/{month}/categories/{category_id} | Update a category for a specific month |
| MoneyMovementsApi | getMoneyMovementGroups | GET /plans/{plan_id}/money_movement_groups | Get all money movement groups |
| MoneyMovementsApi | getMoneyMovementGroupsByMonth | GET /plans/{plan_id}/months/{month}/money_movement_groups | Get money movement groups for a plan month |
| MoneyMovementsApi | getMoneyMovements | GET /plans/{plan_id}/money_movements | Get all money movements |
| MoneyMovementsApi | getMoneyMovementsByMonth | GET /plans/{plan_id}/months/{month}/money_movements | Get money movements for a plan month |
| MonthsApi | getPlanMonth | GET /plans/{plan_id}/months/{month} | Get a plan month |
| MonthsApi | getPlanMonths | GET /plans/{plan_id}/months | Get all plan months |
| PayeeLocationsApi | getPayeeLocationById | GET /plans/{plan_id}/payee_locations/{payee_location_id} | Get a payee location |
| PayeeLocationsApi | getPayeeLocations | GET /plans/{plan_id}/payee_locations | Get all payee locations |
| PayeeLocationsApi | getPayeeLocationsByPayee | GET /plans/{plan_id}/payees/{payee_id}/payee_locations | Get all locations for a payee |
| PayeesApi | createPayee | POST /plans/{plan_id}/payees | Create a payee |
| PayeesApi | getPayeeById | GET /plans/{plan_id}/payees/{payee_id} | Get a payee |
| PayeesApi | getPayees | GET /plans/{plan_id}/payees | Get all payees |
| PayeesApi | updatePayee | PATCH /plans/{plan_id}/payees/{payee_id} | Update a payee |
| PlansApi | getPlanById | GET /plans/{plan_id} | Get a plan |
| PlansApi | getPlanSettingsById | GET /plans/{plan_id}/settings | Get plan settings |
| PlansApi | getPlans | GET /plans | Get all plans |
| ScheduledTransactionsApi | createScheduledTransaction | POST /plans/{plan_id}/scheduled_transactions | Create a scheduled transaction |
| ScheduledTransactionsApi | deleteScheduledTransaction | DELETE /plans/{plan_id}/scheduled_transactions/{scheduled_transaction_id} | Delete a scheduled transaction |
| ScheduledTransactionsApi | getScheduledTransactionById | GET /plans/{plan_id}/scheduled_transactions/{scheduled_transaction_id} | Get a scheduled transaction |
| ScheduledTransactionsApi | getScheduledTransactions | GET /plans/{plan_id}/scheduled_transactions | Get all scheduled transactions |
| ScheduledTransactionsApi | updateScheduledTransaction | PUT /plans/{plan_id}/scheduled_transactions/{scheduled_transaction_id} | Update a scheduled transaction |
| TransactionsApi | createTransaction | POST /plans/{plan_id}/transactions | Create a single transaction or multiple transactions |
| TransactionsApi | deleteTransaction | DELETE /plans/{plan_id}/transactions/{transaction_id} | Delete a transaction |
| TransactionsApi | getTransactionById | GET /plans/{plan_id}/transactions/{transaction_id} | Get a transaction |
| TransactionsApi | getTransactions | GET /plans/{plan_id}/transactions | Get all transactions |
| TransactionsApi | getTransactionsByAccount | GET /plans/{plan_id}/accounts/{account_id}/transactions | Get all account transactions |
| TransactionsApi | getTransactionsByCategory | GET /plans/{plan_id}/categories/{category_id}/transactions | Get all category transactions |
| TransactionsApi | getTransactionsByMonth | GET /plans/{plan_id}/months/{month}/transactions | Get all plan month transactions |
| TransactionsApi | getTransactionsByPayee | GET /plans/{plan_id}/payees/{payee_id}/transactions | Get all payee transactions |
| TransactionsApi | importTransactions | POST /plans/{plan_id}/transactions/import | Import transactions |
| TransactionsApi | updateTransaction | PUT /plans/{plan_id}/transactions/{transaction_id} | Update a transaction |
| TransactionsApi | updateTransactions | PATCH /plans/{plan_id}/transactions | Update multiple transactions |
| UserApi | getUser | GET /user | Get user |
Documentation for Models
- Account
- AccountBase
- AccountResponse
- AccountResponseData
- AccountType
- AccountsResponse
- AccountsResponseData
- BulkResponse
- BulkResponseData
- BulkResponseDataBulk
- BulkTransactions
- CategoriesResponse
- CategoriesResponseData
- Category
- CategoryBase
- CategoryGroup
- CategoryGroupWithCategories
- CategoryResponse
- CategoryResponseData
- CurrencyFormat
- DateFormat
- ErrorDetail
- ErrorResponse
- ExistingCategory
- ExistingTransaction
- HybridTransaction
- HybridTransactionsResponse
- HybridTransactionsResponseData
- MoneyMovement
- MoneyMovementBase
- MoneyMovementGroup
- MoneyMovementGroupsResponse
- MoneyMovementGroupsResponseData
- MoneyMovementsResponse
- MoneyMovementsResponseData
- MonthDetail
- MonthDetailBase
- MonthDetailResponse
- MonthDetailResponseData
- MonthSummariesResponse
- MonthSummariesResponseData
- MonthSummary
- MonthSummaryBase
- NewCategory
- NewTransaction
- PatchCategoryGroupWrapper
- PatchCategoryWrapper
- PatchMonthCategoryWrapper
- PatchPayeeWrapper
- PatchTransactionsWrapper
- Payee
- PayeeLocation
- PayeeLocationResponse
- PayeeLocationResponseData
- PayeeLocationsResponse
- PayeeLocationsResponseData
- PayeeResponse
- PayeeResponseData
- PayeesResponse
- PayeesResponseData
- PlanDetail
- PlanDetailResponse
- PlanDetailResponseData
- PlanSettings
- PlanSettingsResponse
- PlanSettingsResponseData
- PlanSummary
- PlanSummaryResponse
- PlanSummaryResponseData
- PostAccountWrapper
- PostCategoryGroupWrapper
- PostCategoryWrapper
- PostPayee
- PostPayeeWrapper
- PostScheduledTransactionWrapper
- PostTransactionsWrapper
- PutScheduledTransactionWrapper
- PutTransactionWrapper
- SaveAccount
- SaveAccountType
- SaveCategory
- SaveCategoryGroup
- SaveCategoryGroupResponse
- SaveCategoryGroupResponseData
- SaveCategoryResponse
- SaveCategoryResponseData
- SaveMonthCategory
- SavePayee
- SavePayeeResponse
- SavePayeeResponseData
- SaveScheduledTransaction
- SaveSubTransaction
- SaveTransactionWithIdOrImportId
- SaveTransactionWithOptionalFields
- SaveTransactionsResponse
- SaveTransactionsResponseData
- ScheduledSubTransaction
- ScheduledSubTransactionBase
- ScheduledTransactionDetail
- ScheduledTransactionFrequency
- ScheduledTransactionResponse
- ScheduledTransactionResponseData
- ScheduledTransactionSummary
- ScheduledTransactionSummaryBase
- ScheduledTransactionsResponse
- ScheduledTransactionsResponseData
- SubTransaction
- SubTransactionBase
- TransactionClearedStatus
- TransactionDetail
- TransactionFlagColor
- TransactionResponse
- TransactionResponseData
- TransactionSummary
- TransactionSummaryBase
- TransactionsImportResponse
- TransactionsImportResponseData
- TransactionsResponse
- TransactionsResponseData
- User
- UserResponse
- UserResponseData
Documentation for Authorization
Authentication schemes defined for the API:
bearer
- Type: HTTP Bearer Token authentication
Recommendation
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.