@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/README.md +65 -0
- package/docs/README.md +16 -0
- package/docs/amounts-and-balances.md +85 -0
- package/docs/currencies.md +277 -0
- package/docs/getting-started.md +104 -0
- package/docs/introduction.md +63 -0
- package/docs/pagination.md +517 -0
- package/docs/rate-limiting.md +335 -0
- package/docs/using-with-ai.md +103 -0
- package/manifest.json +225 -0
- package/package.json +32 -0
- package/v1/_assets.md +188 -0
- package/v1/_budget.md +256 -0
- package/v1/_categories.md +407 -0
- package/v1/_changelog.md +102 -0
- package/v1/_crypto.md +105 -0
- package/v1/_plaid_accounts.md +117 -0
- package/v1/_recurring_expenses.md +117 -0
- package/v1/_recurring_items.md +240 -0
- package/v1/_tags.md +41 -0
- package/v1/_transactions.md +648 -0
- package/v1/_user.md +39 -0
- package/v2/docs/changelog-visual.html +506 -0
- package/v2/docs/intro-to-v2.md +117 -0
- package/v2/docs/migration-guide.md +1143 -0
- package/v2/docs/version-history.md +381 -0
- package/v2/images/CopyCategoriesAndTags.png +0 -0
- package/v2/images/DemoData.png +0 -0
- package/v2/images/PasteBearer.png +0 -0
- package/v2/images/RequestAccessToken.png +0 -0
- package/v2/images/TestRequest.png +0 -0
- package/v2/images/bearer.png +0 -0
- package/v2/images/green_budget.png +0 -0
- package/v2/images/new_budget.png +0 -0
- package/v2/images/server-dropdown.png +0 -0
- package/v2/spec/lunch-money-api-v2.yaml +11779 -0
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @lunch-money/developer-docs
|
|
2
|
+
|
|
3
|
+
Documentation content for the [Lunch Money](https://lunchmoney.app) developer APIs —
|
|
4
|
+
the guides, v1/v2 reference docs, images, and doc-routing manifest that power the
|
|
5
|
+
[Lunch Money developer portal](https://lunchmoney.dev).
|
|
6
|
+
|
|
7
|
+
Most API consumers want the OpenAPI spec instead: **[`@lunch-money/v2-api-spec`](https://www.npmjs.com/package/@lunch-money/v2-api-spec)**
|
|
8
|
+
is the canonical machine-readable API contract. This package is the human-facing docs
|
|
9
|
+
content, primarily for the docs server that renders the portal.
|
|
10
|
+
|
|
11
|
+
## What's in the package
|
|
12
|
+
|
|
13
|
+
Shipped verbatim at the package root:
|
|
14
|
+
|
|
15
|
+
- `docs/` — version-independent guides (getting started, pagination, rate limiting, …)
|
|
16
|
+
- `v1/` — v1 API reference markdown
|
|
17
|
+
- `v2/` — v2 guides, images, and a **convenience copy** of the OpenAPI YAML under
|
|
18
|
+
`v2/spec/` (non-canonical; the canonical spec is `@lunch-money/v2-api-spec`)
|
|
19
|
+
- `manifest.json` — doc routes, redirects, and sidebar structure
|
|
20
|
+
|
|
21
|
+
## Consuming the content
|
|
22
|
+
|
|
23
|
+
Resolve the package root, then read content files relative to it:
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
const path = require('path');
|
|
27
|
+
const fs = require('fs');
|
|
28
|
+
|
|
29
|
+
const docsRoot = path.dirname(require.resolve('@lunch-money/developer-docs/package.json'));
|
|
30
|
+
const intro = fs.readFileSync(path.join(docsRoot, 'docs/getting-started.md'), 'utf8');
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`manifest.json` describes every page the docs server renders:
|
|
34
|
+
|
|
35
|
+
```jsonc
|
|
36
|
+
{
|
|
37
|
+
"pages": [
|
|
38
|
+
{
|
|
39
|
+
"path": "/amounts-and-balances", // canonical URL
|
|
40
|
+
"file": "docs/amounts-and-balances.md", // path within this package
|
|
41
|
+
"title": "Amounts & Balances",
|
|
42
|
+
"section": "GUIDES", // sidebar grouping
|
|
43
|
+
"type": "markdown", // "markdown" | "html" | "v1-slate"
|
|
44
|
+
"aliases": ["/v2/amounts-and-balances"] // legacy URLs → 301 to path
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"redirects": [ /* { from, to, status } */ ],
|
|
48
|
+
"sidebar": { "docs": [ /* … */ ], "v1": [ /* … */ ] }
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Versioning
|
|
53
|
+
|
|
54
|
+
The package version tracks the newest API version this content documents (e.g. `2.11.x`
|
|
55
|
+
documents the v2.11 API). Pin an exact version in server deployments so docs are
|
|
56
|
+
deterministic.
|
|
57
|
+
|
|
58
|
+
## Contributing
|
|
59
|
+
|
|
60
|
+
Guides, spec, and the routing manifest are edited in the public
|
|
61
|
+
[`developer-docs` repository](https://github.com/lunch-money/developer-docs) — see its
|
|
62
|
+
README for how to add or move a page. This npm package is a published build of that
|
|
63
|
+
content.
|
|
64
|
+
|
|
65
|
+
_ISC licensed._
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Version-Independent Documentation
|
|
2
|
+
|
|
3
|
+
This directory contains documentation that applies across all API versions.
|
|
4
|
+
|
|
5
|
+
## Current Documents
|
|
6
|
+
|
|
7
|
+
- `pagination.md` - Pagination guidelines
|
|
8
|
+
- (To be added) Other version-independent documentation
|
|
9
|
+
|
|
10
|
+
## Version-Specific Documentation
|
|
11
|
+
|
|
12
|
+
Version-specific documentation is located in:
|
|
13
|
+
- `v2/docs/` - Version 2 API documentation
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Amounts & Balances
|
|
2
|
+
|
|
3
|
+
The Lunch Money API uses four properties — `amount`, `balance`, `currency`, and `to_base` — consistently across all objects that deal with money. Understanding how they work will help you build accurate, multi-currency-aware integrations.
|
|
4
|
+
|
|
5
|
+
## `amount`
|
|
6
|
+
|
|
7
|
+
`amount` is a string representation of a monetary value, precise to up to four decimal places. It appears on transactions, child transactions, recurring items, budget objects, and rollover pool adjustments.
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
"amount": "12.5000"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`amount` is always expressed in the currency specified by the companion `currency` property on the same object. Amounts are never rounded or converted.
|
|
14
|
+
|
|
15
|
+
## `balance`
|
|
16
|
+
|
|
17
|
+
`balance` is a string representation of an account's running balance, also precise to up to four decimal places. It appears on manual accounts, Plaid accounts, crypto accounts, and balance history entries.
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
"balance": "1500.0000"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Like `amount`, `balance` is always in the `currency` of the same object and follows the same sign convention.
|
|
24
|
+
|
|
25
|
+
## `currency`
|
|
26
|
+
|
|
27
|
+
`currency` is an ISO 4217 currency code (e.g., `"usd"`, `"eur"`, `"gbp"`). It is present on every object that carries an `amount` or `balance` and tells you what currency those values are in. See the [Supported Currencies guide](/v2/currencies) for the full list.
|
|
28
|
+
|
|
29
|
+
## `to_base`
|
|
30
|
+
|
|
31
|
+
`to_base` is a floating-point number that represents the `amount` or `balance` converted to the user's **primary currency**. It is present on transactions, account objects, balance history entries, budget objects, and summary responses.
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
"amount": "12.5000",
|
|
35
|
+
"currency": "eur",
|
|
36
|
+
"to_base": 13.62
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`to_base` is calculated by the API at response time and is **read-only** — it is never accepted on `POST` or `PUT` requests.
|
|
40
|
+
|
|
41
|
+
`to_base` is the recommended property to use when you need to:
|
|
42
|
+
- Display amounts and balances in a single consistent currency across a multi-currency account
|
|
43
|
+
- Perform arithmetic across transactions or accounts in different currencies
|
|
44
|
+
|
|
45
|
+
## Sign Convention
|
|
46
|
+
|
|
47
|
+
### Transaction amounts
|
|
48
|
+
|
|
49
|
+
For `amount` and `to_base` on transaction objects, the API uses standard accounting convention (the bank ledger perspective):
|
|
50
|
+
|
|
51
|
+
| Value | Meaning |
|
|
52
|
+
|-------|---------|
|
|
53
|
+
| **Positive** | Money going **out** — debits, expenses |
|
|
54
|
+
| **Negative** | Money coming **in** — credits, income |
|
|
55
|
+
|
|
56
|
+
For example:
|
|
57
|
+
|
|
58
|
+
- A $5 coffee purchase has `"amount": "5.0000"`
|
|
59
|
+
- A $1,200 paycheck deposit has `"amount": "-1200.0000"`
|
|
60
|
+
|
|
61
|
+
### Account balances
|
|
62
|
+
|
|
63
|
+
For `balance` on account objects (manual accounts, Plaid accounts, crypto), the sign reflects the account's current standing from the institution's perspective. Positive is the normal direction for both asset and liability accounts:
|
|
64
|
+
|
|
65
|
+
- A savings account with $5,000 has `"balance": "5000.0000"` — positive, you hold that amount
|
|
66
|
+
- A credit card with $800 owed has `"balance": "800.0000"` — positive, you owe that amount
|
|
67
|
+
|
|
68
|
+
A negative balance indicates the reversed state for that account type:
|
|
69
|
+
|
|
70
|
+
- A savings account in overdraft has a negative `balance`
|
|
71
|
+
- A credit card where the issuer owes you money (e.g., after a refund or overpayment) has a negative `balance`
|
|
72
|
+
|
|
73
|
+
> [!NOTE] App Display Setting
|
|
74
|
+
> The Lunch Money app has a setting — **"Show Debits as Negative, Credits as Positive"** — that can flip how amounts are displayed in the UI. This setting is exposed in the API as `debits_as_negative` on the User object. **It has no effect on the API.** The API always returns positive values for debits and negative values for credits regardless of this setting. Apps may read `debits_as_negative` to match the user's preferred display format when showing amounts in their own UI.
|
|
75
|
+
|
|
76
|
+
## Exception: Budget and Summary Amounts
|
|
77
|
+
|
|
78
|
+
Budget objects and summary response objects don't use the transaction sign convention. Direction is conveyed by the **structure of the response** rather than the sign of the value — amounts are always positive magnitudes, and the object type or category flag tells you whether that activity is income or expense.
|
|
79
|
+
|
|
80
|
+
- **Budget objects**: `amount` is the positive budgeted value for a category. Whether that represents an income or expense budget is determined by the linked category's `is_income` flag.
|
|
81
|
+
- **Summary category totals**: fields like `other_activity` and `recurring_activity` are always positive. The associated category's `is_income` flag tells you which direction the activity flows.
|
|
82
|
+
- **Summary top-level totals**: activity is split into separate `inflow` and `outflow` objects, each containing positive magnitudes — so direction is explicit in the structure.
|
|
83
|
+
|
|
84
|
+
> [!TIP]
|
|
85
|
+
> When reading amounts from budget or summary objects, treat all values as positive magnitudes. Check the category's `is_income` flag or the parent object (`inflow` vs `outflow`) to determine the direction of the activity.
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
# Supported Currencies
|
|
2
|
+
|
|
3
|
+
Lunch Money supports a wide range of currencies for transactions and accounts. All currency values in the API use three-letter lowercase currency codes in ISO 4217 format.
|
|
4
|
+
|
|
5
|
+
## Currency Code Format
|
|
6
|
+
|
|
7
|
+
Currency codes must be:
|
|
8
|
+
- Three letters
|
|
9
|
+
- Lowercase
|
|
10
|
+
- Valid ISO 4217 currency codes
|
|
11
|
+
|
|
12
|
+
## Supported Currencies
|
|
13
|
+
|
|
14
|
+
The following currencies are currently supported in Lunch Money:
|
|
15
|
+
|
|
16
|
+
| Code | Currency |
|
|
17
|
+
|------|----------|
|
|
18
|
+
| `aed` | United Arab Emirates Dirham |
|
|
19
|
+
| `afn` | Afghan Afghani |
|
|
20
|
+
| `all` | Albanian Lek |
|
|
21
|
+
| `amd` | Armenian Dram |
|
|
22
|
+
| `ang` | Netherlands Antillean Guilder |
|
|
23
|
+
| `aoa` | Angolan Kwanza |
|
|
24
|
+
| `ars` | Argentine Peso |
|
|
25
|
+
| `aud` | Australian Dollar |
|
|
26
|
+
| `awg` | Aruban Florin |
|
|
27
|
+
| `azn` | Azerbaijani Manat |
|
|
28
|
+
| `bam` | Bosnia-Herzegovina Convertible Mark |
|
|
29
|
+
| `bbd` | Barbadian Dollar |
|
|
30
|
+
| `bdt` | Bangladeshi Taka |
|
|
31
|
+
| `bgn` | Bulgarian Lev |
|
|
32
|
+
| `bhd` | Bahraini Dinar |
|
|
33
|
+
| `bif` | Burundian Franc |
|
|
34
|
+
| `bmd` | Bermudian Dollar |
|
|
35
|
+
| `bnd` | Brunei Dollar |
|
|
36
|
+
| `bob` | Bolivian Boliviano |
|
|
37
|
+
| `brl` | Brazilian Real |
|
|
38
|
+
| `bsd` | Bahamian Dollar |
|
|
39
|
+
| `btc` | Bitcoin |
|
|
40
|
+
| `btn` | Bhutanese Ngultrum |
|
|
41
|
+
| `bwp` | Botswanan Pula |
|
|
42
|
+
| `byn` | Belarusian Ruble |
|
|
43
|
+
| `bzd` | Belize Dollar |
|
|
44
|
+
| `cad` | Canadian Dollar |
|
|
45
|
+
| `cdf` | Congolese Franc |
|
|
46
|
+
| `chf` | Swiss Franc |
|
|
47
|
+
| `clf` | Chilean Unit of Account (UF) |
|
|
48
|
+
| `clp` | Chilean Peso |
|
|
49
|
+
| `cny` | Chinese Yuan |
|
|
50
|
+
| `cop` | Colombian Peso |
|
|
51
|
+
| `crc` | Costa Rican Colón |
|
|
52
|
+
| `cuc` | Cuban Convertible Peso |
|
|
53
|
+
| `cup` | Cuban Peso |
|
|
54
|
+
| `cve` | Cape Verdean Escudo |
|
|
55
|
+
| `czk` | Czech Republic Koruna |
|
|
56
|
+
| `djf` | Djiboutian Franc |
|
|
57
|
+
| `dkk` | Danish Krone |
|
|
58
|
+
| `dop` | Dominican Peso |
|
|
59
|
+
| `dzd` | Algerian Dinar |
|
|
60
|
+
| `egp` | Egyptian Pound |
|
|
61
|
+
| `ern` | Eritrean Nakfa |
|
|
62
|
+
| `etb` | Ethiopian Birr |
|
|
63
|
+
| `eth` | Ethereum |
|
|
64
|
+
| `eur` | Euro |
|
|
65
|
+
| `fjd` | Fijian Dollar |
|
|
66
|
+
| `fkp` | Falkland Islands Pound |
|
|
67
|
+
| `gbp` | British Pound Sterling |
|
|
68
|
+
| `gel` | Georgian Lari |
|
|
69
|
+
| `ggp` | Guernsey Pound |
|
|
70
|
+
| `ghs` | Ghanaian Cedi |
|
|
71
|
+
| `gip` | Gibraltar Pound |
|
|
72
|
+
| `gmd` | Gambian Dalasi |
|
|
73
|
+
| `gnf` | Guinean Franc |
|
|
74
|
+
| `gtq` | Guatemalan Quetzal |
|
|
75
|
+
| `gyd` | Guyanaese Dollar |
|
|
76
|
+
| `hkd` | Hong Kong Dollar |
|
|
77
|
+
| `hnl` | Honduran Lempira |
|
|
78
|
+
| `hrk` | Croatian Kuna |
|
|
79
|
+
| `htg` | Haitian Gourde |
|
|
80
|
+
| `huf` | Hungarian Forint |
|
|
81
|
+
| `idr` | Indonesian Rupiah |
|
|
82
|
+
| `ils` | Israeli New Sheqel |
|
|
83
|
+
| `imp` | Isle of Man Pound |
|
|
84
|
+
| `inr` | Indian Rupee |
|
|
85
|
+
| `iqd` | Iraqi Dinar |
|
|
86
|
+
| `irr` | Iranian Rial |
|
|
87
|
+
| `isk` | Icelandic Króna |
|
|
88
|
+
| `jep` | Jersey Pound |
|
|
89
|
+
| `jmd` | Jamaican Dollar |
|
|
90
|
+
| `jod` | Jordanian Dinar |
|
|
91
|
+
| `jpy` | Japanese Yen |
|
|
92
|
+
| `kes` | Kenyan Shilling |
|
|
93
|
+
| `kgs` | Kyrgystani Som |
|
|
94
|
+
| `khr` | Cambodian Riel |
|
|
95
|
+
| `kmf` | Comorian Franc |
|
|
96
|
+
| `kpw` | North Korean Won |
|
|
97
|
+
| `krw` | South Korean Won |
|
|
98
|
+
| `kwd` | Kuwaiti Dinar |
|
|
99
|
+
| `kyd` | Cayman Islands Dollar |
|
|
100
|
+
| `kzt` | Kazakhstani Tenge |
|
|
101
|
+
| `lak` | Laotian Kip |
|
|
102
|
+
| `lbp` | Lebanese Pound |
|
|
103
|
+
| `lkr` | Sri Lankan Rupee |
|
|
104
|
+
| `lrd` | Liberian Dollar |
|
|
105
|
+
| `lsl` | Lesotho Loti |
|
|
106
|
+
| `ltl` | Lithuanian Litas |
|
|
107
|
+
| `lvl` | Latvian Lats |
|
|
108
|
+
| `lyd` | Libyan Dinar |
|
|
109
|
+
| `mad` | Moroccan Dirham |
|
|
110
|
+
| `mdl` | Moldovan Leu |
|
|
111
|
+
| `mga` | Malagasy Ariary |
|
|
112
|
+
| `mkd` | Macedonian Denar |
|
|
113
|
+
| `mmk` | Myanma Kyat |
|
|
114
|
+
| `mnt` | Mongolian Tugrik |
|
|
115
|
+
| `mop` | Macanese Pataca |
|
|
116
|
+
| `mro` | Mauritanian Ouguiya |
|
|
117
|
+
| `mur` | Mauritian Rupee |
|
|
118
|
+
| `mvr` | Maldivian Rufiyaa |
|
|
119
|
+
| `mwk` | Malawian Kwacha |
|
|
120
|
+
| `mxn` | Mexican Peso |
|
|
121
|
+
| `myr` | Malaysian Ringgit |
|
|
122
|
+
| `mzn` | Mozambican Metical |
|
|
123
|
+
| `nad` | Namibian Dollar |
|
|
124
|
+
| `ngn` | Nigerian Naira |
|
|
125
|
+
| `nio` | Nicaraguan Córdoba |
|
|
126
|
+
| `nok` | Norwegian Krone |
|
|
127
|
+
| `npr` | Nepalese Rupee |
|
|
128
|
+
| `nzd` | New Zealand Dollar |
|
|
129
|
+
| `omr` | Omani Rial |
|
|
130
|
+
| `pab` | Panamanian Balboa |
|
|
131
|
+
| `pen` | Peruvian Nuevo Sol |
|
|
132
|
+
| `pgk` | Papua New Guinean Kina |
|
|
133
|
+
| `php` | Philippine Peso |
|
|
134
|
+
| `pkr` | Pakistani Rupee |
|
|
135
|
+
| `pln` | Polish Zloty |
|
|
136
|
+
| `pyg` | Paraguayan Guarani |
|
|
137
|
+
| `qar` | Qatari Rial |
|
|
138
|
+
| `ron` | Romanian Leu |
|
|
139
|
+
| `rsd` | Serbian Dinar |
|
|
140
|
+
| `rub` | Russian Ruble |
|
|
141
|
+
| `rwf` | Rwandan Franc |
|
|
142
|
+
| `sar` | Saudi Riyal |
|
|
143
|
+
| `sbd` | Solomon Islands Dollar |
|
|
144
|
+
| `scr` | Seychellois Rupee |
|
|
145
|
+
| `sdg` | Sudanese Pound |
|
|
146
|
+
| `sek` | Swedish Krona |
|
|
147
|
+
| `sgd` | Singapore Dollar |
|
|
148
|
+
| `shp` | Saint Helena Pound |
|
|
149
|
+
| `sll` | Sierra Leonean Leone |
|
|
150
|
+
| `sos` | Somali Shilling |
|
|
151
|
+
| `srd` | Surinamese Dollar |
|
|
152
|
+
| `std` | São Tomé and Príncipe Dobra |
|
|
153
|
+
| `svc` | Salvadoran Colón |
|
|
154
|
+
| `syp` | Syrian Pound |
|
|
155
|
+
| `szl` | Swazi Lilangeni |
|
|
156
|
+
| `thb` | Thai Baht |
|
|
157
|
+
| `tjs` | Tajikistani Somoni |
|
|
158
|
+
| `tmt` | Turkmenistani Manat |
|
|
159
|
+
| `tnd` | Tunisian Dinar |
|
|
160
|
+
| `top` | Tongan Paʻanga |
|
|
161
|
+
| `try` | Turkish Lira |
|
|
162
|
+
| `ttd` | Trinidad and Tobago Dollar |
|
|
163
|
+
| `twd` | New Taiwan Dollar |
|
|
164
|
+
| `tzs` | Tanzanian Shilling |
|
|
165
|
+
| `uah` | Ukrainian Hryvnia |
|
|
166
|
+
| `ugx` | Ugandan Shilling |
|
|
167
|
+
| `usd` | United States Dollar |
|
|
168
|
+
| `uyu` | Uruguayan Peso |
|
|
169
|
+
| `uzs` | Uzbekistan Som |
|
|
170
|
+
| `vef` | Venezuelan Bolívar |
|
|
171
|
+
| `ves` | Venezuelan Bolívar Sotiemas |
|
|
172
|
+
| `vnd` | Vietnamese Dong |
|
|
173
|
+
| `vuv` | Vanuatu Vatu |
|
|
174
|
+
| `wst` | Samoan Tala |
|
|
175
|
+
| `xaf` | CFA Franc BEAC |
|
|
176
|
+
| `xag` | Silver (troy ounce) |
|
|
177
|
+
| `xau` | Gold (troy ounce) |
|
|
178
|
+
| `xcd` | East Caribbean Dollar |
|
|
179
|
+
| `xof` | CFA Franc BCEAO |
|
|
180
|
+
| `xpf` | CFP Franc |
|
|
181
|
+
| `yer` | Yemeni Rial |
|
|
182
|
+
| `zar` | South African Rand |
|
|
183
|
+
| `zmw` | Zambian Kwacha |
|
|
184
|
+
| `zwl` | Zimbabwean Dollar |
|
|
185
|
+
|
|
186
|
+
## Using Currencies in the API
|
|
187
|
+
|
|
188
|
+
When creating or updating transactions, accounts, or other resources that include currency information, use the three-letter lowercase currency code:
|
|
189
|
+
|
|
190
|
+
:::tabs
|
|
191
|
+
@tab JavaScript/Node.js
|
|
192
|
+
```javascript
|
|
193
|
+
// Create a transaction with a specific currency
|
|
194
|
+
const transaction = {
|
|
195
|
+
date: "2024-01-15",
|
|
196
|
+
amount: "100.50",
|
|
197
|
+
currency: "eur", // Euro
|
|
198
|
+
payee: "Coffee Shop",
|
|
199
|
+
category_id: 83
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
const response = await fetch('https://api.lunchmoney.dev/v2/transactions', {
|
|
203
|
+
method: 'POST',
|
|
204
|
+
headers: {
|
|
205
|
+
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
|
|
206
|
+
'Content-Type': 'application/json'
|
|
207
|
+
},
|
|
208
|
+
body: JSON.stringify(transaction)
|
|
209
|
+
});
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
@tab Python
|
|
213
|
+
```python
|
|
214
|
+
import requests
|
|
215
|
+
|
|
216
|
+
# Create a transaction with a specific currency
|
|
217
|
+
transaction = {
|
|
218
|
+
"date": "2024-01-15",
|
|
219
|
+
"amount": "100.50",
|
|
220
|
+
"currency": "eur", # Euro
|
|
221
|
+
"payee": "Coffee Shop",
|
|
222
|
+
"category_id": 83
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
response = requests.post(
|
|
226
|
+
'https://api.lunchmoney.dev/v2/transactions',
|
|
227
|
+
headers={
|
|
228
|
+
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
|
|
229
|
+
'Content-Type': 'application/json'
|
|
230
|
+
},
|
|
231
|
+
json=transaction
|
|
232
|
+
)
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
@tab cURL
|
|
236
|
+
```bash
|
|
237
|
+
curl -X POST 'https://api.lunchmoney.dev/v2/transactions' \
|
|
238
|
+
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
|
|
239
|
+
-H 'Content-Type: application/json' \
|
|
240
|
+
-d '{
|
|
241
|
+
"date": "2024-01-15",
|
|
242
|
+
"amount": "100.50",
|
|
243
|
+
"currency": "eur",
|
|
244
|
+
"payee": "Coffee Shop",
|
|
245
|
+
"category_id": 83
|
|
246
|
+
}'
|
|
247
|
+
```
|
|
248
|
+
:::
|
|
249
|
+
|
|
250
|
+
## Default Currency
|
|
251
|
+
|
|
252
|
+
If you don't specify a currency when creating a transaction or account, Lunch Money will default to your account's primary currency. You can check your primary currency by calling the `GET /v2/me` endpoint.
|
|
253
|
+
|
|
254
|
+
## Currency Validation
|
|
255
|
+
|
|
256
|
+
The API validates that currency codes match the supported list. If you provide an unsupported currency code, you'll receive a validation error:
|
|
257
|
+
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"message": "Request Validation Failure",
|
|
261
|
+
"errors": [
|
|
262
|
+
{
|
|
263
|
+
"errMsg": "Invalid currency code",
|
|
264
|
+
"instancePath": "/currency",
|
|
265
|
+
"schemaPath": "#/properties/currency/enum"
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Requesting New Currencies
|
|
272
|
+
|
|
273
|
+
If your currency is missing from the supported list, please let us know via email at [support@lunchmoney.app](mailto:support@lunchmoney.app) and we'll work on getting it added.
|
|
274
|
+
|
|
275
|
+
> [!NOTE] Currency Support
|
|
276
|
+
> Currency support is continuously expanding. If you need a currency that's not currently listed, reach out to our support team and we'll prioritize adding it.
|
|
277
|
+
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Getting Started with the API
|
|
2
|
+
|
|
3
|
+
Welcome to the Lunch Money developer API! This API has enabled the Lunch Money user community to build a broad set of tools and plug-ins to complement their Lunch Money experience and help other users. This guide will help you get started using the Lunch Money API.
|
|
4
|
+
|
|
5
|
+
Most users interact with their Lunch Money data using the official web or mobile app. Making API calls is another way to interact with your Lunch Money data. You can make API calls that **get** your data for you, allowing you to do other things with it, like generating your own charts or simply archiving your data. You can also make API calls that **change** or **delete** your data. Any changes you make are permanent, just like they would be if you made changes using the web or mobile app.
|
|
6
|
+
|
|
7
|
+
> [!WARNING]
|
|
8
|
+
> Changes made via the API are permanent and cannot be undone!<br> Always use a test budget when getting started.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Create a Test Budgeting Account
|
|
12
|
+
|
|
13
|
+
Since changes to your data made by the API are permanent, the best way to begin interacting with the API is to <a href="https://support.lunchmoney.app/miscellaneous/unlimited-budgeting-accounts" target="_blank" rel="noopener noreferrer">create a new test budgeting account</a> in your existing Lunch Money account. As you start using the API, you can interact with this test account and ensure that your real data is not modified.
|
|
14
|
+
|
|
15
|
+
:::tabs
|
|
16
|
+
|
|
17
|
+
@tab 1. Open the Budgets Window
|
|
18
|
+
Click on the green circle in the upper right hand corner in the Lunch Money Web App
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
@tab 2. Create a New Budget
|
|
22
|
+
Click on the "Create a New Budget Account" link and give your new budget a name like "API Test Budget"
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
@tab 3. Add Test Data
|
|
26
|
+
Choose the option to "Set up Demo". This will add categories, accounts, tags and several months worth of transactions to your new budget.
|
|
27
|
+

|
|
28
|
+
:::
|
|
29
|
+
|
|
30
|
+
## Getting an access token
|
|
31
|
+
|
|
32
|
+
Lunch Money API requests are authenticated using the Bearer Token authentication method. In plain English, this means that you will pass a token associated with your budgeting account to Lunch Money. This is so we know which account to operate on and that the request came from someone who can access that account.
|
|
33
|
+
|
|
34
|
+
:::tabs
|
|
35
|
+
|
|
36
|
+
@tab 1. Go to the Developers Page
|
|
37
|
+
|
|
38
|
+
Navigate to <a href="https://my.lunchmoney.app/developers" target="_blank" rel="noopener noreferrer">the developers page in the Lunch Money web app</a>. Look at the green circle in the upper right hand corner and make sure that it is showing the test account that you just created. If you aren't sure which account is active, you can click on the green circle to bring up the "Switch Accounts" dialog. This will show you the full names of all the accounts associated with your account. Select the test budgeting account you created.
|
|
39
|
+

|
|
40
|
+
|
|
41
|
+
@tab 2. Request Access Token
|
|
42
|
+
In the upper right hand corner of the page, give your access token a label and specify what you are using it for. When you're done, hit the "Request Access Token" button.
|
|
43
|
+

|
|
44
|
+
|
|
45
|
+
@tab 3. Save Access Token
|
|
46
|
+
After you do this, the web page will show you a long alphanumeric string. This is your access token. Hit the copy button and save this token somewhere safe. It is only shown to you when you create it.
|
|
47
|
+
:::
|
|
48
|
+
|
|
49
|
+
Congratulations! You've got an access token and are ready to make an API request! Later, when you are more comfortable with the API, you can repeat this process to create a new access token associated with your real budget.
|
|
50
|
+
|
|
51
|
+
> [!WARNING]
|
|
52
|
+
> Treat your access tokens like passwords.<br>Don't share them with anyone that you don't trust.
|
|
53
|
+
|
|
54
|
+
If you ever worry that your access token has been compromised, you can always come back to the Developers page and hit the Revoke button.
|
|
55
|
+
|
|
56
|
+
> [!NOTE]
|
|
57
|
+
> Give your access tokens descriptive names so you can easily identify and revoke them later if needed.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## Using your access token
|
|
61
|
+
|
|
62
|
+
When you start to write code that makes API calls, you will need to include this token in each request using an Authorization header. Here is an example curl request:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
curl --location 'https://api.lunchmoney.dev/v2/me' \
|
|
66
|
+
--header 'Authorization: Bearer <YOUR_ACCESS_TOKEN>'
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
If this doesn't make sense yet, that's OK!
|
|
70
|
+
|
|
71
|
+
There is an easier way to use your access token to make requests. Head over to the [API Reference Documentation](/v2/docs).
|
|
72
|
+
|
|
73
|
+
:::tabs
|
|
74
|
+
|
|
75
|
+
@tab 1. Supply Your Token
|
|
76
|
+
Paste your new token into the box that says "Bearer Token" in the server configuration in the upper right hand corner.
|
|
77
|
+

|
|
78
|
+
|
|
79
|
+
@tab 2. Make a Test Request
|
|
80
|
+
Scroll down to the section called "Get Current User" and hit the "Test Request" button.
|
|
81
|
+

|
|
82
|
+
:::
|
|
83
|
+
|
|
84
|
+
This will pop up a dialog box that you can use to send an API request. This is a simple endpoint, so just hit the "Send" button. You should see a response that includes your name and the name of your test budget.
|
|
85
|
+
|
|
86
|
+
From here, you can explore the rest of the Lunch Money API and start thinking about what you might do with it.
|
|
87
|
+
|
|
88
|
+
## What Can You Build?
|
|
89
|
+
|
|
90
|
+
The Lunch Money community has already built a wide variety of tools — automations, importers, dashboards, and more. Check out the <a href="https://lunchmoney.app/developers#community-projects" target="_blank" rel="noopener noreferrer">Developer Tools & Community Projects</a> list for inspiration, or drop by the <a href="https://discord.com/channels/842337014556262411/1134597088504729780" target="_blank" rel="noopener noreferrer">Show and Tell channel</a> on Discord to see what others are sharing.
|
|
91
|
+
|
|
92
|
+
> [!NOTE]
|
|
93
|
+
> Built something with the API? Let us know and we'll add it to the list!
|
|
94
|
+
|
|
95
|
+
## I still need help!
|
|
96
|
+
|
|
97
|
+
If you still aren't sure how to get started, we have other resources to help.
|
|
98
|
+
|
|
99
|
+
A great way to find get unstuck is to <a href="https://lunchmoney.app/discord" target="_blank" rel="noopener noreferrer">join the Lunch Money community on Discord</a> and send a question in the <a href="https://discord.com/channels/842337014556262411/1134594318414389258" target="_blank" rel="noopener noreferrer">Developer API Channel</a>.
|
|
100
|
+
|
|
101
|
+
You can also [email our developer advocate](mailto:jp@lunchmoney.app) to get help as well.
|
|
102
|
+
|
|
103
|
+
> [!NOTE]
|
|
104
|
+
>These are also great channels to provide feedback! Our v2 API was built based on feedback from our developer community. Your ideas might help us make them even better, so please don't hesitate to reach out.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Lunch Money Developer Docs
|
|
2
|
+
|
|
3
|
+
Welcome to the Lunch Money developer documentation. This site covers the **v2 API** — the current generation of the Lunch Money API — along with guides, a reference for the legacy v1 API, and tools for exploring the API without touching real data.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
The v2 API is available at:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
https://api.lunchmoney.dev/v2
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Get your access token from the <a href="https://my.lunchmoney.app/developers" target="_blank" rel="noopener noreferrer">Lunch Money app developers page</a> and include it as a Bearer token in every request:
|
|
14
|
+
|
|
15
|
+
```http
|
|
16
|
+
Authorization: Bearer YOUR_ACCESS_TOKEN
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
See the [Getting Started guide](/v2/getting-started) for a full walkthrough, including how to create a test budget and make your first request.
|
|
20
|
+
|
|
21
|
+
## Trying the API Without Real Data
|
|
22
|
+
|
|
23
|
+
The <a href="/v2/docs">interactive API reference</a> lets you make live API requests directly from the documentation — including a **static mock server** you can use to explore the API without an access token or any risk to real data.
|
|
24
|
+
|
|
25
|
+
:::tabs
|
|
26
|
+
|
|
27
|
+
@tab 1. Select the Mock Server
|
|
28
|
+
Open the <a href="/v2/docs">API Reference</a> and click the **Server** dropdown near the top of the page. Select **`https://mock.lunchmoney.dev/v2`**.
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
@tab 2. Enter Any Bearer Token
|
|
32
|
+
Set your Bearer Token to any string of **11 or more characters** — no real token needed. You can enter it in the server panel that appears after selecting the mock server, or inside any endpoint's Authentication section.
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
:::
|
|
36
|
+
|
|
37
|
+
## Client Libraries & SDKs
|
|
38
|
+
|
|
39
|
+
An official **TypeScript SDK** is available:
|
|
40
|
+
- NPM: <a href="https://www.npmjs.com/package/@lunch-money/v2-api-spec" target="_blank" rel="noopener noreferrer">`@lunch-money/v2-api-spec`</a>
|
|
41
|
+
- GitHub: <a href="https://github.com/lunch-money/lunch-money-js-v2" target="_blank" rel="noopener noreferrer">lunch-money/lunch-money-js-v2</a>
|
|
42
|
+
|
|
43
|
+
Looking for a Python SDK or a client in another language? The <a href="https://github.com/juftin/lunchmoney-clients" target="_blank" rel="noopener noreferrer">lunchmoney-clients</a> project provides a Python SDK and can generate clients for other languages from the OpenAPI spec.
|
|
44
|
+
|
|
45
|
+
## Migrating from v1
|
|
46
|
+
|
|
47
|
+
The v2 API is **not backwards compatible** with v1. See the [Migration Guide](/v2/migration-guide) to understand what changed and plan your migration.
|
|
48
|
+
|
|
49
|
+
The v1 API remains available at `https://api.lunchmoney.dev/v1` and its documentation is available [here](/v2/v1/changelog). New projects should use v2.
|
|
50
|
+
|
|
51
|
+
## Acknowledgments
|
|
52
|
+
|
|
53
|
+
If you provided feedback during the API design process — **thank you**. We built this based on what the community asked for.
|
|
54
|
+
|
|
55
|
+
Join the conversation in the <a href="https://lunchmoney.app/discord" target="_blank" rel="noopener noreferrer">Lunch Money Discord</a> in the **#developer-api** channel.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
**Useful links:**
|
|
60
|
+
- <a href="/v2/docs">Interactive API Reference</a>
|
|
61
|
+
- [Getting Started Guide](/v2/getting-started)
|
|
62
|
+
- <a href="https://github.com/lunch-money/awesome-lunchmoney" target="_blank" rel="noopener noreferrer">Awesome Lunch Money Projects</a>
|
|
63
|
+
- [Contact: devsupport@lunchmoney.app](mailto:devsupport@lunchmoney.app)
|