quantix-mcp 0.3.7 → 0.4.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.
Files changed (113) hide show
  1. package/.claude/settings.local.json +2 -1
  2. package/.github/agents/copilot-instructions.md +32 -32
  3. package/.github/copilot-instructions.md +17 -17
  4. package/.github/workflows/publish.yaml +28 -28
  5. package/.opencode/command/speckit.analyze.md +184 -184
  6. package/.opencode/command/speckit.checklist.md +294 -294
  7. package/.opencode/command/speckit.clarify.md +181 -181
  8. package/.opencode/command/speckit.constitution.md +84 -84
  9. package/.opencode/command/speckit.implement.md +135 -135
  10. package/.opencode/command/speckit.plan.md +89 -89
  11. package/.opencode/command/speckit.specify.md +258 -258
  12. package/.opencode/command/speckit.tasks.md +137 -137
  13. package/.opencode/command/speckit.taskstoissues.md +30 -30
  14. package/.specify/memory/constitution.md +58 -58
  15. package/.specify/templates/constitution-template.md +50 -50
  16. package/.vscode/launch.json +14 -14
  17. package/CLAUDE.md +70 -64
  18. package/GEMINI.md +58 -0
  19. package/README.md +176 -176
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +14 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/tools/accounts.d.ts.map +1 -1
  24. package/dist/tools/accounts.js +55 -34
  25. package/dist/tools/accounts.js.map +1 -1
  26. package/dist/tools/categories.d.ts.map +1 -1
  27. package/dist/tools/categories.js +46 -20
  28. package/dist/tools/categories.js.map +1 -1
  29. package/dist/tools/credit-cards.d.ts.map +1 -1
  30. package/dist/tools/credit-cards.js +104 -33
  31. package/dist/tools/credit-cards.js.map +1 -1
  32. package/dist/tools/data.d.ts.map +1 -1
  33. package/dist/tools/data.js +19 -8
  34. package/dist/tools/data.js.map +1 -1
  35. package/dist/tools/settings.d.ts.map +1 -1
  36. package/dist/tools/settings.js +28 -12
  37. package/dist/tools/settings.js.map +1 -1
  38. package/dist/tools/subscriptions.d.ts +3 -0
  39. package/dist/tools/subscriptions.d.ts.map +1 -0
  40. package/dist/tools/subscriptions.js +128 -0
  41. package/dist/tools/subscriptions.js.map +1 -0
  42. package/dist/tools/summary.d.ts.map +1 -1
  43. package/dist/tools/summary.js +17 -11
  44. package/dist/tools/summary.js.map +1 -1
  45. package/dist/tools/transactions.d.ts.map +1 -1
  46. package/dist/tools/transactions.js +85 -50
  47. package/dist/tools/transactions.js.map +1 -1
  48. package/dist/tools/transfers.d.ts +3 -0
  49. package/dist/tools/transfers.d.ts.map +1 -0
  50. package/dist/tools/transfers.js +107 -0
  51. package/dist/tools/transfers.js.map +1 -0
  52. package/dist/types/schemas.d.ts +65 -0
  53. package/dist/types/schemas.d.ts.map +1 -1
  54. package/dist/types/schemas.js +69 -3
  55. package/dist/types/schemas.js.map +1 -1
  56. package/dist/utils/toolHelpers.d.ts +7 -0
  57. package/dist/utils/toolHelpers.d.ts.map +1 -0
  58. package/dist/utils/toolHelpers.js +11 -0
  59. package/dist/utils/toolHelpers.js.map +1 -0
  60. package/openapi.yaml +2279 -1828
  61. package/package.json +41 -41
  62. package/specs/001-mcp-api-integration/checklists/requirements.md +34 -34
  63. package/specs/001-mcp-api-integration/contracts/openapi.yaml +635 -635
  64. package/specs/001-mcp-api-integration/data-model.md +106 -106
  65. package/specs/001-mcp-api-integration/plan.md +73 -73
  66. package/specs/001-mcp-api-integration/quickstart.md +74 -74
  67. package/specs/001-mcp-api-integration/research.md +58 -58
  68. package/specs/001-mcp-api-integration/spec.md +119 -119
  69. package/specs/001-mcp-api-integration/tasks.md +64 -64
  70. package/src/config.ts +36 -36
  71. package/src/index.ts +60 -47
  72. package/src/services/apiClient.ts +49 -49
  73. package/src/tools/accounts.ts +122 -111
  74. package/src/tools/categories.ts +102 -81
  75. package/src/tools/credit-cards.ts +203 -147
  76. package/src/tools/data.ts +45 -36
  77. package/src/tools/settings.ts +64 -51
  78. package/src/tools/subscriptions.ts +159 -0
  79. package/src/tools/summary.ts +29 -24
  80. package/src/tools/transactions.ts +156 -128
  81. package/src/tools/transfers.ts +122 -0
  82. package/src/types/schemas.ts +304 -235
  83. package/src/utils/toolHelpers.ts +11 -0
  84. package/tests/benchmark.test.d.ts +1 -1
  85. package/tests/benchmark.test.js +32 -32
  86. package/tests/benchmark.test.ts +38 -38
  87. package/tests/server.test.d.ts +1 -1
  88. package/tests/server.test.js +12 -12
  89. package/tests/server.test.ts +14 -14
  90. package/tests/setup.d.ts +3 -3
  91. package/tests/setup.js +16 -16
  92. package/tests/setup.ts +20 -20
  93. package/tests/tools/accounts.test.ts +159 -118
  94. package/tests/tools/categories.test.d.ts +1 -1
  95. package/tests/tools/categories.test.js +62 -62
  96. package/tests/tools/categories.test.ts +120 -78
  97. package/tests/tools/credit-cards.test.d.ts +1 -1
  98. package/tests/tools/credit-cards.test.js +70 -70
  99. package/tests/tools/credit-cards.test.ts +131 -89
  100. package/tests/tools/data.test.ts +100 -0
  101. package/tests/tools/settings.test.ts +116 -0
  102. package/tests/tools/subscriptions.test.ts +173 -0
  103. package/tests/tools/summary.test.d.ts +1 -1
  104. package/tests/tools/summary.test.js +35 -35
  105. package/tests/tools/summary.test.ts +63 -42
  106. package/tests/tools/transactions.test.d.ts +1 -1
  107. package/tests/tools/transactions.test.js +66 -66
  108. package/tests/tools/transactions.test.ts +133 -82
  109. package/tests/tools/transfers.test.ts +141 -0
  110. package/tsconfig.json +52 -52
  111. package/vitest.config.d.ts +2 -2
  112. package/vitest.config.js +13 -13
  113. package/vitest.config.ts +14 -14
package/openapi.yaml CHANGED
@@ -1,1828 +1,2279 @@
1
- openapi: 3.0.0
2
- info:
3
- title: Quantix Personal Finance Manager API
4
- description: API for managing personal finances including transactions, credit cards, categories, and recurring payments
5
- version: 1.0.0
6
- contact:
7
- name: Quantix Support
8
- email: support@quantix.example.com
9
-
10
- servers:
11
- - url: https://api.quantix.example.com
12
- description: Production server
13
- - url: https://staging.quantix.example.com
14
- description: Staging server
15
-
16
- components:
17
- securitySchemes:
18
- ApiKeyAuth:
19
- type: apiKey
20
- in: header
21
- name: API-KEY
22
- description: API key for authentication, configured via QUANTIX_API_KEY environment variable
23
-
24
- schemas:
25
- Category:
26
- type: object
27
- required:
28
- - name
29
- - type
30
- properties:
31
- id:
32
- type: string
33
- description: Unique identifier for the category
34
- example: "cat_123456789"
35
- name:
36
- type: string
37
- description: Name of the category
38
- example: "Groceries"
39
- type:
40
- type: string
41
- enum: [INCOME, EXPENSE]
42
- description: Type of the category
43
- example: "EXPENSE"
44
- color:
45
- type: string
46
- nullable: true
47
- description: Color for the category in hexadecimal format
48
- example: "#FF5733"
49
- createdAt:
50
- type: string
51
- format: date-time
52
- description: Timestamp when the category was created
53
- example: "2026-01-30T10:00:00Z"
54
-
55
- Transaction:
56
- type: object
57
- required:
58
- - type
59
- - name
60
- - amount
61
- - date
62
- properties:
63
- id:
64
- type: string
65
- description: Unique identifier for the transaction
66
- example: "txn_123456789"
67
- type:
68
- type: string
69
- enum: [INCOME, EXPENSE]
70
- description: Type of the transaction
71
- example: "EXPENSE"
72
- name:
73
- type: string
74
- description: Description of the transaction
75
- example: "Weekly groceries"
76
- amount:
77
- type: number
78
- format: float
79
- minimum: 0
80
- description: Amount of the transaction
81
- example: 125.75
82
- date:
83
- type: string
84
- format: date
85
- description: Date of the transaction
86
- example: "2026-01-30"
87
- purchaseDate:
88
- type: string
89
- format: date
90
- description: Actual purchase date (credit card only, optional)
91
- example: "2026-02-10"
92
- nullable: true
93
- categoryId:
94
- type: string
95
- description: ID of the associated category
96
- example: "cat_123456789"
97
- category:
98
- $ref: '#/components/schemas/Category'
99
- description: Associated category object
100
- paymentMethod:
101
- type: string
102
- enum: [CASH, PIX, DEBIT, CREDIT]
103
- description: Method of payment
104
- example: "CREDIT"
105
- creditCardId:
106
- type: string
107
- description: ID of the associated credit card (required if paymentMethod is CREDIT)
108
- example: "cc_123456789"
109
- creditCard:
110
- $ref: '#/components/schemas/CreditCard'
111
- description: Associated credit card object
112
- installmentGroupId:
113
- type: string
114
- description: ID to group installment transactions
115
- example: "ig_123456789"
116
- installmentNumber:
117
- type: integer
118
- minimum: 1
119
- description: Current installment number in a series
120
- example: 2
121
- installmentTotal:
122
- type: integer
123
- minimum: 1
124
- description: Total number of installments in the series
125
- example: 5
126
- recurrenceRuleId:
127
- type: string
128
- description: ID of the associated recurrence rule
129
- example: "rr_123456789"
130
- accountId:
131
- type: string
132
- description: ID of the associated account (required if paymentMethod is not CREDIT)
133
- example: "acc_123456789"
134
- account:
135
- $ref: '#/components/schemas/Account'
136
- description: Associated account object
137
- paid:
138
- type: boolean
139
- default: false
140
- description: Whether the transaction has been paid/received
141
- example: true
142
- createdAt:
143
- type: string
144
- format: date-time
145
- description: Timestamp when the transaction was created
146
- example: "2026-01-30T10:00:00Z"
147
-
148
- CreditCard:
149
- type: object
150
- required:
151
- - name
152
- - limitAmount
153
- - closingDay
154
- - dueDay
155
- properties:
156
- id:
157
- type: string
158
- description: Unique identifier for the credit card
159
- example: "cc_123456789"
160
- name:
161
- type: string
162
- description: Name of the credit card
163
- example: "Nubank Platinum"
164
- brand:
165
- type: string
166
- description: Brand of the credit card
167
- example: "Visa"
168
- limitAmount:
169
- type: number
170
- format: float
171
- minimum: 0
172
- description: Credit limit of the card
173
- example: 5000.00
174
- closingDay:
175
- type: integer
176
- minimum: 1
177
- maximum: 31
178
- description: Day of the month when the billing cycle closes
179
- example: 15
180
- dueDay:
181
- type: integer
182
- minimum: 1
183
- maximum: 31
184
- description: Day of the month when the bill is due
185
- example: 22
186
- availableLimit:
187
- type: number
188
- format: float
189
- description: Available credit limit (limitAmount minus all pending unpaid expenses)
190
- example: 3200.00
191
- createdAt:
192
- type: string
193
- format: date-time
194
- description: Timestamp when the credit card was added
195
- example: "2026-01-30T10:00:00Z"
196
-
197
- RecurrenceRule:
198
- type: object
199
- required:
200
- - frequency
201
- properties:
202
- id:
203
- type: string
204
- description: Unique identifier for the recurrence rule
205
- example: "rr_123456789"
206
- frequency:
207
- type: string
208
- enum: [MONTHLY, WEEKLY, YEARLY]
209
- description: Frequency of recurrence
210
- example: "MONTHLY"
211
- interval:
212
- type: integer
213
- minimum: 1
214
- default: 1
215
- description: Interval multiplier for the frequency
216
- example: 1
217
- endDate:
218
- type: string
219
- format: date
220
- description: Date when the recurrence should end (mutually exclusive with occurrences)
221
- example: "2026-12-31"
222
- occurrences:
223
- type: integer
224
- minimum: 2
225
- description: Number of occurrences (mutually exclusive with endDate). When set, transaction names will be formatted as "Name (N/total)"
226
- example: 12
227
- createdAt:
228
- type: string
229
- format: date-time
230
- description: Timestamp when the recurrence rule was created
231
- example: "2026-01-30T10:00:00Z"
232
-
233
- Statement:
234
- type: object
235
- properties:
236
- cardId:
237
- type: string
238
- description: ID of the credit card
239
- example: "cc_123456789"
240
- periodStart:
241
- type: string
242
- format: date
243
- description: Start date of the billing period
244
- example: "2026-02-16"
245
- periodEnd:
246
- type: string
247
- format: date
248
- description: End date of the billing period
249
- example: "2026-03-15"
250
- dueDate:
251
- type: string
252
- format: date
253
- description: Due date of the statement
254
- example: "2026-03-22"
255
- transactions:
256
- type: array
257
- items:
258
- $ref: '#/components/schemas/Transaction'
259
- description: List of transactions in the statement period
260
- total:
261
- type: number
262
- format: float
263
- description: Total amount of the statement
264
- example: 3450.00
265
- availableLimit:
266
- type: number
267
- format: float
268
- description: Available credit limit
269
- example: 1550.00
270
-
271
- StatementStatus:
272
- type: object
273
- properties:
274
- cardId:
275
- type: string
276
- description: ID of the credit card
277
- example: "cc_123456789"
278
- month:
279
- type: string
280
- description: Month for the statement (YYYY-MM format)
281
- example: "2026-03"
282
- isPaid:
283
- type: boolean
284
- description: Whether all transactions in the statement are paid
285
- example: true
286
-
287
- Account:
288
- type: object
289
- required:
290
- - name
291
- - type
292
- - initialBalance
293
- properties:
294
- id:
295
- type: string
296
- description: Unique identifier for the account
297
- example: "acc_123456789"
298
- name:
299
- type: string
300
- description: Name of the account
301
- example: "Itaú Checking Account"
302
- type:
303
- type: string
304
- enum: [BANK_ACCOUNT, WALLET, SAVINGS_ACCOUNT, INVESTMENT_ACCOUNT, OTHER]
305
- description: Type of account
306
- example: "BANK_ACCOUNT"
307
- initialBalance:
308
- type: number
309
- format: float
310
- description: Initial balance when the account was created
311
- example: 1000.00
312
- currentBalance:
313
- type: number
314
- format: float
315
- description: Current balance of the account
316
- example: 850.00
317
- createdAt:
318
- type: string
319
- format: date-time
320
- description: Timestamp when the account was created
321
- example: "2026-02-11T12:00:00Z"
322
- updatedAt:
323
- type: string
324
- format: date-time
325
- description: Timestamp when the account was last updated
326
- example: "2026-02-11T15:30:00Z"
327
-
328
- AccountBalance:
329
- type: object
330
- properties:
331
- accountId:
332
- type: string
333
- description: ID of the account
334
- example: "acc_123456789"
335
- currentBalance:
336
- type: number
337
- format: float
338
- description: Current balance of the account
339
- example: 850.00
340
- calculatedAt:
341
- type: string
342
- format: date-time
343
- description: Timestamp when the balance was calculated
344
- example: "2026-02-11T16:00:00Z"
345
-
346
-
347
- CategoryBreakdown:
348
- type: object
349
- properties:
350
- categoryId:
351
- type: string
352
- nullable: true
353
- description: Category ID (null if uncategorized)
354
- example: "cat-123"
355
- categoryName:
356
- type: string
357
- nullable: true
358
- description: Category name (null if uncategorized)
359
- example: "Housing"
360
- color:
361
- type: string
362
- nullable: true
363
- description: Category color in hex format
364
- example: "#ff5733"
365
- total:
366
- type: number
367
- format: float
368
- description: Total amount for this category
369
- example: 1500.00
370
-
371
- Summary:
372
- type: object
373
- properties:
374
- period:
375
- type: object
376
- description: The period covered by this summary
377
- properties:
378
- month:
379
- type: string
380
- description: Month in YYYY-MM format (present when queried by month)
381
- example: "2026-02"
382
- startDate:
383
- type: string
384
- description: Start date in YYYY-MM-DD format (present when queried by range)
385
- example: "2026-01-01"
386
- endDate:
387
- type: string
388
- description: End date in YYYY-MM-DD format (present when queried by range)
389
- example: "2026-03-31"
390
- income:
391
- type: number
392
- format: float
393
- description: Total income for the period (paid + pending)
394
- example: 10000.00
395
- expenses:
396
- type: number
397
- format: float
398
- description: Total expenses for the period (paid + pending)
399
- example: 4000.00
400
- pendingIncome:
401
- type: number
402
- format: float
403
- description: Sum of income transactions not yet marked as received
404
- example: 1000.00
405
- pendingExpenses:
406
- type: number
407
- format: float
408
- description: Sum of expense transactions not yet marked as paid
409
- example: 500.00
410
- balance:
411
- type: number
412
- format: float
413
- description: Net balance (income - expenses)
414
- example: 6000.00
415
- creditCardExpenses:
416
- type: array
417
- description: Credit card totals for the period
418
- items:
419
- type: object
420
- properties:
421
- cardId:
422
- type: string
423
- description: Credit card ID
424
- example: "abc-123"
425
- cardName:
426
- type: string
427
- description: Credit card name
428
- example: "Nubank"
429
- total:
430
- type: number
431
- format: float
432
- description: Total charged to this card in the period
433
- example: 2500.00
434
- dueDate:
435
- type: string
436
- format: date
437
- nullable: true
438
- description: Statement due date (only present when queried by month)
439
- example: "2026-03-22"
440
- isPaid:
441
- type: boolean
442
- nullable: true
443
- description: Whether the statement is fully paid (only present when queried by month)
444
- example: false
445
- expensesByCategory:
446
- type: array
447
- description: Expense totals grouped by category, sorted by total descending
448
- items:
449
- $ref: '#/components/schemas/CategoryBreakdown'
450
- incomeByCategory:
451
- type: array
452
- description: Income totals grouped by category, sorted by total descending
453
- items:
454
- $ref: '#/components/schemas/CategoryBreakdown'
455
- accounts:
456
- type: array
457
- description: >
458
- All accounts with their current balance (initialBalance + paid income - paid expenses).
459
- Not filtered by period.
460
- items:
461
- $ref: '#/components/schemas/AccountSummary'
462
- totalBalance:
463
- type: number
464
- format: float
465
- description: Sum of all account balances. Not filtered by period.
466
- example: 8500.00
467
-
468
- AccountSummary:
469
- type: object
470
- properties:
471
- accountId:
472
- type: string
473
- description: Account ID
474
- example: "acc-123"
475
- accountName:
476
- type: string
477
- description: Account name
478
- example: "Nubank"
479
- accountType:
480
- type: string
481
- enum: [BANK_ACCOUNT, WALLET, SAVINGS_ACCOUNT, INVESTMENT_ACCOUNT, OTHER]
482
- description: Account type
483
- example: "BANK_ACCOUNT"
484
- balance:
485
- type: number
486
- format: float
487
- description: Current balance (initialBalance + paid income - paid expenses)
488
- example: 2500.00
489
-
490
- CreateTransactionRequest:
491
- type: object
492
- required:
493
- - type
494
- - name
495
- - amount
496
- - date
497
- properties:
498
- type:
499
- $ref: '#/components/schemas/Transaction/properties/type'
500
- name:
501
- $ref: '#/components/schemas/Transaction/properties/name'
502
- amount:
503
- $ref: '#/components/schemas/Transaction/properties/amount'
504
- date:
505
- type: string
506
- format: date
507
- description: |
508
- Date of the transaction.
509
- For CREDIT payments, if targetDueMonth is provided, the date will be calculated based on the credit card's due day.
510
- Otherwise, this date will be used directly.
511
- example: "2026-01-30"
512
- categoryId:
513
- $ref: '#/components/schemas/Transaction/properties/categoryId'
514
- paymentMethod:
515
- $ref: '#/components/schemas/Transaction/properties/paymentMethod'
516
- creditCardId:
517
- $ref: '#/components/schemas/Transaction/properties/creditCardId'
518
- installments:
519
- type: integer
520
- minimum: 1
521
- description: Number of installments (optional)
522
- example: 3
523
- targetDueMonth:
524
- type: string
525
- pattern: "^\\d{4}-\\d{2}$"
526
- description: |
527
- Target month for due date in YYYY-MM format (optional).
528
- When provided for CREDIT payments, the transaction date(s) will be set to the credit card's due day in the specified month.
529
- For installments, each installment will be scheduled in subsequent months on the due day.
530
- Example: if credit card due day is 10, and targetDueMonth is "2026-03", the transaction date will be 2026-03-10.
531
- example: "2026-03"
532
- accountId:
533
- type: string
534
- description: ID of the associated account (required if paymentMethod is not CREDIT)
535
- example: "acc_123456789"
536
- recurrence:
537
- type: object
538
- properties:
539
- frequency:
540
- $ref: '#/components/schemas/RecurrenceRule/properties/frequency'
541
- interval:
542
- $ref: '#/components/schemas/RecurrenceRule/properties/interval'
543
- endDate:
544
- $ref: '#/components/schemas/RecurrenceRule/properties/endDate'
545
- occurrences:
546
- $ref: '#/components/schemas/RecurrenceRule/properties/occurrences'
547
- isPaid:
548
- type: boolean
549
- description: Whether the transaction is already paid at creation time (defaults to false)
550
- example: false
551
- purchaseDate:
552
- type: string
553
- format: date
554
- description: Actual purchase date (credit card only, optional)
555
- example: "2026-02-10"
556
-
557
- UpdateTransactionRequest:
558
- type: object
559
- properties:
560
- type:
561
- $ref: '#/components/schemas/Transaction/properties/type'
562
- name:
563
- $ref: '#/components/schemas/Transaction/properties/name'
564
- amount:
565
- $ref: '#/components/schemas/Transaction/properties/amount'
566
- date:
567
- type: string
568
- format: date
569
- description: |
570
- Date of the transaction.
571
- For CREDIT payments, if targetDueMonth is provided, the date will be calculated based on the credit card's due day.
572
- Otherwise, this date will be used directly.
573
- example: "2026-01-30"
574
- categoryId:
575
- $ref: '#/components/schemas/Transaction/properties/categoryId'
576
- paymentMethod:
577
- $ref: '#/components/schemas/Transaction/properties/paymentMethod'
578
- creditCardId:
579
- $ref: '#/components/schemas/Transaction/properties/creditCardId'
580
- targetDueMonth:
581
- type: string
582
- pattern: "^\\d{4}-\\d{2}$"
583
- description: |
584
- Target month for due date in YYYY-MM format (optional).
585
- When provided for CREDIT payments, the transaction date will be set to the credit card's due day in the specified month.
586
- Example: if credit card due day is 10, and targetDueMonth is "2026-03", the transaction date will be 2026-03-10.
587
- example: "2026-03"
588
- accountId:
589
- type: string
590
- description: ID of the associated account (required if paymentMethod is not CREDIT)
591
- example: "acc_123456789"
592
- recurrence:
593
- type: object
594
- properties:
595
- frequency:
596
- $ref: '#/components/schemas/RecurrenceRule/properties/frequency'
597
- interval:
598
- $ref: '#/components/schemas/RecurrenceRule/properties/interval'
599
- endDate:
600
- $ref: '#/components/schemas/RecurrenceRule/properties/endDate'
601
- occurrences:
602
- $ref: '#/components/schemas/RecurrenceRule/properties/occurrences'
603
-
604
- Settings:
605
- type: object
606
- required:
607
- - userName
608
- - language
609
- - currency
610
- properties:
611
- userName:
612
- type: string
613
- description: Name of the user
614
- example: "John Doe"
615
- language:
616
- type: string
617
- enum: [pt-BR, en-US]
618
- description: Preferred language
619
- example: "pt-BR"
620
- currency:
621
- type: string
622
- enum: [BRL, USD, EUR, GBP, JPY, CAD, AUD, CHF]
623
- description: Default currency
624
- example: "BRL"
625
- createdAt:
626
- type: string
627
- format: date-time
628
- description: Timestamp when settings were created
629
- example: "2026-01-30T10:00:00Z"
630
- updatedAt:
631
- type: string
632
- format: date-time
633
- description: Timestamp when settings were last updated
634
- example: "2026-01-30T10:00:00Z"
635
-
636
- responses:
637
- UnauthorizedError:
638
- description: API key is missing or invalid
639
- content:
640
- application/json:
641
- schema:
642
- type: object
643
- properties:
644
- statusCode:
645
- type: integer
646
- example: 401
647
- error:
648
- type: string
649
- example: "Unauthorized"
650
- message:
651
- type: string
652
- example: "Invalid API key"
653
-
654
- security:
655
- - ApiKeyAuth: []
656
-
657
- paths:
658
- /categories:
659
- post:
660
- summary: Create a new category
661
- requestBody:
662
- required: true
663
- content:
664
- application/json:
665
- schema:
666
- type: object
667
- required:
668
- - name
669
- - type
670
- properties:
671
- name:
672
- type: string
673
- example: "Groceries"
674
- type:
675
- type: string
676
- enum: [INCOME, EXPENSE]
677
- example: "EXPENSE"
678
- color:
679
- type: string
680
- nullable: true
681
- pattern: "^#[0-9A-Fa-f]{6}$"
682
- description: Color in hexadecimal format
683
- example: "#FF5733"
684
- responses:
685
- '201':
686
- description: Category created successfully
687
- content:
688
- application/json:
689
- schema:
690
- $ref: '#/components/schemas/Category'
691
- '400':
692
- description: Invalid input
693
- '401':
694
- $ref: '#/components/responses/UnauthorizedError'
695
-
696
- get:
697
- summary: Get all categories
698
- responses:
699
- '200':
700
- description: List of categories
701
- content:
702
- application/json:
703
- schema:
704
- type: array
705
- items:
706
- $ref: '#/components/schemas/Category'
707
- '401':
708
- $ref: '#/components/responses/UnauthorizedError'
709
-
710
- /categories/{id}:
711
- get:
712
- summary: Get a category by ID
713
- parameters:
714
- - name: id
715
- in: path
716
- required: true
717
- schema:
718
- type: string
719
- description: Category ID
720
- responses:
721
- '200':
722
- description: Category found
723
- content:
724
- application/json:
725
- schema:
726
- $ref: '#/components/schemas/Category'
727
- '401':
728
- $ref: '#/components/responses/UnauthorizedError'
729
- '404':
730
- description: Category not found
731
-
732
- patch:
733
- summary: Update a category
734
- parameters:
735
- - name: id
736
- in: path
737
- required: true
738
- schema:
739
- type: string
740
- description: Category ID
741
- requestBody:
742
- required: true
743
- content:
744
- application/json:
745
- schema:
746
- type: object
747
- properties:
748
- name:
749
- type: string
750
- example: "Groceries"
751
- color:
752
- type: string
753
- nullable: true
754
- pattern: "^#[0-9A-Fa-f]{6}$"
755
- description: Color in hexadecimal format
756
- example: "#FF5733"
757
- responses:
758
- '200':
759
- description: Category updated successfully
760
- content:
761
- application/json:
762
- schema:
763
- $ref: '#/components/schemas/Category'
764
- '400':
765
- description: Invalid input
766
- '401':
767
- $ref: '#/components/responses/UnauthorizedError'
768
- '404':
769
- description: Category not found
770
-
771
- delete:
772
- summary: Delete a category
773
- parameters:
774
- - name: id
775
- in: path
776
- required: true
777
- schema:
778
- type: string
779
- description: Category ID
780
- responses:
781
- '200':
782
- description: Category deleted successfully
783
- '401':
784
- $ref: '#/components/responses/UnauthorizedError'
785
- '404':
786
- description: Category not found
787
-
788
- /credit-cards:
789
- post:
790
- summary: Create a new credit card
791
- requestBody:
792
- required: true
793
- content:
794
- application/json:
795
- schema:
796
- type: object
797
- required:
798
- - name
799
- - limitAmount
800
- - closingDay
801
- - dueDay
802
- properties:
803
- name:
804
- type: string
805
- example: "Nubank Platinum"
806
- brand:
807
- type: string
808
- example: "Visa"
809
- limitAmount:
810
- type: number
811
- format: float
812
- example: 5000.00
813
- closingDay:
814
- type: integer
815
- minimum: 1
816
- maximum: 31
817
- example: 15
818
- dueDay:
819
- type: integer
820
- minimum: 1
821
- maximum: 31
822
- example: 22
823
- responses:
824
- '201':
825
- description: Credit card created successfully
826
- content:
827
- application/json:
828
- schema:
829
- $ref: '#/components/schemas/CreditCard'
830
- '400':
831
- description: Invalid input
832
- '401':
833
- $ref: '#/components/responses/UnauthorizedError'
834
-
835
- get:
836
- summary: Get all credit cards
837
- responses:
838
- '200':
839
- description: List of credit cards
840
- content:
841
- application/json:
842
- schema:
843
- type: array
844
- items:
845
- $ref: '#/components/schemas/CreditCard'
846
- '401':
847
- $ref: '#/components/responses/UnauthorizedError'
848
-
849
- /credit-cards/{id}:
850
- get:
851
- summary: Get a credit card by ID
852
- parameters:
853
- - name: id
854
- in: path
855
- required: true
856
- schema:
857
- type: string
858
- description: Credit card ID
859
- responses:
860
- '200':
861
- description: Credit card found
862
- content:
863
- application/json:
864
- schema:
865
- $ref: '#/components/schemas/CreditCard'
866
- '401':
867
- $ref: '#/components/responses/UnauthorizedError'
868
- '404':
869
- description: Credit card not found
870
-
871
- patch:
872
- summary: Update a credit card
873
- parameters:
874
- - name: id
875
- in: path
876
- required: true
877
- schema:
878
- type: string
879
- description: Credit card ID
880
- requestBody:
881
- required: true
882
- content:
883
- application/json:
884
- schema:
885
- type: object
886
- properties:
887
- name:
888
- type: string
889
- example: "Nubank Platinum"
890
- brand:
891
- type: string
892
- example: "Visa"
893
- limitAmount:
894
- type: number
895
- format: float
896
- example: 5000.00
897
- closingDay:
898
- type: integer
899
- minimum: 1
900
- maximum: 31
901
- example: 15
902
- dueDay:
903
- type: integer
904
- minimum: 1
905
- maximum: 31
906
- example: 22
907
- responses:
908
- '200':
909
- description: Credit card updated successfully
910
- content:
911
- application/json:
912
- schema:
913
- $ref: '#/components/schemas/CreditCard'
914
- '400':
915
- description: Invalid input
916
- '401':
917
- $ref: '#/components/responses/UnauthorizedError'
918
- '404':
919
- description: Credit card not found
920
-
921
- delete:
922
- summary: Delete a credit card
923
- parameters:
924
- - name: id
925
- in: path
926
- required: true
927
- schema:
928
- type: string
929
- description: Credit card ID
930
- responses:
931
- '200':
932
- description: Credit card deleted successfully
933
- '400':
934
- description: Cannot delete credit card with associated transactions
935
- '401':
936
- $ref: '#/components/responses/UnauthorizedError'
937
- '404':
938
- description: Credit card not found
939
-
940
- /credit-cards/{id}/statement:
941
- get:
942
- summary: Get credit card statement for a specific month
943
- parameters:
944
- - name: id
945
- in: path
946
- required: true
947
- schema:
948
- type: string
949
- description: Credit card ID
950
- - name: month
951
- in: query
952
- required: true
953
- schema:
954
- type: string
955
- pattern: "^\\d{4}-\\d{2}$"
956
- description: Month in YYYY-MM format
957
- example: "2026-03"
958
- responses:
959
- '200':
960
- description: Credit card statement
961
- content:
962
- application/json:
963
- schema:
964
- $ref: '#/components/schemas/Statement'
965
- '401':
966
- $ref: '#/components/responses/UnauthorizedError'
967
- '404':
968
- description: Credit card not found
969
-
970
- /credit-cards/{id}/pay-statement:
971
- post:
972
- summary: Mark all transactions in a credit card statement as paid
973
- parameters:
974
- - name: id
975
- in: path
976
- required: true
977
- schema:
978
- type: string
979
- description: Credit card ID
980
- requestBody:
981
- required: true
982
- content:
983
- application/json:
984
- schema:
985
- type: object
986
- required:
987
- - month
988
- - paymentAccountId
989
- properties:
990
- month:
991
- type: string
992
- pattern: "^\\d{4}-\\d{2}$"
993
- description: Month in YYYY-MM format
994
- example: "2026-03"
995
- paymentAccountId:
996
- type: string
997
- description: ID of the account to debit for the payment
998
- example: "acc_123456789"
999
- responses:
1000
- '200':
1001
- description: Statement marked as paid
1002
- content:
1003
- application/json:
1004
- schema:
1005
- type: object
1006
- properties:
1007
- message:
1008
- type: string
1009
- example: "Statement for March 2026 marked as paid and linked to account acc_123456789"
1010
- '400':
1011
- description: Invalid input or statement is already paid
1012
- '401':
1013
- $ref: '#/components/responses/UnauthorizedError'
1014
- '404':
1015
- description: Credit card not found
1016
-
1017
- /credit-cards/{id}/reopen-statement:
1018
- post:
1019
- summary: Reopen a credit card statement by marking all transactions as unpaid
1020
- parameters:
1021
- - name: id
1022
- in: path
1023
- required: true
1024
- schema:
1025
- type: string
1026
- description: Credit card ID
1027
- requestBody:
1028
- required: true
1029
- content:
1030
- application/json:
1031
- schema:
1032
- type: object
1033
- required:
1034
- - month
1035
- properties:
1036
- month:
1037
- type: string
1038
- pattern: "^\\d{4}-\\d{2}$"
1039
- description: Month in YYYY-MM format
1040
- example: "2026-03"
1041
- responses:
1042
- '200':
1043
- description: Statement reopened successfully
1044
- content:
1045
- application/json:
1046
- schema:
1047
- type: object
1048
- properties:
1049
- message:
1050
- type: string
1051
- example: "Statement for 2026-03 successfully reopened. 5 transaction(s) marked as unpaid."
1052
- '400':
1053
- description: Invalid input or statement is already open
1054
- '401':
1055
- $ref: '#/components/responses/UnauthorizedError'
1056
- '404':
1057
- description: Credit card not found
1058
-
1059
- /credit-cards/{id}/statement-status:
1060
- get:
1061
- summary: Get credit card statement payment status for a specific month
1062
- parameters:
1063
- - name: id
1064
- in: path
1065
- required: true
1066
- schema:
1067
- type: string
1068
- description: Credit card ID
1069
- - name: month
1070
- in: query
1071
- required: true
1072
- schema:
1073
- type: string
1074
- pattern: "^\\d{4}-\\d{2}$"
1075
- description: Month in YYYY-MM format
1076
- example: "2026-03"
1077
- responses:
1078
- '200':
1079
- description: Credit card statement status
1080
- content:
1081
- application/json:
1082
- schema:
1083
- $ref: '#/components/schemas/StatementStatus'
1084
- '401':
1085
- $ref: '#/components/responses/UnauthorizedError'
1086
- '404':
1087
- description: Credit card not found
1088
-
1089
- /transactions:
1090
- post:
1091
- summary: Create a new transaction
1092
- requestBody:
1093
- required: true
1094
- content:
1095
- application/json:
1096
- schema:
1097
- type: object
1098
- required:
1099
- - type
1100
- - name
1101
- - amount
1102
- - date
1103
- properties:
1104
- type:
1105
- $ref: '#/components/schemas/Transaction/properties/type'
1106
- name:
1107
- $ref: '#/components/schemas/Transaction/properties/name'
1108
- amount:
1109
- $ref: '#/components/schemas/Transaction/properties/amount'
1110
- date:
1111
- $ref: '#/components/schemas/Transaction/properties/date'
1112
- categoryId:
1113
- $ref: '#/components/schemas/Transaction/properties/categoryId'
1114
- paymentMethod:
1115
- $ref: '#/components/schemas/Transaction/properties/paymentMethod'
1116
- creditCardId:
1117
- $ref: '#/components/schemas/Transaction/properties/creditCardId'
1118
- accountId:
1119
- type: string
1120
- description: ID of the associated account (required if paymentMethod is not CREDIT)
1121
- example: "acc_123456789"
1122
- installments:
1123
- type: integer
1124
- minimum: 1
1125
- description: Number of installments (optional)
1126
- example: 3
1127
- targetDueMonth:
1128
- type: string
1129
- pattern: "^\\d{4}-\\d{2}$"
1130
- description: Target month for due date in YYYY-MM format (optional)
1131
- example: "2026-03"
1132
- purchaseDate:
1133
- type: string
1134
- format: date
1135
- description: Actual purchase date (credit card only, optional)
1136
- example: "2026-02-10"
1137
- recurrence:
1138
- type: object
1139
- properties:
1140
- frequency:
1141
- $ref: '#/components/schemas/RecurrenceRule/properties/frequency'
1142
- interval:
1143
- $ref: '#/components/schemas/RecurrenceRule/properties/interval'
1144
- endDate:
1145
- $ref: '#/components/schemas/RecurrenceRule/properties/endDate'
1146
- occurrences:
1147
- $ref: '#/components/schemas/RecurrenceRule/properties/occurrences'
1148
- responses:
1149
- '201':
1150
- description: Transaction created successfully
1151
- content:
1152
- application/json:
1153
- schema:
1154
- $ref: '#/components/schemas/Transaction'
1155
- '400':
1156
- description: Invalid input or target statement is already closed (paid)
1157
- '401':
1158
- $ref: '#/components/responses/UnauthorizedError'
1159
-
1160
- get:
1161
- summary: Get all transactions
1162
- parameters:
1163
- - name: month
1164
- in: query
1165
- required: false
1166
- schema:
1167
- type: string
1168
- pattern: "^\\d{4}-\\d{2}$"
1169
- description: Filter transactions by month (YYYY-MM format)
1170
- example: "2026-03"
1171
- - name: accountId
1172
- in: query
1173
- required: false
1174
- schema:
1175
- type: string
1176
- description: Filter transactions by account ID
1177
- example: "acc_123456789"
1178
- - name: categoryId
1179
- in: query
1180
- required: false
1181
- schema:
1182
- type: string
1183
- description: Filter transactions by category ID
1184
- example: "cat_123456789"
1185
- - name: creditCardId
1186
- in: query
1187
- required: false
1188
- schema:
1189
- type: string
1190
- description: Filter transactions by credit card ID
1191
- example: "cc_123456789"
1192
- - name: type
1193
- in: query
1194
- required: false
1195
- schema:
1196
- type: string
1197
- enum: [INCOME, EXPENSE]
1198
- description: Filter transactions by type
1199
- example: "EXPENSE"
1200
- - name: startDate
1201
- in: query
1202
- required: false
1203
- schema:
1204
- type: string
1205
- format: date
1206
- description: Filter transactions starting from this date (inclusive)
1207
- example: "2026-01-01"
1208
- - name: endDate
1209
- in: query
1210
- required: false
1211
- schema:
1212
- type: string
1213
- format: date
1214
- description: Filter transactions up to this date (inclusive)
1215
- example: "2026-01-31"
1216
- - name: paid
1217
- in: query
1218
- required: false
1219
- schema:
1220
- type: boolean
1221
- description: Filter by payment status (true = paid, false = unpaid)
1222
- example: false
1223
- responses:
1224
- '200':
1225
- description: List of transactions
1226
- content:
1227
- application/json:
1228
- schema:
1229
- type: array
1230
- items:
1231
- $ref: '#/components/schemas/Transaction'
1232
- '401':
1233
- $ref: '#/components/responses/UnauthorizedError'
1234
-
1235
- /transactions/{id}/pay:
1236
- patch:
1237
- summary: Mark a transaction as paid/received
1238
- description: |
1239
- Marks a transaction as paid or received.
1240
- **Note:** Credit card transactions cannot be marked as paid directly. They are automatically
1241
- marked as paid when the credit card statement is paid via the `POST /credit-cards/{id}/pay-statement` endpoint.
1242
- parameters:
1243
- - name: id
1244
- in: path
1245
- required: true
1246
- schema:
1247
- type: string
1248
- description: Transaction ID
1249
- responses:
1250
- '200':
1251
- description: Transaction marked as paid
1252
- content:
1253
- application/json:
1254
- schema:
1255
- $ref: '#/components/schemas/Transaction'
1256
- '400':
1257
- description: Cannot mark credit card transaction as paid directly
1258
- '401':
1259
- $ref: '#/components/responses/UnauthorizedError'
1260
- '404':
1261
- description: Transaction not found
1262
-
1263
- /transactions/{id}/unpay:
1264
- patch:
1265
- summary: Mark a transaction as unpaid
1266
- parameters:
1267
- - name: id
1268
- in: path
1269
- required: true
1270
- schema:
1271
- type: string
1272
- description: Transaction ID
1273
- responses:
1274
- '200':
1275
- description: Transaction marked as unpaid
1276
- content:
1277
- application/json:
1278
- schema:
1279
- $ref: '#/components/schemas/Transaction'
1280
- '404':
1281
- description: Transaction not found
1282
- '401':
1283
- $ref: '#/components/responses/UnauthorizedError'
1284
-
1285
- /transactions/{id}:
1286
- get:
1287
- summary: Get a transaction by ID
1288
- parameters:
1289
- - name: id
1290
- in: path
1291
- required: true
1292
- schema:
1293
- type: string
1294
- description: Transaction ID
1295
- responses:
1296
- '200':
1297
- description: Transaction found
1298
- content:
1299
- application/json:
1300
- schema:
1301
- $ref: '#/components/schemas/Transaction'
1302
- '401':
1303
- $ref: '#/components/responses/UnauthorizedError'
1304
- '404':
1305
- description: Transaction not found
1306
-
1307
- patch:
1308
- summary: Update a transaction
1309
- description: |
1310
- Update a transaction.
1311
- **Note:** Transactions that have already been paid cannot be edited.
1312
- For credit card transactions, you can use targetDueMonth to automatically calculate the date based on the credit card's due day.
1313
-
1314
- **Recurring Transactions - Editable Fields by Mode:**
1315
- - **SINGLE**: Can edit `name`, `categoryId`, `date`, `targetDueMonth`, `amount`
1316
- - **PENDING/ALL**: Can edit `name`, `categoryId`, `amount`, `paymentMethod`, `accountId`, `creditCardId` (date and type are restricted to prevent desynchronization)
1317
-
1318
- **Installment Transactions - Editable Fields by Mode:**
1319
- - **PENDING/ALL**: Only `name`, `categoryId`, and `amount` are propagated to other installments. All other fields are ignored for the bulk update.
1320
- parameters:
1321
- - name: id
1322
- in: path
1323
- required: true
1324
- schema:
1325
- type: string
1326
- description: Transaction ID
1327
- - name: mode
1328
- in: query
1329
- required: false
1330
- schema:
1331
- type: string
1332
- enum: [SINGLE, PENDING, ALL]
1333
- default: SINGLE
1334
- description: |
1335
- Update mode for recurring or installment transactions:
1336
- - **SINGLE**: Update only this specific transaction (default)
1337
- - **PENDING**: Update this transaction and all future unpaid transactions in the same recurrence series or installment group
1338
- - **ALL**: For recurrences, update all transactions (paid or unpaid). For installments, behaves the same as PENDING (only unpaid installments from this one onward are updated)
1339
-
1340
- If the transaction is not part of a recurrence series or installment group, this parameter is ignored.
1341
- example: SINGLE
1342
- requestBody:
1343
- required: true
1344
- content:
1345
- application/json:
1346
- schema:
1347
- $ref: '#/components/schemas/UpdateTransactionRequest'
1348
- responses:
1349
- '200':
1350
- description: Transaction updated successfully
1351
- content:
1352
- application/json:
1353
- schema:
1354
- $ref: '#/components/schemas/Transaction'
1355
- '400':
1356
- description: Invalid input or transaction is already paid
1357
- '401':
1358
- $ref: '#/components/responses/UnauthorizedError'
1359
- '404':
1360
- description: Transaction not found
1361
-
1362
- delete:
1363
- summary: Delete a transaction
1364
- parameters:
1365
- - name: id
1366
- in: path
1367
- required: true
1368
- schema:
1369
- type: string
1370
- description: Transaction ID
1371
- - name: mode
1372
- in: query
1373
- required: false
1374
- schema:
1375
- type: string
1376
- enum: [SINGLE, PENDING, ALL]
1377
- default: SINGLE
1378
- description: |
1379
- Deletion mode for recurring or installment transactions:
1380
- - **SINGLE**: Delete only this specific transaction (default)
1381
- - **PENDING**: Delete this transaction and all future unpaid transactions in the same recurrence series or installment group
1382
- - **ALL**: For recurrences, delete all transactions (paid or unpaid). For installments, behaves the same as PENDING (only unpaid installments from this one onward are deleted)
1383
-
1384
- If the transaction is not part of a recurrence series or installment group, this parameter is ignored.
1385
- example: SINGLE
1386
- responses:
1387
- '200':
1388
- description: Transaction deleted successfully
1389
- '401':
1390
- $ref: '#/components/responses/UnauthorizedError'
1391
- '404':
1392
- description: Transaction not found
1393
-
1394
- /summary:
1395
- get:
1396
- summary: Get financial summary
1397
- description: >
1398
- Returns income, expenses, balance, credit card totals, and category breakdowns.
1399
- Provide either `month` (YYYY-MM) or both `startDate` and `endDate` (YYYY-MM-DD).
1400
- parameters:
1401
- - name: month
1402
- in: query
1403
- required: false
1404
- schema:
1405
- type: string
1406
- pattern: "^\\d{4}-\\d{2}$"
1407
- description: Month in YYYY-MM format
1408
- example: "2026-02"
1409
- - name: startDate
1410
- in: query
1411
- required: false
1412
- schema:
1413
- type: string
1414
- pattern: "^\\d{4}-\\d{2}-\\d{2}$"
1415
- description: Start date in YYYY-MM-DD format (use with endDate for a custom range)
1416
- example: "2026-01-01"
1417
- - name: endDate
1418
- in: query
1419
- required: false
1420
- schema:
1421
- type: string
1422
- pattern: "^\\d{4}-\\d{2}-\\d{2}$"
1423
- description: End date in YYYY-MM-DD format (use with startDate for a custom range)
1424
- example: "2026-03-31"
1425
- responses:
1426
- '200':
1427
- description: Financial summary for the given period
1428
- content:
1429
- application/json:
1430
- schema:
1431
- $ref: '#/components/schemas/Summary'
1432
- '400':
1433
- description: Invalid or missing period parameters
1434
- '401':
1435
- $ref: '#/components/responses/UnauthorizedError'
1436
-
1437
- /accounts:
1438
- post:
1439
- summary: Create a new account
1440
- requestBody:
1441
- required: true
1442
- content:
1443
- application/json:
1444
- schema:
1445
- type: object
1446
- required:
1447
- - name
1448
- - type
1449
- properties:
1450
- name:
1451
- type: string
1452
- description: Name of the account
1453
- example: "Itaú Checking Account"
1454
- type:
1455
- type: string
1456
- enum: [BANK_ACCOUNT, WALLET, SAVINGS_ACCOUNT, INVESTMENT_ACCOUNT, OTHER]
1457
- description: Type of account
1458
- example: "BANK_ACCOUNT"
1459
- initialBalance:
1460
- type: number
1461
- format: float
1462
- description: Initial balance for the account
1463
- example: 1000.00
1464
- responses:
1465
- '201':
1466
- description: Account created successfully
1467
- content:
1468
- application/json:
1469
- schema:
1470
- $ref: '#/components/schemas/Account'
1471
- '400':
1472
- description: Invalid input
1473
- '401':
1474
- $ref: '#/components/responses/UnauthorizedError'
1475
-
1476
- get:
1477
- summary: Get all accounts
1478
- responses:
1479
- '200':
1480
- description: List of accounts with current balances
1481
- content:
1482
- application/json:
1483
- schema:
1484
- type: array
1485
- items:
1486
- $ref: '#/components/schemas/Account'
1487
- '401':
1488
- $ref: '#/components/responses/UnauthorizedError'
1489
-
1490
- /accounts/{id}:
1491
- get:
1492
- summary: Get a specific account
1493
- parameters:
1494
- - name: id
1495
- in: path
1496
- required: true
1497
- schema:
1498
- type: string
1499
- description: Account ID
1500
- responses:
1501
- '200':
1502
- description: Account details
1503
- content:
1504
- application/json:
1505
- schema:
1506
- $ref: '#/components/schemas/Account'
1507
- '401':
1508
- $ref: '#/components/responses/UnauthorizedError'
1509
- '404':
1510
- description: Account not found
1511
-
1512
- patch:
1513
- summary: Update an account
1514
- parameters:
1515
- - name: id
1516
- in: path
1517
- required: true
1518
- schema:
1519
- type: string
1520
- description: Account ID
1521
- requestBody:
1522
- required: true
1523
- content:
1524
- application/json:
1525
- schema:
1526
- type: object
1527
- properties:
1528
- name:
1529
- type: string
1530
- description: Name of the account
1531
- example: "Itaú Savings Account"
1532
- type:
1533
- type: string
1534
- enum: [BANK_ACCOUNT, WALLET, SAVINGS_ACCOUNT, INVESTMENT_ACCOUNT, OTHER]
1535
- description: Type of account
1536
- example: "SAVINGS_ACCOUNT"
1537
- responses:
1538
- '200':
1539
- description: Account updated successfully
1540
- content:
1541
- application/json:
1542
- schema:
1543
- $ref: '#/components/schemas/Account'
1544
- '400':
1545
- description: Invalid input
1546
- '401':
1547
- $ref: '#/components/responses/UnauthorizedError'
1548
- '404':
1549
- description: Account not found
1550
-
1551
- delete:
1552
- summary: Delete an account
1553
- parameters:
1554
- - name: id
1555
- in: path
1556
- required: true
1557
- schema:
1558
- type: string
1559
- description: Account ID
1560
- responses:
1561
- '204':
1562
- description: Account deleted successfully
1563
- '401':
1564
- $ref: '#/components/responses/UnauthorizedError'
1565
- '404':
1566
- description: Account not found
1567
- '409':
1568
- description: Cannot delete account with associated transactions
1569
-
1570
- /accounts/{id}/balance:
1571
- get:
1572
- summary: Get the current balance for an account
1573
- parameters:
1574
- - name: id
1575
- in: path
1576
- required: true
1577
- schema:
1578
- type: string
1579
- description: Account ID
1580
- responses:
1581
- '200':
1582
- description: Account balance
1583
- content:
1584
- application/json:
1585
- schema:
1586
- $ref: '#/components/schemas/AccountBalance'
1587
- '401':
1588
- $ref: '#/components/responses/UnauthorizedError'
1589
- '404':
1590
- description: Account not found
1591
-
1592
- /accounts/{id}/transactions:
1593
- get:
1594
- summary: Get all transactions linked to an account
1595
- parameters:
1596
- - name: id
1597
- in: path
1598
- required: true
1599
- schema:
1600
- type: string
1601
- description: Account ID
1602
- responses:
1603
- '200':
1604
- description: List of transactions linked to the account
1605
- content:
1606
- application/json:
1607
- schema:
1608
- type: array
1609
- items:
1610
- $ref: '#/components/schemas/Transaction'
1611
- '401':
1612
- $ref: '#/components/responses/UnauthorizedError'
1613
- '404':
1614
- description: Account not found
1615
-
1616
- /export:
1617
- get:
1618
- summary: Export all user data
1619
- description: Returns a complete backup of all user data including settings, categories, accounts, credit cards, recurrence rules, and transactions.
1620
- security:
1621
- - ApiKeyAuth: []
1622
- responses:
1623
- '200':
1624
- description: Export payload with all data
1625
- content:
1626
- application/json:
1627
- schema:
1628
- type: object
1629
- properties:
1630
- version:
1631
- type: string
1632
- example: "1.0"
1633
- exportedAt:
1634
- type: string
1635
- format: date-time
1636
- example: "2026-02-14T21:00:00.000Z"
1637
- data:
1638
- type: object
1639
- properties:
1640
- settings:
1641
- nullable: true
1642
- $ref: '#/components/schemas/Settings'
1643
- categories:
1644
- type: array
1645
- items:
1646
- $ref: '#/components/schemas/Category'
1647
- accounts:
1648
- type: array
1649
- items:
1650
- $ref: '#/components/schemas/Account'
1651
- creditCards:
1652
- type: array
1653
- items:
1654
- $ref: '#/components/schemas/CreditCard'
1655
- recurrenceRules:
1656
- type: array
1657
- items:
1658
- $ref: '#/components/schemas/RecurrenceRule'
1659
- transactions:
1660
- type: array
1661
- items:
1662
- $ref: '#/components/schemas/Transaction'
1663
- '401':
1664
- $ref: '#/components/responses/UnauthorizedError'
1665
-
1666
- /import:
1667
- post:
1668
- summary: Import user data
1669
- description: |
1670
- Imports a previously exported backup. Supports two modes:
1671
- - **reset**: Clears all existing data and replaces it with the imported data.
1672
- - **increment**: Adds new records from the import, ignoring records whose IDs already exist.
1673
- security:
1674
- - ApiKeyAuth: []
1675
- requestBody:
1676
- required: true
1677
- content:
1678
- application/json:
1679
- schema:
1680
- type: object
1681
- required:
1682
- - mode
1683
- - version
1684
- - exportedAt
1685
- - data
1686
- properties:
1687
- mode:
1688
- type: string
1689
- enum: [reset, increment]
1690
- description: Import mode
1691
- example: "reset"
1692
- version:
1693
- type: string
1694
- description: Export format version. Must be "1.0".
1695
- example: "1.0"
1696
- exportedAt:
1697
- type: string
1698
- format: date-time
1699
- example: "2026-02-14T21:00:00.000Z"
1700
- data:
1701
- type: object
1702
- properties:
1703
- settings:
1704
- nullable: true
1705
- $ref: '#/components/schemas/Settings'
1706
- categories:
1707
- type: array
1708
- items:
1709
- $ref: '#/components/schemas/Category'
1710
- accounts:
1711
- type: array
1712
- items:
1713
- $ref: '#/components/schemas/Account'
1714
- creditCards:
1715
- type: array
1716
- items:
1717
- $ref: '#/components/schemas/CreditCard'
1718
- recurrenceRules:
1719
- type: array
1720
- items:
1721
- $ref: '#/components/schemas/RecurrenceRule'
1722
- transactions:
1723
- type: array
1724
- items:
1725
- $ref: '#/components/schemas/Transaction'
1726
- responses:
1727
- '200':
1728
- description: Import completed successfully
1729
- content:
1730
- application/json:
1731
- schema:
1732
- type: object
1733
- properties:
1734
- message:
1735
- type: string
1736
- example: "Import completed successfully (mode: reset)"
1737
- '400':
1738
- description: Invalid input or unsupported version
1739
- '401':
1740
- $ref: '#/components/responses/UnauthorizedError'
1741
-
1742
- /settings:
1743
- post:
1744
- summary: Create global settings (only if not exists)
1745
- requestBody:
1746
- required: true
1747
- content:
1748
- application/json:
1749
- schema:
1750
- type: object
1751
- required:
1752
- - userName
1753
- - language
1754
- - currency
1755
- properties:
1756
- userName:
1757
- type: string
1758
- example: "John Doe"
1759
- language:
1760
- type: string
1761
- enum: [pt-BR, en-US]
1762
- example: "pt-BR"
1763
- currency:
1764
- type: string
1765
- enum: [BRL, USD, EUR, GBP, JPY, CAD, AUD, CHF]
1766
- example: "BRL"
1767
- responses:
1768
- '201':
1769
- description: Settings created successfully
1770
- content:
1771
- application/json:
1772
- schema:
1773
- $ref: '#/components/schemas/Settings'
1774
- '400':
1775
- description: Invalid input
1776
- '401':
1777
- $ref: '#/components/responses/UnauthorizedError'
1778
- '409':
1779
- description: Settings already exist
1780
-
1781
- get:
1782
- summary: Get global settings
1783
- responses:
1784
- '200':
1785
- description: Settings retrieved successfully
1786
- content:
1787
- application/json:
1788
- schema:
1789
- $ref: '#/components/schemas/Settings'
1790
- '401':
1791
- $ref: '#/components/responses/UnauthorizedError'
1792
- '404':
1793
- description: Settings not found
1794
-
1795
- put:
1796
- summary: Update global settings
1797
- requestBody:
1798
- required: true
1799
- content:
1800
- application/json:
1801
- schema:
1802
- type: object
1803
- properties:
1804
- userName:
1805
- type: string
1806
- example: "John Doe"
1807
- language:
1808
- type: string
1809
- enum: [pt-BR, en-US]
1810
- example: "pt-BR"
1811
- currency:
1812
- type: string
1813
- enum: [BRL, USD, EUR, GBP, JPY, CAD, AUD, CHF]
1814
- example: "BRL"
1815
- responses:
1816
- '200':
1817
- description: Settings updated successfully
1818
- content:
1819
- application/json:
1820
- schema:
1821
- $ref: '#/components/schemas/Settings'
1822
- '400':
1823
- description: Invalid input
1824
- '401':
1825
- $ref: '#/components/responses/UnauthorizedError'
1826
- '404':
1827
- description: Settings not found
1828
-
1
+ openapi: 3.0.0
2
+ paths:
3
+ /:
4
+ get:
5
+ operationId: getHello
6
+ parameters: []
7
+ responses:
8
+ '200':
9
+ description: ''
10
+ tags:
11
+ - App
12
+ /categories:
13
+ post:
14
+ operationId: create
15
+ parameters:
16
+ - &ref_0
17
+ name: x-api-key
18
+ in: header
19
+ required: false
20
+ schema:
21
+ type: string
22
+ requestBody:
23
+ required: true
24
+ content:
25
+ application/json:
26
+ schema:
27
+ $ref: '#/components/schemas/CreateCategoryDto'
28
+ responses:
29
+ '201':
30
+ description: Category created successfully.
31
+ '400':
32
+ description: Invalid input.
33
+ security: &ref_1
34
+ - bearer: []
35
+ summary: Create a new category
36
+ tags: &ref_2
37
+ - categories
38
+ get:
39
+ operationId: findAll
40
+ parameters:
41
+ - *ref_0
42
+ responses:
43
+ '200':
44
+ description: List of categories.
45
+ security: *ref_1
46
+ summary: Get all categories
47
+ tags: *ref_2
48
+ /categories/{id}:
49
+ get:
50
+ operationId: findOne
51
+ parameters:
52
+ - *ref_0
53
+ - name: id
54
+ required: true
55
+ in: path
56
+ schema:
57
+ type: string
58
+ responses:
59
+ '200':
60
+ description: Category found.
61
+ '404':
62
+ description: Category not found.
63
+ security: *ref_1
64
+ summary: Get a category by ID
65
+ tags: *ref_2
66
+ patch:
67
+ operationId: update
68
+ parameters:
69
+ - *ref_0
70
+ - name: id
71
+ required: true
72
+ in: path
73
+ schema:
74
+ type: string
75
+ requestBody:
76
+ required: true
77
+ content:
78
+ application/json:
79
+ schema:
80
+ $ref: '#/components/schemas/UpdateCategoryDto'
81
+ responses:
82
+ '200':
83
+ description: Category updated successfully.
84
+ '404':
85
+ description: Category not found.
86
+ security: *ref_1
87
+ summary: Update a category
88
+ tags: *ref_2
89
+ delete:
90
+ operationId: remove
91
+ parameters:
92
+ - *ref_0
93
+ - name: id
94
+ required: true
95
+ in: path
96
+ schema:
97
+ type: string
98
+ responses:
99
+ '200':
100
+ description: Category deleted successfully.
101
+ '404':
102
+ description: Category not found.
103
+ security: *ref_1
104
+ summary: Delete a category
105
+ tags: *ref_2
106
+ /auth/register:
107
+ post:
108
+ operationId: register
109
+ parameters: []
110
+ requestBody:
111
+ required: true
112
+ content:
113
+ application/json:
114
+ schema:
115
+ $ref: '#/components/schemas/RegisterDto'
116
+ responses:
117
+ '201':
118
+ description: User successfully registered
119
+ '409':
120
+ description: Email already exists
121
+ summary: Register a new user
122
+ tags: &ref_3
123
+ - auth
124
+ /auth/login:
125
+ post:
126
+ operationId: login
127
+ parameters:
128
+ - name: user-agent
129
+ required: true
130
+ in: header
131
+ schema:
132
+ type: string
133
+ requestBody:
134
+ required: true
135
+ content:
136
+ application/json:
137
+ schema:
138
+ $ref: '#/components/schemas/LoginDto'
139
+ responses:
140
+ '200':
141
+ description: Login successful, returns JWT
142
+ '401':
143
+ description: Invalid credentials
144
+ summary: Login with email and password
145
+ tags: *ref_3
146
+ /auth/refresh:
147
+ post:
148
+ operationId: refresh
149
+ parameters: []
150
+ responses:
151
+ '200':
152
+ description: Token refreshed successfully
153
+ '401':
154
+ description: Invalid refresh token
155
+ summary: Refresh access token using refresh token cookie
156
+ tags: *ref_3
157
+ /auth/logout:
158
+ post:
159
+ operationId: logout
160
+ parameters: []
161
+ responses:
162
+ '200':
163
+ description: Logout successful
164
+ security:
165
+ - bearer: []
166
+ summary: Logout and invalidate session
167
+ tags: *ref_3
168
+ /auth/change-password:
169
+ post:
170
+ operationId: changePassword
171
+ parameters: []
172
+ requestBody:
173
+ required: true
174
+ content:
175
+ application/json:
176
+ schema:
177
+ $ref: '#/components/schemas/ChangePasswordDto'
178
+ responses:
179
+ '200':
180
+ description: Password changed successfully
181
+ '401':
182
+ description: Current password incorrect
183
+ security:
184
+ - bearer: []
185
+ summary: Change authenticated user password
186
+ tags: *ref_3
187
+ /auth/forgot-password:
188
+ post:
189
+ operationId: forgotPassword
190
+ parameters: []
191
+ requestBody:
192
+ required: true
193
+ content:
194
+ application/json:
195
+ schema:
196
+ $ref: '#/components/schemas/ForgotPasswordDto'
197
+ responses:
198
+ '200':
199
+ description: If email exists, a reset link will be sent
200
+ summary: Request a password reset link
201
+ tags: *ref_3
202
+ /auth/reset-password:
203
+ post:
204
+ operationId: resetPassword
205
+ parameters: []
206
+ requestBody:
207
+ required: true
208
+ content:
209
+ application/json:
210
+ schema:
211
+ $ref: '#/components/schemas/ResetPasswordDto'
212
+ responses:
213
+ '200':
214
+ description: Password reset successfully
215
+ '400':
216
+ description: Invalid or expired token
217
+ summary: Reset password using token
218
+ tags: *ref_3
219
+ /auth/sessions:
220
+ get:
221
+ operationId: getSessions
222
+ parameters: []
223
+ responses:
224
+ '200':
225
+ description: Returns list of sessions
226
+ security:
227
+ - bearer: []
228
+ summary: List active sessions for current user
229
+ tags: *ref_3
230
+ delete:
231
+ operationId: revokeAllOtherSessions
232
+ parameters: []
233
+ responses:
234
+ '200':
235
+ description: Other sessions revoked successfully
236
+ security:
237
+ - bearer: []
238
+ summary: Revoke all other sessions
239
+ tags: *ref_3
240
+ /auth/sessions/{id}:
241
+ delete:
242
+ operationId: revokeSession
243
+ parameters:
244
+ - name: id
245
+ required: true
246
+ in: path
247
+ schema:
248
+ type: string
249
+ responses:
250
+ '200':
251
+ description: Session revoked successfully
252
+ security:
253
+ - bearer: []
254
+ summary: Revoke a specific session
255
+ tags: *ref_3
256
+ /auth/me:
257
+ get:
258
+ operationId: getProfile
259
+ parameters: []
260
+ responses:
261
+ '200':
262
+ description: Returns user profile
263
+ '401':
264
+ description: Unauthorized
265
+ security:
266
+ - bearer: []
267
+ summary: Get current user profile
268
+ tags: *ref_3
269
+ /transactions:
270
+ post:
271
+ operationId: create
272
+ parameters:
273
+ - &ref_4
274
+ name: x-api-key
275
+ in: header
276
+ required: false
277
+ schema:
278
+ type: string
279
+ requestBody:
280
+ required: true
281
+ content:
282
+ application/json:
283
+ schema:
284
+ $ref: '#/components/schemas/CreateTransactionDto'
285
+ responses:
286
+ '201':
287
+ description: Transaction created successfully.
288
+ '400':
289
+ description: Invalid input.
290
+ security: &ref_5
291
+ - bearer: []
292
+ summary: Create a new transaction
293
+ tags: &ref_6
294
+ - transactions
295
+ get:
296
+ operationId: findAll
297
+ parameters:
298
+ - *ref_4
299
+ - name: month
300
+ required: false
301
+ in: query
302
+ description: Filter by month (YYYY-MM)
303
+ schema:
304
+ example: 2026-03
305
+ type: string
306
+ - name: accountId
307
+ required: false
308
+ in: query
309
+ description: Filter by account ID
310
+ schema:
311
+ example: acc_123456789
312
+ type: string
313
+ - name: categoryId
314
+ required: false
315
+ in: query
316
+ description: Filter by category ID
317
+ schema:
318
+ example: cat_123456789
319
+ type: string
320
+ - name: creditCardId
321
+ required: false
322
+ in: query
323
+ description: Filter by credit card ID
324
+ schema:
325
+ example: cc_123456789
326
+ type: string
327
+ - name: type
328
+ required: false
329
+ in: query
330
+ description: Filter by transaction type
331
+ schema:
332
+ example: EXPENSE
333
+ type: string
334
+ enum:
335
+ - INCOME
336
+ - EXPENSE
337
+ - name: startDate
338
+ required: false
339
+ in: query
340
+ description: Filter by start date (YYYY-MM-DD)
341
+ schema:
342
+ example: '2026-01-01'
343
+ type: string
344
+ - name: endDate
345
+ required: false
346
+ in: query
347
+ description: Filter by end date (YYYY-MM-DD)
348
+ schema:
349
+ example: '2026-01-31'
350
+ type: string
351
+ - name: paid
352
+ required: false
353
+ in: query
354
+ description: Filter by payment status (true = paid, false = unpaid)
355
+ schema:
356
+ example: false
357
+ type: boolean
358
+ responses:
359
+ '200':
360
+ description: List of transactions with related data.
361
+ content:
362
+ application/json:
363
+ schema:
364
+ type: array
365
+ items:
366
+ $ref: '#/components/schemas/TransactionWithRelationsDto'
367
+ security: *ref_5
368
+ summary: Get all transactions with optional filters
369
+ tags: *ref_6
370
+ /transactions/{id}:
371
+ get:
372
+ operationId: findOne
373
+ parameters:
374
+ - *ref_4
375
+ - name: id
376
+ required: true
377
+ in: path
378
+ schema:
379
+ type: string
380
+ responses:
381
+ '200':
382
+ description: Transaction found with related data.
383
+ content:
384
+ application/json:
385
+ schema:
386
+ $ref: '#/components/schemas/TransactionWithRelationsDto'
387
+ '404':
388
+ description: Transaction not found.
389
+ security: *ref_5
390
+ summary: Get a transaction by ID
391
+ tags: *ref_6
392
+ patch:
393
+ operationId: update
394
+ parameters:
395
+ - *ref_4
396
+ - name: id
397
+ required: true
398
+ in: path
399
+ schema:
400
+ type: string
401
+ - name: mode
402
+ required: false
403
+ in: query
404
+ description: >-
405
+ Update mode for recurring transactions: SINGLE (only this
406
+ transaction), PENDING (this and future pending transactions), ALL
407
+ (all transactions in the series)
408
+ schema:
409
+ enum:
410
+ - SINGLE
411
+ - PENDING
412
+ - ALL
413
+ type: string
414
+ requestBody:
415
+ required: true
416
+ content:
417
+ application/json:
418
+ schema:
419
+ $ref: '#/components/schemas/UpdateTransactionDto'
420
+ responses:
421
+ '200':
422
+ description: Transaction updated successfully with related data.
423
+ content:
424
+ application/json:
425
+ schema:
426
+ $ref: '#/components/schemas/TransactionWithRelationsDto'
427
+ '404':
428
+ description: Transaction not found.
429
+ security: *ref_5
430
+ summary: Update a transaction
431
+ tags: *ref_6
432
+ delete:
433
+ operationId: remove
434
+ parameters:
435
+ - *ref_4
436
+ - name: id
437
+ required: true
438
+ in: path
439
+ schema:
440
+ type: string
441
+ - name: mode
442
+ required: false
443
+ in: query
444
+ description: >-
445
+ Deletion mode for recurring transactions: SINGLE (only this
446
+ transaction), PENDING (this and future pending transactions), ALL
447
+ (all transactions in the series)
448
+ schema:
449
+ enum:
450
+ - SINGLE
451
+ - PENDING
452
+ - ALL
453
+ type: string
454
+ responses:
455
+ '200':
456
+ description: Transaction deleted successfully.
457
+ '404':
458
+ description: Transaction not found.
459
+ security: *ref_5
460
+ summary: Delete a transaction
461
+ tags: *ref_6
462
+ /transactions/{id}/pay:
463
+ patch:
464
+ operationId: markAsPaid
465
+ parameters:
466
+ - *ref_4
467
+ - name: id
468
+ required: true
469
+ in: path
470
+ schema:
471
+ type: string
472
+ responses:
473
+ '200':
474
+ description: Transaction marked as paid with related data.
475
+ content:
476
+ application/json:
477
+ schema:
478
+ $ref: '#/components/schemas/TransactionWithRelationsDto'
479
+ '404':
480
+ description: Transaction not found.
481
+ security: *ref_5
482
+ summary: Mark a transaction as paid
483
+ tags: *ref_6
484
+ /transactions/{id}/unpay:
485
+ patch:
486
+ operationId: markAsUnpaid
487
+ parameters:
488
+ - *ref_4
489
+ - name: id
490
+ required: true
491
+ in: path
492
+ schema:
493
+ type: string
494
+ responses:
495
+ '200':
496
+ description: Transaction marked as unpaid with related data.
497
+ content:
498
+ application/json:
499
+ schema:
500
+ $ref: '#/components/schemas/TransactionWithRelationsDto'
501
+ '404':
502
+ description: Transaction not found.
503
+ security: *ref_5
504
+ summary: Mark a transaction as unpaid
505
+ tags: *ref_6
506
+ /summary:
507
+ get:
508
+ description: >-
509
+ Returns income, expenses, balance, credit card totals, and category
510
+ breakdowns. Provide either `month` (YYYY-MM) or both `startDate` and
511
+ `endDate` (YYYY-MM-DD).
512
+ operationId: getSummary
513
+ parameters:
514
+ - name: x-api-key
515
+ in: header
516
+ required: false
517
+ schema:
518
+ type: string
519
+ - name: month
520
+ required: false
521
+ in: query
522
+ description: Month for the summary in YYYY-MM format
523
+ schema:
524
+ example: 2026-02
525
+ type: string
526
+ - name: startDate
527
+ required: false
528
+ in: query
529
+ description: Start date for a custom range in YYYY-MM-DD format
530
+ schema:
531
+ example: '2026-01-01'
532
+ type: string
533
+ - name: endDate
534
+ required: false
535
+ in: query
536
+ description: End date for a custom range in YYYY-MM-DD format
537
+ schema:
538
+ example: '2026-03-31'
539
+ type: string
540
+ responses:
541
+ '200':
542
+ description: Financial summary for the given period.
543
+ '400':
544
+ description: Invalid or missing period parameters.
545
+ security:
546
+ - bearer: []
547
+ summary: Get financial summary
548
+ tags:
549
+ - summary
550
+ /credit-cards:
551
+ post:
552
+ operationId: create
553
+ parameters:
554
+ - &ref_7
555
+ name: x-api-key
556
+ in: header
557
+ required: false
558
+ schema:
559
+ type: string
560
+ requestBody:
561
+ required: true
562
+ content:
563
+ application/json:
564
+ schema:
565
+ $ref: '#/components/schemas/CreateCreditCardDto'
566
+ responses:
567
+ '201':
568
+ description: Credit card created successfully.
569
+ '400':
570
+ description: Invalid input.
571
+ security: &ref_8
572
+ - bearer: []
573
+ summary: Create a new credit card
574
+ tags: &ref_9
575
+ - credit-cards
576
+ get:
577
+ operationId: findAll
578
+ parameters:
579
+ - *ref_7
580
+ responses:
581
+ '200':
582
+ description: List of credit cards.
583
+ security: *ref_8
584
+ summary: Get all credit cards
585
+ tags: *ref_9
586
+ /credit-cards/{id}:
587
+ get:
588
+ operationId: findOne
589
+ parameters:
590
+ - *ref_7
591
+ - name: id
592
+ required: true
593
+ in: path
594
+ schema:
595
+ type: string
596
+ responses:
597
+ '200':
598
+ description: Credit card found.
599
+ '404':
600
+ description: Credit card not found.
601
+ security: *ref_8
602
+ summary: Get a credit card by ID
603
+ tags: *ref_9
604
+ patch:
605
+ operationId: update
606
+ parameters:
607
+ - *ref_7
608
+ - name: id
609
+ required: true
610
+ in: path
611
+ schema:
612
+ type: string
613
+ requestBody:
614
+ required: true
615
+ content:
616
+ application/json:
617
+ schema:
618
+ $ref: '#/components/schemas/UpdateCreditCardDto'
619
+ responses:
620
+ '200':
621
+ description: Credit card updated successfully.
622
+ '404':
623
+ description: Credit card not found.
624
+ security: *ref_8
625
+ summary: Update a credit card
626
+ tags: *ref_9
627
+ delete:
628
+ operationId: remove
629
+ parameters:
630
+ - *ref_7
631
+ - name: id
632
+ required: true
633
+ in: path
634
+ schema:
635
+ type: string
636
+ responses:
637
+ '200':
638
+ description: Credit card deleted successfully.
639
+ '404':
640
+ description: Credit card not found.
641
+ security: *ref_8
642
+ summary: Delete a credit card
643
+ tags: *ref_9
644
+ /credit-cards/{id}/statement:
645
+ get:
646
+ operationId: getStatement
647
+ parameters:
648
+ - *ref_7
649
+ - name: id
650
+ required: true
651
+ in: path
652
+ schema:
653
+ type: string
654
+ - name: month
655
+ required: true
656
+ in: query
657
+ description: Month for the statement in YYYY-MM format
658
+ schema:
659
+ example: 2026-03
660
+ type: string
661
+ responses:
662
+ '200':
663
+ description: Credit card statement.
664
+ '404':
665
+ description: Credit card not found.
666
+ security: *ref_8
667
+ summary: Get credit card statement for a specific month
668
+ tags: *ref_9
669
+ /credit-cards/{id}/pay-statement:
670
+ post:
671
+ operationId: payStatement
672
+ parameters:
673
+ - *ref_7
674
+ - name: id
675
+ required: true
676
+ in: path
677
+ schema:
678
+ type: string
679
+ requestBody:
680
+ required: true
681
+ content:
682
+ application/json:
683
+ schema:
684
+ $ref: '#/components/schemas/PayStatementDto'
685
+ responses:
686
+ '200':
687
+ description: Statement marked as paid.
688
+ '404':
689
+ description: Credit card not found.
690
+ security: *ref_8
691
+ summary: Mark all transactions in a credit card statement as paid
692
+ tags: *ref_9
693
+ /credit-cards/{id}/reopen-statement:
694
+ post:
695
+ operationId: reopenStatement
696
+ parameters:
697
+ - *ref_7
698
+ - name: id
699
+ required: true
700
+ in: path
701
+ schema:
702
+ type: string
703
+ requestBody:
704
+ required: true
705
+ content:
706
+ application/json:
707
+ schema:
708
+ $ref: '#/components/schemas/ReopenStatementDto'
709
+ responses:
710
+ '200':
711
+ description: Statement reopened successfully.
712
+ '400':
713
+ description: Statement is already open or invalid input.
714
+ '404':
715
+ description: Credit card not found.
716
+ security: *ref_8
717
+ summary: Reopen a credit card statement by marking all transactions as unpaid
718
+ tags: *ref_9
719
+ /credit-cards/{id}/statement-status:
720
+ get:
721
+ operationId: getStatementStatus
722
+ parameters:
723
+ - *ref_7
724
+ - name: id
725
+ required: true
726
+ in: path
727
+ schema:
728
+ type: string
729
+ - name: month
730
+ required: true
731
+ in: query
732
+ description: Month for the statement in YYYY-MM format
733
+ schema:
734
+ example: 2026-03
735
+ type: string
736
+ responses:
737
+ '200':
738
+ description: Credit card statement status.
739
+ '404':
740
+ description: Credit card not found.
741
+ security: *ref_8
742
+ summary: Get credit card statement payment status for a specific month
743
+ tags: *ref_9
744
+ /credit-cards/{id}/anticipations:
745
+ post:
746
+ operationId: createAnticipation
747
+ parameters:
748
+ - *ref_7
749
+ - name: id
750
+ required: true
751
+ in: path
752
+ schema:
753
+ type: string
754
+ requestBody:
755
+ required: true
756
+ content:
757
+ application/json:
758
+ schema:
759
+ $ref: '#/components/schemas/CreateAnticipationDto'
760
+ responses:
761
+ '201':
762
+ description: >-
763
+ Anticipation created: credit card INCOME + account EXPENSE linked
764
+ pair.
765
+ '400':
766
+ description: Statement already closed or invalid input.
767
+ '404':
768
+ description: Credit card or account not found.
769
+ security: *ref_8
770
+ summary: Create a credit card anticipation (advance payment toward the statement)
771
+ tags: *ref_9
772
+ /accounts:
773
+ post:
774
+ operationId: create
775
+ parameters:
776
+ - &ref_10
777
+ name: x-api-key
778
+ in: header
779
+ required: false
780
+ schema:
781
+ type: string
782
+ requestBody:
783
+ required: true
784
+ content:
785
+ application/json:
786
+ schema:
787
+ $ref: '#/components/schemas/CreateAccountDto'
788
+ responses:
789
+ '201':
790
+ description: Account created successfully
791
+ content:
792
+ application/json:
793
+ schema:
794
+ $ref: '#/components/schemas/AccountResponseDto'
795
+ '400':
796
+ description: Invalid input data
797
+ security: &ref_11
798
+ - bearer: []
799
+ summary: Create a new account
800
+ tags: &ref_12
801
+ - accounts
802
+ get:
803
+ operationId: findAll
804
+ parameters:
805
+ - *ref_10
806
+ responses:
807
+ '200':
808
+ description: List of all accounts
809
+ content:
810
+ application/json:
811
+ schema:
812
+ type: array
813
+ items:
814
+ $ref: '#/components/schemas/AccountResponseDto'
815
+ security: *ref_11
816
+ summary: Get all accounts
817
+ tags: *ref_12
818
+ /accounts/{id}:
819
+ get:
820
+ operationId: findOne
821
+ parameters:
822
+ - *ref_10
823
+ - name: id
824
+ required: true
825
+ in: path
826
+ schema:
827
+ type: string
828
+ responses:
829
+ '200':
830
+ description: Account retrieved successfully
831
+ content:
832
+ application/json:
833
+ schema:
834
+ $ref: '#/components/schemas/AccountResponseDto'
835
+ '404':
836
+ description: Account not found
837
+ security: *ref_11
838
+ summary: Get an account by ID
839
+ tags: *ref_12
840
+ patch:
841
+ operationId: update
842
+ parameters:
843
+ - *ref_10
844
+ - name: id
845
+ required: true
846
+ in: path
847
+ schema:
848
+ type: string
849
+ requestBody:
850
+ required: true
851
+ content:
852
+ application/json:
853
+ schema:
854
+ $ref: '#/components/schemas/UpdateAccountDto'
855
+ responses:
856
+ '200':
857
+ description: Account updated successfully
858
+ content:
859
+ application/json:
860
+ schema:
861
+ $ref: '#/components/schemas/AccountResponseDto'
862
+ '404':
863
+ description: Account not found
864
+ security: *ref_11
865
+ summary: Update an account
866
+ tags: *ref_12
867
+ delete:
868
+ operationId: remove
869
+ parameters:
870
+ - *ref_10
871
+ - name: id
872
+ required: true
873
+ in: path
874
+ schema:
875
+ type: string
876
+ responses:
877
+ '204':
878
+ description: Account deleted successfully
879
+ '404':
880
+ description: Account not found
881
+ '409':
882
+ description: Cannot delete account with associated transactions
883
+ security: *ref_11
884
+ summary: Delete an account
885
+ tags: *ref_12
886
+ /accounts/{id}/balance:
887
+ get:
888
+ operationId: getAccountBalance
889
+ parameters:
890
+ - *ref_10
891
+ - name: id
892
+ required: true
893
+ in: path
894
+ schema:
895
+ type: string
896
+ responses:
897
+ '200':
898
+ description: Account balance retrieved successfully
899
+ content:
900
+ application/json:
901
+ schema:
902
+ type: object
903
+ '404':
904
+ description: Account not found
905
+ security: *ref_11
906
+ summary: Get the current balance for an account
907
+ tags: *ref_12
908
+ /settings:
909
+ get:
910
+ operationId: findAll
911
+ parameters:
912
+ - &ref_13
913
+ name: x-api-key
914
+ in: header
915
+ required: false
916
+ schema:
917
+ type: string
918
+ responses:
919
+ '200':
920
+ description: Settings retrieved successfully
921
+ content:
922
+ application/json:
923
+ schema:
924
+ $ref: '#/components/schemas/SettingsResponseDto'
925
+ '404':
926
+ description: Settings not found
927
+ security: &ref_14
928
+ - bearer: []
929
+ summary: Get user settings
930
+ tags: &ref_15
931
+ - settings
932
+ patch:
933
+ operationId: update
934
+ parameters:
935
+ - *ref_13
936
+ requestBody:
937
+ required: true
938
+ content:
939
+ application/json:
940
+ schema:
941
+ $ref: '#/components/schemas/UpdateSettingsDto'
942
+ responses:
943
+ '200':
944
+ description: Settings updated successfully
945
+ content:
946
+ application/json:
947
+ schema:
948
+ $ref: '#/components/schemas/SettingsResponseDto'
949
+ '400':
950
+ description: Invalid input data
951
+ '404':
952
+ description: Settings not found
953
+ security: *ref_14
954
+ summary: Update user settings
955
+ tags: *ref_15
956
+ /export:
957
+ get:
958
+ operationId: export
959
+ parameters: []
960
+ responses:
961
+ '200':
962
+ description: ''
963
+ tags: &ref_16
964
+ - DataTransfer
965
+ /import:
966
+ post:
967
+ operationId: import
968
+ parameters: []
969
+ requestBody:
970
+ required: true
971
+ content:
972
+ application/json:
973
+ schema:
974
+ $ref: '#/components/schemas/ImportDataDto'
975
+ responses:
976
+ '201':
977
+ description: ''
978
+ tags: *ref_16
979
+ /transfers:
980
+ post:
981
+ operationId: create
982
+ parameters:
983
+ - &ref_17
984
+ name: x-api-key
985
+ in: header
986
+ required: false
987
+ schema:
988
+ type: string
989
+ requestBody:
990
+ required: true
991
+ content:
992
+ application/json:
993
+ schema:
994
+ $ref: '#/components/schemas/CreateTransferDto'
995
+ responses:
996
+ '201':
997
+ description: Transfer created
998
+ content:
999
+ application/json:
1000
+ schema:
1001
+ $ref: '#/components/schemas/TransferResponseDto'
1002
+ '400':
1003
+ description: Invalid input
1004
+ '404':
1005
+ description: Account not found
1006
+ security: &ref_18
1007
+ - bearer: []
1008
+ summary: Create a new transfer between accounts
1009
+ tags: &ref_19
1010
+ - transfers
1011
+ get:
1012
+ operationId: findAll
1013
+ parameters:
1014
+ - *ref_17
1015
+ - name: accountId
1016
+ required: false
1017
+ in: query
1018
+ description: Filter by account ID (source or destination)
1019
+ schema:
1020
+ type: string
1021
+ - name: month
1022
+ required: false
1023
+ in: query
1024
+ description: Filter by month (YYYY-MM format)
1025
+ schema:
1026
+ example: 2026-02
1027
+ type: string
1028
+ - name: startDate
1029
+ required: false
1030
+ in: query
1031
+ description: Filter from date (YYYY-MM-DD)
1032
+ schema:
1033
+ example: '2026-02-01'
1034
+ type: string
1035
+ - name: endDate
1036
+ required: false
1037
+ in: query
1038
+ description: Filter to date (YYYY-MM-DD)
1039
+ schema:
1040
+ example: '2026-02-28'
1041
+ type: string
1042
+ responses:
1043
+ '200':
1044
+ description: List of transfers
1045
+ content:
1046
+ application/json:
1047
+ schema:
1048
+ type: array
1049
+ items:
1050
+ $ref: '#/components/schemas/TransferResponseDto'
1051
+ security: *ref_18
1052
+ summary: List transfers with optional filters
1053
+ tags: *ref_19
1054
+ /transfers/{id}:
1055
+ get:
1056
+ operationId: findOne
1057
+ parameters:
1058
+ - *ref_17
1059
+ - name: id
1060
+ required: true
1061
+ in: path
1062
+ schema:
1063
+ type: string
1064
+ responses:
1065
+ '200':
1066
+ description: Transfer found
1067
+ content:
1068
+ application/json:
1069
+ schema:
1070
+ $ref: '#/components/schemas/TransferResponseDto'
1071
+ '404':
1072
+ description: Transfer not found
1073
+ security: *ref_18
1074
+ summary: Get a transfer by ID
1075
+ tags: *ref_19
1076
+ patch:
1077
+ operationId: update
1078
+ parameters:
1079
+ - *ref_17
1080
+ - name: id
1081
+ required: true
1082
+ in: path
1083
+ schema:
1084
+ type: string
1085
+ requestBody:
1086
+ required: true
1087
+ content:
1088
+ application/json:
1089
+ schema:
1090
+ $ref: '#/components/schemas/UpdateTransferDto'
1091
+ responses:
1092
+ '200':
1093
+ description: Transfer updated
1094
+ content:
1095
+ application/json:
1096
+ schema:
1097
+ $ref: '#/components/schemas/TransferResponseDto'
1098
+ '404':
1099
+ description: Transfer not found
1100
+ security: *ref_18
1101
+ summary: Update a transfer
1102
+ tags: *ref_19
1103
+ delete:
1104
+ operationId: remove
1105
+ parameters:
1106
+ - *ref_17
1107
+ - name: id
1108
+ required: true
1109
+ in: path
1110
+ schema:
1111
+ type: string
1112
+ responses:
1113
+ '204':
1114
+ description: Transfer deleted
1115
+ '404':
1116
+ description: Transfer not found
1117
+ security: *ref_18
1118
+ summary: Delete a transfer
1119
+ tags: *ref_19
1120
+ /subscriptions:
1121
+ post:
1122
+ operationId: create
1123
+ parameters:
1124
+ - &ref_20
1125
+ name: x-api-key
1126
+ in: header
1127
+ required: false
1128
+ schema:
1129
+ type: string
1130
+ requestBody:
1131
+ required: true
1132
+ content:
1133
+ application/json:
1134
+ schema:
1135
+ $ref: '#/components/schemas/CreateSubscriptionDto'
1136
+ responses:
1137
+ '201':
1138
+ description: Subscription created successfully.
1139
+ '400':
1140
+ description: Invalid input.
1141
+ '404':
1142
+ description: Credit card not found.
1143
+ security: &ref_21
1144
+ - bearer: []
1145
+ summary: Create a new subscription
1146
+ tags: &ref_22
1147
+ - subscriptions
1148
+ get:
1149
+ operationId: findAll
1150
+ parameters:
1151
+ - *ref_20
1152
+ responses:
1153
+ '200':
1154
+ description: List of subscriptions.
1155
+ security: *ref_21
1156
+ summary: Get all subscriptions
1157
+ tags: *ref_22
1158
+ /subscriptions/active:
1159
+ get:
1160
+ operationId: findActive
1161
+ parameters:
1162
+ - *ref_20
1163
+ responses:
1164
+ '200':
1165
+ description: List of active subscriptions.
1166
+ security: *ref_21
1167
+ summary: Get all active subscriptions
1168
+ tags: *ref_22
1169
+ /subscriptions/{id}:
1170
+ get:
1171
+ operationId: findOne
1172
+ parameters:
1173
+ - *ref_20
1174
+ - name: id
1175
+ required: true
1176
+ in: path
1177
+ schema:
1178
+ type: string
1179
+ responses:
1180
+ '200':
1181
+ description: Subscription found.
1182
+ '404':
1183
+ description: Subscription not found.
1184
+ security: *ref_21
1185
+ summary: Get a subscription by ID
1186
+ tags: *ref_22
1187
+ patch:
1188
+ operationId: update
1189
+ parameters:
1190
+ - *ref_20
1191
+ - name: id
1192
+ required: true
1193
+ in: path
1194
+ schema:
1195
+ type: string
1196
+ requestBody:
1197
+ required: true
1198
+ content:
1199
+ application/json:
1200
+ schema:
1201
+ $ref: '#/components/schemas/UpdateSubscriptionDto'
1202
+ responses:
1203
+ '200':
1204
+ description: Subscription updated successfully.
1205
+ '404':
1206
+ description: Subscription or credit card not found.
1207
+ security: *ref_21
1208
+ summary: Update a subscription
1209
+ tags: *ref_22
1210
+ delete:
1211
+ operationId: remove
1212
+ parameters:
1213
+ - *ref_20
1214
+ - name: id
1215
+ required: true
1216
+ in: path
1217
+ schema:
1218
+ type: string
1219
+ responses:
1220
+ '200':
1221
+ description: Subscription deactivated successfully.
1222
+ '404':
1223
+ description: Subscription not found.
1224
+ security: *ref_21
1225
+ summary: Deactivate a subscription (soft delete)
1226
+ tags: *ref_22
1227
+ /subscriptions/{id}/permanent:
1228
+ delete:
1229
+ operationId: hardDelete
1230
+ parameters:
1231
+ - *ref_20
1232
+ - name: id
1233
+ required: true
1234
+ in: path
1235
+ schema:
1236
+ type: string
1237
+ responses:
1238
+ '200':
1239
+ description: Subscription deleted permanently.
1240
+ '404':
1241
+ description: Subscription not found.
1242
+ security: *ref_21
1243
+ summary: Permanently delete a subscription
1244
+ tags: *ref_22
1245
+ /subscriptions/{id}/reactivate:
1246
+ patch:
1247
+ operationId: reactivate
1248
+ parameters:
1249
+ - *ref_20
1250
+ - name: id
1251
+ required: true
1252
+ in: path
1253
+ schema:
1254
+ type: string
1255
+ responses:
1256
+ '200':
1257
+ description: Subscription reactivated successfully.
1258
+ '404':
1259
+ description: Subscription not found.
1260
+ security: *ref_21
1261
+ summary: Reactivate a deactivated subscription
1262
+ tags: *ref_22
1263
+ /api-keys:
1264
+ post:
1265
+ operationId: create
1266
+ parameters: []
1267
+ requestBody:
1268
+ required: true
1269
+ content:
1270
+ application/json:
1271
+ schema:
1272
+ $ref: '#/components/schemas/CreateApiKeyDto'
1273
+ responses:
1274
+ '201':
1275
+ description: ''
1276
+ content:
1277
+ application/json:
1278
+ schema:
1279
+ $ref: '#/components/schemas/ApiKeyResponseDto'
1280
+ security: &ref_23
1281
+ - bearer: []
1282
+ summary: Create a new API Key
1283
+ tags: &ref_24
1284
+ - api-keys
1285
+ get:
1286
+ operationId: findAll
1287
+ parameters: []
1288
+ responses:
1289
+ '200':
1290
+ description: ''
1291
+ content:
1292
+ application/json:
1293
+ schema:
1294
+ type: array
1295
+ items:
1296
+ $ref: '#/components/schemas/ApiKeyResponseDto'
1297
+ security: *ref_23
1298
+ summary: List your API Keys
1299
+ tags: *ref_24
1300
+ /api-keys/{id}:
1301
+ delete:
1302
+ operationId: revoke
1303
+ parameters:
1304
+ - name: id
1305
+ required: true
1306
+ in: path
1307
+ schema:
1308
+ type: string
1309
+ responses:
1310
+ '204':
1311
+ description: ''
1312
+ security: *ref_23
1313
+ summary: Revoke an API Key
1314
+ tags: *ref_24
1315
+ info:
1316
+ title: Quantix Personal Finance Manager API
1317
+ description: >-
1318
+ O Quantix é um gerenciador financeiro pessoal moderno, projetado para ajudar
1319
+ indivíduos a controlarem suas finanças de maneira simples, eficaz e segura.
1320
+
1321
+
1322
+ ## Principais Recursos
1323
+
1324
+ - **Multi-usuário**: Suporte total a múltiplos usuários com isolamento
1325
+ completo de dados.
1326
+
1327
+ - **Controle de Transações**: Gestão de receitas, despesas e transferências
1328
+ entre contas.
1329
+
1330
+ - **Cartões de Crédito**: Acompanhamento de faturas, limites e pagamentos.
1331
+
1332
+ - **Categorias e Organização**: Classificação visual de gastos com
1333
+ categorias personalizáveis.
1334
+
1335
+ - **Assinaturas e Recorrência**: Automação de lançamentos frequentes
1336
+ (Netflix, aluguel, etc.).
1337
+
1338
+ - **Segurança**: Autenticação robusta via JWT e armazenamento seguro de
1339
+ senhas com Bcrypt.
1340
+
1341
+
1342
+ ## Autenticação
1343
+
1344
+ Esta API utiliza autenticação baseada em **JWT (JSON Web Token)**.
1345
+
1346
+ 1. Registre-se ou faça login através dos endpoints de `/auth` para receber
1347
+ seu token de acesso.
1348
+
1349
+ 2. Inclua o token no header de autorização em todas as requisições
1350
+ protegidas:
1351
+
1352
+ ```
1353
+
1354
+ Authorization: Bearer <seu-token-aqui>
1355
+
1356
+ ```
1357
+
1358
+
1359
+ ## Base URL
1360
+
1361
+ Todos os endpoints da API são relativos a: `http://localhost:3000/api`
1362
+
1363
+ version: 0.4.2
1364
+ contact:
1365
+ name: Quantix Support
1366
+ url: https://github.com/marcosnunesmbs/quantix
1367
+ email: support@example.com
1368
+ license:
1369
+ name: MIT
1370
+ url: https://github.com/marcosnunesmbs/quantix/blob/main/LICENSE
1371
+ tags: []
1372
+ servers: []
1373
+ components:
1374
+ securitySchemes:
1375
+ bearer:
1376
+ scheme: bearer
1377
+ bearerFormat: JWT
1378
+ type: http
1379
+ schemas:
1380
+ CreateCategoryDto:
1381
+ type: object
1382
+ properties:
1383
+ name:
1384
+ type: string
1385
+ description: Name of the category
1386
+ example: Groceries
1387
+ type:
1388
+ type: string
1389
+ description: Type of the category
1390
+ enum:
1391
+ - INCOME
1392
+ - EXPENSE
1393
+ example: EXPENSE
1394
+ color:
1395
+ type: object
1396
+ description: Color for the category in hexadecimal format
1397
+ example: '#FF5733'
1398
+ nullable: true
1399
+ required:
1400
+ - name
1401
+ - type
1402
+ UpdateCategoryDto:
1403
+ type: object
1404
+ properties:
1405
+ name:
1406
+ type: string
1407
+ description: Name of the category
1408
+ example: Groceries
1409
+ color:
1410
+ type: object
1411
+ description: Color for the category in hexadecimal format
1412
+ example: '#FF5733'
1413
+ nullable: true
1414
+ RegisterDto:
1415
+ type: object
1416
+ properties:
1417
+ name:
1418
+ type: string
1419
+ description: User name
1420
+ email:
1421
+ type: string
1422
+ description: User email
1423
+ password:
1424
+ type: string
1425
+ description: User password
1426
+ minLength: 6
1427
+ required:
1428
+ - name
1429
+ - email
1430
+ - password
1431
+ LoginDto:
1432
+ type: object
1433
+ properties:
1434
+ email:
1435
+ type: string
1436
+ description: User email
1437
+ password:
1438
+ type: string
1439
+ description: User password
1440
+ required:
1441
+ - email
1442
+ - password
1443
+ ChangePasswordDto:
1444
+ type: object
1445
+ properties:
1446
+ currentPassword:
1447
+ type: string
1448
+ description: Current user password
1449
+ newPassword:
1450
+ type: string
1451
+ description: New user password
1452
+ minLength: 6
1453
+ required:
1454
+ - currentPassword
1455
+ - newPassword
1456
+ ForgotPasswordDto:
1457
+ type: object
1458
+ properties:
1459
+ email:
1460
+ type: string
1461
+ description: User email
1462
+ required:
1463
+ - email
1464
+ ResetPasswordDto:
1465
+ type: object
1466
+ properties:
1467
+ token:
1468
+ type: string
1469
+ description: Reset token received by email
1470
+ newPassword:
1471
+ type: string
1472
+ description: New user password
1473
+ minLength: 6
1474
+ required:
1475
+ - token
1476
+ - newPassword
1477
+ RecurrenceDto:
1478
+ type: object
1479
+ properties:
1480
+ frequency:
1481
+ type: string
1482
+ description: Frequency of recurrence
1483
+ enum:
1484
+ - WEEKLY
1485
+ - MONTHLY
1486
+ - YEARLY
1487
+ example: MONTHLY
1488
+ interval:
1489
+ type: number
1490
+ description: Interval between recurrences
1491
+ example: 1
1492
+ minimum: 1
1493
+ startDate:
1494
+ type: object
1495
+ description: Start date for recurrence
1496
+ example: '2026-01-30'
1497
+ endDate:
1498
+ type: string
1499
+ description: >-
1500
+ End date for recurrence (optional, mutually exclusive with
1501
+ occurrences)
1502
+ example: '2026-12-31'
1503
+ occurrences:
1504
+ type: number
1505
+ description: Number of occurrences (optional, mutually exclusive with endDate)
1506
+ example: 12
1507
+ minimum: 2
1508
+ required:
1509
+ - frequency
1510
+ - interval
1511
+ - startDate
1512
+ CreateTransactionDto:
1513
+ type: object
1514
+ properties:
1515
+ type:
1516
+ type: string
1517
+ description: Type of the transaction
1518
+ enum: &ref_25
1519
+ - INCOME
1520
+ - EXPENSE
1521
+ example: EXPENSE
1522
+ name:
1523
+ type: object
1524
+ description: Name or description of the transaction
1525
+ example: Grocery shopping
1526
+ amount:
1527
+ type: object
1528
+ description: Amount of the transaction
1529
+ example: 125.75
1530
+ minimum: 0
1531
+ date:
1532
+ type: object
1533
+ description: >-
1534
+ Date of the transaction (for credit cards, this will be overridden
1535
+ by the due day of the card if targetDueMonth is provided)
1536
+ example: '2026-01-30'
1537
+ categoryId:
1538
+ type: string
1539
+ description: ID of the associated category
1540
+ example: cat_123456789
1541
+ paymentMethod:
1542
+ type: string
1543
+ description: Method of payment
1544
+ enum: &ref_26
1545
+ - CASH
1546
+ - PIX
1547
+ - DEBIT
1548
+ - CREDIT
1549
+ example: CREDIT
1550
+ creditCardId:
1551
+ type: string
1552
+ description: >-
1553
+ ID of the associated credit card (required if paymentMethod is
1554
+ CREDIT)
1555
+ example: cc_123456789
1556
+ installments:
1557
+ type: number
1558
+ description: Number of installments (optional)
1559
+ example: 3
1560
+ minimum: 1
1561
+ targetDueMonth:
1562
+ type: string
1563
+ description: Target month for due date in YYYY-MM format (optional)
1564
+ example: 2026-03
1565
+ isRecurring:
1566
+ type: boolean
1567
+ description: Whether the transaction is recurring
1568
+ example: false
1569
+ default: false
1570
+ recurrence:
1571
+ description: Recurrence information (optional)
1572
+ allOf:
1573
+ - $ref: '#/components/schemas/RecurrenceDto'
1574
+ accountId:
1575
+ type: string
1576
+ description: >-
1577
+ ID of the associated account (required if paymentMethod is not
1578
+ CREDIT)
1579
+ example: acc_123456789
1580
+ isPaid:
1581
+ type: boolean
1582
+ description: Whether the transaction has been paid
1583
+ example: false
1584
+ default: false
1585
+ purchaseDate:
1586
+ type: string
1587
+ description: Actual purchase date (credit card only)
1588
+ example: '2026-02-10'
1589
+ required:
1590
+ - type
1591
+ - name
1592
+ - amount
1593
+ - date
1594
+ CategoryDto:
1595
+ type: object
1596
+ properties:
1597
+ id:
1598
+ type: string
1599
+ name:
1600
+ type: string
1601
+ type:
1602
+ type: string
1603
+ enum:
1604
+ - INCOME
1605
+ - EXPENSE
1606
+ color:
1607
+ type: object
1608
+ nullable: true
1609
+ createdAt:
1610
+ format: date-time
1611
+ type: string
1612
+ required:
1613
+ - id
1614
+ - name
1615
+ - type
1616
+ - createdAt
1617
+ CreditCardDto:
1618
+ type: object
1619
+ properties:
1620
+ id:
1621
+ type: string
1622
+ name:
1623
+ type: string
1624
+ brand:
1625
+ type: string
1626
+ limitAmount:
1627
+ type: number
1628
+ closingDay:
1629
+ type: number
1630
+ dueDay:
1631
+ type: number
1632
+ availableLimit:
1633
+ type: number
1634
+ createdAt:
1635
+ format: date-time
1636
+ type: string
1637
+ required:
1638
+ - id
1639
+ - name
1640
+ - limitAmount
1641
+ - closingDay
1642
+ - dueDay
1643
+ - createdAt
1644
+ RecurrenceRule:
1645
+ type: object
1646
+ properties: {}
1647
+ SubscriptionDto:
1648
+ type: object
1649
+ properties:
1650
+ id:
1651
+ type: string
1652
+ name:
1653
+ type: string
1654
+ amount:
1655
+ type: number
1656
+ billingDay:
1657
+ type: number
1658
+ creditCardId:
1659
+ type: string
1660
+ categoryId:
1661
+ type: string
1662
+ active:
1663
+ type: boolean
1664
+ createdAt:
1665
+ format: date-time
1666
+ type: string
1667
+ updatedAt:
1668
+ format: date-time
1669
+ type: string
1670
+ required:
1671
+ - id
1672
+ - name
1673
+ - amount
1674
+ - billingDay
1675
+ - creditCardId
1676
+ - active
1677
+ - createdAt
1678
+ - updatedAt
1679
+ AccountDto:
1680
+ type: object
1681
+ properties:
1682
+ id:
1683
+ type: string
1684
+ name:
1685
+ type: string
1686
+ type:
1687
+ type: string
1688
+ initialBalance:
1689
+ type: number
1690
+ currentBalance:
1691
+ type: number
1692
+ createdAt:
1693
+ format: date-time
1694
+ type: string
1695
+ updatedAt:
1696
+ format: date-time
1697
+ type: string
1698
+ required:
1699
+ - name
1700
+ - type
1701
+ - initialBalance
1702
+ - currentBalance
1703
+ TransactionWithRelationsDto:
1704
+ type: object
1705
+ properties:
1706
+ id:
1707
+ type: string
1708
+ type:
1709
+ type: string
1710
+ enum:
1711
+ - INCOME
1712
+ - EXPENSE
1713
+ name:
1714
+ type: string
1715
+ amount:
1716
+ type: number
1717
+ date:
1718
+ format: date-time
1719
+ type: string
1720
+ categoryId:
1721
+ type: string
1722
+ category:
1723
+ $ref: '#/components/schemas/CategoryDto'
1724
+ paymentMethod:
1725
+ type: string
1726
+ enum:
1727
+ - CASH
1728
+ - PIX
1729
+ - DEBIT
1730
+ - CREDIT
1731
+ creditCardId:
1732
+ type: string
1733
+ creditCard:
1734
+ $ref: '#/components/schemas/CreditCardDto'
1735
+ recurrenceRule:
1736
+ $ref: '#/components/schemas/RecurrenceRule'
1737
+ subscriptionId:
1738
+ type: string
1739
+ subscription:
1740
+ $ref: '#/components/schemas/SubscriptionDto'
1741
+ accountId:
1742
+ type: string
1743
+ account:
1744
+ $ref: '#/components/schemas/AccountDto'
1745
+ installmentGroupId:
1746
+ type: string
1747
+ installmentNumber:
1748
+ type: number
1749
+ installmentTotal:
1750
+ type: number
1751
+ recurrenceRuleId:
1752
+ type: string
1753
+ paid:
1754
+ type: boolean
1755
+ createdAt:
1756
+ format: date-time
1757
+ type: string
1758
+ purchaseDate:
1759
+ format: date-time
1760
+ type: string
1761
+ linkedTransactionId:
1762
+ type: string
1763
+ isAnticipation:
1764
+ type: boolean
1765
+ description: >-
1766
+ Indicates if this transaction is part of a credit card anticipation
1767
+ pair
1768
+ required:
1769
+ - id
1770
+ - type
1771
+ - name
1772
+ - amount
1773
+ - date
1774
+ - paid
1775
+ - createdAt
1776
+ UpdateTransactionDto:
1777
+ type: object
1778
+ properties:
1779
+ type:
1780
+ type: string
1781
+ description: Type of the transaction
1782
+ enum: *ref_25
1783
+ example: EXPENSE
1784
+ name:
1785
+ type: object
1786
+ description: Name or description of the transaction
1787
+ example: Grocery shopping
1788
+ amount:
1789
+ type: object
1790
+ description: Amount of the transaction
1791
+ example: 125.75
1792
+ minimum: 0
1793
+ date:
1794
+ type: object
1795
+ description: >-
1796
+ Date of the transaction (for credit cards, this will be overridden
1797
+ by the due day of the card if targetDueMonth is provided)
1798
+ example: '2026-01-30'
1799
+ categoryId:
1800
+ type: string
1801
+ description: ID of the associated category
1802
+ example: cat_123456789
1803
+ paymentMethod:
1804
+ type: string
1805
+ description: Method of payment
1806
+ enum: *ref_26
1807
+ example: CREDIT
1808
+ creditCardId:
1809
+ type: string
1810
+ description: >-
1811
+ ID of the associated credit card (required if paymentMethod is
1812
+ CREDIT)
1813
+ example: cc_123456789
1814
+ installments:
1815
+ type: number
1816
+ description: Number of installments (optional)
1817
+ example: 3
1818
+ minimum: 1
1819
+ targetDueMonth:
1820
+ type: string
1821
+ description: >-
1822
+ Target month for due date in YYYY-MM format (optional). When
1823
+ provided for CREDIT payments, the transaction date will be set to
1824
+ the credit card's due day in the specified month.
1825
+ example: 2026-03
1826
+ isRecurring:
1827
+ type: boolean
1828
+ description: Whether the transaction is recurring
1829
+ example: false
1830
+ default: false
1831
+ recurrence:
1832
+ description: Recurrence information (optional)
1833
+ allOf:
1834
+ - $ref: '#/components/schemas/RecurrenceDto'
1835
+ accountId:
1836
+ type: string
1837
+ description: >-
1838
+ ID of the associated account (required if paymentMethod is not
1839
+ CREDIT)
1840
+ example: acc_123456789
1841
+ isPaid:
1842
+ type: boolean
1843
+ description: Whether the transaction has been paid
1844
+ example: false
1845
+ default: false
1846
+ purchaseDate:
1847
+ type: string
1848
+ description: Actual purchase date (credit card only)
1849
+ example: '2026-02-10'
1850
+ CreateCreditCardDto:
1851
+ type: object
1852
+ properties:
1853
+ name:
1854
+ type: string
1855
+ description: Name of the credit card
1856
+ example: Nubank Platinum
1857
+ brand:
1858
+ type: string
1859
+ description: Brand of the credit card
1860
+ example: Visa
1861
+ limitAmount:
1862
+ type: number
1863
+ description: Credit limit of the card
1864
+ example: 5000
1865
+ minimum: 0
1866
+ closingDay:
1867
+ type: number
1868
+ description: Day of the month when the billing cycle closes
1869
+ example: 15
1870
+ minimum: 1
1871
+ maximum: 31
1872
+ dueDay:
1873
+ type: number
1874
+ description: Day of the month when the bill is due
1875
+ example: 22
1876
+ minimum: 1
1877
+ maximum: 31
1878
+ required:
1879
+ - name
1880
+ - limitAmount
1881
+ - closingDay
1882
+ - dueDay
1883
+ UpdateCreditCardDto:
1884
+ type: object
1885
+ properties:
1886
+ name:
1887
+ type: string
1888
+ description: Name of the credit card
1889
+ example: Nubank Platinum
1890
+ brand:
1891
+ type: string
1892
+ description: Brand of the credit card
1893
+ example: Visa
1894
+ limitAmount:
1895
+ type: number
1896
+ description: Credit limit of the card
1897
+ example: 5000
1898
+ minimum: 0
1899
+ closingDay:
1900
+ type: number
1901
+ description: Day of the month when the billing cycle closes
1902
+ example: 15
1903
+ minimum: 1
1904
+ maximum: 31
1905
+ dueDay:
1906
+ type: number
1907
+ description: Day of the month when the bill is due
1908
+ example: 22
1909
+ minimum: 1
1910
+ maximum: 31
1911
+ PayStatementDto:
1912
+ type: object
1913
+ properties:
1914
+ month:
1915
+ type: object
1916
+ description: Month for the statement in YYYY-MM format
1917
+ example: 2026-03
1918
+ paymentAccountId:
1919
+ type: object
1920
+ description: ID of the account to debit for the payment
1921
+ example: acc_123456789
1922
+ required:
1923
+ - month
1924
+ - paymentAccountId
1925
+ ReopenStatementDto:
1926
+ type: object
1927
+ properties:
1928
+ month:
1929
+ type: object
1930
+ description: Month for the statement in YYYY-MM format
1931
+ example: 2026-03
1932
+ required:
1933
+ - month
1934
+ CreateAnticipationDto:
1935
+ type: object
1936
+ properties:
1937
+ name:
1938
+ type: string
1939
+ description: Name/description of the anticipation
1940
+ amount:
1941
+ type: number
1942
+ description: Amount to anticipate
1943
+ minimum: 0.01
1944
+ purchaseDate:
1945
+ type: string
1946
+ description: Date the money leaves the account (YYYY-MM-DD)
1947
+ example: '2026-02-23'
1948
+ targetDueMonth:
1949
+ type: string
1950
+ description: Target statement due month (YYYY-MM)
1951
+ example: 2026-03
1952
+ accountId:
1953
+ type: string
1954
+ description: Account ID from which money will be debited
1955
+ categoryId:
1956
+ type: string
1957
+ description: Category ID for both transactions
1958
+ required:
1959
+ - name
1960
+ - amount
1961
+ - purchaseDate
1962
+ - targetDueMonth
1963
+ - accountId
1964
+ CreateAccountDto:
1965
+ type: object
1966
+ properties:
1967
+ name:
1968
+ type: string
1969
+ description: Name of the account
1970
+ example: Itaú Checking Account
1971
+ type:
1972
+ type: string
1973
+ description: Type of account
1974
+ enum: &ref_27
1975
+ - BANK_ACCOUNT
1976
+ - WALLET
1977
+ - SAVINGS_ACCOUNT
1978
+ - INVESTMENT_ACCOUNT
1979
+ - OTHER
1980
+ example: BANK_ACCOUNT
1981
+ initialBalance:
1982
+ type: number
1983
+ description: Initial balance for the account
1984
+ example: 1000
1985
+ required:
1986
+ - name
1987
+ - type
1988
+ AccountResponseDto:
1989
+ type: object
1990
+ properties:
1991
+ id:
1992
+ type: string
1993
+ description: Unique identifier for the account
1994
+ example: uuid-string
1995
+ name:
1996
+ type: string
1997
+ description: Name of the account
1998
+ example: Itaú Checking Account
1999
+ type:
2000
+ type: string
2001
+ description: Type of account
2002
+ enum:
2003
+ - BANK_ACCOUNT
2004
+ - WALLET
2005
+ - SAVINGS_ACCOUNT
2006
+ - INVESTMENT_ACCOUNT
2007
+ - OTHER
2008
+ example: BANK_ACCOUNT
2009
+ initialBalance:
2010
+ type: number
2011
+ description: Initial balance when the account was created
2012
+ example: 1000
2013
+ currentBalance:
2014
+ type: number
2015
+ description: Current balance of the account
2016
+ example: 850
2017
+ createdAt:
2018
+ format: date-time
2019
+ type: string
2020
+ description: Timestamp when the account was created
2021
+ example: '2026-02-11T12:00:00Z'
2022
+ updatedAt:
2023
+ format: date-time
2024
+ type: string
2025
+ description: Timestamp when the account was last updated
2026
+ example: '2026-02-11T15:30:00Z'
2027
+ required:
2028
+ - id
2029
+ - name
2030
+ - type
2031
+ - initialBalance
2032
+ - currentBalance
2033
+ - createdAt
2034
+ - updatedAt
2035
+ UpdateAccountDto:
2036
+ type: object
2037
+ properties:
2038
+ name:
2039
+ type: string
2040
+ description: Name of the account
2041
+ example: Itaú Checking Account
2042
+ type:
2043
+ type: string
2044
+ description: Type of account
2045
+ enum: *ref_27
2046
+ example: BANK_ACCOUNT
2047
+ initialBalance:
2048
+ type: number
2049
+ description: Initial balance for the account
2050
+ example: 1000
2051
+ SettingsResponseDto:
2052
+ type: object
2053
+ properties:
2054
+ language:
2055
+ type: string
2056
+ description: Preferred language
2057
+ example: pt-BR
2058
+ enum:
2059
+ - pt-BR
2060
+ - en-US
2061
+ currency:
2062
+ type: string
2063
+ description: Default currency
2064
+ example: BRL
2065
+ enum:
2066
+ - BRL
2067
+ - USD
2068
+ - EUR
2069
+ - GBP
2070
+ - JPY
2071
+ - CAD
2072
+ - AUD
2073
+ - CHF
2074
+ createdAt:
2075
+ type: string
2076
+ description: Settings creation date
2077
+ example: '2024-01-15T10:30:00.000Z'
2078
+ updatedAt:
2079
+ type: string
2080
+ description: Settings last update date
2081
+ example: '2024-01-15T10:30:00.000Z'
2082
+ required:
2083
+ - language
2084
+ - currency
2085
+ - createdAt
2086
+ - updatedAt
2087
+ UpdateSettingsDto:
2088
+ type: object
2089
+ properties:
2090
+ userName:
2091
+ type: string
2092
+ description: User name
2093
+ example: John Doe
2094
+ language:
2095
+ type: string
2096
+ description: Preferred language
2097
+ example: pt-BR
2098
+ enum:
2099
+ - pt-BR
2100
+ - en-US
2101
+ currency:
2102
+ type: string
2103
+ description: Default currency
2104
+ example: BRL
2105
+ enum:
2106
+ - BRL
2107
+ - USD
2108
+ - EUR
2109
+ - GBP
2110
+ - JPY
2111
+ - CAD
2112
+ - AUD
2113
+ - CHF
2114
+ ImportDataDto:
2115
+ type: object
2116
+ properties: {}
2117
+ CreateTransferDto:
2118
+ type: object
2119
+ properties:
2120
+ sourceAccountId:
2121
+ type: string
2122
+ description: ID of the source account
2123
+ destinationAccountId:
2124
+ type: string
2125
+ description: ID of the destination account
2126
+ amount:
2127
+ type: number
2128
+ description: Amount to transfer
2129
+ minimum: 0.01
2130
+ date:
2131
+ type: string
2132
+ description: Date of the transfer (YYYY-MM-DD)
2133
+ example: '2026-02-17'
2134
+ required:
2135
+ - sourceAccountId
2136
+ - destinationAccountId
2137
+ - amount
2138
+ - date
2139
+ TransferResponseDto:
2140
+ type: object
2141
+ properties:
2142
+ id:
2143
+ type: string
2144
+ sourceAccountId:
2145
+ type: string
2146
+ destinationAccountId:
2147
+ type: string
2148
+ amount:
2149
+ type: number
2150
+ date:
2151
+ type: string
2152
+ description: Date of the transfer (YYYY-MM-DD)
2153
+ createdAt:
2154
+ format: date-time
2155
+ type: string
2156
+ updatedAt:
2157
+ format: date-time
2158
+ type: string
2159
+ required:
2160
+ - id
2161
+ - sourceAccountId
2162
+ - destinationAccountId
2163
+ - amount
2164
+ - date
2165
+ - createdAt
2166
+ - updatedAt
2167
+ UpdateTransferDto:
2168
+ type: object
2169
+ properties:
2170
+ sourceAccountId:
2171
+ type: string
2172
+ description: ID of the source account
2173
+ destinationAccountId:
2174
+ type: string
2175
+ description: ID of the destination account
2176
+ amount:
2177
+ type: number
2178
+ description: Amount to transfer
2179
+ minimum: 0.01
2180
+ date:
2181
+ type: string
2182
+ description: Date of the transfer (YYYY-MM-DD)
2183
+ example: '2026-02-17'
2184
+ CreateSubscriptionDto:
2185
+ type: object
2186
+ properties:
2187
+ name:
2188
+ type: string
2189
+ description: Name of the subscription (e.g., Netflix, Spotify)
2190
+ example: Netflix
2191
+ amount:
2192
+ type: number
2193
+ description: Monthly amount charged
2194
+ example: 55.9
2195
+ minimum: 0.01
2196
+ billingDay:
2197
+ type: number
2198
+ description: Day of the month when the subscription is charged (1-31)
2199
+ example: 15
2200
+ minimum: 1
2201
+ maximum: 31
2202
+ creditCardId:
2203
+ type: string
2204
+ description: ID of the credit card used for this subscription
2205
+ example: cc_123456789
2206
+ categoryId:
2207
+ type: string
2208
+ description: ID of the expense category
2209
+ example: cat_123456789
2210
+ required:
2211
+ - name
2212
+ - amount
2213
+ - billingDay
2214
+ - creditCardId
2215
+ UpdateSubscriptionDto:
2216
+ type: object
2217
+ properties:
2218
+ name:
2219
+ type: string
2220
+ description: Name of the subscription
2221
+ example: Netflix Premium
2222
+ amount:
2223
+ type: number
2224
+ description: Monthly amount charged
2225
+ example: 79.9
2226
+ minimum: 0.01
2227
+ billingDay:
2228
+ type: number
2229
+ description: Day of the month when the subscription is charged (1-31)
2230
+ example: 10
2231
+ minimum: 1
2232
+ maximum: 31
2233
+ creditCardId:
2234
+ type: string
2235
+ description: ID of the credit card used for this subscription
2236
+ example: cc_987654321
2237
+ categoryId:
2238
+ type: string
2239
+ description: ID of the expense category
2240
+ example: cat_123456789
2241
+ active:
2242
+ type: boolean
2243
+ description: Whether the subscription is active
2244
+ example: true
2245
+ CreateApiKeyDto:
2246
+ type: object
2247
+ properties:
2248
+ name:
2249
+ type: string
2250
+ example: My MCP Server
2251
+ required:
2252
+ - name
2253
+ ApiKeyResponseDto:
2254
+ type: object
2255
+ properties:
2256
+ id:
2257
+ type: string
2258
+ name:
2259
+ type: string
2260
+ keyPrefix:
2261
+ type: string
2262
+ secret:
2263
+ type: string
2264
+ isActive:
2265
+ type: boolean
2266
+ lastUsedAt:
2267
+ format: date-time
2268
+ type: string
2269
+ createdAt:
2270
+ format: date-time
2271
+ type: string
2272
+ required:
2273
+ - id
2274
+ - name
2275
+ - keyPrefix
2276
+ - isActive
2277
+ - createdAt
2278
+ security:
2279
+ - bearer: []