@lunch-money/developer-docs 2.11.0-preview.10

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.
@@ -0,0 +1,407 @@
1
+ # Categories
2
+
3
+ <aside class="notice">
4
+ This API (v1) will not progress to a generally available state. For new projects, we recommend using the <a href="/v2/docs#tag/categories">v2 API</a>, which is in open alpha and actively maintained.
5
+ </aside>
6
+
7
+ ## Categories Object
8
+
9
+ Attribute Name | Type | Nullable | Description
10
+ ------------------- | ---------------- | -------- | --------------------------------------------------------------------
11
+ id | number | false | A unique identifier for the category.
12
+ name | string | false | The name of the category. Must be between 1 and 40 characters.
13
+ description | string | true | The description of the category. Must not exceed 140 characters.
14
+ is_income | boolean | false | If true, the transactions in this category will be treated as income.
15
+ exclude_from_budget | boolean | false | If true, the transactions in this category will be excluded from the budget.
16
+ exclude_from_totals | boolean | false | If true, the transactions in this category will be excluded from totals.
17
+ archived | boolean | true | If true, the category is archived and not displayed in relevant areas of the Lunch Money app.
18
+ archived_on | string | true | The date and time of when the category was last archived (in the ISO 8601 extended format).
19
+ updated_at | string | true | The date and time of when the category was last updated (in the ISO 8601 extended format).
20
+ created_at | string | true | The date and time of when the category was created (in the ISO 8601 extended format).
21
+ is_group | boolean | false | If true, the category is a group that can be a parent to other categories.
22
+ group_id | number | true | The ID of a category group (or null if the category doesn't belong to a category group).
23
+ order | number | true | Numerical ordering of categories
24
+ children | array of objects | true | For category groups, this will populate with the categories nested within and include id, name, description and created_at fields.
25
+ group_category_name | string | true | For grouped categories, the name of the category group
26
+
27
+ ## Get All Categories
28
+
29
+ Use this endpoint to get a flattened list of all categories in alphabetical order associated with the user's account.
30
+
31
+ ```json
32
+ {
33
+ "categories": [
34
+ {
35
+ "id": 83,
36
+ "name": "Test 1",
37
+ "description": "Test description",
38
+ "is_income": false,
39
+ "exclude_from_budget": true,
40
+ "exclude_from_totals": false,
41
+ "updated_at": "2020-01-28T09:49:03.225Z",
42
+ "created_at": "2020-01-28T09:49:03.225Z",
43
+ "is_group": false,
44
+ "group_id": null,
45
+ "order": 0
46
+ },
47
+ {
48
+ "id": 84,
49
+ "name": "Test 2",
50
+ "description": null,
51
+ "is_income": true,
52
+ "exclude_from_budget": false,
53
+ "exclude_from_totals": true,
54
+ "updated_at": "2020-01-28T09:49:03.238Z",
55
+ "created_at": "2020-01-28T09:49:03.238Z",
56
+ "is_group": true,
57
+ "group_id": 83,
58
+ "order": 1,
59
+ "children": [
60
+ {
61
+ "id": 315162,
62
+ "name": "Alcohol, Bars",
63
+ "description": null,
64
+ "created_at": "2022-03-06T20:11:36.066Z"
65
+ },
66
+ {
67
+ "id": 315169,
68
+ "name": "Groceries",
69
+ "description": null,
70
+ "created_at": "2022-03-06T20:11:36.120Z"
71
+ },
72
+ {
73
+ "id": 315172,
74
+ "name": "Restaurants",
75
+ "description": null,
76
+ "created_at": "2022-03-06T20:11:36.146Z"
77
+ }
78
+ ]
79
+ }
80
+ ]
81
+ }
82
+ ```
83
+
84
+ ### HTTP Request
85
+
86
+ `GET https://api.lunchmoney.dev/v1/categories`
87
+
88
+ ### Query Parameters
89
+
90
+ Parameter | Type | Required | Default | Description
91
+ --------- | ------ | -------- | --------- | --------------------------------------------------------------------------
92
+ format | string | false | flattened | Can either `flattened` or `nested`. If `flattened`, returns a singular array of categories, ordered alphabetically. If `nested`, returns top-level categories (either category groups or categories not part of a category group) in an array. Subcategories are nested within the category group under the property `children`.
93
+
94
+ ## Get Single Category
95
+
96
+ Use this endpoint to get hydrated details on a single category. Note that if this category is part of a category group, its properties (is_income, exclude_from_budget, exclude_from_totals) will inherit from the category group.
97
+
98
+ ```json
99
+ {
100
+ "id": 315358,
101
+ "name": "Food & Drink",
102
+ "description": null,
103
+ "is_income": false,
104
+ "exclude_from_budget": false,
105
+ "exclude_from_totals": false,
106
+ "archived": false,
107
+ "archived_on": null,
108
+ "is_group": true,
109
+ "group_id": null,
110
+ "order": 5,
111
+ "children": [
112
+ {
113
+ "id": 315162,
114
+ "name": "Alcohol, Bars",
115
+ "description": null,
116
+ "created_at": "2022-03-06T20:11:36.066Z"
117
+ },
118
+ {
119
+ "id": 315169,
120
+ "name": "Groceries",
121
+ "description": null,
122
+ "created_at": "2022-03-06T20:11:36.120Z"
123
+ },
124
+ {
125
+ "id": 315172,
126
+ "name": "Restaurants",
127
+ "description": null,
128
+ "created_at": "2022-03-06T20:11:36.146Z"
129
+ }
130
+ ]
131
+ }
132
+ ```
133
+
134
+ ### HTTP Request
135
+
136
+ `GET https://api.lunchmoney.dev/v1/categories/:category_id`
137
+
138
+ ## Create Category
139
+
140
+ Use this endpoint to create a single category
141
+
142
+ > Example 200 Response
143
+ >
144
+ > Returns the ID of the newly-created category
145
+
146
+ ```json
147
+ {
148
+ "category_id": 26213
149
+ }
150
+ ```
151
+
152
+ > Example Error Response (sends as 200)
153
+
154
+ ```json
155
+ { "error": "Missing category name." }
156
+ ```
157
+
158
+ ```json
159
+ { "error": "Category name must be less than 40 characters." }
160
+ ```
161
+
162
+ ```json
163
+ { "error": "Category description must be less than 140 characters." }
164
+ ```
165
+
166
+ ```json
167
+ {
168
+ "error": "Operation error occurred. Please try again or contact support@lunchmoney.app for assistance."
169
+ }
170
+ ```
171
+
172
+ ### HTTP Request
173
+
174
+ `POST https://api.lunchmoney.dev/v1/categories`
175
+
176
+ Parameter | Type | Required | Default | Description
177
+ ------------------- | ------- | -------- | ------- | -------------------------------------------------------------------
178
+ name | string | true | - | Name of category. Must be between 1 and 40 characters.
179
+ description | string | false | - | Description of category. Must be less than 140 categories.
180
+ is_income | boolean | false | false | Whether or not transactions in this category should be treated as income.
181
+ exclude_from_budget | boolean | false | false | Whether or not transactions in this category should be excluded from budgets.
182
+ exclude_from_totals | boolean | false | false | Whether or not transactions in this category should be excluded from calculated totals.
183
+ archived | boolean | false | false | Whether or not category should be archived.
184
+ group_id | number | false | - | Assigns the newly-created category to an existing category group.
185
+
186
+ ## Create Category Group
187
+
188
+ Use this endpoint to create a single category group
189
+
190
+ > Example 200 Response
191
+ >
192
+ > Returns the ID of the newly-created category group
193
+
194
+ ```json
195
+ {
196
+ "category_id": 26213
197
+ }
198
+ ```
199
+
200
+ > Example Error Response (sends as 200)
201
+
202
+ ```json
203
+ { "error": "Missing category name." }
204
+ ```
205
+
206
+ ```json
207
+ {
208
+ "error": "A category with the same name (sample_duplicate_name) already exists."
209
+ }
210
+ ```
211
+
212
+ ```json
213
+ {
214
+ "error": "The following category id(s) could not be added as a group because you do not have permissions for this category, or it is already a category group: 3893"
215
+ }
216
+ ```
217
+
218
+ ### HTTP Request
219
+
220
+ `POST https://api.lunchmoney.dev/v1/categories/group`
221
+
222
+ Parameter | Type | Required | Default | Description
223
+ ------------------- | ---------------- | -------- | ------- | ----------------------------------------------------------
224
+ name | string | true | - | Name of category. Must be between 1 and 40 characters.
225
+ description | string | false | - | Description of category. Must be less than 140 categories.
226
+ is_income | boolean | false | false | Whether or not transactions in this category should be treated as income.
227
+ exclude_from_budget | boolean | false | false | Whether or not transactions in this category should be excluded from budgets.
228
+ exclude_from_totals | boolean | false | false | Whether or not transactions in this category should be excluded from calculated totals.
229
+ category_ids | array of numbers | false | - | Array of category_id to include in the category group.
230
+ new_categories | array of strings | false | - | Array of strings representing new categories to create and subsequently include in the category group.
231
+
232
+ ## Update Category
233
+
234
+ Use this endpoint to update the properties for a single category or category group
235
+
236
+ > Example 200 Response
237
+ >
238
+ > If successfully updated, returns true
239
+
240
+ ```json
241
+ true
242
+ ```
243
+
244
+ > Example Error Response (sends as 200)
245
+
246
+ ```json
247
+ { "error": "No valid fields to update for this category." }
248
+ ```
249
+
250
+ ```json
251
+ { "error": "You may not set the is_group property for an existing category." }
252
+ ```
253
+
254
+ ```json
255
+ {
256
+ "error": "This category cannot be assigned a group because it is a category group."
257
+ }
258
+ ```
259
+
260
+ ```json
261
+ {
262
+ "error": "Operation error occurred. Please try again or contact support@lunchmoney.app for assistance."
263
+ }
264
+ ```
265
+
266
+ ### HTTP Request
267
+
268
+ `PUT https://api.lunchmoney.dev/v1/categories/:category_id`
269
+
270
+ Parameter | Type | Required | Default | Description
271
+ ------------------- | ------- | -------- | ------- | -------------------------------------------------------------------
272
+ name | string | false | - | Name of category. Must be between 1 and 40 characters.
273
+ description | string | false | - | Description of category. Must be less than 140 categories.
274
+ is_income | boolean | false | false | Whether or not transactions in this category should be treated as income.
275
+ exclude_from_budget | boolean | false | false | Whether or not transactions in this category should be excluded from budgets.
276
+ exclude_from_totals | boolean | false | false | Whether or not transactions in this category should be excluded from calculated totals.
277
+ archived | boolean | false | false | Whether or not category should be archived.
278
+ group_id | number | false | false | For a category, set the group_id to include it in a category group
279
+
280
+ ## Add to Category Group
281
+
282
+ Use this endpoint to add categories (either existing or new) to a single category group
283
+
284
+ > Example 200 Response
285
+ >
286
+ > Returns the hydrated object for the category group
287
+
288
+ ```json
289
+ {
290
+ "id": 315358,
291
+ "name": "Food & Drink",
292
+ "description": null,
293
+ "is_income": false,
294
+ "exclude_from_budget": false,
295
+ "exclude_from_totals": false,
296
+ "is_group": true,
297
+ "group_id": null,
298
+ "children": [
299
+ {
300
+ "id": 315162,
301
+ "name": "Alcohol, Bars",
302
+ "description": null,
303
+ "created_at": "2022-03-06T20:11:36.066Z"
304
+ },
305
+ {
306
+ "id": 315164,
307
+ "name": "Coffee Shops",
308
+ "description": null,
309
+ "created_at": "2022-03-06T20:11:36.082Z"
310
+ },
311
+ {
312
+ "id": 315169,
313
+ "name": "Groceries",
314
+ "description": null,
315
+ "created_at": "2022-03-06T20:11:36.120Z"
316
+ },
317
+ {
318
+ "id": 315172,
319
+ "name": "Restaurants",
320
+ "description": null,
321
+ "created_at": "2022-03-06T20:11:36.146Z"
322
+ }
323
+ ]
324
+ }
325
+ ```
326
+
327
+ > Example Error Response (sends as 200)
328
+
329
+ ```json
330
+ {
331
+ "error": "The following category id(s) could not be added as a group because you do not have permissions for this category, or it is already a category group: 3280"
332
+ }
333
+ ```
334
+
335
+ ```json
336
+ {
337
+ "error": "Operation error occurred. Please try again or contact support@lunchmoney.app for assistance."
338
+ }
339
+ ```
340
+
341
+ ### HTTP Request
342
+
343
+ `POST https://api.lunchmoney.dev/v1/categories/group/:group_id/add`
344
+
345
+ Parameter | Type | Required | Default | Description
346
+ -------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------
347
+ category_ids | array of numbers | false | - | Array of category_id to include in the category group.
348
+ new_categories | array of strings | false | - | Array of strings representing new categories to create and subsequently include in the category group.
349
+
350
+ ## Delete Category
351
+
352
+ Use this endpoint to delete a single category or category group. This will only work if there are no dependencies, such as existing budgets for the category, categorized transactions, categorized recurring items, etc. If there are dependents, this endpoint will return what the dependents are and how many there are.
353
+
354
+ > Example 200 Response
355
+ >
356
+ > If successfully deleted, returns true
357
+
358
+ ```json
359
+ true
360
+ ```
361
+
362
+ > Example Error Response (sends as 200)
363
+
364
+ ```json
365
+ {
366
+ "dependents": {
367
+ "category_name": "Food & Drink",
368
+ "budget": 4,
369
+ "category_rules": 0,
370
+ "transactions": 43,
371
+ "children": 7,
372
+ "recurring": 0
373
+ }
374
+ }
375
+ ```
376
+
377
+ ### HTTP Request
378
+
379
+ `DELETE https://api.lunchmoney.dev/v1/categories/:category_id`
380
+
381
+ ## Force Delete Category
382
+
383
+ Use this endpoint to force delete a single category or category group and along with it, disassociate the category from any transactions, recurring items, budgets, etc.
384
+
385
+ _Note: it is best practice to first try the `Delete Category` endpoint to ensure you don't accidentally delete any data. Disassociation/deletion of the data arising from this endpoint is irreversible!_
386
+
387
+ > Example 200 Response
388
+ >
389
+ > If successfully deleted, returns true
390
+
391
+ ```json
392
+ true
393
+ ```
394
+
395
+ > Example Error Response (sends as 200)
396
+
397
+ ```json
398
+ {
399
+ "error": "Operation error occurred. Please try again or contact support@lunchmoney.app for assistance."
400
+ }
401
+ ```
402
+
403
+ ### HTTP Request
404
+
405
+ `DELETE https://api.lunchmoney.dev/v1/categories/:category_id/force`
406
+
407
+ ---
@@ -0,0 +1,102 @@
1
+ # Changelog
2
+
3
+ A log of changes. Breaking changes will be denoted with 🚨
4
+ ## Feb 6, 2025
5
+ - The [Assets Object](#assets-object) and [Plaid Accounts Object](#plaid-accounts-object) now include a `to_base` property which shows the account balance converted to the user's primary currency.
6
+
7
+ ## Feb 3, 2025
8
+ - The [Update Transaction Object](#update-transaction-object) now accepts a `plaid_account_id` allowing developers to update existing transactions associated with plaid accounts or to move transactions to a plaid account if the "Allow Modifications to Transactions" property is set.
9
+ - The bug in the [GET /transactions/{id}](#get-single-transaction) endpoint where the `debit_as_negative` query param was ignored has been fixed.
10
+
11
+ ## Dec 20, 2024
12
+ - The [Transaction Insert Object](#transaction-object-to-insert) now accepts a `plaid_account_id` allowing developers to insert transactions associated with plaid accounts if the "Allow Modifications to Transactions" property is set.
13
+ - The bug that prevented users from inserting transactions with the same `asset_id`/`external_id` as a previously deleted transaction has been fixed.
14
+
15
+ ## June 15, 2024
16
+ - New endpoint: [GET /v1/recurring_items](#get-recurring-items)
17
+ - Deprecated the [GET /v1/recurring_expenses](#get-recurring-expenses) endpoint in favor of the new recurring_items endpoint
18
+
19
+ ## March 27, 2024
20
+
21
+ ### Updated
22
+
23
+ - 🚨 Deprecated `transaction_id` in [Recurring Expenses Object](#recurring-expenses-object) (temporarily... it will come back in another form)
24
+ - 🚨 Deprecated special statuses for transactions (`recurring` and `recurring_suggested`)
25
+
26
+ ## January 18, 2024
27
+
28
+ ### New
29
+
30
+ - New endpoint: [GET /v1/transactions/group](#get-transaction-group)
31
+ - New fields for [Transaction object](#transaction-object) and deprecated query parameter (`group_id`) and fields (`type`, `subtype`, `quantity`, `fee`, `price`)
32
+
33
+ ## December 20, 2023
34
+
35
+ ### New
36
+
37
+ - New endpoint: [POST /v1/plaid_accounts/fetch](#trigger-fetch-from-plaid) (experimental)
38
+
39
+ ## October 8, 2023
40
+
41
+ ### Updated
42
+
43
+ - New fields for [GET /v1/categories](#get-all-categories): order
44
+ - New option for [GET /v1/categories](#get-all-categories): format (flattened or nested)
45
+
46
+ ## June 22, 2022
47
+
48
+ ### New
49
+
50
+ - New endpoint: [POST /v1/transactions/unsplit](#unsplit-transactions)
51
+
52
+ ## June 4, 2022
53
+
54
+ ### New
55
+
56
+ - Lots of new endpoints for [categories](#categories) with support for [category groups](#create-category-group)
57
+
58
+ ## August 31, 2021
59
+
60
+ ### Updated
61
+
62
+ - New fields for [GET /v1/budgets](#get-budget-summary): config
63
+
64
+ ## June 9, 2021
65
+
66
+ ### New
67
+
68
+ - New endpoint: [POST /v1/transactions/group](#create-transaction-group)
69
+ - New endpoint: [DELETE /v1/transactions/group/:transaction_id](#delete-transaction-group)
70
+
71
+ ### Updated
72
+
73
+ - New option for [POST /v1/transactions](#insert-transactions) and [PUT /v1/transactions](#update-transaction): skip_balance_update
74
+ - New fields for [GET /v1/transactions](#get-all-transactions): original_name, type, subtype, fees, price, quantity
75
+ - New filter options for [GET /v1/transactions](#get-all-transactions): status, is_group, group_id
76
+
77
+ ## May 27, 2021
78
+
79
+ ### New
80
+
81
+ - New endpoint: [GET /v1/budgets](#get-budget-summary)
82
+ - New endpoint: [GET /v1/crypto](#get-all-crypto)
83
+ - New endpoint: [PUT /v1/crypto/manual/:id](#update-manual-crypto-asset)
84
+
85
+ ### Updated
86
+
87
+ - New fields for [GET /v1/assets](#get-all-assets): display_name and closed_on
88
+
89
+ ## March 28, 2020
90
+
91
+ ### New
92
+
93
+ - Pagination options for [GET /v1/transactions](#get-all-transactions): limit and offset
94
+ - Filter options for [GET /v1/transactions](#get-all-transactions): asset_id, recurring_id, plaid_account_id, tag_id, category_id
95
+ - New endpoint: [GET /v1/budget](#get-all-tags)
96
+
97
+ ### Updated
98
+
99
+ - Support for tags in [PUT /v1/transactions/:id](#update-transaction) and [POST /v1/transactions](#insert-transactions)
100
+ - 🚨Split object for [splitting transactions](#update-transaction) is moved out of the Transactions object and to a higher-level. We will still support the split property for a few more weeks before removing it completely.
101
+
102
+ ---
package/v1/_crypto.md ADDED
@@ -0,0 +1,105 @@
1
+ # Crypto
2
+
3
+ <aside class="notice">
4
+ The v2 API does not yet support crypto endpoints. Please continue using the v1 crypto API as documented here.
5
+ </aside>
6
+
7
+ ## Crypto Object
8
+
9
+ Attribute Name | Type | Nullable | Description
10
+ ------------------- | ---- | -------- | -----------
11
+ id | number | true | Unique identifier for a manual crypto account (no ID for synced accounts)
12
+ zabo_account_id | number | true | Unique identifier for a synced crypto account (no ID for manual accounts, multiple currencies may have the same zabo_account_id)
13
+ source | string | false | One of:<br/><ul><li>`synced`: this account is synced via a wallet, exchange, etc.</li><li>`manual`: this account balance is managed manually</li></ul>
14
+ name | string | false | Name of the crypto asset
15
+ display_name | string | true | Display name of the crypto asset (as set by user)
16
+ balance | string | false | Current balance
17
+ balance_as_of | string | false | Date/time the balance was last updated in ISO 8601 extended format
18
+ currency | string | false | Abbreviation for the cryptocurrency
19
+ status | string | false | The current status of the crypto account. Either active or in error.
20
+ institution_name | string | true | Name of provider holding the asset
21
+ created_at | string | false | Date/time the asset was created in ISO 8601 extended format
22
+ to_base | number | true | The balance converted to the user's primary currency.
23
+
24
+ ## Get All Crypto
25
+
26
+ Use this endpoint to get a list of all cryptocurrency assets associated with the user's account. Both crypto balances from synced and manual accounts will be returned.
27
+
28
+ > Example 200 Response
29
+
30
+ ```json
31
+ {
32
+ "crypto": [
33
+ {
34
+ "zabo_account_id": 544,
35
+ "source": "synced",
36
+ "created_at": "2020-07-27T11:53:02.722Z",
37
+ "name": "Dogecoin",
38
+ "display_name": null,
39
+ "balance": "1.902383849000000000",
40
+ "balance_as_of": "2021-05-21T00:05:36.000Z",
41
+ "currency": "doge",
42
+ "status": "active",
43
+ "institution_name": "MetaMask"
44
+ },
45
+ {
46
+ "id": 152,
47
+ "source": "manual",
48
+ "created_at": "2021-04-03T04:16:48.230Z",
49
+ "name": "Ether",
50
+ "display_name": "BlockFi - ETH",
51
+ "balance": "5.391445130000000000",
52
+ "balance_as_of": "2021-05-20T16:57:00.000Z",
53
+ "currency": "ETH",
54
+ "status": "active",
55
+ "institution_name": "BlockFi"
56
+ },
57
+ ]
58
+ }
59
+ ```
60
+
61
+ ### HTTP Request
62
+
63
+ `GET https://api.lunchmoney.dev/v1/crypto`
64
+
65
+ ## Update Manual Crypto Asset
66
+
67
+ Use this endpoint to update a single manually-managed crypto asset (does not include assets received from syncing with your wallet/exchange/etc). These are denoted by `source: manual` from the GET call above.
68
+
69
+ > Example 200 Response
70
+
71
+ ```json
72
+ {
73
+ "id": 1,
74
+ "source": "manual",
75
+ "created_at": "2021-02-10T05:57:34.305Z",
76
+ "name": "Shiba Token",
77
+ "display_name": "SHIB",
78
+ "balance": "12.000000000000000000",
79
+ "currency": "SHIB",
80
+ "status": "active",
81
+ "institution_name": null
82
+ }
83
+ ```
84
+
85
+ > Example Error Response (sends as 200)
86
+
87
+ ```json
88
+ { "errors": [ "currency is invalid for crypto: fakecoin. It may not be supported yet. Request to get it supported via the app or support@lunchmoney.app" ] }
89
+ ```
90
+
91
+ ### HTTP Request
92
+
93
+ `PUT https://api.lunchmoney.dev/v1/crypto/manual/:id`
94
+
95
+ ### Body Parameters
96
+
97
+ Parameter | Type | Required | Default | Description
98
+ --------- | ---- | -------- | ------- | -----------
99
+ name | string | false | - | Official or full name of the account. Max 45 characters
100
+ display_name | string | false | - | Display name for the account. Max 25 characters
101
+ institution_name | string | false | - | Name of provider that holds the account. Max 50 characters
102
+ balance | number | false | - | Numeric value of the current balance of the account. Do not include any special characters aside from a decimal point!
103
+ currency | string | false | - | Cryptocurrency that is supported for manual tracking in our database
104
+
105
+ ---