ynab 1.29.0 → 2.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (260) hide show
  1. checksums.yaml +4 -4
  2. data/DEVELOPMENT.md +11 -0
  3. data/Gemfile +8 -0
  4. data/Gemfile.lock +42 -0
  5. data/README.md +6 -6
  6. data/Rakefile +58 -0
  7. data/config.json +9 -0
  8. data/docs/Account.md +25 -0
  9. data/docs/AccountResponse.md +8 -0
  10. data/docs/AccountResponseData.md +8 -0
  11. data/docs/AccountType.md +7 -0
  12. data/docs/AccountWrapper.md +8 -0
  13. data/docs/AccountsApi.md +70 -0
  14. data/docs/AccountsResponse.md +8 -0
  15. data/docs/AccountsResponseData.md +9 -0
  16. data/docs/AccountsWrapper.md +9 -0
  17. data/docs/BudgetDetail.md +24 -0
  18. data/docs/BudgetDetailAllOf.md +17 -0
  19. data/docs/BudgetDetailResponse.md +8 -0
  20. data/docs/BudgetDetailResponseData.md +9 -0
  21. data/docs/BudgetDetailWrapper.md +9 -0
  22. data/docs/BudgetSettings.md +9 -0
  23. data/docs/BudgetSettingsResponse.md +8 -0
  24. data/docs/BudgetSettingsResponseData.md +8 -0
  25. data/docs/BudgetSettingsWrapper.md +8 -0
  26. data/docs/BudgetSummary.md +15 -0
  27. data/docs/BudgetSummaryResponse.md +8 -0
  28. data/docs/BudgetSummaryResponseData.md +9 -0
  29. data/docs/BudgetSummaryWrapper.md +9 -0
  30. data/docs/BudgetsApi.md +68 -0
  31. data/docs/BulkIdWrapper.md +8 -0
  32. data/docs/BulkIds.md +9 -0
  33. data/docs/BulkResponse.md +8 -0
  34. data/docs/BulkResponseData.md +8 -0
  35. data/docs/BulkResponseDataBulk.md +9 -0
  36. data/docs/BulkTransactionCreateResponse.md +8 -0
  37. data/docs/BulkTransactionIds.md +8 -0
  38. data/docs/BulkTransactions.md +8 -0
  39. data/docs/CategoriesApi.md +94 -0
  40. data/docs/CategoriesResponse.md +8 -0
  41. data/docs/CategoriesResponseData.md +9 -0
  42. data/docs/Category.md +30 -0
  43. data/docs/CategoryGroup.md +11 -0
  44. data/docs/CategoryGroupWithCategories.md +12 -0
  45. data/docs/CategoryGroupWithCategoriesAllOf.md +8 -0
  46. data/docs/CategoryGroupsWrapper.md +9 -0
  47. data/docs/CategoryResponse.md +8 -0
  48. data/docs/CategoryResponseData.md +8 -0
  49. data/docs/CategoryWrapper.md +9 -0
  50. data/docs/CurrencyFormat.md +15 -0
  51. data/docs/DateFormat.md +8 -0
  52. data/docs/DeprecatedApi.md +28 -0
  53. data/docs/ErrorDetail.md +10 -0
  54. data/docs/ErrorResponse.md +8 -0
  55. data/docs/HybridTransaction.md +30 -0
  56. data/docs/HybridTransactionAllOf.md +12 -0
  57. data/docs/HybridTransactionsResponse.md +8 -0
  58. data/docs/HybridTransactionsResponseData.md +9 -0
  59. data/docs/HybridTransactionsWrapper.md +8 -0
  60. data/docs/LoanAccountPeriodicValue.md +7 -0
  61. data/docs/MonthDetail.md +16 -0
  62. data/docs/MonthDetailAllOf.md +8 -0
  63. data/docs/MonthDetailResponse.md +8 -0
  64. data/docs/MonthDetailResponseData.md +8 -0
  65. data/docs/MonthDetailWrapper.md +8 -0
  66. data/docs/MonthSummariesResponse.md +8 -0
  67. data/docs/MonthSummariesResponseData.md +9 -0
  68. data/docs/MonthSummariesWrapper.md +9 -0
  69. data/docs/MonthSummary.md +15 -0
  70. data/docs/MonthsApi.md +49 -0
  71. data/docs/PatchMonthCategoryWrapper.md +8 -0
  72. data/docs/PatchTransactionsWrapper.md +8 -0
  73. data/docs/Payee.md +11 -0
  74. data/docs/PayeeLocation.md +12 -0
  75. data/docs/PayeeLocationResponse.md +8 -0
  76. data/docs/PayeeLocationResponseData.md +8 -0
  77. data/docs/PayeeLocationWrapper.md +8 -0
  78. data/docs/PayeeLocationsApi.md +69 -0
  79. data/docs/PayeeLocationsResponse.md +8 -0
  80. data/docs/PayeeLocationsResponseData.md +8 -0
  81. data/docs/PayeeLocationsWrapper.md +8 -0
  82. data/docs/PayeeResponse.md +8 -0
  83. data/docs/PayeeResponseData.md +8 -0
  84. data/docs/PayeeWrapper.md +8 -0
  85. data/docs/PayeesApi.md +49 -0
  86. data/docs/PayeesResponse.md +8 -0
  87. data/docs/PayeesResponseData.md +9 -0
  88. data/docs/PayeesWrapper.md +9 -0
  89. data/docs/PostAccountWrapper.md +8 -0
  90. data/docs/PostTransactionsWrapper.md +9 -0
  91. data/docs/PutTransactionWrapper.md +8 -0
  92. data/docs/SaveAccount.md +10 -0
  93. data/docs/SaveAccountWrapper.md +8 -0
  94. data/docs/SaveCategoryResponse.md +8 -0
  95. data/docs/SaveCategoryResponseData.md +9 -0
  96. data/docs/SaveMonthCategory.md +8 -0
  97. data/docs/SaveMonthCategoryWrapper.md +8 -0
  98. data/docs/SaveSubTransaction.md +12 -0
  99. data/docs/SaveTransaction.md +19 -0
  100. data/docs/SaveTransactionWithId.md +20 -0
  101. data/docs/SaveTransactionWithIdAllOf.md +8 -0
  102. data/docs/SaveTransactionWithOptionalFields.md +19 -0
  103. data/docs/SaveTransactionWrapper.md +8 -0
  104. data/docs/SaveTransactionsResponse.md +8 -0
  105. data/docs/SaveTransactionsResponseData.md +12 -0
  106. data/docs/SaveTransactionsWrapper.md +9 -0
  107. data/docs/ScheduledSubTransaction.md +15 -0
  108. data/docs/ScheduledTransactionDetail.md +23 -0
  109. data/docs/ScheduledTransactionDetailAllOf.md +11 -0
  110. data/docs/ScheduledTransactionResponse.md +8 -0
  111. data/docs/ScheduledTransactionResponseData.md +8 -0
  112. data/docs/ScheduledTransactionSummary.md +19 -0
  113. data/docs/ScheduledTransactionWrapper.md +8 -0
  114. data/docs/ScheduledTransactionsApi.md +49 -0
  115. data/docs/ScheduledTransactionsResponse.md +8 -0
  116. data/docs/ScheduledTransactionsResponseData.md +9 -0
  117. data/docs/ScheduledTransactionsWrapper.md +8 -0
  118. data/docs/SubTransaction.md +18 -0
  119. data/docs/TransactionDetail.md +29 -0
  120. data/docs/TransactionDetailAllOf.md +11 -0
  121. data/docs/TransactionResponse.md +8 -0
  122. data/docs/TransactionResponseData.md +8 -0
  123. data/docs/TransactionSummary.md +25 -0
  124. data/docs/TransactionWrapper.md +8 -0
  125. data/docs/TransactionsApi.md +228 -0
  126. data/docs/TransactionsImportResponse.md +8 -0
  127. data/docs/TransactionsImportResponseData.md +8 -0
  128. data/docs/TransactionsResponse.md +8 -0
  129. data/docs/TransactionsResponseData.md +9 -0
  130. data/docs/TransactionsWrapper.md +9 -0
  131. data/docs/UpdateTransaction.md +20 -0
  132. data/docs/UpdateTransactionsWrapper.md +8 -0
  133. data/docs/User.md +8 -0
  134. data/docs/UserApi.md +25 -0
  135. data/docs/UserResponse.md +8 -0
  136. data/docs/UserResponseData.md +8 -0
  137. data/docs/UserWrapper.md +8 -0
  138. data/examples/budget-list.rb +21 -0
  139. data/examples/budget-month.rb +33 -0
  140. data/examples/category-balance.rb +23 -0
  141. data/examples/create-multiple-transactions.rb +42 -0
  142. data/examples/create-transaction.rb +30 -0
  143. data/examples/update-category-budgeted.rb +25 -0
  144. data/examples/update-multiple-transactions.rb +20 -0
  145. data/lib/ynab/api/accounts_api.rb +79 -42
  146. data/lib/ynab/api/budgets_api.rb +69 -37
  147. data/lib/ynab/api/categories_api.rb +109 -61
  148. data/lib/ynab/api/deprecated_api.rb +33 -18
  149. data/lib/ynab/api/months_api.rb +50 -29
  150. data/lib/ynab/api/payee_locations_api.rb +74 -42
  151. data/lib/ynab/api/payees_api.rb +50 -29
  152. data/lib/ynab/api/scheduled_transactions_api.rb +50 -29
  153. data/lib/ynab/api/transactions_api.rb +269 -141
  154. data/lib/ynab/api/user_api.rb +23 -13
  155. data/lib/ynab/api_client.rb +98 -96
  156. data/lib/ynab/configuration.rb +103 -16
  157. data/lib/ynab/models/account.rb +118 -56
  158. data/lib/ynab/models/account_response.rb +54 -19
  159. data/lib/ynab/models/account_response_data.rb +54 -19
  160. data/lib/ynab/models/account_type.rb +31 -21
  161. data/lib/ynab/models/accounts_response.rb +54 -19
  162. data/lib/ynab/models/accounts_response_data.rb +55 -20
  163. data/lib/ynab/models/budget_detail.rb +81 -36
  164. data/lib/ynab/models/budget_detail_all_of.rb +320 -0
  165. data/lib/ynab/models/budget_detail_response.rb +54 -19
  166. data/lib/ynab/models/budget_detail_response_data.rb +55 -20
  167. data/lib/ynab/models/budget_settings.rb +57 -30
  168. data/lib/ynab/models/budget_settings_response.rb +54 -19
  169. data/lib/ynab/models/budget_settings_response_data.rb +54 -19
  170. data/lib/ynab/models/budget_summary.rb +64 -27
  171. data/lib/ynab/models/budget_summary_response.rb +54 -19
  172. data/lib/ynab/models/budget_summary_response_data.rb +55 -21
  173. data/lib/ynab/models/bulk_response.rb +54 -19
  174. data/lib/ynab/models/bulk_response_data.rb +54 -19
  175. data/lib/ynab/models/bulk_response_data_bulk.rb +55 -20
  176. data/lib/ynab/models/bulk_transactions.rb +54 -19
  177. data/lib/ynab/models/categories_response.rb +54 -19
  178. data/lib/ynab/models/categories_response_data.rb +55 -20
  179. data/lib/ynab/models/category.rb +111 -49
  180. data/lib/ynab/models/category_group.rb +59 -24
  181. data/lib/ynab/models/category_group_with_categories.rb +68 -25
  182. data/lib/ynab/models/{save_month_category_wrapper.rb → category_group_with_categories_all_of.rb} +67 -29
  183. data/lib/ynab/models/category_response.rb +54 -19
  184. data/lib/ynab/models/category_response_data.rb +54 -19
  185. data/lib/ynab/models/currency_format.rb +63 -28
  186. data/lib/ynab/models/date_format.rb +54 -19
  187. data/lib/ynab/models/error_detail.rb +56 -21
  188. data/lib/ynab/models/error_response.rb +54 -19
  189. data/lib/ynab/models/hybrid_transaction.rb +120 -47
  190. data/lib/ynab/models/hybrid_transaction_all_of.rb +304 -0
  191. data/lib/ynab/models/hybrid_transactions_response.rb +54 -19
  192. data/lib/ynab/models/hybrid_transactions_response_data.rb +55 -20
  193. data/lib/ynab/models/month_detail.rb +73 -28
  194. data/lib/ynab/models/{update_transactions_wrapper.rb → month_detail_all_of.rb} +66 -30
  195. data/lib/ynab/models/month_detail_response.rb +54 -19
  196. data/lib/ynab/models/month_detail_response_data.rb +54 -19
  197. data/lib/ynab/models/month_summaries_response.rb +54 -19
  198. data/lib/ynab/models/month_summaries_response_data.rb +55 -20
  199. data/lib/ynab/models/month_summary.rb +64 -27
  200. data/lib/ynab/models/patch_month_category_wrapper.rb +54 -19
  201. data/lib/ynab/models/patch_transactions_wrapper.rb +54 -19
  202. data/lib/ynab/models/payee.rb +59 -23
  203. data/lib/ynab/models/payee_location.rb +59 -24
  204. data/lib/ynab/models/payee_location_response.rb +54 -19
  205. data/lib/ynab/models/payee_location_response_data.rb +54 -19
  206. data/lib/ynab/models/payee_locations_response.rb +54 -19
  207. data/lib/ynab/models/payee_locations_response_data.rb +54 -19
  208. data/lib/ynab/models/payee_response.rb +54 -19
  209. data/lib/ynab/models/payee_response_data.rb +54 -19
  210. data/lib/ynab/models/payees_response.rb +54 -19
  211. data/lib/ynab/models/payees_response_data.rb +55 -20
  212. data/lib/ynab/models/post_account_wrapper.rb +54 -19
  213. data/lib/ynab/models/post_transactions_wrapper.rb +55 -20
  214. data/lib/ynab/models/put_transaction_wrapper.rb +54 -19
  215. data/lib/ynab/models/save_account.rb +78 -21
  216. data/lib/ynab/models/save_category_response.rb +54 -19
  217. data/lib/ynab/models/save_category_response_data.rb +55 -20
  218. data/lib/ynab/models/save_month_category.rb +54 -19
  219. data/lib/ynab/models/save_sub_transaction.rb +62 -23
  220. data/lib/ynab/models/save_transaction.rb +89 -34
  221. data/lib/ynab/models/save_transaction_with_id.rb +103 -47
  222. data/lib/ynab/models/{save_transactions_wrapper.rb → save_transaction_with_id_all_of.rb} +60 -36
  223. data/lib/ynab/models/save_transaction_with_optional_fields.rb +82 -34
  224. data/lib/ynab/models/save_transactions_response.rb +54 -19
  225. data/lib/ynab/models/save_transactions_response_data.rb +58 -24
  226. data/lib/ynab/models/scheduled_sub_transaction.rb +67 -28
  227. data/lib/ynab/models/scheduled_transaction_detail.rb +96 -37
  228. data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +262 -0
  229. data/lib/ynab/models/scheduled_transaction_response.rb +54 -19
  230. data/lib/ynab/models/scheduled_transaction_response_data.rb +54 -19
  231. data/lib/ynab/models/scheduled_transaction_summary.rb +81 -33
  232. data/lib/ynab/models/scheduled_transactions_response.rb +54 -19
  233. data/lib/ynab/models/scheduled_transactions_response_data.rb +55 -20
  234. data/lib/ynab/models/sub_transaction.rb +72 -30
  235. data/lib/ynab/models/transaction_detail.rb +114 -45
  236. data/lib/ynab/models/{save_transaction_wrapper.rb → transaction_detail_all_of.rb} +102 -29
  237. data/lib/ynab/models/transaction_response.rb +54 -19
  238. data/lib/ynab/models/transaction_response_data.rb +54 -19
  239. data/lib/ynab/models/transaction_summary.rb +99 -41
  240. data/lib/ynab/models/transactions_import_response.rb +54 -19
  241. data/lib/ynab/models/transactions_import_response_data.rb +54 -19
  242. data/lib/ynab/models/transactions_response.rb +54 -19
  243. data/lib/ynab/models/transactions_response_data.rb +55 -20
  244. data/lib/ynab/models/user.rb +54 -19
  245. data/lib/ynab/models/user_response.rb +54 -19
  246. data/lib/ynab/models/user_response_data.rb +54 -19
  247. data/lib/ynab/version.rb +1 -1
  248. data/lib/ynab.rb +21 -16
  249. data/open_api_spec.yaml +3012 -0
  250. data/templates/api_client.mustache +274 -0
  251. data/templates/api_client_typhoeus_partial.mustache +156 -0
  252. data/templates/api_doc.mustache +44 -0
  253. data/templates/gem.mustache +84 -0
  254. data/templates/partial_model_generic_doc.mustache +9 -0
  255. data/ynab.gemspec +38 -0
  256. metadata +197 -90
  257. data/lib/ynab/models/loan_account_periodic_value.rb +0 -175
  258. data/lib/ynab/models/save_account_wrapper.rb +0 -189
  259. data/lib/ynab/models/update_transaction.rb +0 -407
  260. data/spec/models/transaction_detail_spec.rb +0 -11
@@ -0,0 +1,18 @@
1
+ # YNAB::SubTransaction
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | |
8
+ | **transaction_id** | **String** | | |
9
+ | **amount** | **Integer** | The subtransaction amount in milliunits format | |
10
+ | **memo** | **String** | | [optional] |
11
+ | **payee_id** | **String** | | [optional] |
12
+ | **payee_name** | **String** | | [optional] |
13
+ | **category_id** | **String** | | [optional] |
14
+ | **category_name** | **String** | | [optional] |
15
+ | **transfer_account_id** | **String** | If a transfer, the account_id which the subtransaction transfers to | [optional] |
16
+ | **transfer_transaction_id** | **String** | If a transfer, the id of transaction on the other side of the transfer | [optional] |
17
+ | **deleted** | **Boolean** | Whether or not the subtransaction has been deleted. Deleted subtransactions will only be included in delta requests. | |
18
+
@@ -0,0 +1,29 @@
1
+ # YNAB::TransactionDetail
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | |
8
+ | **date** | **Date** | The transaction date in ISO format (e.g. 2016-12-01) | |
9
+ | **amount** | **Integer** | The transaction amount in milliunits format | |
10
+ | **memo** | **String** | | [optional] |
11
+ | **cleared** | **String** | The cleared status of the transaction | |
12
+ | **approved** | **Boolean** | Whether or not the transaction is approved | |
13
+ | **flag_color** | **String** | The transaction flag | [optional] |
14
+ | **account_id** | **String** | | |
15
+ | **payee_id** | **String** | | [optional] |
16
+ | **category_id** | **String** | | [optional] |
17
+ | **transfer_account_id** | **String** | If a transfer transaction, the account to which it transfers | [optional] |
18
+ | **transfer_transaction_id** | **String** | If a transfer transaction, the id of transaction on the other side of the transfer | [optional] |
19
+ | **matched_transaction_id** | **String** | If transaction is matched, the id of the matched transaction | [optional] |
20
+ | **import_id** | **String** | If the transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have the format: 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'. For example, a transaction dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of 'YNAB:-294230:2015-12-30:1'. If a second transaction on the same account was imported and had the same date and same amount, its import_id would be 'YNAB:-294230:2015-12-30:2'. | [optional] |
21
+ | **import_payee_name** | **String** | If the transaction was imported, the payee name that was used when importing and before applying any payee rename rules | [optional] |
22
+ | **import_payee_name_original** | **String** | If the transaction was imported, the original payee name as it appeared on the statement | [optional] |
23
+ | **debt_transaction_type** | **String** | If the transaction is a debt/loan account transaction, the type of transaction | [optional] |
24
+ | **deleted** | **Boolean** | Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. | |
25
+ | **account_name** | **String** | | |
26
+ | **payee_name** | **String** | | [optional] |
27
+ | **category_name** | **String** | The name of the category. If a split transaction, this will be 'Split'. | [optional] |
28
+ | **subtransactions** | [**Array<SubTransaction>**](SubTransaction.md) | If a split transaction, the subtransactions. | |
29
+
@@ -0,0 +1,11 @@
1
+ # YNAB::TransactionDetailAllOf
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **account_name** | **String** | | |
8
+ | **payee_name** | **String** | | [optional] |
9
+ | **category_name** | **String** | The name of the category. If a split transaction, this will be 'Split'. | [optional] |
10
+ | **subtransactions** | [**Array<SubTransaction>**](SubTransaction.md) | If a split transaction, the subtransactions. | |
11
+
@@ -0,0 +1,8 @@
1
+ # YNAB::TransactionResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | [**TransactionResponseData**](TransactionResponseData.md) | | |
8
+
@@ -0,0 +1,8 @@
1
+ # YNAB::TransactionResponseData
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **transaction** | [**TransactionDetail**](TransactionDetail.md) | | |
8
+
@@ -0,0 +1,25 @@
1
+ # YNAB::TransactionSummary
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | |
8
+ | **date** | **Date** | The transaction date in ISO format (e.g. 2016-12-01) | |
9
+ | **amount** | **Integer** | The transaction amount in milliunits format | |
10
+ | **memo** | **String** | | [optional] |
11
+ | **cleared** | **String** | The cleared status of the transaction | |
12
+ | **approved** | **Boolean** | Whether or not the transaction is approved | |
13
+ | **flag_color** | **String** | The transaction flag | [optional] |
14
+ | **account_id** | **String** | | |
15
+ | **payee_id** | **String** | | [optional] |
16
+ | **category_id** | **String** | | [optional] |
17
+ | **transfer_account_id** | **String** | If a transfer transaction, the account to which it transfers | [optional] |
18
+ | **transfer_transaction_id** | **String** | If a transfer transaction, the id of transaction on the other side of the transfer | [optional] |
19
+ | **matched_transaction_id** | **String** | If transaction is matched, the id of the matched transaction | [optional] |
20
+ | **import_id** | **String** | If the transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have the format: 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'. For example, a transaction dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of 'YNAB:-294230:2015-12-30:1'. If a second transaction on the same account was imported and had the same date and same amount, its import_id would be 'YNAB:-294230:2015-12-30:2'. | [optional] |
21
+ | **import_payee_name** | **String** | If the transaction was imported, the payee name that was used when importing and before applying any payee rename rules | [optional] |
22
+ | **import_payee_name_original** | **String** | If the transaction was imported, the original payee name as it appeared on the statement | [optional] |
23
+ | **debt_transaction_type** | **String** | If the transaction is a debt/loan account transaction, the type of transaction | [optional] |
24
+ | **deleted** | **Boolean** | Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. | |
25
+
@@ -0,0 +1,8 @@
1
+ # YNAB::TransactionWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **transaction** | [**TransactionDetail**](TransactionDetail.md) | |
7
+
8
+
@@ -0,0 +1,228 @@
1
+ # YNAB::TransactionsApi
2
+
3
+ All URIs are relative to *https://api.ynab.com/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**create_transaction**](TransactionsApi.md#create_transaction) | **POST** /budgets/{budget_id}/transactions | Create a single transaction or multiple transactions |
8
+ | [**delete_transaction**](TransactionsApi.md#delete_transaction) | **DELETE** /budgets/{budget_id}/transactions/{transaction_id} | Deletes an existing transaction |
9
+ | [**get_transaction_by_id**](TransactionsApi.md#get_transaction_by_id) | **GET** /budgets/{budget_id}/transactions/{transaction_id} | Single transaction |
10
+ | [**get_transactions**](TransactionsApi.md#get_transactions) | **GET** /budgets/{budget_id}/transactions | List transactions |
11
+ | [**get_transactions_by_account**](TransactionsApi.md#get_transactions_by_account) | **GET** /budgets/{budget_id}/accounts/{account_id}/transactions | List account transactions |
12
+ | [**get_transactions_by_category**](TransactionsApi.md#get_transactions_by_category) | **GET** /budgets/{budget_id}/categories/{category_id}/transactions | List category transactions |
13
+ | [**get_transactions_by_payee**](TransactionsApi.md#get_transactions_by_payee) | **GET** /budgets/{budget_id}/payees/{payee_id}/transactions | List payee transactions |
14
+ | [**import_transactions**](TransactionsApi.md#import_transactions) | **POST** /budgets/{budget_id}/transactions/import | Import transactions |
15
+ | [**update_transaction**](TransactionsApi.md#update_transaction) | **PUT** /budgets/{budget_id}/transactions/{transaction_id} | Updates an existing transaction |
16
+ | [**update_transactions**](TransactionsApi.md#update_transactions) | **PATCH** /budgets/{budget_id}/transactions | Update multiple transactions |
17
+
18
+
19
+ ## create_transaction
20
+
21
+ > <SaveTransactionsResponse> create_transaction(budget_id, data)
22
+
23
+ Create a single transaction or multiple transactions
24
+
25
+ Creates a single transaction or multiple transactions. If you provide a body containing a `transaction` object, a single transaction will be created and if you provide a body containing a `transactions` array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint.
26
+
27
+ ### Parameters
28
+
29
+ | Name | Type | Description | Notes |
30
+ | ---- | ---- | ----------- | ----- |
31
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
32
+ | **data** | [**PostTransactionsWrapper**](PostTransactionsWrapper.md) | The transaction or transactions to create. To create a single transaction you can specify a value for the &#x60;transaction&#x60; object and to create multiple transactions you can specify an array of &#x60;transactions&#x60;. It is expected that you will only provide a value for one of these objects. | |
33
+
34
+ ### Return type
35
+
36
+ [**SaveTransactionsResponse**](SaveTransactionsResponse.md)
37
+
38
+
39
+ ## delete_transaction
40
+
41
+ > <TransactionResponse> delete_transaction(budget_id, transaction_id)
42
+
43
+ Deletes an existing transaction
44
+
45
+ Deletes a transaction
46
+
47
+ ### Parameters
48
+
49
+ | Name | Type | Description | Notes |
50
+ | ---- | ---- | ----------- | ----- |
51
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
52
+ | **transaction_id** | **String** | The id of the transaction | |
53
+
54
+ ### Return type
55
+
56
+ [**TransactionResponse**](TransactionResponse.md)
57
+
58
+
59
+ ## get_transaction_by_id
60
+
61
+ > <TransactionResponse> get_transaction_by_id(budget_id, transaction_id)
62
+
63
+ Single transaction
64
+
65
+ Returns a single transaction
66
+
67
+ ### Parameters
68
+
69
+ | Name | Type | Description | Notes |
70
+ | ---- | ---- | ----------- | ----- |
71
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
72
+ | **transaction_id** | **String** | The id of the transaction | |
73
+
74
+ ### Return type
75
+
76
+ [**TransactionResponse**](TransactionResponse.md)
77
+
78
+
79
+ ## get_transactions
80
+
81
+ > <TransactionsResponse> get_transactions(budget_id, opts)
82
+
83
+ List transactions
84
+
85
+ Returns budget transactions
86
+
87
+ ### Parameters
88
+
89
+ | Name | Type | Description | Notes |
90
+ | ---- | ---- | ----------- | ----- |
91
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
92
+ | **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] |
93
+ | **type** | **String** | If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported. | [optional] |
94
+ | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included. | [optional] |
95
+
96
+ ### Return type
97
+
98
+ [**TransactionsResponse**](TransactionsResponse.md)
99
+
100
+
101
+ ## get_transactions_by_account
102
+
103
+ > <TransactionsResponse> get_transactions_by_account(budget_id, account_id, opts)
104
+
105
+ List account transactions
106
+
107
+ Returns all transactions for a specified account
108
+
109
+ ### Parameters
110
+
111
+ | Name | Type | Description | Notes |
112
+ | ---- | ---- | ----------- | ----- |
113
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
114
+ | **account_id** | **String** | The id of the account | |
115
+ | **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] |
116
+ | **type** | **String** | If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported. | [optional] |
117
+ | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included. | [optional] |
118
+
119
+ ### Return type
120
+
121
+ [**TransactionsResponse**](TransactionsResponse.md)
122
+
123
+
124
+ ## get_transactions_by_category
125
+
126
+ > <HybridTransactionsResponse> get_transactions_by_category(budget_id, category_id, opts)
127
+
128
+ List category transactions
129
+
130
+ Returns all transactions for a specified category
131
+
132
+ ### Parameters
133
+
134
+ | Name | Type | Description | Notes |
135
+ | ---- | ---- | ----------- | ----- |
136
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
137
+ | **category_id** | **String** | The id of the category | |
138
+ | **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] |
139
+ | **type** | **String** | If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported. | [optional] |
140
+ | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included. | [optional] |
141
+
142
+ ### Return type
143
+
144
+ [**HybridTransactionsResponse**](HybridTransactionsResponse.md)
145
+
146
+
147
+ ## get_transactions_by_payee
148
+
149
+ > <HybridTransactionsResponse> get_transactions_by_payee(budget_id, payee_id, opts)
150
+
151
+ List payee transactions
152
+
153
+ Returns all transactions for a specified payee
154
+
155
+ ### Parameters
156
+
157
+ | Name | Type | Description | Notes |
158
+ | ---- | ---- | ----------- | ----- |
159
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
160
+ | **payee_id** | **String** | The id of the payee | |
161
+ | **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] |
162
+ | **type** | **String** | If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported. | [optional] |
163
+ | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included. | [optional] |
164
+
165
+ ### Return type
166
+
167
+ [**HybridTransactionsResponse**](HybridTransactionsResponse.md)
168
+
169
+
170
+ ## import_transactions
171
+
172
+ > <TransactionsImportResponse> import_transactions(budget_id)
173
+
174
+ Import transactions
175
+
176
+ 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.
177
+
178
+ ### Parameters
179
+
180
+ | Name | Type | Description | Notes |
181
+ | ---- | ---- | ----------- | ----- |
182
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
183
+
184
+ ### Return type
185
+
186
+ [**TransactionsImportResponse**](TransactionsImportResponse.md)
187
+
188
+
189
+ ## update_transaction
190
+
191
+ > <TransactionResponse> update_transaction(budget_id, transaction_id, data)
192
+
193
+ Updates an existing transaction
194
+
195
+ Updates a single transaction
196
+
197
+ ### Parameters
198
+
199
+ | Name | Type | Description | Notes |
200
+ | ---- | ---- | ----------- | ----- |
201
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
202
+ | **transaction_id** | **String** | The id of the transaction | |
203
+ | **data** | [**PutTransactionWrapper**](PutTransactionWrapper.md) | The transaction to update | |
204
+
205
+ ### Return type
206
+
207
+ [**TransactionResponse**](TransactionResponse.md)
208
+
209
+
210
+ ## update_transactions
211
+
212
+ > <SaveTransactionsResponse> update_transactions(budget_id, data)
213
+
214
+ Update multiple transactions
215
+
216
+ Updates multiple transactions, by `id` or `import_id`.
217
+
218
+ ### Parameters
219
+
220
+ | Name | Type | Description | Notes |
221
+ | ---- | ---- | ----------- | ----- |
222
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
223
+ | **data** | [**PatchTransactionsWrapper**](PatchTransactionsWrapper.md) | The transactions to update. Each transaction must have either an &#x60;id&#x60; or &#x60;import_id&#x60; specified. If &#x60;id&#x60; is specified as null an &#x60;import_id&#x60; value can be provided which will allow transaction(s) to be updated by their &#x60;import_id&#x60;. If an &#x60;id&#x60; is specified, it will always be used for lookup. | |
224
+
225
+ ### Return type
226
+
227
+ [**SaveTransactionsResponse**](SaveTransactionsResponse.md)
228
+
@@ -0,0 +1,8 @@
1
+ # YNAB::TransactionsImportResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | [**TransactionsImportResponseData**](TransactionsImportResponseData.md) | | |
8
+
@@ -0,0 +1,8 @@
1
+ # YNAB::TransactionsImportResponseData
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **transaction_ids** | **Array&lt;String&gt;** | The list of transaction ids that were imported. | |
8
+
@@ -0,0 +1,8 @@
1
+ # YNAB::TransactionsResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | [**TransactionsResponseData**](TransactionsResponseData.md) | | |
8
+
@@ -0,0 +1,9 @@
1
+ # YNAB::TransactionsResponseData
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **transactions** | [**Array&lt;TransactionDetail&gt;**](TransactionDetail.md) | | |
8
+ | **server_knowledge** | **Integer** | The knowledge of the server | |
9
+
@@ -0,0 +1,9 @@
1
+ # YNAB::TransactionsWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **transactions** | [**Array&lt;TransactionDetail&gt;**](TransactionDetail.md) | |
7
+ **server_knowledge** | **Integer** | The knowledge of the server |
8
+
9
+
@@ -0,0 +1,20 @@
1
+ # YNAB::UpdateTransaction
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **account_id** | **String** | |
7
+ **date** | **Date** | The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored. |
8
+ **amount** | **Integer** | The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. |
9
+ **payee_id** | **String** | The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as &#x60;tranfer_payee_id&#x60; on the account resource. | [optional]
10
+ **payee_name** | **String** | The payee name. If a &#x60;payee_name&#x60; value is provided and &#x60;payee_id&#x60; has a null value, the &#x60;payee_name&#x60; value will be used to resolve the payee by either (1) a matching payee rename rule (only if &#x60;import_id&#x60; is also specified) or (2) a payee with the same name or (3) creation of a new payee. | [optional]
11
+ **category_id** | **String** | The category for the transaction. To configure a split transaction, you can specify null for &#x60;category_id&#x60; and provide a &#x60;subtransactions&#x60; array as part of the transaction object. If an existing transaction is a split, the &#x60;category_id&#x60; cannot be changed. Credit Card Payment categories are not permitted and will be ignored if supplied. | [optional]
12
+ **memo** | **String** | | [optional]
13
+ **cleared** | **String** | The cleared status of the transaction | [optional]
14
+ **approved** | **BOOLEAN** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional]
15
+ **flag_color** | **String** | The transaction flag | [optional]
16
+ **import_id** | **String** | If specified, the new transaction will be assigned this &#x60;import_id&#x60; and considered \&quot;imported\&quot;. We will also attempt to match this imported transaction to an existing \&quot;user-entered\&quot; transation on the same account, with the same amount, and with a date +/-10 days from the imported transaction date.&lt;br&gt;&lt;br&gt;Transactions imported through File Based Import or Direct Import (not through the API) are assigned an import_id in the format: &#39;YNAB:[milliunit_amount]:[iso_date]:[occurrence]&#39;. For example, a transaction dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of &#39;YNAB:-294230:2015-12-30:1&#39;. If a second transaction on the same account was imported and had the same date and same amount, its import_id would be &#39;YNAB:-294230:2015-12-30:2&#39;. Using a consistent format will prevent duplicates through Direct Import and File Based Import.&lt;br&gt;&lt;br&gt;If import_id is omitted or specified as null, the transaction will be treated as a \&quot;user-entered\&quot; transaction. As such, it will be eligible to be matched against transactions later being imported (via DI, FBI, or API). | [optional]
17
+ **subtransactions** | [**Array&lt;SaveSubTransaction&gt;**](SaveSubTransaction.md) | An array of subtransactions to configure a transaction as a split. Updating &#x60;subtransactions&#x60; on an existing split transaction is not supported. | [optional]
18
+ **id** | **String** | |
19
+
20
+
@@ -0,0 +1,8 @@
1
+ # YNAB::UpdateTransactionsWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **transactions** | [**Array&lt;UpdateTransaction&gt;**](UpdateTransaction.md) | |
7
+
8
+
data/docs/User.md ADDED
@@ -0,0 +1,8 @@
1
+ # YNAB::User
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | |
8
+
data/docs/UserApi.md ADDED
@@ -0,0 +1,25 @@
1
+ # YNAB::UserApi
2
+
3
+ All URIs are relative to *https://api.ynab.com/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**get_user**](UserApi.md#get_user) | **GET** /user | User info |
8
+
9
+
10
+ ## get_user
11
+
12
+ > <UserResponse> get_user
13
+
14
+ User info
15
+
16
+ Returns authenticated user information
17
+
18
+ ### Parameters
19
+
20
+ This endpoint does not need any parameter.
21
+
22
+ ### Return type
23
+
24
+ [**UserResponse**](UserResponse.md)
25
+
@@ -0,0 +1,8 @@
1
+ # YNAB::UserResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | [**UserResponseData**](UserResponseData.md) | | |
8
+
@@ -0,0 +1,8 @@
1
+ # YNAB::UserResponseData
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **user** | [**User**](User.md) | | |
8
+
@@ -0,0 +1,8 @@
1
+ # YNAB::UserWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **user** | [**User**](User.md) | |
7
+
8
+
@@ -0,0 +1,21 @@
1
+ require 'ynab'
2
+
3
+ access_token = ENV['YNAB_ACCESS_TOKEN']
4
+ ynab = YNAB::API.new(access_token)
5
+
6
+ begin
7
+ puts 'Fetching budgets...'
8
+
9
+ budget_response = ynab.budgets.get_budgets
10
+ budgets = budget_response.data.budgets
11
+
12
+ puts '==========='
13
+ puts 'BUDGET LIST'
14
+ puts '==========='
15
+
16
+ budgets.each do |budget|
17
+ puts "[id: #{budget.id}, name: #{budget.name}]"
18
+ end
19
+ rescue YNAB::ApiError => e
20
+ puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}"
21
+ end
@@ -0,0 +1,33 @@
1
+ require 'ynab'
2
+ require 'date'
3
+
4
+ access_token = ENV['YNAB_ACCESS_TOKEN']
5
+ ynab = YNAB::API.new(access_token)
6
+
7
+ budget_id = ENV['YNAB_BUDGET_ID']
8
+
9
+ begin
10
+ puts 'Fetching month...'
11
+
12
+ first_day_of_month_iso = Date.new(Date.today.year, Date.today.month, 1).iso8601
13
+ current_date = Date.today
14
+ first_day_of_month = Date.new(current_date.year, current_date.month, 1)
15
+ month_response = ynab.months.get_budget_month(budget_id, first_day_of_month_iso)
16
+ budget_month = month_response.data.month
17
+
18
+ puts "============"
19
+ puts "BUDGET MONTH"
20
+ puts "============"
21
+ puts " Month: #{budget_month.month}"
22
+ puts " Note: #{budget_month.note}"
23
+ puts "To Be Budgeted: #{budget_month.to_be_budgeted}"
24
+ puts " Age of Money: #{budget_month.age_of_money}"
25
+ puts " Categories: "
26
+
27
+ budget_month.categories.each do |category|
28
+ puts " #{category.name} - $#{category.balance}"
29
+ end
30
+ rescue YNAB::ApiError => e
31
+ puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}"
32
+ end
33
+
@@ -0,0 +1,23 @@
1
+ require 'ynab'
2
+
3
+ access_token = ENV['YNAB_ACCESS_TOKEN']
4
+ ynab = YNAB::API.new(access_token)
5
+
6
+ budget_id = ENV['YNAB_BUDGET_ID']
7
+ category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe'
8
+
9
+ begin
10
+ puts 'Fetching category...'
11
+
12
+ category_response = ynab.categories.get_category_by_id(budget_id, category_id)
13
+ category = category_response.data.category
14
+
15
+ puts "==========="
16
+ puts "CATEGORY"
17
+ puts "==========="
18
+ puts " Name: #{category.name}"
19
+ puts " Budgeted: #{category.budgeted}"
20
+ puts " Balance: #{category.balance}"
21
+ rescue YNAB::ApiError => e
22
+ puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}"
23
+ end
@@ -0,0 +1,42 @@
1
+ require 'date'
2
+ require 'ynab'
3
+
4
+ access_token = ENV['YNAB_ACCESS_TOKEN']
5
+ ynab = YNAB::API.new(access_token)
6
+
7
+ budget_id = ENV['YNAB_BUDGET_ID']
8
+ account_id = 'f6fe07cb-c895-not-real-acfac0b7f026'
9
+ category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe'
10
+
11
+ data = {
12
+ transactions: [
13
+ {
14
+ account_id: account_id,
15
+ category_id: category_id,
16
+ date: Date.today,
17
+ payee_name: 'A Test Payee',
18
+ memo: 'I was created through the API',
19
+ cleared: 'Cleared',
20
+ approved: true,
21
+ flag_color: 'Blue',
22
+ amount: 20000
23
+ },
24
+ {
25
+ account_id: account_id,
26
+ category_id: category_id,
27
+ date: Date.today,
28
+ payee_name: 'Another Test Payee',
29
+ memo: 'I was also created through the API',
30
+ cleared: 'Uncleared',
31
+ approved: false,
32
+ flag_color: 'Red',
33
+ amount: 39453
34
+ }
35
+ ]
36
+ }
37
+
38
+ begin
39
+ ynab.transactions.create_transaction(budget_id, data)
40
+ rescue YNAB::ApiError => e
41
+ puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}"
42
+ end
@@ -0,0 +1,30 @@
1
+ require 'date'
2
+ require 'ynab'
3
+
4
+ access_token = ENV['YNAB_ACCESS_TOKEN']
5
+ ynab = YNAB::API.new(access_token)
6
+
7
+ budget_id = ENV['YNAB_BUDGET_ID']
8
+ account_id = 'f6fe07cb-c895-not-real-acfac0b7f026'
9
+ category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe'
10
+
11
+ data = {
12
+ transaction: {
13
+ account_id: account_id,
14
+ category_id: category_id,
15
+ date: Date.today,
16
+ payee_name: 'A Test Payee',
17
+ memo: 'I was created through the API',
18
+ cleared: 'Cleared',
19
+ approved: true,
20
+ flag_color: 'Blue',
21
+ amount: 20000
22
+ }
23
+ }
24
+
25
+ begin
26
+ ynab.transactions.create_transaction(budget_id, data)
27
+ rescue YNAB::ApiError => e
28
+ puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}"
29
+ end
30
+