@lunch-money/v2-api-spec 2.11.0-preview.4 → 2.11.0-preview.5

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.
@@ -1364,7 +1364,9 @@ components:
1364
1364
  - $ref: "#/components/schemas/accountTypeEnum"
1365
1365
  subtype:
1366
1366
  type: string
1367
- description: If set, an optional account subtype. Examples include<br>
1367
+ nullable: true
1368
+ description: If set, an optional account subtype. Set to `null` to clear it.
1369
+ Examples include<br>
1368
1370
  - retirement - checking - savings - prepaid credit card
1369
1371
  minLength: 1
1370
1372
  maxLength: 100
@@ -1791,7 +1793,10 @@ components:
1791
1793
  deleted: "#/components/schemas/balanceHistorySourceDeleted"
1792
1794
  balances:
1793
1795
  type: array
1794
- description: One or more monthly balance history entries for the source account.
1796
+ description: >
1797
+ Monthly balance history entries for the source account. On GET responses,
1798
+ this includes all entries in the requested range. On PUT upsert responses,
1799
+ this includes only the entries modified by that request.
1795
1800
  items:
1796
1801
  $ref: "#/components/schemas/balanceHistoryObject"
1797
1802
  required:
@@ -1816,7 +1821,7 @@ components:
1816
1821
  balance:
1817
1822
  type: string
1818
1823
  pattern: ^-?\d+(\.\d{1,4})?$
1819
- description: Historical balance stored for this entry. For manual and Plaid accounts this is in the account currency. For crypto accounts this is in the user's primary currency.
1824
+ description: Historical balance stored for this entry, as a numeric string with up to four decimal places. Trailing zeros and decimal places are not guaranteed in responses. For manual and Plaid accounts this is in the account currency. For crypto accounts this is in the user's primary currency.
1820
1825
  currency:
1821
1826
  allOf:
1822
1827
  - $ref: "#/components/schemas/currencyEnum"
@@ -1863,7 +1868,7 @@ components:
1863
1868
  date:
1864
1869
  type: string
1865
1870
  format: date
1866
- description: Month to update, in YYYY-MM-DD format. This must be the first day of a month and must not be in the future.
1871
+ description: Month to update, in YYYY-MM-DD format. This must be the first day of a month and must be in a past month.
1867
1872
  balance:
1868
1873
  oneOf:
1869
1874
  - type: number
@@ -2452,14 +2457,9 @@ components:
2452
2457
  external_id:
2453
2458
  type: string
2454
2459
  nullable: true
2455
- description: A user-defined external ID for any transaction that was
2456
- added via csv import, `POST /transactions` API call, or manually
2457
- added via the Lunch Money app. No external ID exists for
2458
- transactions associated with synced accounts, and they cannot be
2459
- added. For transactions associated with manual accounts, the
2460
- external ID must be unique as attempts to add a subsequent
2461
- transaction with the same external_id and manual_account_id will be
2462
- flagged as duplicates and fail.
2460
+ description: A user-defined external ID associated with the transaction.
2461
+ For transactions belonging to manual accounts, the
2462
+ external ID must be unique for each transaction associated with the account.
2463
2463
  minLength: 0
2464
2464
  maxLength: 75
2465
2465
  tag_ids:
@@ -2856,14 +2856,9 @@ components:
2856
2856
  external_id:
2857
2857
  type: string
2858
2858
  nullable: true
2859
- description: A user-defined external ID for any transaction that was
2860
- added via csv import, `POST /transactions` API call, or manually
2861
- added via the Lunch Money app. No external ID exists for
2862
- transactions associated with synced accounts, and they cannot be
2863
- added. For transactions associated with manual accounts, the
2864
- external ID must be unique as attempts to add a subsequent
2865
- transaction with the same external_id and manual_account_id will be
2866
- flagged as duplicates and fail.
2859
+ description: A user-defined external ID associated with the transaction.
2860
+ For transactions belonging to manual accounts, the
2861
+ external ID must be unique for each transaction associated with the account.
2867
2862
  minLength: 0
2868
2863
  maxLength: 75
2869
2864
  plaid_metadata:
@@ -3982,7 +3977,9 @@ components:
3982
3977
  while processing the request.<br> If multiple errors were
3983
3978
  encountered, the list will contain multiple objects.<br> Each
3984
3979
  `error` object is guaranteed to have an `errMsg`, but it may also
3985
- contain other error specific properties.
3980
+ contain other error-specific properties such as `code` (for example
3981
+ `VALIDATION_ERROR`), or other properties that are useful to map
3982
+ the error to the relevant part of the request.
3986
3983
  type: array
3987
3984
  items:
3988
3985
  type: object
@@ -5959,11 +5956,22 @@ paths:
5959
5956
  examples:
5960
5957
  missing required properties:
5961
5958
  value:
5962
- message: Request Validation Failure
5959
+ message: Invalid Request Body
5963
5960
  errors:
5964
5961
  - errMsg: "Missing required property 'name' in request body."
5965
5962
  - errMsg: "Missing required property 'balance' in request body."
5966
5963
  - errMsg: "Missing required property 'symbol' in request body."
5964
+ invalid balance:
5965
+ value:
5966
+ message: Invalid Request Body
5967
+ errors:
5968
+ - errMsg: "Invalid value for property 'balance'. 'abc' cannot be converted to a number"
5969
+ - errMsg: "Invalid value for property 'balance'. Invalid input"
5970
+ invalid property:
5971
+ value:
5972
+ message: Invalid Request Body
5973
+ errors:
5974
+ - errMsg: "Invalid property 'coingecko_id' in request body."
5967
5975
  unsupported symbol:
5968
5976
  value:
5969
5977
  message: Request Validation Failure
@@ -6711,7 +6719,7 @@ paths:
6711
6719
  value:
6712
6720
  message: Request Validation Failure
6713
6721
  errors:
6714
- - errMsg: "`start_date` must be less than or equal to `end_date`."
6722
+ - errMsg: "`start_date` must be before or equal to `end_date`."
6715
6723
  not first of month:
6716
6724
  value:
6717
6725
  message: Request Validation Failure
@@ -6837,7 +6845,7 @@ paths:
6837
6845
  value:
6838
6846
  message: Request Validation Failure
6839
6847
  errors:
6840
- - errMsg: "`start_date` must be less than or equal to `end_date`."
6848
+ - errMsg: "`start_date` must be before or equal to `end_date`."
6841
6849
  "401":
6842
6850
  $ref: "#/components/responses/unauthorizedToken"
6843
6851
  "404":
@@ -6856,7 +6864,7 @@ paths:
6856
6864
  value:
6857
6865
  message: Not Found
6858
6866
  errors:
6859
- - errMsg: "There is no deleted balance history source with the id: 99999999."
6867
+ - errMsg: "Deleted balance history source 99999999 was not found."
6860
6868
  "429":
6861
6869
  $ref: "#/components/responses/rateLimited"
6862
6870
  "500":
@@ -6867,29 +6875,29 @@ paths:
6867
6875
  summary: Upsert balance history for an account
6868
6876
  description: >-
6869
6877
  Upsert one or more historical balance entries for a single manual, Plaid,
6870
- manual crypto, or deleted acount. Crypto synced accounts require an additional `symbol` path parameter.<br><br>
6878
+ manual crypto, or deleted account. Crypto synced accounts require an additional `symbol` path parameter.<br><br>
6871
6879
 
6872
- The `account_type` path parameter identifies the the type of account and the
6880
+ The `account_type` path parameter identifies the type of account and the
6873
6881
  `account_id` path parameter identifies the specific id for that account type.<br><br>
6874
6882
 
6875
6883
  Submit one or more entries in the `balances` array. Each entry must specify
6876
6884
  a `date` and `balance` value.<br><br>
6877
6885
 
6878
6886
  Balance history is monthly. Each entry's `date` must be the first day of
6879
- a month and must not be in the future.<br><br>
6887
+ a month and must be in a past month.<br><br>
6880
6888
 
6881
6889
  `currency` may be provided for any balance entry. If omitted, it defaults
6882
6890
  to the account currency for manual/Plaid accounts, or the user's primary
6883
6891
  currency for crypto/deleted accounts.<br><br>
6884
6892
 
6885
- `symbol` is optional for `crypto_manual` accounts, tolerated for `deleted`
6886
- accounts, and invalid for `manual` or `plaid` accounts.<br><br>
6893
+ `symbol` may only be set when `account_type` is `crypto_manual` or
6894
+ `crypto_synced`. It is optional for `crypto_manual` accounts and tolerated
6895
+ for `deleted` accounts.<br><br>
6887
6896
 
6888
- `crypto_balance` may be provided for `crypto_manual` and `deleted` accounts,
6889
- and is invalid for `manual` or `plaid` accounts.<br><br>
6897
+ `crypto_balance` may be provided for `crypto_manual`, `crypto_synced`, and
6898
+ `deleted` accounts, and is invalid for `manual` or `plaid` accounts.<br><br>
6890
6899
 
6891
- Use `PUT /v2/balance_history/deleted/{account_id}/details` to update
6892
- deleted-source metadata.
6900
+ The response contains only the balance entries that were submitted in this request.
6893
6901
  operationId: upsertBalanceHistoryForAccount
6894
6902
  parameters:
6895
6903
  - name: account_type
@@ -6934,7 +6942,7 @@ paths:
6934
6942
  symbol: btc
6935
6943
  crypto_balance: "0.020000000000000000"
6936
6944
  currency: usd
6937
- balance: "1255.0000"
6945
+ balance: "1255"
6938
6946
  get-shaped balance entry input:
6939
6947
  value:
6940
6948
  balances:
@@ -6946,13 +6954,15 @@ paths:
6946
6954
  crypto_balance: null
6947
6955
  responses:
6948
6956
  "200":
6949
- description: All balance history entries were upserted successfully
6957
+ description: Returns the modified balance entries only. Other historical
6958
+ entries for the account are omitted from `balances`.
6950
6959
  content:
6951
6960
  application/json:
6952
6961
  schema:
6953
6962
  $ref: "#/components/schemas/balanceHistoryAccountObject"
6954
6963
  examples:
6955
- balances updated:
6964
+ manual account bulk upsert:
6965
+ summary: Two upserted rows returned (not full account history)
6956
6966
  value:
6957
6967
  source:
6958
6968
  type: manual
@@ -6970,6 +6980,40 @@ paths:
6970
6980
  currency: usd
6971
6981
  to_base: 41625.5
6972
6982
  crypto_balance: null
6983
+ crypto manual balance with symbol:
6984
+ summary: Single upserted row returned
6985
+ value:
6986
+ source:
6987
+ type: crypto_manual
6988
+ crypto_manual_id: 22001
6989
+ symbol: btc
6990
+ balances:
6991
+ - id: 603
6992
+ date: "2026-03-01"
6993
+ balance: "56011.1200"
6994
+ currency: usd
6995
+ to_base: 56011.12
6996
+ crypto_balance: "0.852341920145782301"
6997
+ deleted account bulk upsert:
6998
+ summary: Single upserted row returned
6999
+ value:
7000
+ source:
7001
+ type: deleted
7002
+ deleted_account_id: 91
7003
+ name: Savings
7004
+ institution_name: Old Bank
7005
+ display_name: Closed Savings
7006
+ account_type: savings
7007
+ subtype: savings
7008
+ mask: "1234"
7009
+ symbol: btc
7010
+ balances:
7011
+ - id: 504
7012
+ date: "2026-03-01"
7013
+ balance: "1255"
7014
+ currency: usd
7015
+ to_base: 1255
7016
+ crypto_balance: "0.020000000000000000"
6973
7017
  "400":
6974
7018
  description: Bad Request. The entire request is rejected if any row in
6975
7019
  `balances` fails validation; no rows are updated.
@@ -6983,6 +7027,11 @@ paths:
6983
7027
  message: Invalid Request Body
6984
7028
  errors:
6985
7029
  - errMsg: "Missing required property 'balances' in request body."
7030
+ empty balances array:
7031
+ value:
7032
+ message: Invalid Request Body
7033
+ errors:
7034
+ - errMsg: "Invalid value for property 'balances'. Array must contain at least 1 element(s)"
6986
7035
  invalid property:
6987
7036
  value:
6988
7037
  message: Invalid Request Body
@@ -6994,23 +7043,24 @@ paths:
6994
7043
  errors:
6995
7044
  - errMsg: "`date` must be the first day of a month."
6996
7045
  request_balances_index: 0
7046
+ code: VALIDATION_ERROR
6997
7047
  future date:
6998
7048
  value:
6999
7049
  message: Request Validation Failure
7000
7050
  errors:
7001
- - errMsg: "`date` must not be in the future."
7051
+ - errMsg: "`date` must be in a past month."
7002
7052
  request_balances_index: 1
7003
7053
  crypto balance not allowed:
7004
7054
  value:
7005
7055
  message: Request Validation Failure
7006
7056
  errors:
7007
- - errMsg: "`crypto_balance` may only be set when `account_type` is `crypto_manual` or `deleted`."
7057
+ - errMsg: "`crypto_balance` may only be set when `account_type` is `crypto_manual`, `crypto_synced`, or `deleted`."
7008
7058
  request_balances_index: 0
7009
7059
  invalid row in bulk request:
7010
7060
  value:
7011
7061
  message: Request Validation Failure
7012
7062
  errors:
7013
- - errMsg: "`symbol` may not be set when `account_type` is `manual` or `plaid`."
7063
+ - errMsg: "`symbol` may only be set when `account_type` is `crypto_manual` or `crypto_synced`."
7014
7064
  request_balances_index: 1
7015
7065
  "401":
7016
7066
  $ref: "#/components/responses/unauthorizedToken"
@@ -7154,7 +7204,7 @@ paths:
7154
7204
  value:
7155
7205
  message: Request Validation Failure
7156
7206
  errors:
7157
- - errMsg: "`start_date` must be less than or equal to `end_date`."
7207
+ - errMsg: "`start_date` must be before or equal to `end_date`."
7158
7208
  "401":
7159
7209
  $ref: "#/components/responses/unauthorizedToken"
7160
7210
  "404":
@@ -7173,7 +7223,7 @@ paths:
7173
7223
  value:
7174
7224
  message: Not Found
7175
7225
  errors:
7176
- - errMsg: "There is no synced crypto balance history stream for symbol 'doge' on account id: 33004."
7226
+ - errMsg: "There is no balance history for symbol 'doge' on this account."
7177
7227
  "429":
7178
7228
  $ref: "#/components/responses/rateLimited"
7179
7229
  "500":
@@ -7192,14 +7242,18 @@ paths:
7192
7242
  a `date` and `balance` value.<br><br>
7193
7243
 
7194
7244
  Balance history is monthly. Each entry's `date` must be the first day of
7195
- a month and must not be in the future.<br><br>
7245
+ a month and must be in a past month.<br><br>
7196
7246
 
7197
- The request body must not include `symbol`; the symbol is supplied by the path.<br><br>
7247
+ The request body may include an optional `symbol` on each balance entry. If
7248
+ provided, it must match the `symbol` path parameter. Omit `symbol` to use
7249
+ the path value.<br><br>
7198
7250
 
7199
7251
  `currency` may be provided for any balance entry. If omitted, it defaults
7200
7252
  to the user's primary currency for synced crypto balances.<br><br>
7201
7253
 
7202
- `crypto_balance` may be provided for synced crypto balances.
7254
+ `crypto_balance` may be provided for synced crypto balances.<br><br>
7255
+
7256
+ The response contains only the balance entries that were submitted in this request.
7203
7257
  operationId: upsertBalanceHistoryForCryptoSynced
7204
7258
  parameters:
7205
7259
  - name: account_id
@@ -7235,13 +7289,15 @@ paths:
7235
7289
  crypto_balance: "0.100020003000400050"
7236
7290
  responses:
7237
7291
  "200":
7238
- description: All balance history entries were upserted successfully
7292
+ description: Returns the modified balance entries only. Other historical
7293
+ entries for the symbol stream are omitted from `balances`.
7239
7294
  content:
7240
7295
  application/json:
7241
7296
  schema:
7242
7297
  $ref: "#/components/schemas/balanceHistoryAccountObject"
7243
7298
  examples:
7244
- balances updated:
7299
+ synced crypto bulk upsert:
7300
+ summary: Two upserted rows returned (not full symbol history)
7245
7301
  value:
7246
7302
  source:
7247
7303
  type: crypto_synced
@@ -7273,6 +7329,11 @@ paths:
7273
7329
  message: Invalid Request Body
7274
7330
  errors:
7275
7331
  - errMsg: "Missing required property 'balances' in request body."
7332
+ empty balances array:
7333
+ value:
7334
+ message: Invalid Request Body
7335
+ errors:
7336
+ - errMsg: "Invalid value for property 'balances'. Array must contain at least 1 element(s)"
7276
7337
  invalid date:
7277
7338
  value:
7278
7339
  message: Request Validation Failure
@@ -7283,8 +7344,14 @@ paths:
7283
7344
  value:
7284
7345
  message: Request Validation Failure
7285
7346
  errors:
7286
- - errMsg: "`date` must not be in the future."
7347
+ - errMsg: "`date` must be in a past month."
7287
7348
  request_balances_index: 1
7349
+ symbol mismatch:
7350
+ value:
7351
+ message: Request Validation Failure
7352
+ errors:
7353
+ - errMsg: "`symbol` in request body (doge) does not match the path symbol (eth)."
7354
+ request_balances_index: 0
7288
7355
  invalid row in bulk request:
7289
7356
  value:
7290
7357
  message: Request Validation Failure
@@ -7309,7 +7376,7 @@ paths:
7309
7376
  value:
7310
7377
  message: Not Found
7311
7378
  errors:
7312
- - errMsg: "There is no synced crypto balance history stream for symbol 'doge' on account id: 33004."
7379
+ - errMsg: "There is no balance history for symbol 'doge' on this account."
7313
7380
  "429":
7314
7381
  $ref: "#/components/responses/rateLimited"
7315
7382
  "500":
@@ -7354,7 +7421,7 @@ paths:
7354
7421
  example:
7355
7422
  message: Not Found
7356
7423
  errors:
7357
- - errMsg: "There is no synced crypto balance history stream for symbol 'doge' on account id: 33004."
7424
+ - errMsg: "There is no balance history for symbol 'doge' on this account."
7358
7425
  "429":
7359
7426
  $ref: "#/components/responses/rateLimited"
7360
7427
  "500":
@@ -7378,6 +7445,16 @@ paths:
7378
7445
  responses:
7379
7446
  "204":
7380
7447
  description: The balance history entry was deleted
7448
+ "400":
7449
+ description: Bad Request
7450
+ content:
7451
+ application/json:
7452
+ schema:
7453
+ $ref: "#/components/schemas/errorResponseObject"
7454
+ example:
7455
+ message: Request Validation Failure
7456
+ errors:
7457
+ - errMsg: "Invalid value type for path parameter: 'id'. Expected 'number', received 'string'."
7381
7458
  "401":
7382
7459
  $ref: "#/components/responses/unauthorizedToken"
7383
7460
  "404":
@@ -7452,7 +7529,7 @@ paths:
7452
7529
  example:
7453
7530
  message: Invalid Request Body
7454
7531
  errors:
7455
- - errMsg: "Request body must include at least one of: name, institution_name, display_name, account_type, subtype, mask."
7532
+ - errMsg: "At least one property must be provided: name, institution_name, display_name, account_type, subtype, mask."
7456
7533
  "401":
7457
7534
  $ref: "#/components/responses/unauthorizedToken"
7458
7535
  "404":
@@ -7464,7 +7541,7 @@ paths:
7464
7541
  example:
7465
7542
  message: Not Found
7466
7543
  errors:
7467
- - errMsg: "There is no deleted balance history source with the id: 99999999."
7544
+ - errMsg: "Deleted balance history source 99999999 was not found."
7468
7545
  "429":
7469
7546
  $ref: "#/components/responses/rateLimited"
7470
7547
  "500":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunch-money/v2-api-spec",
3
- "version": "2.11.0-preview.4",
3
+ "version": "2.11.0-preview.5",
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": [
@@ -16,6 +16,7 @@ The Lunch Money API spec uses a modified version of SEMVER for its versioning me
16
16
  - Add `DELETE /balance_history/crypto_synced/{account_id}/{symbol}`
17
17
  - Add `PUT /balance_history/deleted/{account_id}/details`
18
18
  - Remove `rollover_pool` from the category object returned in the summary response. It is in the main summary response.
19
+ - It is now possible to set an external_id on any transaction, including those that belong to a Plaid account.
19
20
 
20
21
  ## v2.10.0 - TBD
21
22
  - Add v2 crypto endpoints which support: