@lunch-money/v2-api-spec 2.11.0-preview.8 → 2.11.1-preview.2

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 CHANGED
@@ -21,12 +21,8 @@ After installation, the package provides:
21
21
 
22
22
  ```javascript
23
23
  const fs = require('fs');
24
- const path = require('path');
25
24
 
26
- const specPath = path.join(
27
- __dirname,
28
- 'node_modules/@lunch-money/v2-api-spec/lunch-money-api-v2.yaml'
29
- );
25
+ const specPath = require.resolve('@lunch-money/v2-api-spec/lunch-money-api-v2.yaml');
30
26
  const spec = fs.readFileSync(specPath, 'utf8');
31
27
  ```
32
28
 
@@ -123,14 +119,17 @@ For example, version `2.8.2` means:
123
119
  - 8 main endpoint groups
124
120
  - 2 updates since the 8th endpoint was added
125
121
 
122
+ ## Related Packages
123
+
124
+ This package is the canonical v2 OpenAPI specification artifact. The `@lunch-money/developer-docs` package ships the public documentation content and may include a convenience copy of the spec under `v2/spec/`, but API tooling should consume the YAML from `@lunch-money/v2-api-spec`.
125
+
126
126
  ## Resources
127
127
 
128
128
  - [Lunch Money Website](https://lunchmoney.app)
129
129
  - [Interactive API Documentation](https://alpha.lunchmoney.dev/v2/docs)
130
- - [GitHub Repository](https://github.com/lunch-money/api-specs)
130
+ - [GitHub Repository](https://github.com/lunch-money/developer-docs)
131
131
  - [API Status](https://status.lunchmoney.app)
132
132
 
133
133
  ## License
134
134
 
135
135
  ISC
136
-
@@ -2,12 +2,6 @@ openapi: 3.0.2
2
2
  info:
3
3
  title: Lunch Money API - v2
4
4
  description: |-
5
- Welcome to the Lunch Money v2 API reference. This is the **v2.11.0** spec. It includes previews of the proposed `/crypto` and `/balance_history` endpoints. Only the mock service works with these endpoints.<br><br>
6
- The most recent stable version of the API is v2.9.4 and is available at:
7
- `https://api.lunchmoney.dev/v2`
8
-
9
- ------------------------------------------------------------------------------------------------
10
-
11
5
  ### Introduction
12
6
 
13
7
  The API is available at `https://api.lunchmoney.dev/v2`. Get your access token from the [Lunch Money developers page](https://my.lunchmoney.app/developers).
@@ -20,7 +14,7 @@ info:
20
14
 
21
15
  **Client Libraries & SDKs**
22
16
 
23
- An official TypeScript SDK is available on [NPM](https://www.npmjs.com/package/@lunch-money/v2-api-spec) and [GitHub](https://github.com/lunch-money/lunch-money-js-v2). For Python or other languages, see [lunchmoney-clients](https://github.com/juftin/lunchmoney-clients) or generate a client from this OpenAPI spec.
17
+ An official TypeScript SDK is available on [NPM](https://www.npmjs.com/package/@lunch-money/v2-api-spec) and [GitHub](https://github.com/lunch-money/lunch-money-js-v2). For Python or other languages, see [lunchmoney-clients](https://github.com/juftin/lunchmoney-clients) or generate a client from [this OpenAPI spec](/v2/openapi).
24
18
 
25
19
  **Migrating from v1**
26
20
 
@@ -39,7 +33,7 @@ info:
39
33
  license:
40
34
  name: Apache 2.0
41
35
  url: http://www.apache.org/licenses/LICENSE-2.0.html
42
- version: 2.11.0
36
+ version: 2.11.1
43
37
 
44
38
  servers:
45
39
  - url: https://api.lunchmoney.dev/v2
@@ -50,7 +44,10 @@ servers:
50
44
 
51
45
  tags:
52
46
  - name: me
53
- description: View details and settings for the current user and account
47
+ description: View details and settings for the current user and account.<p>
48
+ Use [/me/account/settings](#tag/me/GET/me/account/settings) and
49
+ [/me/user/settings](#tag/me/GET/me/user/settings) for account- and
50
+ user-level preferences.
54
51
  - name: categories
55
52
  description: Work with categories
56
53
  externalDocs:
@@ -113,8 +110,10 @@ tags:
113
110
  description: Learn more about transactions
114
111
  url: https://support.lunchmoney.app/finances/transactions
115
112
  - name: budgets
116
- description: View settings and modify budget amounts.<p> Use the
117
- [/summary](#tag/summary) endpoint to view the budget details performance.
113
+ description: View settings and modify budget amounts.<p> Use
114
+ [/budgets/settings](#tag/budgets/GET/budgets/settings) to view budget
115
+ period settings.<p> Use the [/summary](#tag/summary) endpoint to view
116
+ the budget details performance.
118
117
  externalDocs:
119
118
  description: Learn more about budgets
120
119
  url: https://support.lunchmoney.app/finances/budgets
@@ -142,12 +141,18 @@ components:
142
141
  account_id:
143
142
  type: integer
144
143
  format: int64
145
- description: Unique ID for the linked budgeting account
144
+ description: Unique ID for the current budgeting account
146
145
  budget_name:
147
146
  type: string
148
- description: Name of the linked budgeting account
147
+ description: Name of the current budgeting account.<p> Also available
148
+ as `display_name` on
149
+ [/me/account/settings](#tag/me/GET/me/account/settings), which is
150
+ the preferred endpoint for reading and updating account settings.
149
151
  primary_currency:
150
- description: Primary currency set in the user's settings
152
+ description: Primary currency for the current budgeting account.<p>
153
+ Also available on [/me/account/settings](#tag/me/GET/me/account/settings),
154
+ which is the preferred endpoint for reading and updating account
155
+ settings.
151
156
  allOf:
152
157
  - $ref: "#/components/schemas/currencyEnum"
153
158
  api_key_label:
@@ -3612,10 +3617,11 @@ components:
3612
3617
 
3613
3618
  # Response body for GET /budgets/settings (200)
3614
3619
  budgetSettingsResponseObject:
3615
- x-internal: true
3616
3620
  type: object
3621
+ title: budget settings object
3617
3622
  additionalProperties: false
3618
- description: Budget period and display settings
3623
+ description: Budget period and display settings for the current budgeting
3624
+ account.
3619
3625
  properties:
3620
3626
  budget_period_granularity:
3621
3627
  type: string
@@ -3627,8 +3633,8 @@ components:
3627
3633
  - twice a month
3628
3634
  description: Budget period granularity
3629
3635
  budget_period_quantity:
3630
- type: number
3631
- format: double
3636
+ type: integer
3637
+ format: int32
3632
3638
  description: The number of `granularity` units that make up a single
3633
3639
  budgeting period.
3634
3640
  budget_period_anchor_date:
@@ -3670,6 +3676,371 @@ components:
3670
3676
  - budget_income_option
3671
3677
  - budget_rollover_left_to_budget
3672
3678
 
3679
+ weekStartsOnEnum:
3680
+ type: string
3681
+ title: week starts on enum
3682
+ enum:
3683
+ - sunday
3684
+ - monday
3685
+ description: The day on which a calendar week begins.
3686
+
3687
+ monthYearFormatEnum:
3688
+ type: string
3689
+ title: month and year format enum
3690
+ description: Format string for displaying month and year values
3691
+ in the Lunch Money app.
3692
+ enum:
3693
+ - "MMMM YYYY"
3694
+ - "MMM YYYY"
3695
+ - "YYYY MMM"
3696
+ - "MM YYYY"
3697
+ - "MM-YYYY"
3698
+ - "MM.YYYY"
3699
+ - "MM/YYYY"
3700
+ - "M YYYY"
3701
+ - "M-YYYY"
3702
+ - "M.YYYY"
3703
+ - "M/YYYY"
3704
+ - "YYYY M"
3705
+ - "YYYY-M"
3706
+ - "YYYY.M"
3707
+ - "YYYY/M"
3708
+ - "YYYY MM"
3709
+ - "YYYY-MM"
3710
+ - "YYYY.MM"
3711
+ - "YYYY/MM"
3712
+
3713
+ monthDayYearFormatEnum:
3714
+ type: string
3715
+ title: month, day and year format enum
3716
+ description: Format string for displaying full dates in the
3717
+ Lunch Money app.
3718
+ enum:
3719
+ - "MMM D, YYYY"
3720
+ - "D MMM YYYY"
3721
+ - "YYYY MM DD"
3722
+ - "YYYY-MM-DD"
3723
+ - "YYYY.MM.DD"
3724
+ - "YYYY/MM/DD"
3725
+ - "YYYY M DD"
3726
+ - "YYYY-M-DD"
3727
+ - "YYYY.M.DD"
3728
+ - "YYYY/M/DD"
3729
+ - "YYYY MM D"
3730
+ - "YYYY-MM-D"
3731
+ - "YYYY.MM.D"
3732
+ - "YYYY/MM/D"
3733
+ - "YYYY M D"
3734
+ - "YYYY-M-D"
3735
+ - "YYYY.M.D"
3736
+ - "YYYY/M/D"
3737
+ - "DD MM YYYY"
3738
+ - "DD-MM-YYYY"
3739
+ - "DD.MM.YYYY"
3740
+ - "DD/MM/YYYY"
3741
+ - "DD M YYYY"
3742
+ - "DD-M-YYYY"
3743
+ - "DD.M.YYYY"
3744
+ - "DD/M/YYYY"
3745
+ - "D MM YYYY"
3746
+ - "D-MM-YYYY"
3747
+ - "D.MM.YYYY"
3748
+ - "D/MM/YYYY"
3749
+ - "D M YYYY"
3750
+ - "D-M-YYYY"
3751
+ - "D.M.YYYY"
3752
+ - "D/M/YYYY"
3753
+ - "M D YYYY"
3754
+ - "M-D-YYYY"
3755
+ - "M.D.YYYY"
3756
+ - "M/D/YYYY"
3757
+ - "MM D YYYY"
3758
+ - "MM-D-YYYY"
3759
+ - "MM.D.YYYY"
3760
+ - "MM/D/YYYY"
3761
+ - "MM DD YYYY"
3762
+ - "MM-DD-YYYY"
3763
+ - "MM.DD.YYYY"
3764
+ - "MM/DD/YYYY"
3765
+ - "M DD YYYY"
3766
+ - "M-DD-YYYY"
3767
+ - "M.DD.YYYY"
3768
+ - "M/DD/YYYY"
3769
+
3770
+ monthDayFormatEnum:
3771
+ type: string
3772
+ title: month and day format enum
3773
+ description: Format string for displaying month and day values
3774
+ without a year.
3775
+ enum:
3776
+ - "MMM D"
3777
+ - "MMM DD"
3778
+ - "D MMM"
3779
+ - "DD MMM"
3780
+ - "MM D"
3781
+ - "MM-D"
3782
+ - "MM.D"
3783
+ - "MM/D"
3784
+ - "MM DD"
3785
+ - "MM-DD"
3786
+ - "MM.DD"
3787
+ - "MM/DD"
3788
+ - "M D"
3789
+ - "M-D"
3790
+ - "M.D"
3791
+ - "M/D"
3792
+ - "M DD"
3793
+ - "M-DD"
3794
+ - "M.DD"
3795
+ - "M/DD"
3796
+ - "D MM"
3797
+ - "D-MM"
3798
+ - "D.MM"
3799
+ - "D/MM"
3800
+ - "DD MM"
3801
+ - "DD-MM"
3802
+ - "DD.MM"
3803
+ - "DD/MM"
3804
+ - "D M"
3805
+ - "D-M"
3806
+ - "D.M"
3807
+ - "D/M"
3808
+ - "DD M"
3809
+ - "DD-M"
3810
+ - "DD.M"
3811
+ - "DD/M"
3812
+
3813
+ accountSettingsObject:
3814
+ type: object
3815
+ title: account settings object
3816
+ additionalProperties: false
3817
+ description: Account-level settings for the budgeting account
3818
+ associated with the authorized API token.
3819
+ properties:
3820
+ primary_currency:
3821
+ description: Primary currency for the account.
3822
+ allOf:
3823
+ - $ref: "#/components/schemas/currencyEnum"
3824
+ supported_currencies:
3825
+ type: array
3826
+ items:
3827
+ $ref: "#/components/schemas/currencyEnum"
3828
+ description: Currencies available when creating or editing transactions,
3829
+ balances, and other amounts in the Lunch Money app.
3830
+ display_name:
3831
+ type: string
3832
+ nullable: true
3833
+ description: Display name of the budgeting account in the Lunch Money
3834
+ app.
3835
+ locale:
3836
+ type: string
3837
+ description: Locale used for formatting dates and numbers in the
3838
+ Lunch Money app (for example, `en-US`). When no locale is explicitly
3839
+ stored for the account, the effective locale is derived from the
3840
+ `default_locale` associated with `primary_currency` in the
3841
+ currencies table (for example, `usd` → `en-US`, `cad` → `en-CA`,
3842
+ `gbp` → `en-GB`).
3843
+ auto_create_category_rules:
3844
+ type: boolean
3845
+ default: true
3846
+ description: If `true`, category rules are created automatically when
3847
+ categorizing transactions.
3848
+ auto_create_suggested_transaction_rules:
3849
+ type: boolean
3850
+ default: true
3851
+ description: If `true`, suggested transaction rules are created
3852
+ automatically.
3853
+ auto_review_transaction_on_update:
3854
+ type: boolean
3855
+ default: true
3856
+ description: If `true`, transactions are marked as reviewed when
3857
+ updated.
3858
+ auto_review_transaction_on_creation:
3859
+ type: boolean
3860
+ default: true
3861
+ description: If `true`, transactions are marked as reviewed when
3862
+ created.
3863
+ required:
3864
+ - primary_currency
3865
+ - supported_currencies
3866
+ - display_name
3867
+ - locale
3868
+ - auto_create_category_rules
3869
+ - auto_create_suggested_transaction_rules
3870
+ - auto_review_transaction_on_update
3871
+ - auto_review_transaction_on_creation
3872
+
3873
+ updateAccountSettingsRequestObject:
3874
+ x-internal: true
3875
+ type: object
3876
+ additionalProperties: false
3877
+ description: Request body for updating account settings. Include at least
3878
+ one property to update.
3879
+ properties:
3880
+ primary_currency:
3881
+ allOf:
3882
+ - $ref: "#/components/schemas/currencyEnum"
3883
+ description: If set, updates the account's primary currency.
3884
+ x-updatable: true
3885
+ supported_currencies:
3886
+ type: array
3887
+ items:
3888
+ $ref: "#/components/schemas/currencyEnum"
3889
+ description: If set, replaces the list of supported currencies for the
3890
+ account.
3891
+ x-updatable: true
3892
+ display_name:
3893
+ type: string
3894
+ nullable: true
3895
+ description: If set, updates the display name of the budgeting account.
3896
+ x-updatable: true
3897
+ locale:
3898
+ type: string
3899
+ description: If set, updates the locale used for formatting dates and
3900
+ numbers in the Lunch Money app.
3901
+ x-updatable: true
3902
+ auto_create_category_rules:
3903
+ type: boolean
3904
+ description: If set, updates whether category rules are created
3905
+ automatically.
3906
+ x-updatable: true
3907
+ auto_create_suggested_transaction_rules:
3908
+ type: boolean
3909
+ description: If set, updates whether suggested transaction rules are
3910
+ created automatically.
3911
+ x-updatable: true
3912
+ auto_review_transaction_on_update:
3913
+ type: boolean
3914
+ description: If set, updates whether transactions are marked as reviewed
3915
+ when updated.
3916
+ x-updatable: true
3917
+ auto_review_transaction_on_creation:
3918
+ type: boolean
3919
+ description: If set, updates whether transactions are marked as reviewed
3920
+ when created.
3921
+ x-updatable: true
3922
+
3923
+ userSettingsObject:
3924
+ type: object
3925
+ title: user settings object
3926
+ additionalProperties: false
3927
+ description: User-level display and formatting preferences for the user
3928
+ associated with the authorized API token.
3929
+ properties:
3930
+ show_debits_as_negative:
3931
+ type: boolean
3932
+ default: true
3933
+ description: Display preference for how amounts are shown in the Lunch
3934
+ Money app. When `true`, debits are shown as negative values and
3935
+ credits as positive values.<p> This setting does **not** change
3936
+ amount sign conventions in API responses. Amount fields such as
3937
+ `amount` and `to_base` on transaction objects always use positive
3938
+ values for debits and negative values for credits.
3939
+ auto_suggest_payee:
3940
+ type: boolean
3941
+ default: true
3942
+ description: If `true`, payee suggestions are shown when entering
3943
+ transactions in the Lunch Money app.
3944
+ month_year_format:
3945
+ allOf:
3946
+ - $ref: "#/components/schemas/monthYearFormatEnum"
3947
+ default: "MMM YYYY"
3948
+ description: Format string used when displaying month and year values.
3949
+ month_day_year_format:
3950
+ allOf:
3951
+ - $ref: "#/components/schemas/monthDayYearFormatEnum"
3952
+ default: "MMM D, YYYY"
3953
+ description: Format string used when displaying full dates (month, day,
3954
+ and year).
3955
+ month_day_format:
3956
+ allOf:
3957
+ - $ref: "#/components/schemas/monthDayFormatEnum"
3958
+ default: "MMM D"
3959
+ description: Format string used when displaying month and day values
3960
+ without a year.
3961
+ show_am_pm:
3962
+ type: boolean
3963
+ default: true
3964
+ description: If `true`, times are displayed using a 12-hour clock with
3965
+ AM/PM. If `false`, times are displayed using a 24-hour clock.
3966
+ week_starts_on:
3967
+ allOf:
3968
+ - $ref: "#/components/schemas/weekStartsOnEnum"
3969
+ default: sunday
3970
+ description: The day on which a calendar week begins.
3971
+ always_display_year:
3972
+ type: boolean
3973
+ default: false
3974
+ description: If `true`, dates always include the year and
3975
+ `month_day_format` is not used.
3976
+ always_display_weekday:
3977
+ type: boolean
3978
+ default: true
3979
+ description: If `true`, weekday names are included when displaying
3980
+ dates.
3981
+ required:
3982
+ - show_debits_as_negative
3983
+ - auto_suggest_payee
3984
+ - month_year_format
3985
+ - month_day_year_format
3986
+ - month_day_format
3987
+ - show_am_pm
3988
+ - week_starts_on
3989
+ - always_display_year
3990
+ - always_display_weekday
3991
+
3992
+ updateUserSettingsRequestObject:
3993
+ x-internal: true
3994
+ type: object
3995
+ additionalProperties: false
3996
+ description: Request body for updating user settings. Include at least one
3997
+ property to update.
3998
+ properties:
3999
+ show_debits_as_negative:
4000
+ type: boolean
4001
+ description: If set, updates the display preference for amount signs in
4002
+ the Lunch Money app. Does not affect amount sign conventions in API
4003
+ responses.
4004
+ x-updatable: true
4005
+ auto_suggest_payee:
4006
+ type: boolean
4007
+ description: If set, updates whether payee suggestions are shown.
4008
+ x-updatable: true
4009
+ month_year_format:
4010
+ allOf:
4011
+ - $ref: "#/components/schemas/monthYearFormatEnum"
4012
+ description: If set, updates the month and year display format.
4013
+ x-updatable: true
4014
+ month_day_year_format:
4015
+ allOf:
4016
+ - $ref: "#/components/schemas/monthDayYearFormatEnum"
4017
+ description: If set, updates the full date display format.
4018
+ x-updatable: true
4019
+ month_day_format:
4020
+ allOf:
4021
+ - $ref: "#/components/schemas/monthDayFormatEnum"
4022
+ description: If set, updates the month and day display format.
4023
+ x-updatable: true
4024
+ show_am_pm:
4025
+ type: boolean
4026
+ description: If set, updates whether times use a 12-hour (AM/PM) or
4027
+ 24-hour clock.
4028
+ x-updatable: true
4029
+ week_starts_on:
4030
+ allOf:
4031
+ - $ref: "#/components/schemas/weekStartsOnEnum"
4032
+ description: If set, updates the day on which a calendar week begins.
4033
+ x-updatable: true
4034
+ always_display_year:
4035
+ type: boolean
4036
+ description: If set, updates whether dates always include the year.
4037
+ x-updatable: true
4038
+ always_display_weekday:
4039
+ type: boolean
4040
+ description: If set, updates whether weekday names are shown when
4041
+ displaying dates.
4042
+ x-updatable: true
4043
+
3673
4044
  # Summary endpoint response schemas
3674
4045
  summaryResponseObject:
3675
4046
  type: object
@@ -4468,8 +4839,13 @@ paths:
4468
4839
  tags:
4469
4840
  - me
4470
4841
  summary: Get current user
4471
- description: Get details about the user associated with the supplied
4472
- authorization token.
4842
+ description: |-
4843
+ Get details about the user associated with the supplied authorization
4844
+ token.<p> For account- and user-level preferences, prefer
4845
+ [/me/account/settings](#tag/me/GET/me/account/settings) and
4846
+ [/me/user/settings](#tag/me/GET/me/user/settings). Properties such as
4847
+ `primary_currency` and `budget_name` remain on this response for
4848
+ backwards compatibility.
4473
4849
  operationId: getMe
4474
4850
  parameters: []
4475
4851
  responses:
@@ -4493,6 +4869,165 @@ paths:
4493
4869
  $ref: "#/components/responses/rateLimited"
4494
4870
  "500":
4495
4871
  $ref: "#/components/responses/serverError"
4872
+ /me/account/settings:
4873
+ get:
4874
+ tags:
4875
+ - me
4876
+ summary: Get account settings
4877
+ description: Returns account-level settings for the budgeting
4878
+ account associated with the authorized API token.
4879
+ operationId: getAccountSettings
4880
+ responses:
4881
+ "200":
4882
+ description: Account settings for the current budgeting account
4883
+ content:
4884
+ application/json:
4885
+ schema:
4886
+ $ref: "#/components/schemas/accountSettingsObject"
4887
+ example:
4888
+ primary_currency: usd
4889
+ supported_currencies:
4890
+ - usd
4891
+ - cad
4892
+ - jpy
4893
+ display_name: "\U0001F3E0 Family budget"
4894
+ locale: en-US
4895
+ auto_create_category_rules: true
4896
+ auto_create_suggested_transaction_rules: true
4897
+ auto_review_transaction_on_update: true
4898
+ auto_review_transaction_on_creation: true
4899
+ "401":
4900
+ $ref: "#/components/responses/unauthorizedToken"
4901
+ "429":
4902
+ $ref: "#/components/responses/rateLimited"
4903
+ "500":
4904
+ $ref: "#/components/responses/serverError"
4905
+ put:
4906
+ tags:
4907
+ - me
4908
+ summary: Update account settings
4909
+ description: |-
4910
+ Updates account-level settings for the budgeting account
4911
+ associated with the authorized API token.<p> You may submit the response from a
4912
+ `GET /me/account/settings` as the request body; however, only certain
4913
+ properties can be updated.<p> It is also possible to provide only the
4914
+ properties to be updated in the request body, as long as the request
4915
+ includes at least one updatable property.
4916
+ operationId: updateAccountSettings
4917
+ requestBody:
4918
+ required: true
4919
+ content:
4920
+ application/json:
4921
+ schema:
4922
+ $ref: "#/components/schemas/updateAccountSettingsRequestObject"
4923
+ examples:
4924
+ Update display name:
4925
+ value:
4926
+ display_name: "Travel budget"
4927
+ Update automation preferences:
4928
+ value:
4929
+ auto_create_category_rules: false
4930
+ auto_review_transaction_on_creation: false
4931
+ responses:
4932
+ "200":
4933
+ description: Account settings updated successfully
4934
+ content:
4935
+ application/json:
4936
+ schema:
4937
+ $ref: "#/components/schemas/accountSettingsObject"
4938
+ "400":
4939
+ description: Invalid request body
4940
+ content:
4941
+ application/json:
4942
+ schema:
4943
+ $ref: "#/components/schemas/errorResponseObject"
4944
+ "401":
4945
+ $ref: "#/components/responses/unauthorizedToken"
4946
+ "429":
4947
+ $ref: "#/components/responses/rateLimited"
4948
+ "500":
4949
+ $ref: "#/components/responses/serverError"
4950
+ /me/user/settings:
4951
+ get:
4952
+ tags:
4953
+ - me
4954
+ summary: Get user settings
4955
+ description: Returns user-level display and formatting preferences for the
4956
+ user associated with the authorized API token.
4957
+ operationId: getUserSettings
4958
+ responses:
4959
+ "200":
4960
+ description: User settings for the authorized user
4961
+ content:
4962
+ application/json:
4963
+ schema:
4964
+ $ref: "#/components/schemas/userSettingsObject"
4965
+ example:
4966
+ show_debits_as_negative: true
4967
+ auto_suggest_payee: true
4968
+ month_year_format: "MMM YYYY"
4969
+ month_day_year_format: "MMM D, YYYY"
4970
+ month_day_format: "MMM D"
4971
+ show_am_pm: true
4972
+ week_starts_on: sunday
4973
+ always_display_year: false
4974
+ always_display_weekday: true
4975
+ "401":
4976
+ $ref: "#/components/responses/unauthorizedToken"
4977
+ "429":
4978
+ $ref: "#/components/responses/rateLimited"
4979
+ "500":
4980
+ $ref: "#/components/responses/serverError"
4981
+ put:
4982
+ tags:
4983
+ - me
4984
+ summary: Update user settings
4985
+ description: |-
4986
+ Updates user-level display and formatting preferences for the user
4987
+ associated with the authorized API token.<p> You may submit the response
4988
+ from a `GET /me/user/settings` as the request body; however, only
4989
+ certain properties can be updated.<p> It is also possible to provide
4990
+ only the properties to be updated in the request body, as long as the
4991
+ request includes at least one updatable property.<p> Updating
4992
+ `show_debits_as_negative` affects display in the Lunch Money app only.
4993
+ Amount fields in API responses always use positive values for debits and
4994
+ negative values for credits.
4995
+ operationId: updateUserSettings
4996
+ requestBody:
4997
+ required: true
4998
+ content:
4999
+ application/json:
5000
+ schema:
5001
+ $ref: "#/components/schemas/updateUserSettingsRequestObject"
5002
+ examples:
5003
+ Update date formats:
5004
+ value:
5005
+ month_year_format: "YYYY-MM"
5006
+ month_day_year_format: "YYYY-MM-DD"
5007
+ month_day_format: "MM-DD"
5008
+ Use 24-hour time and Monday week start:
5009
+ value:
5010
+ show_am_pm: false
5011
+ week_starts_on: monday
5012
+ responses:
5013
+ "200":
5014
+ description: User settings updated successfully
5015
+ content:
5016
+ application/json:
5017
+ schema:
5018
+ $ref: "#/components/schemas/userSettingsObject"
5019
+ "400":
5020
+ description: Invalid request body
5021
+ content:
5022
+ application/json:
5023
+ schema:
5024
+ $ref: "#/components/schemas/errorResponseObject"
5025
+ "401":
5026
+ $ref: "#/components/responses/unauthorizedToken"
5027
+ "429":
5028
+ $ref: "#/components/responses/rateLimited"
5029
+ "500":
5030
+ $ref: "#/components/responses/serverError"
4496
5031
  /summary:
4497
5032
  get:
4498
5033
  tags:
@@ -11617,12 +12152,17 @@ paths:
11617
12152
  get:
11618
12153
  tags:
11619
12154
  - budgets
11620
- summary: Get budget settings
11621
- description: Returns the budget-related settings for the user's account.
12155
+ summary: Get budget period settings
12156
+ description: |-
12157
+ Returns budget period and display settings for the budget
12158
+ associated with this API token.<p> These control how budget **periods** are calculated
12159
+ (granularity, anchor date, rollover, and related options). For general
12160
+ budget preferences such as currency and locale, see
12161
+ [/me/account/settings](#tag/me/GET/me/account/settings).
11622
12162
  operationId: getBudgetSettings
11623
12163
  responses:
11624
12164
  "200":
11625
- description: Budget settings for the account
12165
+ description: Budget period settings for the current budget
11626
12166
  content:
11627
12167
  application/json:
11628
12168
  schema:
@@ -11645,7 +12185,7 @@ paths:
11645
12185
  Note that `start_date` **must** be a valid budget period start for the account (based on the account's
11646
12186
  budget period settings). If an invalid `start_date` is provided, the request will fail with an error that indicates what the previous and next valid start dates are.<p>
11647
12187
 
11648
- Use the [budgets/settings](#tag/budgets/GET/budgets/settings) endpoint to view the account's budget settings.<br>
12188
+ Use the [/budgets/settings](#tag/budgets/GET/budgets/settings) endpoint to view the budget period settings for the account.<br>
11649
12189
  To view details for existing budgets, use the [summary](#tag/summary) endpoint.
11650
12190
  operationId: upsertBudget
11651
12191
  requestBody:
@@ -11716,7 +12256,7 @@ paths:
11716
12256
  period settings). If an invalid `start_date` is provided, the request
11717
12257
  will fail with an error that indicates what the previous and next valid
11718
12258
  start dates are.<p> Use the
11719
- [budgets/settings](#tag/budgets/GET/budgets/settings) endpoint to view
12259
+ [/budgets/settings](#tag/budgets/GET/budgets/settings) endpoint to view
11720
12260
  the account's budget settings.<br> To view details for existing budgets,
11721
12261
  use the [summary](#tag/summary) endpoint.
11722
12262
  operationId: deleteBudget
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunch-money/v2-api-spec",
3
- "version": "2.11.0-preview.8",
3
+ "version": "2.11.1-preview.2",
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": [
@@ -12,7 +12,15 @@
12
12
  "scripts": {
13
13
  "prepare": "husky install",
14
14
  "prepublishOnly": "node scripts/prep-for-publish.js",
15
- "postpublish": "node scripts/restore-readme.js"
15
+ "postpublish": "node scripts/restore-readme.js",
16
+ "publish:docs": "node scripts/publish-docs.js --tag preview",
17
+ "publish:spec": "node scripts/publish-spec.js --tag preview",
18
+ "publish:all": "npm run publish:docs && npm run publish:spec",
19
+ "publish:docs:latest": "node scripts/publish-docs.js",
20
+ "publish:spec:latest": "node scripts/publish-spec.js",
21
+ "publish:all:latest": "npm run publish:docs:latest && npm run publish:spec:latest",
22
+ "pack:docs": "node scripts/pack-docs.js",
23
+ "pack:spec": "node scripts/pack-spec.js"
16
24
  },
17
25
  "keywords": [
18
26
  "lunchmoney",
@@ -26,4 +34,3 @@
26
34
  "husky": "^8.0.3"
27
35
  }
28
36
  }
29
-
@@ -5,6 +5,11 @@ 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.11.1 - TBD
9
+ - Add `GET /me/account/settings` and `PUT /me/account/settings` for account-level settings
10
+ - Add `GET /me/user/settings` and `PUT /me/user/settings` for user-level display and formatting preferences
11
+ - Document `GET /budgets/settings` response schema publicly; change `budget_period_quantity` to integer
12
+
8
13
  ## v2.11.0 - TBD
9
14
  - Add `GET /balance_history`
10
15
  - Add `GET /balance_history/{account_type}/{account_id}`
package/README.md.backup DELETED
@@ -1,217 +0,0 @@
1
- # Lunch Money API Specifications and Documentation
2
-
3
- This repository contains the official API specifications and documentation for the [Lunch Money](https://lunchmoney.app) API. Lunch Money is a delightfully simple personal finance and budgeting tool with a comprehensive developer API.
4
-
5
- ## Repository Structure
6
-
7
- This repository is organized in a multi-version structure to support current and future API versions:
8
-
9
- ```
10
- .
11
- ├── v2/ # Version 2 API specific content
12
- │ ├── spec/ # OpenAPI specification (YAML)
13
- │ ├── docs/ # Version-specific documentation guides
14
- │ └── images/ # Images used in documentation
15
- ├── docs/ # Version-independent documentation
16
- ├── scripts/ # Build and publishing scripts
17
- └── spec/ # Generated directory (created during npm publish)
18
- ```
19
-
20
- ### Directory Details
21
-
22
- #### `v2/spec/` - OpenAPI Specification
23
- The OpenAPI 3.0 specification file (`lunch-money-api-v2.yaml`) defines the complete API contract:
24
- - All available endpoints
25
- - Request/response schemas
26
- - Authentication requirements
27
- - Error responses
28
- - Example requests and responses
29
-
30
- **This is the source of truth for the API.** Changes to the specification automatically update the interactive API documentation.
31
-
32
- #### `v2/docs/` - Version-Specific Documentation Guides
33
- Markdown files containing detailed guides and reference material specific to v2:
34
- - `intro-to-v2.md` - Overview of the v2 API and key features
35
- - `migration-guide.md` - Guide for migrating from v1 to v2
36
- - `version-history.md` - Changelog of all API versions
37
-
38
- These guides are written in Markdown and support custom rendering features (see below).
39
-
40
- #### `v2/images/` - Documentation Assets
41
- Images and screenshots used in the documentation guides.
42
-
43
- #### `docs/` - Version-Independent Documentation
44
- Shared documentation that applies across all API versions:
45
- - `getting-started.md` - Quick start guide for new developers (applies to all API versions)
46
- - `rate-limiting.md` - Rate limiting policies and best practices (applies to all API versions)
47
- - Additional version-independent guides (e.g., pagination guidelines, general API concepts)
48
-
49
- ## OpenAPI Specification vs Documentation Guides
50
-
51
- There are two types of content in this repository, each serving a different purpose:
52
-
53
- ### OpenAPI Specification (`v2/spec/lunch-money-api-v2.yaml`)
54
- - **Purpose**: Machine-readable API contract
55
- - **Format**: YAML (OpenAPI 3.0)
56
- - **Used for**:
57
- - Generating interactive API documentation
58
- - Code generation for SDKs and client libraries
59
- - API validation and testing
60
- - IDE autocomplete and type checking
61
- - **Editable**: Yes - changes here automatically update the docs
62
-
63
- The OpenAPI spec is the authoritative source for:
64
- - Endpoint definitions (paths, methods, parameters)
65
- - Request/response schemas
66
- - Authentication requirements
67
- - Status codes and error formats
68
-
69
- ### Documentation Guides (`v2/docs/*.md`)
70
- - **Purpose**: Human-readable guides and tutorials
71
- - **Format**: Markdown with custom extensions
72
- - **Used for**:
73
- - Developer onboarding and tutorials
74
- - Best practices and patterns
75
- - Migration guides and changelogs
76
- - Conceptual explanations
77
- - **Editable**: Yes - written in Markdown with support for custom features
78
-
79
- The guides provide context, examples, and explanations that complement the technical specification.
80
-
81
- ## Custom Markdown Features
82
-
83
- The documentation system supports custom rendering features that enhance Markdown files. These features are processed when the documentation is served and can be used in any Markdown file in the `v2/docs/` directory.
84
-
85
- ### Callouts
86
-
87
- Callouts are styled information boxes for highlighting important information, warnings, or tips.
88
-
89
- **Syntax:**
90
- ```markdown
91
- > [!TYPE]
92
- > Title (optional)
93
- >
94
- > Content goes here. This can span multiple lines
95
- > and include **markdown formatting**.
96
- ```
97
-
98
- **Supported Types:**
99
- - `[!NOTE]` - General information or notes (blue styling)
100
- - `[!TIP]` - Helpful tips or best practices (green styling)
101
- - `[!WARNING]` - Warnings or important cautions (yellow/orange styling)
102
-
103
- **Example:**
104
- ```markdown
105
- > [!NOTE]
106
- > API Rate Limits
107
- >
108
- > The API has a rate limit of 1000 requests per 5 minutes per IP address.
109
- ```
110
-
111
- ### Tabs
112
-
113
- Tabs organize content into multiple tabbed sections, useful for showing different code examples, API versions, or alternative approaches.
114
-
115
- **Syntax:**
116
- ```markdown
117
- :::tabs
118
- @tab Tab Label 1
119
- Content for the first tab. This can include **markdown** and code blocks.
120
-
121
- @tab Tab Label 2
122
- Content for the second tab. You can have as many tabs as needed.
123
- :::
124
- ```
125
-
126
- **Example: Code Examples in Multiple Languages**
127
- ```markdown
128
- :::tabs
129
- @tab cURL
130
- ```bash
131
- curl -X GET "https://api.lunchmoney.app/v2/transactions" \
132
- -H "Authorization: Bearer YOUR_API_TOKEN"
133
- ```
134
-
135
- @tab JavaScript
136
- ```javascript
137
- const response = await fetch('https://api.lunchmoney.app/v2/transactions', {
138
- headers: {
139
- 'Authorization': 'Bearer YOUR_API_TOKEN'
140
- }
141
- });
142
- ```
143
- :::
144
- ```
145
-
146
- **Usage Notes:**
147
- - Each tab must start with `@tab` followed by the tab label
148
- - The first tab is active by default when the page loads
149
- - Tab content can include any markdown, including code blocks, lists, callouts, tables, and links
150
- - You can combine callouts and tabs in various ways
151
-
152
- ## Versioning
153
-
154
- The Lunch Money API uses a modified version of SEMVER:
155
-
156
- - **Major version**: The API version (currently 2)
157
- - **Minor version**: The number of main endpoints (OpenAPI tags) the spec supports
158
- - **Revision number**: The number of updates since the last endpoint was added
159
-
160
- For example, version `2.8.2` means:
161
- - API version 2
162
- - 8 main endpoint groups
163
- - 2 updates since the 8th endpoint was added
164
-
165
- Details of each version can be found in [`v2/docs/version-history.md`](./v2/docs/version-history.md).
166
-
167
- ### Branch Naming Convention
168
-
169
- Each API version is maintained on a branch named after the version number (e.g., `v2.8.2`). The `main` branch typically tracks the most recent version.
170
-
171
- ## Using This Repository
172
-
173
- ### As an npm Package
174
-
175
- This repository is published as `@lunchmoney/v2-api-spec` on npm for lightweight consumption:
176
-
177
- ```bash
178
- npm install @lunchmoney/v2-api-spec
179
- ```
180
-
181
- After installation, you can access:
182
- - OpenAPI spec: `node_modules/@lunchmoney/v2-api-spec/spec/lunch-money-api-v2.yaml`
183
- - Version history: `node_modules/@lunchmoney/v2-api-spec/spec/version-history.md`
184
-
185
- ### As a Git Repository
186
-
187
- You can clone this repository directly:
188
-
189
- ```bash
190
- git clone https://github.com/lunch-money/api-specs.git
191
- cd api-specs
192
- ```
193
-
194
- Or add it as a submodule to your project:
195
-
196
- ```bash
197
- git submodule add https://github.com/lunch-money/api-specs.git specs/v2
198
- ```
199
-
200
- ## Contributing
201
-
202
- We welcome contributions to improve the API documentation! When contributing:
203
-
204
- 1. **For API reference changes**: Update the OpenAPI specification in `v2/spec/lunch-money-api-v2.yaml`
205
- 2. **For documentation**: Update the relevant Markdown files in `v2/docs/`
206
- 3. **Version updates**: Update `v2/docs/version-history.md` with your changes
207
- 4. Create a pull request with a clear description of your changes
208
-
209
- Please ensure that:
210
- - OpenAPI spec changes are valid YAML and conform to OpenAPI 3.0
211
- - Documentation follows the existing style and uses the custom Markdown features appropriately
212
-
213
- ## Resources
214
-
215
- - [Lunch Money Website](https://lunchmoney.app)
216
- - [Interactive API Documentation](https://alpha.lunchmoney.dev/v2/docs)
217
- - [API Status](https://status.lunchmoney.app)