@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.
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@lunch-money/developer-docs",
3
+ "version": "2.11.0-preview.10",
4
+ "description": "Developer documentation content for Lunch Money APIs",
5
+ "exports": {
6
+ ".": "./package.json",
7
+ "./manifest.json": "./manifest.json",
8
+ "./package.json": "./package.json"
9
+ },
10
+ "files": [
11
+ "docs",
12
+ "v1",
13
+ "v2",
14
+ "manifest.json",
15
+ "README.md"
16
+ ],
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "scripts": {
21
+ "validate:manifest": "node scripts/validate-manifest.js",
22
+ "prepack": "node scripts/validate-manifest.js && node scripts/prepack.js",
23
+ "postpack": "node scripts/postpack.js"
24
+ },
25
+ "keywords": [
26
+ "lunchmoney",
27
+ "api",
28
+ "documentation"
29
+ ],
30
+ "author": "",
31
+ "license": "ISC"
32
+ }
package/v1/_assets.md ADDED
@@ -0,0 +1,188 @@
1
+ # Assets
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/manual_accounts">v2 API</a>, which is in open alpha and actively maintained.
5
+ </aside>
6
+
7
+ ## Assets Object
8
+
9
+ Attribute Name | Type | Nullable | Description
10
+ -------------------- | ------- | -------- | ----------------------------------------------------------------------------
11
+ id | number | false | Unique identifier for asset
12
+ type_name | string | false | Primary type of the asset. Must be one of:<br><ul> <li>cash</li> <li>credit</li> <li>investment</li> <li>real estate</li> <li>loan</li> <li>vehicle</li> <li>cryptocurrency</li> <li>employee compensation</li> <li>other liability</li> <li>other asset</li> </ul> |
13
+ subtype_name | string | true | Optional asset subtype. Examples include:<br><ul> <li>retirement</li> <li>checking</li> <li>savings</li> <li>prepaid credit card</li><ul>
14
+ name | string | false | Name of the asset
15
+ display_name | string | true | Display name of the asset (as set by user)
16
+ balance | string | false | Current balance of the asset in numeric format to 4 decimal places
17
+ to_base | number | true | The balance converted to the user's primary currency
18
+ balance_as_of | string | false | Date/time the balance was last updated in ISO 8601 extended format
19
+ closed_on | string | true | The date this asset was closed (optional)
20
+ currency | string | false | Three-letter lowercase currency code of the balance in ISO 4217 format
21
+ institution_name | string | true | Name of institution holding the asset
22
+ exclude_transactions | boolean | false | If true, this asset will not show up as an option for assignment when creating transactions manually.
23
+ created_at | string | false | Date/time the asset was created in ISO 8601 extended format
24
+
25
+ ## Get All Assets
26
+
27
+ Use this endpoint to get a list of all manually-managed assets associated with the user's account.
28
+
29
+ > Example 200 Response
30
+
31
+ ```json
32
+ {
33
+ "assets": [
34
+ {
35
+ "id": 72,
36
+ "type_name": "cash",
37
+ "subtype_name": "physical cash",
38
+ "name": "Test Asset 1",
39
+ "balance": "1201.0100",
40
+ "to_base": 1020.85,
41
+ "balance_as_of": "2020-01-26T12:27:22.000Z",
42
+ "currency": "cad",
43
+ "institution_name": "Bank of Me",
44
+ "exclude_transactions": false,
45
+ "created_at": "2020-01-26T12:27:22.726Z"
46
+ },
47
+ {
48
+ "id": 73,
49
+ "type_name": "credit",
50
+ "subtype_name": "credit card",
51
+ "name": "Test Asset 2",
52
+ "balance": "0.0000",
53
+ "to_base": 0,
54
+ "balance_as_of": "2020-01-26T12:27:22.000Z",
55
+ "currency": "usd",
56
+ "institution_name": "Bank of You",
57
+ "exclude_transactions": false,
58
+ "created_at": "2020-01-26T12:27:22.744Z"
59
+ },
60
+ {
61
+ "id": 74,
62
+ "type_name": "vehicle",
63
+ "subtype_name": "automobile",
64
+ "name": "Test Asset 3",
65
+ "balance": "99999999999.0000",
66
+ "to_base": 657179189.99,
67
+ "balance_as_of": "2020-01-26T12:27:22.000Z",
68
+ "currency": "jpy",
69
+ "institution_name": "Bank of Mom",
70
+ "exclude_transactions": false,
71
+ "created_at": "2020-01-26T12:27:22.755Z"
72
+ },
73
+ {
74
+ "id": 75,
75
+ "type_name": "loan",
76
+ "subtype_name": null,
77
+ "name": "Test Asset 4",
78
+ "balance": "10101010101.0000",
79
+ "to_base": 307687460.61,
80
+ "balance_as_of": "2020-01-26T12:27:22.000Z",
81
+ "currency": "twd",
82
+ "institution_name": null,
83
+ "exclude_transactions": true,
84
+ "created_at": "2020-01-26T12:27:22.765Z"
85
+ }
86
+ ]
87
+ }
88
+ ```
89
+
90
+ ### HTTP Request
91
+
92
+ `GET https://api.lunchmoney.dev/v1/assets`
93
+
94
+ ## Create Asset
95
+
96
+ Use this endpoint to create a single (manually-managed) asset.
97
+
98
+ > Example 200 Response
99
+
100
+ ```json
101
+ {
102
+ "id": 34061,
103
+ "type_name": "depository",
104
+ "subtype_name": null,
105
+ "name": "My Test Asset",
106
+ "display_name": null,
107
+ "balance": "67.2100",
108
+ "to_base": 47.05,
109
+ "balance_as_of": "2022-05-29T21:35:36.557Z",
110
+ "closed_on": null,
111
+ "created_at": "2022-05-29T21:35:36.564Z",
112
+ "currency": "cad",
113
+ "institution_name": null,
114
+ "exclude_transactions": false
115
+ }
116
+ ```
117
+
118
+ ### HTTP Request
119
+
120
+ `POST https://api.lunchmoney.dev/v1/assets`
121
+
122
+ ### Body Parameters
123
+
124
+ Parameter | Type | Required | Default | Description
125
+ -------------------- | ------- | -------- | ----------------------- | --------------------------------------------------
126
+ type_name | string | true | - | Must be one of: cash, credit, investment, other, real estate, loan, vehicle, cryptocurrency, employee compensation
127
+ subtype_name | string | false | - | Max 25 characters
128
+ name | string | true | - | Max 45 characters
129
+ display_name | string | false | - | Display name of the asset (as set by user)
130
+ balance | string | true | - | Numeric value of the current balance of the account. Do not include any special characters aside from a decimal point!
131
+ balance_as_of | string | false | Current timestamp | Has no effect if balance is not defined. If balance is defined, but balance_as_of is not supplied or is invalid, current timestamp will be used.
132
+ currency | string | false | User's primary currency | Three-letter lowercase currency in ISO 4217 format. The code sent must exist in our database. Defaults to user's primary currency.
133
+ institution_name | string | false | - | Max 50 characters
134
+ closed_on | string | false | - | The date this asset was closed
135
+ exclude_transactions | boolean | false | false | If true, this asset will not show up as an option for assignment when creating transactions manually
136
+
137
+ ## Update Asset
138
+
139
+ Use this endpoint to update a single asset.
140
+
141
+ > Example 200 Response
142
+
143
+ ```json
144
+ {
145
+ "id": 12,
146
+ "type_name": "cash",
147
+ "subtype_name": "savings",
148
+ "name": "TD Savings Account",
149
+ "balance": "28658.5300",
150
+ "to_base": 20061.34,
151
+ "balance_as_of": "2020-03-10T05:17:23.856Z",
152
+ "currency": "cad",
153
+ "institution_name": "TD Bank",
154
+ "exclude_transactions": false,
155
+ "created_at": "2019-08-10T22:46:19.486Z"
156
+ }
157
+ ```
158
+
159
+ > Example Error Response (sends as 200)
160
+
161
+ ```json
162
+ {
163
+ "errors": [
164
+ "type_name must be one of: cash, credit, investment, other, real estate, loan, vehicle, cryptocurrency, employee compensation"
165
+ ]
166
+ }
167
+ ```
168
+
169
+ ### HTTP Request
170
+
171
+ `PUT https://api.lunchmoney.dev/v1/assets/:id`
172
+
173
+ ### Body Parameters
174
+
175
+ Parameter | Type | Required | Default | Description
176
+ -------------------- | ------- | -------- | ----------------------- | --------------------------------------------------
177
+ type_name | string | false | - | Must be one of: cash, credit, investment, other, real estate, loan, vehicle, cryptocurrency, employee compensation
178
+ subtype_name | string | false | - | Max 25 characters
179
+ name | string | false | - | Max 45 characters
180
+ display_name | string | false | - | Display name of the asset (as set by user)
181
+ balance | string | false | - | Numeric value of the current balance of the account. Do not include any special characters aside from a decimal point!
182
+ balance_as_of | string | false | Current timestamp | Has no effect if balance is not defined. If balance is defined, but balance_as_of is not supplied or is invalid, current timestamp will be used.
183
+ currency | string | false | User's primary currency | Three-letter lowercase currency in ISO 4217 format. The code sent must exist in our database. Defaults to user's primary currency.
184
+ institution_name | string | false | - | Max 50 characters
185
+ closed_on | string | false | - | The date this asset was closed
186
+ exclude_transactions | boolean | false | false | If true, this asset will not show up as an option for assignment when creating transactions manually
187
+
188
+ ---
package/v1/_budget.md ADDED
@@ -0,0 +1,256 @@
1
+ # Budget
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/summary">v2 API</a>, which is in open alpha and actively maintained.
5
+ </aside>
6
+
7
+ ## Budget Object
8
+
9
+ | Attribute Name | Type | Nullable | Description |
10
+ | ------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
11
+ | category_name | string | false | Name of the category, will be "Uncategorized" if no category is assigned |
12
+ | category_id | number | true | Unique identifier for category, can be null when `category_name` is "Uncategorized" |
13
+ | category_group_name | string | true | Name of the category group, if applicable |
14
+ | group_id | number | true | Unique identifier for category group |
15
+ | is_group | boolean | true | If true, this category is a group |
16
+ | is_income | boolean | false | If true, this category is an income category (category properties are set in the app via the Categories page) |
17
+ | exclude_from_budget | boolean | false | If true, this category is excluded from budget (category properties are set in the app via the Categories page) |
18
+ | exclude_from_totals | boolean | false | If true, this category is excluded from totals (category properties are set in the app via the Categories page) |
19
+ | data | Data[] | false | For each month with budget or category spending data, there is a data object with the key set to the month in format YYYY-MM-DD. For properties, see Data object below. |
20
+ | config | object | true | Object representing the category's budget suggestion configuration. Will be `null` if the category has no budget configuration set. See Config Object below for details. |
21
+ | order | number | false | Numerical ordering of budgets |
22
+ | archived | boolean | false | True if the category is archived and not displayed in relevant areas of the Lunch Money app. |
23
+ | recurring | object | true | Returns a list object that contains an array of Recurring Expenses objects (just the `payee`, `amount`, `currency`, and `to_base` fields) that affect this budget |
24
+
25
+ **Note:** A category may appear in the budget response even if no budget has been set for it. This can happen when:
26
+ - The category has transactions but no budget entries have been created
27
+ - The category has a custom budget period configured but no budget amounts have been set
28
+ - Budget entries were deleted but transactions still exist for that category
29
+ - After a users existing v1 budgets were migrated to v2 budgets, if a user changed their budget period settings (quantity, granularity, or anchor date), categories without budget values may exist.
30
+
31
+ In these cases, the `config` property will be `null`, and the `data` object will contain spending information (`spending_to_base`, `num_transactions`) but all `budget_*` properties will be `null`.
32
+
33
+ ## Data Object
34
+
35
+ | Attribute Name | Type | Nullable | Description |
36
+ | ---------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
37
+ | budget_amount | number | true | The budget amount, as set by the user. Will be `null` if no budget has been set for this category and time period. |
38
+ | budget_currency | string | true | The budget currency, as set by the user. Will be `null` if no budget has been set for this category and time period. |
39
+ | budget_to_base | number | true | The budget converted to the user's primary currency. If the multicurrency feature is not being used, budget_to_base and budget_amount will be the same. Will be `null` if no budget has been set for this category and time period. |
40
+ | spending_to_base | number | false | The total amount spent in this category for this time period in the user's primary currency. This value will always be present, even if no budget has been set. |
41
+ | num_transactions | number | false | Number of transactions that make up "spending_to_base". This value will always be present, even if no budget has been set. |
42
+ | is_automated | boolean | true | If true, the budget_amount is only a suggestion based on the set config. If not present, it is false (meaning this is a locked in budget). Will be `null` if no budget has been set. |
43
+
44
+ **Note:** When a category has transactions but no budget entries, the `data` object will still be present with spending information, but all `budget_*` properties will be `null`. This allows you to see spending activity even when budgets haven't been configured.
45
+
46
+ ## Config Object
47
+
48
+ | Attribute Name | Type | Nullable | Description |
49
+ | -------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
50
+ | config_id | number | false | Unique identifier for config |
51
+ | cadence | string | false | One of:<br> <ul> <li>monthly</li> <li>twice a month</li> <li>once a week</li> <li>every 3 months</li> <li>every 4 months</li> <li>twice a year</li> <li>yearly</li></ul> |
52
+ | amount | number | false | Amount in numeric format |
53
+ | currency | string | false | Three-letter lowercase currency code for the recurring expense in ISO 4217 format |
54
+ | to_base | number | false | The amount converted to the user's primary currency. |
55
+ | auto_suggest | string | false | One of:<br> <ul> <li>budgeted</li> <li>fixed</li> <li>fixed-rollover</li> <li>spent</li> </ul> |
56
+
57
+ **Note:** The `config` property in the Budget Object can be `null`. When `config` is `null`, it means the category has no budget configuration set. When `config` is present (not null), all properties listed above are required and not nullable.
58
+
59
+ ## Get Budget Summary
60
+
61
+ Use this endpoint to get full details on the budgets for all budgetable categories between a certain time period. The budgeted and spending amounts will be broken down by month.
62
+
63
+ **Note:** Categories may appear in the response even if they have no budget entries, as long as they have transactions in the specified time period. In these cases, `config` will be `null` and all `budget_*` properties in the `data` object will be `null`, but `spending_to_base` and `num_transactions` will still be populated.
64
+
65
+ > Example 200 Response
66
+
67
+ ```json
68
+ [
69
+ {
70
+ "category_name": "Food",
71
+ "category_id": 34476,
72
+ "category_group_name": null,
73
+ "group_id": null,
74
+ "is_group": true,
75
+ "is_income": false,
76
+ "exclude_from_budget": false,
77
+ "exclude_from_totals": false,
78
+ "data": {
79
+ "2020-09-01": {
80
+ "num_transactions": 23,
81
+ "spending_to_base": 373.51,
82
+ "budget_to_base": 376.08,
83
+ "budget_amount": 376.08,
84
+ "budget_currency": "usd",
85
+ "is_automated": true,
86
+ },
87
+ "2020-08-01": {
88
+ "num_transactions": 23,
89
+ "spending_to_base": 123.92,
90
+ "budget_to_base": 300,
91
+ "budget_amount": 300,
92
+ "budget_currency": "usd",
93
+ },
94
+ "2020-07-01": {
95
+ "num_transactions": 23,
96
+ "spending_to_base": 228.66,
97
+ "budget_to_base": 300,
98
+ "budget_amount": 300,
99
+ "budget_currency": "usd",
100
+ }
101
+ },
102
+ "config": {
103
+ "config_id": 9,
104
+ "cadence": "monthly",
105
+ "amount": 300,
106
+ "currency": "usd",
107
+ "to_base": 300,
108
+ "auto_suggest": "fixed-rollover"
109
+ },
110
+ "order": 0,
111
+ "archived": false,
112
+ "recurring": null
113
+ },
114
+ {
115
+ "category_name": "Alcohol & Bars",
116
+ "category_id": 26,
117
+ "category_group_name": "Food",
118
+ "group_id": 34476,
119
+ "is_group": null,
120
+ "is_income": false,
121
+ "exclude_from_budget": false,
122
+ "exclude_from_totals": false,
123
+ "data": {
124
+ "2020-09-01": {
125
+ "spending_to_base": 270.86,
126
+ "num_transactions": 14
127
+ },
128
+ "2020-08-01": {
129
+ "spending_to_base": 79.53,
130
+ "num_transactions": 8
131
+ },
132
+ "2020-07-01": {
133
+ "spending_to_base": 149.61,
134
+ "num_transactions": 8
135
+ }
136
+ },
137
+ "config": null,
138
+ "archived": false,
139
+ "order": 1,
140
+ "recurring": {
141
+ "list": [
142
+ {
143
+ "payee": "Recurring Payee",
144
+ "amount": "20.000",
145
+ "currency": "cad",
146
+ "to_base": 20
147
+ }
148
+ ]
149
+ }
150
+ },
151
+ {
152
+ "category_name": "Unbudgeted Category",
153
+ "category_id": 12345,
154
+ "category_group_name": null,
155
+ "group_id": null,
156
+ "is_group": false,
157
+ "is_income": false,
158
+ "exclude_from_budget": false,
159
+ "exclude_from_totals": false,
160
+ "data": {
161
+ "2020-09-01": {
162
+ "spending_to_base": 50.00,
163
+ "num_transactions": 1,
164
+ "budget_to_base": null,
165
+ "budget_amount": null,
166
+ "budget_currency": null
167
+ }
168
+ },
169
+ "config": null,
170
+ "order": 2,
171
+ "archived": false,
172
+ "recurring": null
173
+ }
174
+ ]
175
+ ```
176
+
177
+ ### HTTP Request
178
+
179
+ `GET https://api.lunchmoney.dev/v1/budgets`
180
+
181
+ ### Query Parameters
182
+
183
+ | Parameter | Type | Required | Default | Description |
184
+ | ---------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
185
+ | start_date | string | true | - | Start date for the budget period. Lunch Money currently only supports monthly budgets, so your date should be the start of a month (eg. 2021-04-01) |
186
+ | end_date | string | true | - | End date for the budget period. Lunch Money currently only supports monthly budgets, so your date should be the end of a month (eg. 2021-04-30) |
187
+ | currency | string | false | - | Currency for the budgeted amount (optional). If empty, will default to your primary currency |
188
+
189
+ ## Upsert Budget
190
+
191
+ Use this endpoint to update an existing budget or insert a new budget for a particular category and date.
192
+
193
+ Note: Lunch Money currently only supports monthly budgets, so your date must always be the start of a month (eg. 2021-04-01)
194
+
195
+ > Example 200 Response
196
+
197
+ If this is a sub-category, the response will include the updated category group's budget. This is because setting a sub-category may also update the category group's overall budget.
198
+
199
+ ```json
200
+ {
201
+ "category_group": {
202
+ "category_id": 34476,
203
+ "amount": 100,
204
+ "currency": "usd",
205
+ "start_date": "2021-06-01"
206
+ }
207
+ }
208
+ ```
209
+
210
+ > Example Error Response (sends as 200)
211
+
212
+ ```json
213
+ { "error": "Budget must be greater than or equal to the sum of sub-category budgets ($10.01)." }
214
+ ```
215
+
216
+ ### HTTP Request
217
+
218
+ `PUT https://api.lunchmoney.dev/v1/budgets`
219
+
220
+ ### Body Parameters
221
+
222
+ | Parameter | Type | Required | Default | Description |
223
+ | ----------- | ------ | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
224
+ | start_date | string | true | - | Start date for the budget period. Lunch Money currently only supports monthly budgets, so your date must always be the start of a month (eg. 2021-04-01) |
225
+ | category_id | number | true | - | Unique identifier for the category |
226
+ | amount | number | true | - | Amount for budget |
227
+ | currency | string | false | - | Currency for the budgeted amount (optional). If empty, will default to your primary currency |
228
+
229
+ ## Remove Budget
230
+
231
+ Use this endpoint to unset an existing budget for a particular category in a particular month.
232
+
233
+ > Example 200 Response
234
+
235
+ ```json
236
+ true
237
+ ```
238
+
239
+ > Example Error Response (sends as 200)
240
+
241
+ ```json
242
+ { "error": "start_date must be a valid date in format YYYY-MM-01" }
243
+ ```
244
+
245
+ ### HTTP Request
246
+
247
+ `DELETE https://api.lunchmoney.dev/v1/budgets`
248
+
249
+ ### Query Parameters
250
+
251
+ | Parameter | Type | Required | Default | Description |
252
+ | ----------- | ------ | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
253
+ | start_date | string | true | - | Start date for the budget period. Lunch Money currently only supports monthly budgets, so your date must always be the start of a month (eg. 2021-04-01) |
254
+ | category_id | number | true | - | Unique identifier for the category |
255
+
256
+ ---