@lunch-money/v2-api-spec 2.8.2 → 2.8.3

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.
@@ -3,16 +3,22 @@ info:
3
3
  title: Lunch Money API - v2
4
4
  description: |-
5
5
  ## Overview
6
- Welcome to the Lunch Money v2 API.
6
+ Welcome to the documentation for the "next version" of the Lunch Money v2 API. This documentation includes proposed updates to the API design that have not yet been released. <br><br>
7
+ This documentation is for the **v2.8.3** release of the API. <br>
8
+ The latest implementation of the spec is for the **v2.8.1** release and can be found [here](https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2/). <br><br>
9
+ Feedback on any of the API design is welcome, but we are particularly interested in getting feedback on most recent changes in the [version history](https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2/version-history).
10
+
11
+ ------------------------------------------------------------------------------------------------
12
+ Welcome the Lunch Money v2 API.
7
13
 
8
14
  A working version of this API is now available through these docs, or directly at:
9
15
 
10
- `https://alpha.lunchmoney.dev/v2`
16
+ `https://api.lunchmoney.dev/v2`
11
17
 
12
- **This service has only had internal testing so users are strongly encouraged to create a test budget with example data as the first step to interacting with the v2 API.**
13
- See the [Getting Started Guide](https://alpha.lunchmoney.dev/v2/getting-started) for more information.
18
+ **This service has only had limited external testing so users are strongly encouraged to create a test budget with example data as the first step to interacting with the v2 API.**
19
+ See the [Getting Started Guide](https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2/getting-started) for more information.
14
20
 
15
- If you are new to the v2 API, you may wish to review the [v2 API Overview of Changes](https://alpha.lunchmoney.dev/v2/migration-guide).
21
+ If you are new to the v2 API, you may wish to review the [v2 API Overview of Changes](https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2/changelog).
16
22
 
17
23
  ### Static Mock Server
18
24
 
@@ -23,17 +29,17 @@ info:
23
29
 
24
30
  ### Migrating from V1
25
31
 
26
- The v2 API is NOT backwards compatible with the v1 API. Developers are encouraged to review the [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) to understand the changes and plan their migration.
32
+ The v2 API is NOT backwards compatible with the v1 API. Developers are encouraged to review the [Migration Guide](https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2/migration-guide) to understand the changes and plan their migration.
27
33
 
28
34
  ### Acknowledgments
29
35
 
30
36
  If you have been providing feedback on the API during our iterative design process, **THANK YOU**. We are happy to provide the opportunity to finally interact with the working API that was built based on your feedback.
31
37
 
32
38
  ### Useful links:
33
- - [Getting Started](https://alpha.lunchmoney.dev/v2/getting-started)
34
- - [v2 API Changelog](https://alpha.lunchmoney.dev/v2/changelog)
35
- - [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide)
36
- - [Rate Limits](https://alpha.lunchmoney.dev/v2/rate-limits)
39
+ - [Getting Started](https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2/getting-started)
40
+ - [v2 API Changelog](https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2/changelog)
41
+ - [Migration Guide](https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2/migration-guide)
42
+ - [Rate Limits](https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2/rate-limits)
37
43
  - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev)
38
44
  - [Awesome Lunch Money Projects](https://github.com/lunch-money/awesome-lunchmoney?tab=readme-ov-file)
39
45
  termsOfService: https://lunchmoney.dev/#current-status
@@ -42,12 +48,12 @@ info:
42
48
  license:
43
49
  name: Apache 2.0
44
50
  url: http://www.apache.org/licenses/LICENSE-2.0.html
45
- version: 2.8.2
51
+ version: 2.8.3
46
52
 
47
53
  servers:
48
54
  - url: https://api.lunchmoney.dev/v2
49
55
  description: v2 Lunch Money API Server - modifies real data!
50
- - url: https://alpha.lunchmoney.dev/v2
56
+ - url: https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2
51
57
  description: Static Mock v2 Lunch Money API Server
52
58
 
53
59
  tags:
@@ -1144,7 +1150,7 @@ components:
1144
1150
  Positive values indicate a debit transaction, negative values indicate a credit transaction.
1145
1151
  currency:
1146
1152
  description: Three-letter lowercase currency code of the transaction in ISO 4217
1147
- format. Must match one of the [supported currencies](). If not set
1153
+ format. Must match one of the [supported currencies](https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2/currencies). If not set
1148
1154
  defaults to the user account's primary currency.
1149
1155
  allOf:
1150
1156
  - $ref: "#/components/schemas/currencyEnum"
@@ -5191,22 +5197,22 @@ paths:
5191
5197
  schema:
5192
5198
  type: integer
5193
5199
  minimum: 1
5194
- maximum: 1000
5195
- default: 100
5200
+ maximum: 2000
5201
+ default: 1000
5196
5202
  description: Sets the maximum number of transactions to return. If more match
5197
5203
  the filter criteria, the response will include a `has_more`
5198
- attribute set to `true`. See [pagination](foo)
5204
+ attribute set to `true`. See [Pagination](https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2/pagination)
5199
5205
  - name: offset
5200
5206
  in: query
5201
5207
  schema:
5202
5208
  type: integer
5203
5209
  description: Sets the offset for the records returned. This is typically set
5204
- automatically in the header. See [Pagination](/foo)
5210
+ automatically in the header. See [Pagination](https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2/pagination)
5205
5211
  responses:
5206
5212
  "200":
5207
5213
  description: Returns an array of transactions. <br><br>The `has_more` property
5208
5214
  is set to `true` if more transactions are available. See
5209
- [Pagination](/foo)
5215
+ [Pagination](https://lm-v2-api-next-a7fabcab8e9a.herokuapp.com/v2/pagination)
5210
5216
  content:
5211
5217
  application/json:
5212
5218
  schema:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunch-money/v2-api-spec",
3
- "version": "2.8.2",
3
+ "version": "2.8.3",
4
4
  "description": "OpenAPI specification and version history for the Lunch Money v2 API",
5
5
  "main": "lunch-money-api-v2.yaml",
6
6
  "files": [
package/update-urls.sh CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/bin/bash
2
2
 
3
3
  # Script to update URLs in the OpenAPI specification file
4
- # This is useful for switching between local development and production URLs
4
+ # This is useful for switching the docs/mock server URL between local development and production
5
+ # Note: All references to DOCS_DEPLOY_URL throughout the file are toggled; the API server URL remains unchanged
5
6
  #
6
7
  # Usage:
7
8
  # # In git repo:
@@ -11,25 +12,24 @@
11
12
  # ./update-urls.sh --local|--production
12
13
  #
13
14
  # Flags:
14
- # --local Switch URLs to local development (http://localhost:3000/v2)
15
- # --production Switch URLs to production deployment URLs
15
+ # --local Switch docs/mock server URL to local development (http://localhost:3000/v2)
16
+ # --production Switch docs/mock server URL to production deployment URL
16
17
  #
17
18
  # Environment variables (optional, with defaults):
18
19
  # LOCAL_URL - Local development URL (default: http://localhost:3000/v2)
19
- # API_DEPLOY_URL - API deployment URL (default: https://api.lunchmoney.app/v2)
20
- # DOCS_DEPLOY_URL - Docs/mock deployment URL (default: https://alpha.lunchmoney.app/v2)
20
+ # DOCS_DEPLOY_URL - Docs/mock deployment URL (default: https://alpha.lunchmoney.dev/v2)
21
21
  #
22
22
  # Examples:
23
- # # Switch to production URLs (using defaults)
23
+ # # Switch to production URL (using defaults)
24
24
  # ./update-urls.sh --production
25
25
  #
26
- # # Switch to production URLs (with custom URLs)
27
- # API_DEPLOY_URL=https://api.lunchmoney.app/v2 DOCS_DEPLOY_URL=https://alpha.lunchmoney.app/v2 ./update-urls.sh --production
26
+ # # Switch to production URL (with custom URL)
27
+ # DOCS_DEPLOY_URL=https://alpha.lunchmoney.dev/v2 ./update-urls.sh --production
28
28
  #
29
- # # Switch to local URLs
29
+ # # Switch to local URL
30
30
  # ./update-urls.sh --local
31
31
  #
32
- # # Switch to local URLs (with custom local URL)
32
+ # # Switch to local URL (with custom local URL)
33
33
  # LOCAL_URL=http://localhost:4000/v2 ./update-urls.sh --local
34
34
 
35
35
  set -e
@@ -40,7 +40,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
40
40
  # Determine if we're in the git repo or npm package
41
41
  # In git repo: script is in scripts/ subdirectory, spec is in v2/spec/
42
42
  # In npm package: script is at root, spec is at root
43
- if [ -f "$SCRIPT_DIR/v2/spec/lunch-money-api-v2.yaml" ]; then
43
+ if [ -f "$SCRIPT_DIR/../v2/spec/lunch-money-api-v2.yaml" ]; then
44
44
  # In the git repo (script is in scripts/ subdirectory)
45
45
  REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
46
46
  SPEC_FILE="$REPO_ROOT/v2/spec/lunch-money-api-v2.yaml"
@@ -62,91 +62,71 @@ fi
62
62
 
63
63
  # Set default values for the URLs if not provided
64
64
  LOCAL_URL=${LOCAL_URL:-"http://localhost:3000/v2"}
65
- API_DEPLOY_URL=${API_DEPLOY_URL:-"https://api.lunchmoney.app/v2"}
66
- DOCS_DEPLOY_URL=${DOCS_DEPLOY_URL:-"https://alpha.lunchmoney.app/v2"}
65
+ DOCS_DEPLOY_URL=${DOCS_DEPLOY_URL:-"https://alpha.lunchmoney.dev/v2"}
67
66
 
68
67
  # Function to show help and exit
69
68
  show_help() {
70
69
  echo "Usage: $0 --local|--production"
71
70
  echo ""
72
71
  echo "Flags (required):"
73
- echo " --local Switch URLs to local development"
74
- echo " --production Switch URLs to production deployment"
72
+ echo " --local Switch docs/mock server URL to local development"
73
+ echo " --production Switch docs/mock server URL to production deployment"
75
74
  echo ""
76
75
  echo "Environment variables (optional, with defaults):"
77
76
  echo " LOCAL_URL Local development URL (default: http://localhost:3000/v2)"
78
- echo " API_DEPLOY_URL API deployment URL (default: https://api.lunchmoney.app/v2)"
79
- echo " DOCS_DEPLOY_URL Docs/mock deployment URL (default: https://alpha.lunchmoney.app/v2)"
77
+ echo " DOCS_DEPLOY_URL Docs/mock deployment URL (default: https://alpha.lunchmoney.dev/v2)"
80
78
  echo ""
81
79
  echo "Examples:"
82
- echo " # Switch to production URLs (using defaults)"
80
+ echo " # Switch to production URL (using defaults)"
83
81
  echo " $0 --production"
84
82
  echo ""
85
- echo " # Switch to production URLs (with custom URLs)"
86
- echo " API_DEPLOY_URL=https://api.lunchmoney.app/v2 DOCS_DEPLOY_URL=https://alpha.lunchmoney.app/v2 $0 --production"
83
+ echo " # Switch to production URL (with custom URL)"
84
+ echo " DOCS_DEPLOY_URL=https://alpha.lunchmoney.dev/v2 $0 --production"
87
85
  echo ""
88
- echo " # Switch to local URLs"
86
+ echo " # Switch to local URL"
89
87
  echo " $0 --local"
90
88
  echo ""
91
- echo " # Switch to local URLs (with custom local URL)"
89
+ echo " # Switch to local URL (with custom local URL)"
92
90
  echo " LOCAL_URL=http://localhost:4000/v2 $0 --local"
93
91
  echo ""
94
92
  echo "Note: Environment variables can also be set in a .env file in the repository root."
93
+ echo "Note: All references to DOCS_DEPLOY_URL throughout the file are updated; the API server URL remains unchanged."
95
94
  exit 1
96
95
  }
97
96
 
98
- # Function to replace URLs in the spec file
99
- replace_urls() {
97
+ # Function to replace all occurrences of the docs/mock server URL in the spec file
98
+ replace_docs_url() {
100
99
  local from_url=$1
101
- local to_url_1=$2
102
- local to_url_2=$3
100
+ local to_url=$2
103
101
 
104
102
  if [ ! -f "$SPEC_FILE" ]; then
105
103
  echo "Error: Spec file not found at $SPEC_FILE"
106
104
  exit 1
107
105
  fi
108
106
 
109
- echo "Updating URLs in $SPEC_FILE..."
107
+ echo "Updating all references to docs/mock server URL in $SPEC_FILE..."
110
108
  echo " From: $from_url"
111
- echo " To (server 1): $to_url_1"
112
- echo " To (server 2): $to_url_2"
109
+ echo " To: $to_url"
113
110
 
114
- # Special handling for lunch-money-api-v2.yaml
115
- awk -v from_url="$from_url" -v to_url_1="$to_url_1" -v to_url_2="$to_url_2" '
116
- BEGIN { server_count = 0 }
117
- {
118
- if ($0 ~ "servers:") {
119
- in_servers = 1
120
- }
121
- if (in_servers && $0 ~ "url:") {
122
- server_count++
123
- if (server_count == 1) {
124
- sub(from_url, to_url_1)
125
- } else if (server_count == 2) {
126
- sub(from_url, to_url_2)
127
- } else {
128
- sub(from_url, to_url_1)
129
- }
130
- } else {
131
- sub(from_url, to_url_2)
132
- }
133
- print
134
- }' "$SPEC_FILE" > "$SPEC_FILE.tmp" && mv "$SPEC_FILE.tmp" "$SPEC_FILE"
111
+ # Replace all occurrences of the URL throughout the entire file
112
+ # Using sed with proper escaping for URLs
113
+ # Escape special regex characters in from_url
114
+ escaped_from_url=$(echo "$from_url" | sed 's/[[\.*^$()+?{|]/\\&/g')
115
+ # Use a temporary file for cross-platform compatibility
116
+ sed "s|$escaped_from_url|$to_url|g" "$SPEC_FILE" > "$SPEC_FILE.tmp" && mv "$SPEC_FILE.tmp" "$SPEC_FILE"
135
117
 
136
118
  echo "✓ URLs updated successfully"
137
119
  }
138
120
 
139
121
  # Check for required flag
140
122
  if [ "$1" == "--local" ]; then
141
- echo "Switching URLs to local development..."
123
+ echo "Switching docs/mock server URL to local development..."
142
124
  echo " Using LOCAL_URL: $LOCAL_URL"
143
- replace_urls "$API_DEPLOY_URL" "$LOCAL_URL" "$LOCAL_URL"
144
- replace_urls "$DOCS_DEPLOY_URL" "$LOCAL_URL" "$LOCAL_URL"
125
+ replace_docs_url "$DOCS_DEPLOY_URL" "$LOCAL_URL"
145
126
  elif [ "$1" == "--production" ]; then
146
- echo "Switching URLs to production..."
147
- echo " Using API_DEPLOY_URL: $API_DEPLOY_URL"
127
+ echo "Switching docs/mock server URL to production..."
148
128
  echo " Using DOCS_DEPLOY_URL: $DOCS_DEPLOY_URL"
149
- replace_urls "$LOCAL_URL" "$API_DEPLOY_URL" "$DOCS_DEPLOY_URL"
129
+ replace_docs_url "$LOCAL_URL" "$DOCS_DEPLOY_URL"
150
130
  else
151
131
  echo "Error: A flag is required (--local or --production)"
152
132
  echo ""
@@ -5,13 +5,17 @@ The Lunch Money API spec uses a modified version of SEMVER for its versioning me
5
5
  - The minor version represents the number of main endpoints the current version of the spec supports. For example, a version of the API that supports the /me, /categories, and /transactions endpoints would have a minor version of 3.
6
6
  - The revision number represents the number of updates since the last endpoint was added. For example, each time changes are made to one of the existing three APIs as described above, the revision number will be bumped.
7
7
 
8
- ## v2.8.2 - [Nov 26, 2025]
8
+ ## v2.8.3 - Dec 19, 2025
9
+ - The default for the GET /transactions query parameter `limit` has been changed from 100 to 1000. The max for this parameter is now 2000.
10
+ - Added new guides covering pagination and supported currencies.
11
+
12
+ ## v2.8.2 - Nov 26, 2025
9
13
  - The category object now includes both an `order` and `collapsed` property. These properties are used by GUIs that display a list of categories.
10
14
  - The DELETE /manual_accounts endpoint now supports two optional query parameters:
11
15
  - `delete_items` (boolean, default: false): When set to true, also deletes transactions, rules, and recurring items associated with the account
12
16
  - `delete_balance_history` (boolean, default: false): When set to true, deletes balance history associated with the account
13
17
 
14
- ## v2.8.1 - November 14, 2025
18
+ ## v2.8.1 - Nov 14, 2025
15
19
  - Removed `debits_as_negative` from the userObject
16
20
  - For api users, positive values always indicate a debit transaction, and negative values indicate a credit transaction.
17
21
  - Added `background_color` and `text_color` to the tagObject