ynab 3.9.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +4 -2
- data/README.md +47 -39
- data/Rakefile +3 -3
- data/docs/Account.md +3 -3
- data/docs/AccountsApi.md +12 -12
- data/docs/CategoriesApi.md +89 -25
- data/docs/Category.md +4 -3
- data/docs/CategoryGroupWithCategories.md +1 -1
- data/docs/ExistingCategory.md +12 -0
- data/docs/MoneyMovement.md +16 -0
- data/docs/MoneyMovementGroup.md +12 -0
- data/docs/MoneyMovementGroupsResponse.md +8 -0
- data/docs/MoneyMovementGroupsResponseData.md +9 -0
- data/docs/MoneyMovementsApi.md +89 -0
- data/docs/{BudgetSettingsResponse.md → MoneyMovementsResponse.md} +2 -2
- data/docs/MoneyMovementsResponseData.md +9 -0
- data/docs/MonthDetail.md +2 -2
- data/docs/MonthSummary.md +1 -1
- data/docs/MonthsApi.md +13 -13
- data/docs/NewCategory.md +12 -0
- data/docs/PatchCategoryGroupWrapper.md +8 -0
- data/docs/PatchCategoryWrapper.md +1 -1
- data/docs/PayeeLocationsApi.md +12 -12
- data/docs/PayeesApi.md +11 -11
- data/docs/{BudgetDetail.md → PlanDetail.md} +4 -4
- data/docs/PlanDetailResponse.md +8 -0
- data/docs/{BudgetDetailResponseData.md → PlanDetailResponseData.md} +2 -2
- data/docs/{BudgetSettings.md → PlanSettings.md} +1 -1
- data/docs/{BudgetDetailResponse.md → PlanSettingsResponse.md} +2 -2
- data/docs/PlanSettingsResponseData.md +8 -0
- data/docs/PlanSummary.md +15 -0
- data/docs/PlanSummaryResponse.md +8 -0
- data/docs/PlanSummaryResponseData.md +9 -0
- data/docs/PlansApi.md +68 -0
- data/docs/PostCategoryGroupWrapper.md +8 -0
- data/docs/PostCategoryWrapper.md +8 -0
- data/docs/SaveCategory.md +2 -1
- data/docs/SaveCategoryGroup.md +8 -0
- data/docs/SaveCategoryGroupResponse.md +8 -0
- data/docs/SaveCategoryGroupResponseData.md +9 -0
- data/docs/SaveMonthCategory.md +1 -1
- data/docs/ScheduledTransactionsApi.md +20 -20
- data/docs/TransactionsApi.md +48 -48
- data/docs/UserApi.md +2 -2
- data/examples/category-balance.rb +2 -2
- data/examples/create-multiple-transactions.rb +2 -2
- data/examples/create-transaction.rb +2 -2
- data/examples/{budget-list.rb → plan-list.rb} +6 -6
- data/examples/{budget-month.rb → plan-month.rb} +9 -10
- data/examples/update-category-budgeted.rb +2 -2
- data/examples/update-multiple-transactions.rb +3 -3
- data/lib/ynab/api/accounts_api.rb +33 -34
- data/lib/ynab/api/categories_api.rb +293 -66
- data/lib/ynab/api/deprecated_api.rb +11 -11
- data/lib/ynab/api/money_movements_api.rb +282 -0
- data/lib/ynab/api/months_api.rb +35 -36
- data/lib/ynab/api/payee_locations_api.rb +33 -34
- data/lib/ynab/api/payees_api.rb +31 -32
- data/lib/ynab/api/{budgets_api.rb → plans_api.rb} +55 -56
- data/lib/ynab/api/scheduled_transactions_api.rb +55 -56
- data/lib/ynab/api/transactions_api.rb +130 -131
- data/lib/ynab/api/user_api.rb +2 -3
- data/lib/ynab/api_client.rb +0 -2
- data/lib/ynab/api_model_base.rb +85 -0
- data/lib/ynab/models/account.rb +4 -81
- data/lib/ynab/models/account_response.rb +1 -75
- data/lib/ynab/models/account_response_data.rb +1 -75
- data/lib/ynab/models/accounts_response.rb +1 -75
- data/lib/ynab/models/accounts_response_data.rb +1 -75
- data/lib/ynab/models/bulk_response.rb +1 -75
- data/lib/ynab/models/bulk_response_data.rb +1 -75
- data/lib/ynab/models/bulk_response_data_bulk.rb +1 -75
- data/lib/ynab/models/bulk_transactions.rb +1 -75
- data/lib/ynab/models/categories_response.rb +1 -75
- data/lib/ynab/models/categories_response_data.rb +1 -75
- data/lib/ynab/models/category.rb +16 -79
- data/lib/ynab/models/category_group.rb +1 -75
- data/lib/ynab/models/category_group_with_categories.rb +2 -76
- data/lib/ynab/models/category_response.rb +1 -75
- data/lib/ynab/models/category_response_data.rb +1 -75
- data/lib/ynab/models/currency_format.rb +2 -76
- data/lib/ynab/models/date_format.rb +2 -76
- data/lib/ynab/models/error_detail.rb +1 -75
- data/lib/ynab/models/error_response.rb +1 -75
- data/lib/ynab/models/existing_category.rb +180 -0
- data/lib/ynab/models/existing_transaction.rb +1 -79
- data/lib/ynab/models/hybrid_transaction.rb +1 -85
- data/lib/ynab/models/hybrid_transactions_response.rb +1 -75
- data/lib/ynab/models/hybrid_transactions_response_data.rb +1 -75
- data/lib/ynab/models/{budget_summary_response_data.rb → money_movement.rb} +95 -93
- data/lib/ynab/models/money_movement_group.rb +179 -0
- data/lib/ynab/models/{budget_summary_response.rb → money_movement_groups_response.rb} +4 -78
- data/lib/ynab/models/money_movement_groups_response_data.rb +149 -0
- data/lib/ynab/models/{budget_settings_response.rb → money_movements_response.rb} +4 -78
- data/lib/ynab/models/{budget_detail_response_data.rb → money_movements_response_data.rb} +13 -85
- data/lib/ynab/models/month_detail.rb +3 -79
- data/lib/ynab/models/month_detail_response.rb +1 -75
- data/lib/ynab/models/month_detail_response_data.rb +1 -75
- data/lib/ynab/models/month_summaries_response.rb +1 -75
- data/lib/ynab/models/month_summaries_response_data.rb +1 -75
- data/lib/ynab/models/month_summary.rb +2 -76
- data/lib/ynab/models/new_category.rb +180 -0
- data/lib/ynab/models/new_transaction.rb +1 -79
- data/lib/ynab/models/patch_category_group_wrapper.rb +136 -0
- data/lib/ynab/models/patch_category_wrapper.rb +2 -76
- data/lib/ynab/models/patch_month_category_wrapper.rb +1 -75
- data/lib/ynab/models/patch_payee_wrapper.rb +1 -75
- data/lib/ynab/models/patch_transactions_wrapper.rb +1 -75
- data/lib/ynab/models/payee.rb +1 -75
- data/lib/ynab/models/payee_location.rb +1 -75
- data/lib/ynab/models/payee_location_response.rb +1 -75
- data/lib/ynab/models/payee_location_response_data.rb +1 -75
- data/lib/ynab/models/payee_locations_response.rb +1 -75
- data/lib/ynab/models/payee_locations_response_data.rb +1 -75
- data/lib/ynab/models/payee_response.rb +1 -75
- data/lib/ynab/models/payee_response_data.rb +1 -75
- data/lib/ynab/models/payees_response.rb +1 -75
- data/lib/ynab/models/payees_response_data.rb +1 -75
- data/lib/ynab/models/{budget_detail.rb → plan_detail.rb} +7 -83
- data/lib/ynab/models/plan_detail_response.rb +136 -0
- data/lib/ynab/models/plan_detail_response_data.rb +147 -0
- data/lib/ynab/models/{budget_settings.rb → plan_settings.rb} +5 -79
- data/lib/ynab/models/{budget_detail_response.rb → plan_settings_response.rb} +4 -78
- data/lib/ynab/models/{budget_settings_response_data.rb → plan_settings_response_data.rb} +4 -78
- data/lib/ynab/models/{budget_summary.rb → plan_summary.rb} +7 -83
- data/lib/ynab/models/plan_summary_response.rb +136 -0
- data/lib/ynab/models/plan_summary_response_data.rb +147 -0
- data/lib/ynab/models/post_account_wrapper.rb +1 -75
- data/lib/ynab/models/post_category_group_wrapper.rb +136 -0
- data/lib/ynab/models/post_category_wrapper.rb +136 -0
- data/lib/ynab/models/post_scheduled_transaction_wrapper.rb +1 -75
- data/lib/ynab/models/post_transactions_wrapper.rb +1 -75
- data/lib/ynab/models/put_scheduled_transaction_wrapper.rb +1 -75
- data/lib/ynab/models/put_transaction_wrapper.rb +1 -75
- data/lib/ynab/models/save_account.rb +1 -75
- data/lib/ynab/models/save_category.rb +18 -81
- data/lib/ynab/models/save_category_group.rb +148 -0
- data/lib/ynab/models/save_category_group_response.rb +136 -0
- data/lib/ynab/models/save_category_group_response_data.rb +147 -0
- data/lib/ynab/models/save_category_response.rb +1 -75
- data/lib/ynab/models/save_category_response_data.rb +1 -75
- data/lib/ynab/models/save_month_category.rb +2 -76
- data/lib/ynab/models/save_payee.rb +1 -75
- data/lib/ynab/models/save_payee_response.rb +1 -75
- data/lib/ynab/models/save_payee_response_data.rb +1 -75
- data/lib/ynab/models/save_scheduled_transaction.rb +1 -75
- data/lib/ynab/models/save_sub_transaction.rb +1 -75
- data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +1 -79
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +1 -75
- data/lib/ynab/models/save_transactions_response.rb +1 -75
- data/lib/ynab/models/save_transactions_response_data.rb +1 -75
- data/lib/ynab/models/scheduled_sub_transaction.rb +1 -75
- data/lib/ynab/models/scheduled_transaction_detail.rb +1 -80
- data/lib/ynab/models/scheduled_transaction_response.rb +1 -75
- data/lib/ynab/models/scheduled_transaction_response_data.rb +1 -75
- data/lib/ynab/models/scheduled_transaction_summary.rb +1 -75
- data/lib/ynab/models/scheduled_transactions_response.rb +1 -75
- data/lib/ynab/models/scheduled_transactions_response_data.rb +1 -75
- data/lib/ynab/models/sub_transaction.rb +1 -75
- data/lib/ynab/models/transaction_detail.rb +1 -85
- data/lib/ynab/models/transaction_response.rb +1 -75
- data/lib/ynab/models/transaction_response_data.rb +1 -75
- data/lib/ynab/models/transaction_summary.rb +1 -75
- data/lib/ynab/models/transactions_import_response.rb +1 -75
- data/lib/ynab/models/transactions_import_response_data.rb +1 -75
- data/lib/ynab/models/transactions_response.rb +1 -75
- data/lib/ynab/models/transactions_response_data.rb +1 -75
- data/lib/ynab/models/user.rb +1 -75
- data/lib/ynab/models/user_response.rb +1 -75
- data/lib/ynab/models/user_response_data.rb +1 -75
- data/lib/ynab/overrides/transactions_api.rb +6 -6
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +28 -13
- data/open_api_spec.yaml +1161 -916
- data/spec/api/accounts_spec.rb +9 -9
- data/spec/api/categories_spec.rb +9 -9
- data/spec/api/months_spec.rb +7 -7
- data/spec/api/payee_locations_spec.rb +7 -7
- data/spec/api/payees_spec.rb +7 -7
- data/spec/api/plans_spec.rb +55 -0
- data/spec/api/scheduled_transactions_spec.rb +9 -9
- data/spec/api/transactions_spec.rb +27 -27
- data/spec/fixtures/vcr_cassettes/account.yml +2 -2
- data/spec/fixtures/vcr_cassettes/accounts.yml +2 -2
- data/spec/fixtures/vcr_cassettes/accounts_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/bulk_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/categories.yml +2 -2
- data/spec/fixtures/vcr_cassettes/categories_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/category.yml +2 -2
- data/spec/fixtures/vcr_cassettes/category_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/create_account.yml +2 -2
- data/spec/fixtures/vcr_cassettes/create_scheduled_transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/create_transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/create_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/import_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/month.yml +2 -2
- data/spec/fixtures/vcr_cassettes/month_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/months.yml +2 -2
- data/spec/fixtures/vcr_cassettes/months_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/multiple_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/patch_month_category.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee_location.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee_locations.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee_locations_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payees.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payees_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/{budget.yml → plan.yml} +3 -3
- data/spec/fixtures/vcr_cassettes/{budgets.yml → plans.yml} +3 -3
- data/spec/fixtures/vcr_cassettes/{budgets_unauthorized.yml → plans_unauthorized.yml} +3 -3
- data/spec/fixtures/vcr_cassettes/scheduled_transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/scheduled_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/scheduled_transactions_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/transactions_invalid_flags.yml +2 -2
- data/spec/fixtures/vcr_cassettes/transactions_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/update_transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/update_transactions.yml +2 -2
- data/templates/gem.mustache +3 -2
- data/templates/partial_model_generic.mustache +1 -1
- data/ynab.gemspec +1 -2
- metadata +64 -33
- data/docs/BudgetSettingsResponseData.md +0 -8
- data/docs/BudgetSummary.md +0 -15
- data/docs/BudgetSummaryResponse.md +0 -8
- data/docs/BudgetSummaryResponseData.md +0 -9
- data/docs/BudgetsApi.md +0 -68
- data/spec/api/budgets_spec.rb +0 -55
|
@@ -4,18 +4,18 @@ All URIs are relative to *https://api.ynab.com/v1*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
|
-
| [**create_scheduled_transaction**](ScheduledTransactionsApi.md#create_scheduled_transaction) | **POST** /
|
|
8
|
-
| [**delete_scheduled_transaction**](ScheduledTransactionsApi.md#delete_scheduled_transaction) | **DELETE** /
|
|
9
|
-
| [**get_scheduled_transaction_by_id**](ScheduledTransactionsApi.md#get_scheduled_transaction_by_id) | **GET** /
|
|
10
|
-
| [**get_scheduled_transactions**](ScheduledTransactionsApi.md#get_scheduled_transactions) | **GET** /
|
|
11
|
-
| [**update_scheduled_transaction**](ScheduledTransactionsApi.md#update_scheduled_transaction) | **PUT** /
|
|
7
|
+
| [**create_scheduled_transaction**](ScheduledTransactionsApi.md#create_scheduled_transaction) | **POST** /plans/{plan_id}/scheduled_transactions | Create a scheduled transaction |
|
|
8
|
+
| [**delete_scheduled_transaction**](ScheduledTransactionsApi.md#delete_scheduled_transaction) | **DELETE** /plans/{plan_id}/scheduled_transactions/{scheduled_transaction_id} | Delete a scheduled transaction |
|
|
9
|
+
| [**get_scheduled_transaction_by_id**](ScheduledTransactionsApi.md#get_scheduled_transaction_by_id) | **GET** /plans/{plan_id}/scheduled_transactions/{scheduled_transaction_id} | Get a scheduled transaction |
|
|
10
|
+
| [**get_scheduled_transactions**](ScheduledTransactionsApi.md#get_scheduled_transactions) | **GET** /plans/{plan_id}/scheduled_transactions | Get all scheduled transactions |
|
|
11
|
+
| [**update_scheduled_transaction**](ScheduledTransactionsApi.md#update_scheduled_transaction) | **PUT** /plans/{plan_id}/scheduled_transactions/{scheduled_transaction_id} | Update a scheduled transaction |
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
## create_scheduled_transaction
|
|
15
15
|
|
|
16
|
-
> <ScheduledTransactionResponse> create_scheduled_transaction(
|
|
16
|
+
> <ScheduledTransactionResponse> create_scheduled_transaction(plan_id, data)
|
|
17
17
|
|
|
18
|
-
Create a
|
|
18
|
+
Create a scheduled transaction
|
|
19
19
|
|
|
20
20
|
Creates a single scheduled transaction (a transaction with a future date).
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ Creates a single scheduled transaction (a transaction with a future date).
|
|
|
23
23
|
|
|
24
24
|
| Name | Type | Description | Notes |
|
|
25
25
|
| ---- | ---- | ----------- | ----- |
|
|
26
|
-
| **
|
|
26
|
+
| **plan_id** | **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). | |
|
|
27
27
|
| **data** | [**PostScheduledTransactionWrapper**](PostScheduledTransactionWrapper.md) | The scheduled transaction to create | |
|
|
28
28
|
|
|
29
29
|
### Return type
|
|
@@ -33,9 +33,9 @@ Creates a single scheduled transaction (a transaction with a future date).
|
|
|
33
33
|
|
|
34
34
|
## delete_scheduled_transaction
|
|
35
35
|
|
|
36
|
-
> <ScheduledTransactionResponse> delete_scheduled_transaction(
|
|
36
|
+
> <ScheduledTransactionResponse> delete_scheduled_transaction(plan_id, scheduled_transaction_id)
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
Delete a scheduled transaction
|
|
39
39
|
|
|
40
40
|
Deletes a scheduled transaction
|
|
41
41
|
|
|
@@ -43,7 +43,7 @@ Deletes a scheduled transaction
|
|
|
43
43
|
|
|
44
44
|
| Name | Type | Description | Notes |
|
|
45
45
|
| ---- | ---- | ----------- | ----- |
|
|
46
|
-
| **
|
|
46
|
+
| **plan_id** | **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). | |
|
|
47
47
|
| **scheduled_transaction_id** | **String** | The id of the scheduled transaction | |
|
|
48
48
|
|
|
49
49
|
### Return type
|
|
@@ -53,9 +53,9 @@ Deletes a scheduled transaction
|
|
|
53
53
|
|
|
54
54
|
## get_scheduled_transaction_by_id
|
|
55
55
|
|
|
56
|
-
> <ScheduledTransactionResponse> get_scheduled_transaction_by_id(
|
|
56
|
+
> <ScheduledTransactionResponse> get_scheduled_transaction_by_id(plan_id, scheduled_transaction_id)
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
Get a scheduled transaction
|
|
59
59
|
|
|
60
60
|
Returns a single scheduled transaction
|
|
61
61
|
|
|
@@ -63,7 +63,7 @@ Returns a single scheduled transaction
|
|
|
63
63
|
|
|
64
64
|
| Name | Type | Description | Notes |
|
|
65
65
|
| ---- | ---- | ----------- | ----- |
|
|
66
|
-
| **
|
|
66
|
+
| **plan_id** | **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). | |
|
|
67
67
|
| **scheduled_transaction_id** | **String** | The id of the scheduled transaction | |
|
|
68
68
|
|
|
69
69
|
### Return type
|
|
@@ -73,9 +73,9 @@ Returns a single scheduled transaction
|
|
|
73
73
|
|
|
74
74
|
## get_scheduled_transactions
|
|
75
75
|
|
|
76
|
-
> <ScheduledTransactionsResponse> get_scheduled_transactions(
|
|
76
|
+
> <ScheduledTransactionsResponse> get_scheduled_transactions(plan_id, opts)
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
Get all scheduled transactions
|
|
79
79
|
|
|
80
80
|
Returns all scheduled transactions
|
|
81
81
|
|
|
@@ -83,7 +83,7 @@ Returns all scheduled transactions
|
|
|
83
83
|
|
|
84
84
|
| Name | Type | Description | Notes |
|
|
85
85
|
| ---- | ---- | ----------- | ----- |
|
|
86
|
-
| **
|
|
86
|
+
| **plan_id** | **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). | |
|
|
87
87
|
| **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] |
|
|
88
88
|
|
|
89
89
|
### Return type
|
|
@@ -93,9 +93,9 @@ Returns all scheduled transactions
|
|
|
93
93
|
|
|
94
94
|
## update_scheduled_transaction
|
|
95
95
|
|
|
96
|
-
> <ScheduledTransactionResponse> update_scheduled_transaction(
|
|
96
|
+
> <ScheduledTransactionResponse> update_scheduled_transaction(plan_id, scheduled_transaction_id, put_scheduled_transaction_wrapper)
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
Update a scheduled transaction
|
|
99
99
|
|
|
100
100
|
Updates a single scheduled transaction
|
|
101
101
|
|
|
@@ -103,7 +103,7 @@ Updates a single scheduled transaction
|
|
|
103
103
|
|
|
104
104
|
| Name | Type | Description | Notes |
|
|
105
105
|
| ---- | ---- | ----------- | ----- |
|
|
106
|
-
| **
|
|
106
|
+
| **plan_id** | **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). | |
|
|
107
107
|
| **scheduled_transaction_id** | **String** | The id of the scheduled transaction | |
|
|
108
108
|
| **put_scheduled_transaction_wrapper** | [**PutScheduledTransactionWrapper**](PutScheduledTransactionWrapper.md) | The scheduled transaction to update | |
|
|
109
109
|
|
data/docs/TransactionsApi.md
CHANGED
|
@@ -4,22 +4,22 @@ All URIs are relative to *https://api.ynab.com/v1*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
|
-
| [**create_transaction**](TransactionsApi.md#create_transaction) | **POST** /
|
|
8
|
-
| [**delete_transaction**](TransactionsApi.md#delete_transaction) | **DELETE** /
|
|
9
|
-
| [**get_transaction_by_id**](TransactionsApi.md#get_transaction_by_id) | **GET** /
|
|
10
|
-
| [**get_transactions**](TransactionsApi.md#get_transactions) | **GET** /
|
|
11
|
-
| [**get_transactions_by_account**](TransactionsApi.md#get_transactions_by_account) | **GET** /
|
|
12
|
-
| [**get_transactions_by_category**](TransactionsApi.md#get_transactions_by_category) | **GET** /
|
|
13
|
-
| [**get_transactions_by_month**](TransactionsApi.md#get_transactions_by_month) | **GET** /
|
|
14
|
-
| [**get_transactions_by_payee**](TransactionsApi.md#get_transactions_by_payee) | **GET** /
|
|
15
|
-
| [**import_transactions**](TransactionsApi.md#import_transactions) | **POST** /
|
|
16
|
-
| [**update_transaction**](TransactionsApi.md#update_transaction) | **PUT** /
|
|
17
|
-
| [**update_transactions**](TransactionsApi.md#update_transactions) | **PATCH** /
|
|
7
|
+
| [**create_transaction**](TransactionsApi.md#create_transaction) | **POST** /plans/{plan_id}/transactions | Create a single transaction or multiple transactions |
|
|
8
|
+
| [**delete_transaction**](TransactionsApi.md#delete_transaction) | **DELETE** /plans/{plan_id}/transactions/{transaction_id} | Delete a transaction |
|
|
9
|
+
| [**get_transaction_by_id**](TransactionsApi.md#get_transaction_by_id) | **GET** /plans/{plan_id}/transactions/{transaction_id} | Get a transaction |
|
|
10
|
+
| [**get_transactions**](TransactionsApi.md#get_transactions) | **GET** /plans/{plan_id}/transactions | Get all transactions |
|
|
11
|
+
| [**get_transactions_by_account**](TransactionsApi.md#get_transactions_by_account) | **GET** /plans/{plan_id}/accounts/{account_id}/transactions | Get all account transactions |
|
|
12
|
+
| [**get_transactions_by_category**](TransactionsApi.md#get_transactions_by_category) | **GET** /plans/{plan_id}/categories/{category_id}/transactions | Get all category transactions |
|
|
13
|
+
| [**get_transactions_by_month**](TransactionsApi.md#get_transactions_by_month) | **GET** /plans/{plan_id}/months/{month}/transactions | Get all plan month transactions |
|
|
14
|
+
| [**get_transactions_by_payee**](TransactionsApi.md#get_transactions_by_payee) | **GET** /plans/{plan_id}/payees/{payee_id}/transactions | Get all payee transactions |
|
|
15
|
+
| [**import_transactions**](TransactionsApi.md#import_transactions) | **POST** /plans/{plan_id}/transactions/import | Import transactions |
|
|
16
|
+
| [**update_transaction**](TransactionsApi.md#update_transaction) | **PUT** /plans/{plan_id}/transactions/{transaction_id} | Update a transaction |
|
|
17
|
+
| [**update_transactions**](TransactionsApi.md#update_transactions) | **PATCH** /plans/{plan_id}/transactions | Update multiple transactions |
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
## create_transaction
|
|
21
21
|
|
|
22
|
-
> <SaveTransactionsResponse> create_transaction(
|
|
22
|
+
> <SaveTransactionsResponse> create_transaction(plan_id, data)
|
|
23
23
|
|
|
24
24
|
Create a single transaction or multiple transactions
|
|
25
25
|
|
|
@@ -29,7 +29,7 @@ Creates a single transaction or multiple transactions. If you provide a body co
|
|
|
29
29
|
|
|
30
30
|
| Name | Type | Description | Notes |
|
|
31
31
|
| ---- | ---- | ----------- | ----- |
|
|
32
|
-
| **
|
|
32
|
+
| **plan_id** | **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). | |
|
|
33
33
|
| **data** | [**PostTransactionsWrapper**](PostTransactionsWrapper.md) | The transaction or transactions to create. To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`. It is expected that you will only provide a value for one of these objects. | |
|
|
34
34
|
|
|
35
35
|
### Return type
|
|
@@ -39,9 +39,9 @@ Creates a single transaction or multiple transactions. If you provide a body co
|
|
|
39
39
|
|
|
40
40
|
## delete_transaction
|
|
41
41
|
|
|
42
|
-
> <TransactionResponse> delete_transaction(
|
|
42
|
+
> <TransactionResponse> delete_transaction(plan_id, transaction_id)
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Delete a transaction
|
|
45
45
|
|
|
46
46
|
Deletes a transaction
|
|
47
47
|
|
|
@@ -49,7 +49,7 @@ Deletes a transaction
|
|
|
49
49
|
|
|
50
50
|
| Name | Type | Description | Notes |
|
|
51
51
|
| ---- | ---- | ----------- | ----- |
|
|
52
|
-
| **
|
|
52
|
+
| **plan_id** | **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). | |
|
|
53
53
|
| **transaction_id** | **String** | The id of the transaction | |
|
|
54
54
|
|
|
55
55
|
### Return type
|
|
@@ -59,9 +59,9 @@ Deletes a transaction
|
|
|
59
59
|
|
|
60
60
|
## get_transaction_by_id
|
|
61
61
|
|
|
62
|
-
> <TransactionResponse> get_transaction_by_id(
|
|
62
|
+
> <TransactionResponse> get_transaction_by_id(plan_id, transaction_id)
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Get a transaction
|
|
65
65
|
|
|
66
66
|
Returns a single transaction
|
|
67
67
|
|
|
@@ -69,7 +69,7 @@ Returns a single transaction
|
|
|
69
69
|
|
|
70
70
|
| Name | Type | Description | Notes |
|
|
71
71
|
| ---- | ---- | ----------- | ----- |
|
|
72
|
-
| **
|
|
72
|
+
| **plan_id** | **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). | |
|
|
73
73
|
| **transaction_id** | **String** | The id of the transaction | |
|
|
74
74
|
|
|
75
75
|
### Return type
|
|
@@ -79,17 +79,17 @@ Returns a single transaction
|
|
|
79
79
|
|
|
80
80
|
## get_transactions
|
|
81
81
|
|
|
82
|
-
> <TransactionsResponse> get_transactions(
|
|
82
|
+
> <TransactionsResponse> get_transactions(plan_id, opts)
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
Get all transactions
|
|
85
85
|
|
|
86
|
-
Returns
|
|
86
|
+
Returns plan transactions, excluding any pending transactions
|
|
87
87
|
|
|
88
88
|
### Parameters
|
|
89
89
|
|
|
90
90
|
| Name | Type | Description | Notes |
|
|
91
91
|
| ---- | ---- | ----------- | ----- |
|
|
92
|
-
| **
|
|
92
|
+
| **plan_id** | **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). | |
|
|
93
93
|
| **since_date** | **Date** | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] |
|
|
94
94
|
| **type** | **String** | If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. | [optional] |
|
|
95
95
|
| **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] |
|
|
@@ -101,9 +101,9 @@ Returns budget transactions, excluding any pending transactions
|
|
|
101
101
|
|
|
102
102
|
## get_transactions_by_account
|
|
103
103
|
|
|
104
|
-
> <TransactionsResponse> get_transactions_by_account(
|
|
104
|
+
> <TransactionsResponse> get_transactions_by_account(plan_id, account_id, opts)
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
Get all account transactions
|
|
107
107
|
|
|
108
108
|
Returns all transactions for a specified account, excluding any pending transactions
|
|
109
109
|
|
|
@@ -111,7 +111,7 @@ Returns all transactions for a specified account, excluding any pending transact
|
|
|
111
111
|
|
|
112
112
|
| Name | Type | Description | Notes |
|
|
113
113
|
| ---- | ---- | ----------- | ----- |
|
|
114
|
-
| **
|
|
114
|
+
| **plan_id** | **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). | |
|
|
115
115
|
| **account_id** | **String** | The id of the account | |
|
|
116
116
|
| **since_date** | **Date** | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] |
|
|
117
117
|
| **type** | **String** | If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. | [optional] |
|
|
@@ -124,17 +124,17 @@ Returns all transactions for a specified account, excluding any pending transact
|
|
|
124
124
|
|
|
125
125
|
## get_transactions_by_category
|
|
126
126
|
|
|
127
|
-
> <HybridTransactionsResponse> get_transactions_by_category(
|
|
127
|
+
> <HybridTransactionsResponse> get_transactions_by_category(plan_id, category_id, opts)
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
Get all category transactions
|
|
130
130
|
|
|
131
|
-
Returns all transactions for a specified category
|
|
131
|
+
Returns all transactions for a specified category, excluding any pending transactions
|
|
132
132
|
|
|
133
133
|
### Parameters
|
|
134
134
|
|
|
135
135
|
| Name | Type | Description | Notes |
|
|
136
136
|
| ---- | ---- | ----------- | ----- |
|
|
137
|
-
| **
|
|
137
|
+
| **plan_id** | **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). | |
|
|
138
138
|
| **category_id** | **String** | The id of the category | |
|
|
139
139
|
| **since_date** | **Date** | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] |
|
|
140
140
|
| **type** | **String** | If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. | [optional] |
|
|
@@ -147,40 +147,40 @@ Returns all transactions for a specified category
|
|
|
147
147
|
|
|
148
148
|
## get_transactions_by_month
|
|
149
149
|
|
|
150
|
-
> <
|
|
150
|
+
> <TransactionsResponse> get_transactions_by_month(plan_id, month, opts)
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
Get all plan month transactions
|
|
153
153
|
|
|
154
|
-
Returns all transactions for a specified month
|
|
154
|
+
Returns all transactions for a specified month, excluding any pending transactions
|
|
155
155
|
|
|
156
156
|
### Parameters
|
|
157
157
|
|
|
158
158
|
| Name | Type | Description | Notes |
|
|
159
159
|
| ---- | ---- | ----------- | ----- |
|
|
160
|
-
| **
|
|
161
|
-
| **month** | **String** | The
|
|
160
|
+
| **plan_id** | **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). | |
|
|
161
|
+
| **month** | **String** | The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) | |
|
|
162
162
|
| **since_date** | **Date** | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] |
|
|
163
163
|
| **type** | **String** | If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. | [optional] |
|
|
164
164
|
| **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] |
|
|
165
165
|
|
|
166
166
|
### Return type
|
|
167
167
|
|
|
168
|
-
[**
|
|
168
|
+
[**TransactionsResponse**](TransactionsResponse.md)
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
## get_transactions_by_payee
|
|
172
172
|
|
|
173
|
-
> <HybridTransactionsResponse> get_transactions_by_payee(
|
|
173
|
+
> <HybridTransactionsResponse> get_transactions_by_payee(plan_id, payee_id, opts)
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
Get all payee transactions
|
|
176
176
|
|
|
177
|
-
Returns all transactions for a specified payee
|
|
177
|
+
Returns all transactions for a specified payee, excluding any pending transactions
|
|
178
178
|
|
|
179
179
|
### Parameters
|
|
180
180
|
|
|
181
181
|
| Name | Type | Description | Notes |
|
|
182
182
|
| ---- | ---- | ----------- | ----- |
|
|
183
|
-
| **
|
|
183
|
+
| **plan_id** | **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). | |
|
|
184
184
|
| **payee_id** | **String** | The id of the payee | |
|
|
185
185
|
| **since_date** | **Date** | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] |
|
|
186
186
|
| **type** | **String** | If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. | [optional] |
|
|
@@ -193,17 +193,17 @@ Returns all transactions for a specified payee
|
|
|
193
193
|
|
|
194
194
|
## import_transactions
|
|
195
195
|
|
|
196
|
-
> <TransactionsImportResponse> import_transactions(
|
|
196
|
+
> <TransactionsImportResponse> import_transactions(plan_id)
|
|
197
197
|
|
|
198
198
|
Import transactions
|
|
199
199
|
|
|
200
|
-
Imports available transactions on all linked accounts for the given
|
|
200
|
+
Imports available transactions on all linked accounts for the given plan. 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.
|
|
201
201
|
|
|
202
202
|
### Parameters
|
|
203
203
|
|
|
204
204
|
| Name | Type | Description | Notes |
|
|
205
205
|
| ---- | ---- | ----------- | ----- |
|
|
206
|
-
| **
|
|
206
|
+
| **plan_id** | **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). | |
|
|
207
207
|
|
|
208
208
|
### Return type
|
|
209
209
|
|
|
@@ -212,9 +212,9 @@ Imports available transactions on all linked accounts for the given budget. Lin
|
|
|
212
212
|
|
|
213
213
|
## update_transaction
|
|
214
214
|
|
|
215
|
-
> <TransactionResponse> update_transaction(
|
|
215
|
+
> <TransactionResponse> update_transaction(plan_id, transaction_id, data)
|
|
216
216
|
|
|
217
|
-
|
|
217
|
+
Update a transaction
|
|
218
218
|
|
|
219
219
|
Updates a single transaction
|
|
220
220
|
|
|
@@ -222,7 +222,7 @@ Updates a single transaction
|
|
|
222
222
|
|
|
223
223
|
| Name | Type | Description | Notes |
|
|
224
224
|
| ---- | ---- | ----------- | ----- |
|
|
225
|
-
| **
|
|
225
|
+
| **plan_id** | **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). | |
|
|
226
226
|
| **transaction_id** | **String** | The id of the transaction | |
|
|
227
227
|
| **data** | [**PutTransactionWrapper**](PutTransactionWrapper.md) | The transaction to update | |
|
|
228
228
|
|
|
@@ -233,7 +233,7 @@ Updates a single transaction
|
|
|
233
233
|
|
|
234
234
|
## update_transactions
|
|
235
235
|
|
|
236
|
-
> <SaveTransactionsResponse> update_transactions(
|
|
236
|
+
> <SaveTransactionsResponse> update_transactions(plan_id, data)
|
|
237
237
|
|
|
238
238
|
Update multiple transactions
|
|
239
239
|
|
|
@@ -243,7 +243,7 @@ Updates multiple transactions, by `id` or `import_id`.
|
|
|
243
243
|
|
|
244
244
|
| Name | Type | Description | Notes |
|
|
245
245
|
| ---- | ---- | ----------- | ----- |
|
|
246
|
-
| **
|
|
246
|
+
| **plan_id** | **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). | |
|
|
247
247
|
| **data** | [**PatchTransactionsWrapper**](PatchTransactionsWrapper.md) | The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by its `import_id`. If an `id` is specified, it will always be used for lookup. You should not specify both `id` and `import_id`. Updating an `import_id` on an existing transaction is not allowed; if an `import_id` is specified, it will only be used to lookup the transaction. | |
|
|
248
248
|
|
|
249
249
|
### Return type
|
data/docs/UserApi.md
CHANGED
|
@@ -4,14 +4,14 @@ All URIs are relative to *https://api.ynab.com/v1*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
|
-
| [**get_user**](UserApi.md#get_user) | **GET** /user |
|
|
7
|
+
| [**get_user**](UserApi.md#get_user) | **GET** /user | Get user |
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
## get_user
|
|
11
11
|
|
|
12
12
|
> <UserResponse> get_user
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Get user
|
|
15
15
|
|
|
16
16
|
Returns authenticated user information
|
|
17
17
|
|
|
@@ -3,13 +3,13 @@ require 'ynab'
|
|
|
3
3
|
access_token = ENV['YNAB_ACCESS_TOKEN']
|
|
4
4
|
ynab = YNAB::API.new(access_token)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
plan_id = ENV['YNAB_plan_id']
|
|
7
7
|
category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe'
|
|
8
8
|
|
|
9
9
|
begin
|
|
10
10
|
puts 'Fetching category...'
|
|
11
11
|
|
|
12
|
-
category_response = ynab.categories.get_category_by_id(
|
|
12
|
+
category_response = ynab.categories.get_category_by_id(plan_id, category_id)
|
|
13
13
|
category = category_response.data.category
|
|
14
14
|
|
|
15
15
|
puts "==========="
|
|
@@ -4,7 +4,7 @@ require 'ynab'
|
|
|
4
4
|
access_token = ENV['YNAB_ACCESS_TOKEN']
|
|
5
5
|
ynab = YNAB::API.new(access_token)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
plan_id = ENV['YNAB_plan_id']
|
|
8
8
|
account_id = 'f6fe07cb-c895-not-real-acfac0b7f026'
|
|
9
9
|
category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe'
|
|
10
10
|
|
|
@@ -36,7 +36,7 @@ data = {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
begin
|
|
39
|
-
ynab.transactions.create_transaction(
|
|
39
|
+
ynab.transactions.create_transaction(plan_id, data)
|
|
40
40
|
rescue YNAB::ApiError => e
|
|
41
41
|
puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}"
|
|
42
42
|
end
|
|
@@ -4,7 +4,7 @@ require 'ynab'
|
|
|
4
4
|
access_token = ENV['YNAB_ACCESS_TOKEN']
|
|
5
5
|
ynab = YNAB::API.new(access_token)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
plan_id = ENV['YNAB_plan_id']
|
|
8
8
|
account_id = 'f6fe07cb-c895-not-real-acfac0b7f026'
|
|
9
9
|
category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe'
|
|
10
10
|
|
|
@@ -23,7 +23,7 @@ data = {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
begin
|
|
26
|
-
ynab.transactions.create_transaction(
|
|
26
|
+
ynab.transactions.create_transaction(plan_id, data)
|
|
27
27
|
rescue YNAB::ApiError => e
|
|
28
28
|
puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}"
|
|
29
29
|
end
|
|
@@ -4,17 +4,17 @@ access_token = ENV['YNAB_ACCESS_TOKEN']
|
|
|
4
4
|
ynab = YNAB::API.new(access_token)
|
|
5
5
|
|
|
6
6
|
begin
|
|
7
|
-
puts 'Fetching
|
|
7
|
+
puts 'Fetching plans...'
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
plan_response = ynab.plans.get_plans
|
|
10
|
+
plans = plan_response.data.budgets
|
|
11
11
|
|
|
12
12
|
puts '==========='
|
|
13
|
-
puts '
|
|
13
|
+
puts 'PLAN LIST'
|
|
14
14
|
puts '==========='
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
puts "[id: #{
|
|
16
|
+
plans.each do |plan|
|
|
17
|
+
puts "[id: #{plan.id}, name: #{plan.name}]"
|
|
18
18
|
end
|
|
19
19
|
rescue YNAB::ApiError => e
|
|
20
20
|
puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}"
|
|
@@ -4,24 +4,23 @@ require 'date'
|
|
|
4
4
|
access_token = ENV['YNAB_ACCESS_TOKEN']
|
|
5
5
|
ynab = YNAB::API.new(access_token)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
plan_id = ENV['YNAB_plan_id']
|
|
8
8
|
|
|
9
9
|
begin
|
|
10
10
|
puts 'Fetching month...'
|
|
11
11
|
|
|
12
12
|
first_day_of_month_iso = Date.new(Date.today.year, Date.today.month, 1).iso8601
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
budget_month = month_response.data.month
|
|
13
|
+
|
|
14
|
+
month_response = ynab.months.get_plan_month(plan_id, first_day_of_month_iso)
|
|
15
|
+
plan_month = month_response.data.month
|
|
17
16
|
|
|
18
17
|
puts "============"
|
|
19
|
-
puts "
|
|
18
|
+
puts "PLAN MONTH"
|
|
20
19
|
puts "============"
|
|
21
|
-
puts " Month: #{
|
|
22
|
-
puts " Note: #{
|
|
23
|
-
puts "To Be Budgeted: #{
|
|
24
|
-
puts " Age of Money: #{
|
|
20
|
+
puts " Month: #{plan_month.month}"
|
|
21
|
+
puts " Note: #{plan_month.note}"
|
|
22
|
+
puts "To Be Budgeted: #{plan_month.to_be_budgeted}"
|
|
23
|
+
puts " Age of Money: #{plan_month.age_of_money}"
|
|
25
24
|
puts " Categories: "
|
|
26
25
|
|
|
27
26
|
budget_month.categories.each do |category|
|
|
@@ -4,7 +4,7 @@ require 'ynab'
|
|
|
4
4
|
access_token = ENV['YNAB_ACCESS_TOKEN']
|
|
5
5
|
ynab = YNAB::API.new(access_token)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
plan_id = ENV['YNAB_plan_id']
|
|
8
8
|
category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe'
|
|
9
9
|
month = '2019-01-01'
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ data = {
|
|
|
16
16
|
|
|
17
17
|
begin
|
|
18
18
|
# Update budgeted amount to 203.82 in 2018-09-01 for category_id
|
|
19
|
-
response = ynab.categories.update_month_category(
|
|
19
|
+
response = ynab.categories.update_month_category(plan_id, month, category_id, data)
|
|
20
20
|
month_category_response = response.data.category
|
|
21
21
|
puts "[budgeted: #{month_category_response.budgeted}, balance: #{month_category_response.balance}]"
|
|
22
22
|
rescue YNAB::ApiError => e
|
|
@@ -3,18 +3,18 @@ require 'ynab'
|
|
|
3
3
|
access_token = ENV['YNAB_ACCESS_TOKEN']
|
|
4
4
|
ynab = YNAB::API.new(access_token)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
plan_id = ENV['YNAB_plan_id']
|
|
7
7
|
|
|
8
8
|
begin
|
|
9
9
|
# Fetch all unapproved transactions and update them all as approved
|
|
10
|
-
unapproved_transaction_data = ynab.transactions.get_transactions(
|
|
10
|
+
unapproved_transaction_data = ynab.transactions.get_transactions(plan_id, { type: 'unapproved' }).data
|
|
11
11
|
|
|
12
12
|
data = unapproved_transaction_data.clone
|
|
13
13
|
data.transactions.each do |t|
|
|
14
14
|
t.approved = true
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
ynab.transactions.update_transactions(
|
|
17
|
+
ynab.transactions.update_transactions(plan_id, update_data)
|
|
18
18
|
rescue YNAB::ApiError => e
|
|
19
19
|
puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}"
|
|
20
20
|
end
|