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

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.
@@ -760,7 +760,12 @@ components:
760
760
  type: string
761
761
  minLength: 1
762
762
  maxLength: 45
763
- description: The name of the crypto asset
763
+ description: The asset name for this balance, typically the uppercased currency symbol (e.g. ETH).
764
+ display_name:
765
+ type: string
766
+ nullable: true
767
+ description: Optional display name for the synced crypto asset as set by the user. If `null`,
768
+ clients may derive a display name from syncedCryptoAccount's `provider` + `name`.
764
769
  balance:
765
770
  type: string
766
771
  pattern: ^-?\d+(\.\d{1,18})?$
@@ -1791,7 +1796,10 @@ components:
1791
1796
  deleted: "#/components/schemas/balanceHistorySourceDeleted"
1792
1797
  balances:
1793
1798
  type: array
1794
- description: One or more monthly balance history entries for the source account.
1799
+ description: >
1800
+ Monthly balance history entries for the source account. On GET responses,
1801
+ this includes all entries in the requested range. On PUT upsert responses,
1802
+ this includes only the entries modified by that request.
1795
1803
  items:
1796
1804
  $ref: "#/components/schemas/balanceHistoryObject"
1797
1805
  required:
@@ -1816,7 +1824,7 @@ components:
1816
1824
  balance:
1817
1825
  type: string
1818
1826
  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.
1827
+ 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
1828
  currency:
1821
1829
  allOf:
1822
1830
  - $ref: "#/components/schemas/currencyEnum"
@@ -1863,7 +1871,7 @@ components:
1863
1871
  date:
1864
1872
  type: string
1865
1873
  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.
1874
+ 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
1875
  balance:
1868
1876
  oneOf:
1869
1877
  - type: number
@@ -2452,14 +2460,9 @@ components:
2452
2460
  external_id:
2453
2461
  type: string
2454
2462
  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.
2463
+ description: A user-defined external ID associated with the transaction.
2464
+ For transactions belonging to manual accounts, the
2465
+ external ID must be unique for each transaction associated with the account.
2463
2466
  minLength: 0
2464
2467
  maxLength: 75
2465
2468
  tag_ids:
@@ -2856,14 +2859,9 @@ components:
2856
2859
  external_id:
2857
2860
  type: string
2858
2861
  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.
2862
+ description: A user-defined external ID associated with the transaction.
2863
+ For transactions belonging to manual accounts, the
2864
+ external ID must be unique for each transaction associated with the account.
2867
2865
  minLength: 0
2868
2866
  maxLength: 75
2869
2867
  plaid_metadata:
@@ -3982,7 +3980,9 @@ components:
3982
3980
  while processing the request.<br> If multiple errors were
3983
3981
  encountered, the list will contain multiple objects.<br> Each
3984
3982
  `error` object is guaranteed to have an `errMsg`, but it may also
3985
- contain other error specific properties.
3983
+ contain other error-specific properties such as `code` (for example
3984
+ `VALIDATION_ERROR`), or other properties that are useful to map
3985
+ the error to the relevant part of the request.
3986
3986
  type: array
3987
3987
  items:
3988
3988
  type: object
@@ -5959,11 +5959,22 @@ paths:
5959
5959
  examples:
5960
5960
  missing required properties:
5961
5961
  value:
5962
- message: Request Validation Failure
5962
+ message: Invalid Request Body
5963
5963
  errors:
5964
5964
  - errMsg: "Missing required property 'name' in request body."
5965
5965
  - errMsg: "Missing required property 'balance' in request body."
5966
5966
  - errMsg: "Missing required property 'symbol' in request body."
5967
+ invalid balance:
5968
+ value:
5969
+ message: Invalid Request Body
5970
+ errors:
5971
+ - errMsg: "Invalid value for property 'balance'. 'abc' cannot be converted to a number"
5972
+ - errMsg: "Invalid value for property 'balance'. Invalid input"
5973
+ invalid property:
5974
+ value:
5975
+ message: Invalid Request Body
5976
+ errors:
5977
+ - errMsg: "Invalid property 'coingecko_id' in request body."
5967
5978
  unsupported symbol:
5968
5979
  value:
5969
5980
  message: Request Validation Failure
@@ -6711,7 +6722,7 @@ paths:
6711
6722
  value:
6712
6723
  message: Request Validation Failure
6713
6724
  errors:
6714
- - errMsg: "`start_date` must be less than or equal to `end_date`."
6725
+ - errMsg: "`start_date` must be before or equal to `end_date`."
6715
6726
  not first of month:
6716
6727
  value:
6717
6728
  message: Request Validation Failure
@@ -6837,7 +6848,7 @@ paths:
6837
6848
  value:
6838
6849
  message: Request Validation Failure
6839
6850
  errors:
6840
- - errMsg: "`start_date` must be less than or equal to `end_date`."
6851
+ - errMsg: "`start_date` must be before or equal to `end_date`."
6841
6852
  "401":
6842
6853
  $ref: "#/components/responses/unauthorizedToken"
6843
6854
  "404":
@@ -6856,7 +6867,7 @@ paths:
6856
6867
  value:
6857
6868
  message: Not Found
6858
6869
  errors:
6859
- - errMsg: "There is no deleted balance history source with the id: 99999999."
6870
+ - errMsg: "Deleted balance history source 99999999 was not found."
6860
6871
  "429":
6861
6872
  $ref: "#/components/responses/rateLimited"
6862
6873
  "500":
@@ -6867,29 +6878,29 @@ paths:
6867
6878
  summary: Upsert balance history for an account
6868
6879
  description: >-
6869
6880
  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>
6881
+ manual crypto, or deleted account. Crypto synced accounts require an additional `symbol` path parameter.<br><br>
6871
6882
 
6872
- The `account_type` path parameter identifies the the type of account and the
6883
+ The `account_type` path parameter identifies the type of account and the
6873
6884
  `account_id` path parameter identifies the specific id for that account type.<br><br>
6874
6885
 
6875
6886
  Submit one or more entries in the `balances` array. Each entry must specify
6876
6887
  a `date` and `balance` value.<br><br>
6877
6888
 
6878
6889
  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>
6890
+ a month and must be in a past month.<br><br>
6880
6891
 
6881
6892
  `currency` may be provided for any balance entry. If omitted, it defaults
6882
6893
  to the account currency for manual/Plaid accounts, or the user's primary
6883
6894
  currency for crypto/deleted accounts.<br><br>
6884
6895
 
6885
- `symbol` is optional for `crypto_manual` accounts, tolerated for `deleted`
6886
- accounts, and invalid for `manual` or `plaid` accounts.<br><br>
6896
+ `symbol` may only be set when `account_type` is `crypto_manual` or
6897
+ `crypto_synced`. It is optional for `crypto_manual` accounts and tolerated
6898
+ for `deleted` accounts.<br><br>
6887
6899
 
6888
- `crypto_balance` may be provided for `crypto_manual` and `deleted` accounts,
6889
- and is invalid for `manual` or `plaid` accounts.<br><br>
6900
+ `crypto_balance` may be provided for `crypto_manual`, `crypto_synced`, and
6901
+ `deleted` accounts, and is invalid for `manual` or `plaid` accounts.<br><br>
6890
6902
 
6891
- Use `PUT /v2/balance_history/deleted/{account_id}/details` to update
6892
- deleted-source metadata.
6903
+ The response contains only the balance entries that were submitted in this request.
6893
6904
  operationId: upsertBalanceHistoryForAccount
6894
6905
  parameters:
6895
6906
  - name: account_type
@@ -6934,7 +6945,7 @@ paths:
6934
6945
  symbol: btc
6935
6946
  crypto_balance: "0.020000000000000000"
6936
6947
  currency: usd
6937
- balance: "1255.0000"
6948
+ balance: "1255"
6938
6949
  get-shaped balance entry input:
6939
6950
  value:
6940
6951
  balances:
@@ -6946,13 +6957,15 @@ paths:
6946
6957
  crypto_balance: null
6947
6958
  responses:
6948
6959
  "200":
6949
- description: All balance history entries were upserted successfully
6960
+ description: Returns the modified balance entries only. Other historical
6961
+ entries for the account are omitted from `balances`.
6950
6962
  content:
6951
6963
  application/json:
6952
6964
  schema:
6953
6965
  $ref: "#/components/schemas/balanceHistoryAccountObject"
6954
6966
  examples:
6955
- balances updated:
6967
+ manual account bulk upsert:
6968
+ summary: Two upserted rows returned (not full account history)
6956
6969
  value:
6957
6970
  source:
6958
6971
  type: manual
@@ -6970,6 +6983,40 @@ paths:
6970
6983
  currency: usd
6971
6984
  to_base: 41625.5
6972
6985
  crypto_balance: null
6986
+ crypto manual balance with symbol:
6987
+ summary: Single upserted row returned
6988
+ value:
6989
+ source:
6990
+ type: crypto_manual
6991
+ crypto_manual_id: 22001
6992
+ symbol: btc
6993
+ balances:
6994
+ - id: 603
6995
+ date: "2026-03-01"
6996
+ balance: "56011.1200"
6997
+ currency: usd
6998
+ to_base: 56011.12
6999
+ crypto_balance: "0.852341920145782301"
7000
+ deleted account bulk upsert:
7001
+ summary: Single upserted row returned
7002
+ value:
7003
+ source:
7004
+ type: deleted
7005
+ deleted_account_id: 91
7006
+ name: Savings
7007
+ institution_name: Old Bank
7008
+ display_name: Closed Savings
7009
+ account_type: savings
7010
+ subtype: savings
7011
+ mask: "1234"
7012
+ symbol: btc
7013
+ balances:
7014
+ - id: 504
7015
+ date: "2026-03-01"
7016
+ balance: "1255"
7017
+ currency: usd
7018
+ to_base: 1255
7019
+ crypto_balance: "0.020000000000000000"
6973
7020
  "400":
6974
7021
  description: Bad Request. The entire request is rejected if any row in
6975
7022
  `balances` fails validation; no rows are updated.
@@ -6983,6 +7030,11 @@ paths:
6983
7030
  message: Invalid Request Body
6984
7031
  errors:
6985
7032
  - errMsg: "Missing required property 'balances' in request body."
7033
+ empty balances array:
7034
+ value:
7035
+ message: Invalid Request Body
7036
+ errors:
7037
+ - errMsg: "Invalid value for property 'balances'. Array must contain at least 1 element(s)"
6986
7038
  invalid property:
6987
7039
  value:
6988
7040
  message: Invalid Request Body
@@ -6994,23 +7046,24 @@ paths:
6994
7046
  errors:
6995
7047
  - errMsg: "`date` must be the first day of a month."
6996
7048
  request_balances_index: 0
7049
+ code: VALIDATION_ERROR
6997
7050
  future date:
6998
7051
  value:
6999
7052
  message: Request Validation Failure
7000
7053
  errors:
7001
- - errMsg: "`date` must not be in the future."
7054
+ - errMsg: "`date` must be in a past month."
7002
7055
  request_balances_index: 1
7003
7056
  crypto balance not allowed:
7004
7057
  value:
7005
7058
  message: Request Validation Failure
7006
7059
  errors:
7007
- - errMsg: "`crypto_balance` may only be set when `account_type` is `crypto_manual` or `deleted`."
7060
+ - errMsg: "`crypto_balance` may only be set when `account_type` is `crypto_manual`, `crypto_synced`, or `deleted`."
7008
7061
  request_balances_index: 0
7009
7062
  invalid row in bulk request:
7010
7063
  value:
7011
7064
  message: Request Validation Failure
7012
7065
  errors:
7013
- - errMsg: "`symbol` may not be set when `account_type` is `manual` or `plaid`."
7066
+ - errMsg: "`symbol` may only be set when `account_type` is `crypto_manual` or `crypto_synced`."
7014
7067
  request_balances_index: 1
7015
7068
  "401":
7016
7069
  $ref: "#/components/responses/unauthorizedToken"
@@ -7154,7 +7207,7 @@ paths:
7154
7207
  value:
7155
7208
  message: Request Validation Failure
7156
7209
  errors:
7157
- - errMsg: "`start_date` must be less than or equal to `end_date`."
7210
+ - errMsg: "`start_date` must be before or equal to `end_date`."
7158
7211
  "401":
7159
7212
  $ref: "#/components/responses/unauthorizedToken"
7160
7213
  "404":
@@ -7173,7 +7226,7 @@ paths:
7173
7226
  value:
7174
7227
  message: Not Found
7175
7228
  errors:
7176
- - errMsg: "There is no synced crypto balance history stream for symbol 'doge' on account id: 33004."
7229
+ - errMsg: "There is no balance history for symbol 'doge' on this account."
7177
7230
  "429":
7178
7231
  $ref: "#/components/responses/rateLimited"
7179
7232
  "500":
@@ -7192,14 +7245,18 @@ paths:
7192
7245
  a `date` and `balance` value.<br><br>
7193
7246
 
7194
7247
  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>
7248
+ a month and must be in a past month.<br><br>
7196
7249
 
7197
- The request body must not include `symbol`; the symbol is supplied by the path.<br><br>
7250
+ The request body may include an optional `symbol` on each balance entry. If
7251
+ provided, it must match the `symbol` path parameter. Omit `symbol` to use
7252
+ the path value.<br><br>
7198
7253
 
7199
7254
  `currency` may be provided for any balance entry. If omitted, it defaults
7200
7255
  to the user's primary currency for synced crypto balances.<br><br>
7201
7256
 
7202
- `crypto_balance` may be provided for synced crypto balances.
7257
+ `crypto_balance` may be provided for synced crypto balances.<br><br>
7258
+
7259
+ The response contains only the balance entries that were submitted in this request.
7203
7260
  operationId: upsertBalanceHistoryForCryptoSynced
7204
7261
  parameters:
7205
7262
  - name: account_id
@@ -7235,13 +7292,15 @@ paths:
7235
7292
  crypto_balance: "0.100020003000400050"
7236
7293
  responses:
7237
7294
  "200":
7238
- description: All balance history entries were upserted successfully
7295
+ description: Returns the modified balance entries only. Other historical
7296
+ entries for the symbol stream are omitted from `balances`.
7239
7297
  content:
7240
7298
  application/json:
7241
7299
  schema:
7242
7300
  $ref: "#/components/schemas/balanceHistoryAccountObject"
7243
7301
  examples:
7244
- balances updated:
7302
+ synced crypto bulk upsert:
7303
+ summary: Two upserted rows returned (not full symbol history)
7245
7304
  value:
7246
7305
  source:
7247
7306
  type: crypto_synced
@@ -7273,6 +7332,11 @@ paths:
7273
7332
  message: Invalid Request Body
7274
7333
  errors:
7275
7334
  - errMsg: "Missing required property 'balances' in request body."
7335
+ empty balances array:
7336
+ value:
7337
+ message: Invalid Request Body
7338
+ errors:
7339
+ - errMsg: "Invalid value for property 'balances'. Array must contain at least 1 element(s)"
7276
7340
  invalid date:
7277
7341
  value:
7278
7342
  message: Request Validation Failure
@@ -7283,8 +7347,14 @@ paths:
7283
7347
  value:
7284
7348
  message: Request Validation Failure
7285
7349
  errors:
7286
- - errMsg: "`date` must not be in the future."
7350
+ - errMsg: "`date` must be in a past month."
7287
7351
  request_balances_index: 1
7352
+ symbol mismatch:
7353
+ value:
7354
+ message: Request Validation Failure
7355
+ errors:
7356
+ - errMsg: "`symbol` in request body (doge) does not match the path symbol (eth)."
7357
+ request_balances_index: 0
7288
7358
  invalid row in bulk request:
7289
7359
  value:
7290
7360
  message: Request Validation Failure
@@ -7309,7 +7379,7 @@ paths:
7309
7379
  value:
7310
7380
  message: Not Found
7311
7381
  errors:
7312
- - errMsg: "There is no synced crypto balance history stream for symbol 'doge' on account id: 33004."
7382
+ - errMsg: "There is no balance history for symbol 'doge' on this account."
7313
7383
  "429":
7314
7384
  $ref: "#/components/responses/rateLimited"
7315
7385
  "500":
@@ -7354,7 +7424,7 @@ paths:
7354
7424
  example:
7355
7425
  message: Not Found
7356
7426
  errors:
7357
- - errMsg: "There is no synced crypto balance history stream for symbol 'doge' on account id: 33004."
7427
+ - errMsg: "There is no balance history for symbol 'doge' on this account."
7358
7428
  "429":
7359
7429
  $ref: "#/components/responses/rateLimited"
7360
7430
  "500":
@@ -7378,6 +7448,16 @@ paths:
7378
7448
  responses:
7379
7449
  "204":
7380
7450
  description: The balance history entry was deleted
7451
+ "400":
7452
+ description: Bad Request
7453
+ content:
7454
+ application/json:
7455
+ schema:
7456
+ $ref: "#/components/schemas/errorResponseObject"
7457
+ example:
7458
+ message: Request Validation Failure
7459
+ errors:
7460
+ - errMsg: "Invalid value type for path parameter: 'id'. Expected 'number', received 'string'."
7381
7461
  "401":
7382
7462
  $ref: "#/components/responses/unauthorizedToken"
7383
7463
  "404":
@@ -7452,7 +7532,7 @@ paths:
7452
7532
  example:
7453
7533
  message: Invalid Request Body
7454
7534
  errors:
7455
- - errMsg: "Request body must include at least one of: name, institution_name, display_name, account_type, subtype, mask."
7535
+ - errMsg: "At least one property must be provided: name, institution_name, display_name, account_type, subtype, mask."
7456
7536
  "401":
7457
7537
  $ref: "#/components/responses/unauthorizedToken"
7458
7538
  "404":
@@ -7464,7 +7544,7 @@ paths:
7464
7544
  example:
7465
7545
  message: Not Found
7466
7546
  errors:
7467
- - errMsg: "There is no deleted balance history source with the id: 99999999."
7547
+ - errMsg: "Deleted balance history source 99999999 was not found."
7468
7548
  "429":
7469
7549
  $ref: "#/components/responses/rateLimited"
7470
7550
  "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.6",
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: