{"openapi":"3.1.0","info":{"title":"DayZero API Documentation","contact":{"name":"DayZero Engineering","url":"https://ondayzero.com/"},"license":{"name":"Proprietary"},"version":"1.0.0","description":"\n# DayZero API Documentation\n\nPublic API reference for DayZero accounting platform.\n\n## Authentication\n\nAll endpoints require Bearer token authentication:\n\n```bash\ncurl \"https://api.ondayzero.com/api/v1/businesses\" \\\n  -H \"Authorization: Bearer YOUR_API_TOKEN\" \\\n  -H \"x-business-id: YOUR_BUSINESS_ID\"\n```\n\n## Getting Started\n\n1. **Get API Access**: Contact your administrator to enable API access\n2. **Create Token**: Generate an API token from your dashboard\n3. **Make Requests**: Use your token in the Authorization header\n\n## Rate Limits\n\n- **10 active tokens** maximum per user\n- Tokens can be revoked at any time\n- Optional token expiration (1-365 days)\n    "},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/accounting-periods":{"get":{"tags":["accounting-periods"],"summary":"List accounting periods","description":"List all accounting periods for the business.","operationId":"list_periods_api_v1_accounting_periods_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: open, closed, locked","title":"Status"},"description":"Filter by status: open, closed, locked"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search status, dates, or lock/reopen reasons (case-insensitive)","title":"Search"},"description":"Search status, dates, or lock/reopen reasons (case-insensitive)"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AccountingPeriodsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["accounting-periods"],"summary":"Create accounting period","description":"Create a new accounting period.","operationId":"create_period_api_v1_accounting_periods_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingPeriodCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AccountingPeriodResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-periods/{period_id}":{"get":{"tags":["accounting-periods"],"summary":"Get accounting period","description":"Get details of a specific accounting period.","operationId":"get_period_api_v1_accounting_periods__period_id__get","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AccountingPeriodResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-periods/close":{"post":{"tags":["accounting-periods"],"summary":"Close accounting period","description":"Close an accounting period to prevent modifications.","operationId":"close_period_api_v1_accounting_periods_close_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClosePeriodRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AccountingPeriodResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-periods/{period_id}/lock":{"post":{"tags":["accounting-periods"],"summary":"Lock accounting period","description":"Lock a closed period (stronger protection than close).","operationId":"lock_period_api_v1_accounting_periods__period_id__lock_post","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AccountingPeriodResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-periods/bulk-lock":{"post":{"tags":["accounting-periods"],"summary":"Bulk close-and-lock accounting periods","description":"Close and lock multiple accounting periods in one call. Designed for historical-data migration: any open period in the list is closed first, then transitioned to locked. Already-locked periods are skipped.","operationId":"bulk_lock_periods_api_v1_accounting_periods_bulk_lock_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkLockPeriodsRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkLockPeriodsResult_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-periods/{period_id}/reopen":{"post":{"tags":["accounting-periods"],"summary":"Reopen accounting period","description":"Reopen a closed or locked period (requires reason).","operationId":"reopen_period_api_v1_accounting_periods__period_id__reopen_post","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReopenPeriodRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AccountingPeriodResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-periods/{period_id}/close-readiness":{"post":{"tags":["accounting-periods"],"summary":"AI close readiness check","description":"Check period close readiness with AI-enhanced analysis.","operationId":"check_close_readiness_api_v1_accounting_periods__period_id__close_readiness_post","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CloseReadinessResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-periods/{period_id}/checklist-acks":{"get":{"tags":["accounting-periods"],"summary":"List checklist acknowledgements","description":"Return all manual checklist step acknowledgements recorded for the period. Used by the close dashboard so Phase 4 'trial balance reviewed', 'P&L variance reviewed', 'controller signed off' etc. persist across page refreshes.","operationId":"list_period_checklist_acks_api_v1_accounting_periods__period_id__checklist_acks_get","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CloseChecklistAcksListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-periods/{period_id}/checklist-acks/{step_id}":{"put":{"tags":["accounting-periods"],"summary":"Acknowledge a checklist step","description":"Record (or update) a manual-step ack so the dashboard treats the step as done. Idempotent — re-calling updates the notes.","operationId":"acknowledge_checklist_step_api_v1_accounting_periods__period_id__checklist_acks__step_id__put","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"step_id","in":"path","required":true,"schema":{"type":"string","title":"Step Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcknowledgeCloseStepRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CloseChecklistAckResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["accounting-periods"],"summary":"Remove a checklist acknowledgement","description":"Clear a previously-recorded checklist step ack for a period.","operationId":"unacknowledge_checklist_step_api_v1_accounting_periods__period_id__checklist_acks__step_id__delete","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"step_id","in":"path","required":true,"schema":{"type":"string","title":"Step Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-periods/{period_id}/close-score":{"get":{"tags":["accounting-periods"],"summary":"Get unified close readiness score","description":"Return the persisted close-as-score gauge value for the period. If no score has been computed yet (or upstream state has changed) the score is recomputed in-line. Components include: txn_review, categorization, reconciliation, checklist, anomalies.","operationId":"get_close_score_api_v1_accounting_periods__period_id__close_score_get","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetCloseScoreResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-periods/{period_id}/close-score/recompute":{"post":{"tags":["accounting-periods"],"summary":"Force-recompute close score","description":"Re-run scoring for the period and persist the new value. Use this after resolving a blocker (e.g. dismissing the last anomaly) so the gauge updates immediately rather than waiting for the nightly Temporal recompute.","operationId":"recompute_close_score_api_v1_accounting_periods__period_id__close_score_recompute_post","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecomputeCloseScoreResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-periods/{period_id}/blockers":{"get":{"tags":["accounting-periods"],"summary":"List what's blocking close","description":"Return only the itemized 'What's between you and 100%' blockers list ordered by severity. Used by the AccountingPeriodsPage side panel and the Daily Brief tile.","operationId":"list_close_blockers_api_v1_accounting_periods__period_id__blockers_get","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListCloseBlockersResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-periods/{period_id}/score-history":{"get":{"tags":["accounting-periods"],"summary":"Daily close-score trend","description":"Return the append-only daily snapshot of close score for this period (oldest first). Powers the 'Day 1 → Day 6' sparkline.","operationId":"get_score_history_api_v1_accounting_periods__period_id__score_history_get","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":60,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetScoreHistoryResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-periods/{period_id}/sign-offs":{"get":{"tags":["accounting-periods"],"summary":"List multi-reviewer sign-offs","description":"Return all sign-off rows for the period (preparer, reviewer, controller, partner). Powers the Multi-reviewer sign-off badge on the AccountingPeriodsPage.","operationId":"list_period_sign_offs_api_v1_accounting_periods__period_id__sign_offs_get","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListPeriodSignOffsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["accounting-periods"],"summary":"Record a reviewer sign-off","description":"Record (or update) a reviewer's sign-off on the period. Idempotent on (user_id, role) — re-signing refreshes the snapshot score + notes. Side-effect: triggers a close-score recompute so the gauge updates immediately.","operationId":"create_period_sign_off_api_v1_accounting_periods__period_id__sign_offs_post","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignOffRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreatePeriodSignOffResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["accounting-periods"],"summary":"Revoke a reviewer sign-off","description":"Remove the caller's sign-off for the given role. The close-score is recomputed on success so the gauge reflects the lost sign-off.","operationId":"delete_period_sign_off_api_v1_accounting_periods__period_id__sign_offs_delete","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period Id"}},{"name":"role","in":"query","required":true,"schema":{"type":"string","description":"Role to revoke (preparer/reviewer/...)","title":"Role"},"description":"Role to revoke (preparer/reviewer/...)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms":{"get":{"tags":["advisory-firms"],"summary":"List advisory firms","description":"List advisory firms for a user. Defaults to the authenticated user; pass `user_id` to filter by a different user.","operationId":"list_advisory_firms_api_v1_advisory_firms_get","parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter firms by this user's memberships","title":"User Id"},"description":"Filter firms by this user's memberships"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AdvisoryFirmListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["advisory-firms"],"summary":"Create advisory firm","description":"Create a new advisory firm.","operationId":"create_advisory_firm_api_v1_advisory_firms_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvisoryFirmCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AdvisoryFirmResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}":{"get":{"tags":["advisory-firms"],"summary":"Get advisory firm","description":"Get details of a specific advisory firm.","operationId":"get_firm_api_v1_advisory_firms__firm_id__get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AdvisoryFirmResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["advisory-firms"],"summary":"Update advisory firm","description":"Update advisory firm details.","operationId":"update_firm_api_v1_advisory_firms__firm_id__put","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvisoryFirmUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AdvisoryFirmResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["advisory-firms"],"summary":"Delete advisory firm","description":"Delete an advisory firm and all associations.","operationId":"delete_firm_api_v1_advisory_firms__firm_id__delete","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/logo":{"get":{"tags":["advisory-firms"],"summary":"Get firm logo download URL","description":"Generate a short-lived presigned download URL for the firm logo.","operationId":"get_firm_logo_api_v1_advisory_firms__firm_id__logo_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetFirmLogoResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/businesses":{"get":{"tags":["advisory-firms"],"summary":"List firm businesses","description":"List all businesses assigned to an advisory firm.","operationId":"list_firm_businesses_api_v1_advisory_firms__firm_id__businesses_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FirmBusinessesCursorResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["advisory-firms"],"summary":"Assign business to firm","description":"Assign a business to an advisory firm.","operationId":"assign_business_to_firm_api_v1_advisory_firms__firm_id__businesses_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessFirmAssociationCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BusinessFirmAssociationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/stripe-customer":{"put":{"tags":["advisory-firms"],"summary":"Link Stripe customer","description":"Link an advisory firm to a Stripe customer for billing.","operationId":"update_stripe_customer_api_v1_advisory_firms__firm_id__stripe_customer_put","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStripeCustomerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UpdateStripeCustomerResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/users":{"get":{"tags":["advisory-firms"],"summary":"List firm users","description":"List all users in an advisory firm.","operationId":"list_firm_users_api_v1_advisory_firms__firm_id__users_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FirmUsersListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["advisory-firms"],"summary":"Add user to firm","description":"Add a user to an advisory firm by user_id or email.","operationId":"add_user_to_firm_api_v1_advisory_firms__firm_id__users_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserFirmAssociationCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UserFirmAssociationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/users/{user_id}":{"delete":{"tags":["advisory-firms"],"summary":"Remove user from firm","description":"Remove a user from an advisory firm.","operationId":"remove_user_from_firm_api_v1_advisory_firms__firm_id__users__user_id__delete","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/users/{user_id}/role":{"put":{"tags":["advisory-firms"],"summary":"Update user role in firm","description":"Update a user's role in an advisory firm.","operationId":"update_user_role_in_firm_api_v1_advisory_firms__firm_id__users__user_id__role_put","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRoleUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UserFirmAssociationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/users/{user_id}/api-access":{"patch":{"tags":["advisory-firms"],"summary":"Set firm user API access","description":"Enable or disable DayZero API access for a firm staff member. API access is enabled by default for everyone; firm owners/admins can restrict it per user.","operationId":"set_firm_user_api_access_api_v1_advisory_firms__firm_id__users__user_id__api_access_patch","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirmUserApiAccessRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FirmUserApiAccessResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/businesses/{business_id}":{"delete":{"tags":["advisory-firms"],"summary":"Unassign business from firm","description":"Unassign a business from an advisory firm.","operationId":"unassign_business_from_firm_api_v1_advisory_firms__firm_id__businesses__business_id__delete","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/businesses/{business_id}/invite-client":{"post":{"tags":["advisory-firms"],"summary":"Invite a client user to a business","description":"Invite a user by email to access a client business. If the user already exists they are added immediately; otherwise an invitation email is sent and they are added on signup.","operationId":"invite_client_to_business_api_v1_advisory_firms__firm_id__businesses__business_id__invite_client_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteClientRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InviteClientResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/users/invite":{"post":{"tags":["advisory-firms"],"summary":"Invite a staff member to the firm","description":"Invite a user by email to join the firm as staff (admin or member). If the user already exists they are added immediately; otherwise an invitation email is sent and they are added on signup. Owner role cannot be assigned via invitation.","operationId":"invite_staff_to_firm_api_v1_advisory_firms__firm_id__users_invite_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteStaffRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InviteStaffResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/invitations":{"get":{"tags":["advisory-firms"],"summary":"List pending invitations","description":"List all invitations for a firm, optionally filtered by type (client, staff, or all) and status.","operationId":"list_firm_invitations_api_v1_advisory_firms__firm_id__invitations_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"type","in":"query","required":false,"schema":{"enum":["client","staff","all"],"type":"string","description":"Filter by invitation type","default":"all","title":"Type"},"description":"Filter by invitation type"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status (e.g. pending)","title":"Status"},"description":"Filter by status (e.g. pending)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvitationListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/invitations/{invitation_id}/resend":{"post":{"tags":["advisory-firms"],"summary":"Resend an invitation","description":"Resend the invitation email and reset the expiry to 7 days from now. Only works on pending invitations.","operationId":"resend_invitation_api_v1_advisory_firms__firm_id__invitations__invitation_id__resend_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ResendInvitationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/invitations/{invitation_id}":{"delete":{"tags":["advisory-firms"],"summary":"Cancel an invitation","description":"Cancel a pending invitation. Cannot undo.","operationId":"cancel_invitation_api_v1_advisory_firms__firm_id__invitations__invitation_id__delete","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/clients":{"get":{"tags":["advisory-firms"],"summary":"List firm clients","description":"List all users with the 'client' role in this firm, with their assigned businesses.","operationId":"list_firm_clients_api_v1_advisory_firms__firm_id__clients_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by client name or email","title":"Search"},"description":"Search by client name or email"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FirmClientsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/clients/{user_id}/businesses":{"post":{"tags":["advisory-firms"],"summary":"Grant client business access","description":"Grant a client user access to a specific business within the firm.","operationId":"grant_client_business_access_api_v1_advisory_firms__firm_id__clients__user_id__businesses_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientBusinessAccessRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ClientBusinessAccessResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["advisory-firms"],"summary":"List client business access","description":"List which businesses a specific client can access.","operationId":"list_client_business_access_api_v1_advisory_firms__firm_id__clients__user_id__businesses_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListClientBusinessAccessResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/clients/{user_id}/businesses/{business_id}":{"delete":{"tags":["advisory-firms"],"summary":"Revoke client business access","description":"Revoke a client's access to a specific business.","operationId":"revoke_client_business_access_api_v1_advisory_firms__firm_id__clients__user_id__businesses__business_id__delete","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/slack/status":{"get":{"tags":["advisory-firms"],"summary":"Get firm Slack status","description":"Check whether a Slack webhook is configured and get notification preferences.","operationId":"get_firm_slack_status_api_v1_advisory_firms__firm_id__slack_status_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SlackIntegrationStatus_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/slack":{"put":{"tags":["advisory-firms"],"summary":"Save firm Slack webhook","description":"Configure a Slack Incoming Webhook URL for the advisory firm.","operationId":"save_firm_slack_webhook_api_v1_advisory_firms__firm_id__slack_put","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackWebhookSaveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SlackIntegrationStatus_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/slack/{webhook_id}/preferences":{"put":{"tags":["advisory-firms"],"summary":"Update firm Slack notification preferences","description":"Toggle which notification categories are sent to the firm's Slack.","operationId":"update_firm_slack_preferences_api_v1_advisory_firms__firm_id__slack__webhook_id__preferences_put","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackPreferencesUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SlackIntegrationStatus_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/slack/{webhook_id}/test":{"post":{"tags":["advisory-firms"],"summary":"Test Slack webhook","description":"Send a test message to the firm's configured Slack webhook.","operationId":"test_firm_slack_webhook_api_v1_advisory_firms__firm_id__slack__webhook_id__test_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SlackTestSendResult_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/slack/test":{"post":{"tags":["advisory-firms"],"summary":"Test Slack webhook","description":"Send a test message to the firm's first configured Slack webhook (legacy).","operationId":"test_firm_slack_webhook_legacy_api_v1_advisory_firms__firm_id__slack_test_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SlackTestSendResult_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/slack/{webhook_id}":{"delete":{"tags":["advisory-firms"],"summary":"Disconnect Slack","description":"Remove the firm's Slack webhook URL and notification preferences.","operationId":"disconnect_firm_slack_api_v1_advisory_firms__firm_id__slack__webhook_id__delete","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SlackDisconnectResult_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/preferences/notifications/topics":{"get":{"tags":["advisory-firms"],"summary":"Get firm notification topic policy","description":"Per-topic channel toggles applied firm-wide to firm staff.","operationId":"get_firm_notification_topic_policy_api_v1_advisory_firms__firm_id__preferences_notifications_topics_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TopicChannelOverridesResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["advisory-firms"],"summary":"Update firm notification topic policy","description":"Replace the firm-wide per-topic channel policy.","operationId":"update_firm_notification_topic_policy_api_v1_advisory_firms__firm_id__preferences_notifications_topics_put","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopicChannelOverridesUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TopicChannelOverridesResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/businesses/{business_id}/preferences/notifications/topics":{"get":{"tags":["advisory-firms"],"summary":"Get a business notification topic policy","description":"Per-topic channel toggles applied to a client business's users.","operationId":"get_business_notification_topic_policy_api_v1_advisory_firms__firm_id__businesses__business_id__preferences_notifications_topics_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TopicChannelOverridesResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["advisory-firms"],"summary":"Update a business notification topic policy","description":"Replace the per-topic channel policy for a client business.","operationId":"update_business_notification_topic_policy_api_v1_advisory_firms__firm_id__businesses__business_id__preferences_notifications_topics_put","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopicChannelOverridesUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TopicChannelOverridesResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/ai-insights":{"post":{"tags":["advisory-firms"],"summary":"AI cross-client insights","description":"Get AI-powered cross-client insights for an advisory firm.","operationId":"get_firm_ai_insights_api_v1_advisory_firms__firm_id__ai_insights_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetFirmAIInsightsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/teams":{"get":{"tags":["advisory-firm-teams"],"summary":"List firm teams","description":"List all teams for a firm with member and business counts.","operationId":"list_teams_api_v1_advisory_firms__firm_id__teams_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TeamListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["advisory-firm-teams"],"summary":"Create team","description":"Create a new team within the firm. Requires owner or admin role.","operationId":"create_team_api_v1_advisory_firms__firm_id__teams_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTeamRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TeamSummaryResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/teams/{team_id}":{"get":{"tags":["advisory-firm-teams"],"summary":"Get team details","description":"Get a team with full member and business lists.","operationId":"get_team_api_v1_advisory_firms__firm_id__teams__team_id__get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TeamDetailResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["advisory-firm-teams"],"summary":"Update team","description":"Update a team's name or description.","operationId":"update_team_api_v1_advisory_firms__firm_id__teams__team_id__patch","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTeamRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TeamSummaryResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["advisory-firm-teams"],"summary":"Delete team","description":"Delete a team and all its member/business associations.","operationId":"delete_team_api_v1_advisory_firms__firm_id__teams__team_id__delete","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/teams/{team_id}/members":{"post":{"tags":["advisory-firm-teams"],"summary":"Add team member","description":"Add a firm staff member to a team.","operationId":"add_team_member_api_v1_advisory_firms__firm_id__teams__team_id__members_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AddTeamMemberResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/teams/{team_id}/members/{user_id}":{"delete":{"tags":["advisory-firm-teams"],"summary":"Remove team member","description":"Remove a member from a team.","operationId":"remove_team_member_api_v1_advisory_firms__firm_id__teams__team_id__members__user_id__delete","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/teams/{team_id}/businesses":{"post":{"tags":["advisory-firm-teams"],"summary":"Add business to team","description":"Assign a firm business to a team.","operationId":"add_team_business_api_v1_advisory_firms__firm_id__teams__team_id__businesses_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamBusinessRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AddTeamBusinessResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/teams/{team_id}/businesses/{business_id}":{"delete":{"tags":["advisory-firm-teams"],"summary":"Remove business from team","description":"Remove a business from a team.","operationId":"remove_team_business_api_v1_advisory_firms__firm_id__teams__team_id__businesses__business_id__delete","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/users/{user_id}/assignments":{"get":{"tags":["advisory-firm-teams"],"summary":"List staff assignments","description":"List all business assignments for a firm member, with engagement metadata.","operationId":"list_assignments_api_v1_advisory_firms__firm_id__users__user_id__assignments_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_StaffAssignmentListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["advisory-firm-teams"],"summary":"Create staff assignment","description":"Assign a member to a business with optional engagement metadata.","operationId":"create_assignment_api_v1_advisory_firms__firm_id__users__user_id__assignments_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStaffAssignmentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_StaffAssignmentResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["advisory-firm-teams"],"summary":"Bulk set assignments","description":"Replace all business assignments for a member with the given set.","operationId":"bulk_set_assignments_api_v1_advisory_firms__firm_id__users__user_id__assignments_put","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkSetAssignmentsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_StaffAssignmentListResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/users/{user_id}/assignments/{assignment_id}":{"patch":{"tags":["advisory-firm-teams"],"summary":"Update assignment","description":"Update engagement metadata on an assignment.","operationId":"update_assignment_api_v1_advisory_firms__firm_id__users__user_id__assignments__assignment_id__patch","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"assignment_id","in":"path","required":true,"schema":{"type":"string","title":"Assignment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStaffAssignmentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_StaffAssignmentResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["advisory-firm-teams"],"summary":"Delete assignment","description":"Remove a business assignment from a member.","operationId":"delete_assignment_api_v1_advisory_firms__firm_id__users__user_id__assignments__assignment_id__delete","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"assignment_id","in":"path","required":true,"schema":{"type":"string","title":"Assignment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/users/{user_id}/accessible-businesses":{"get":{"tags":["advisory-firm-teams"],"summary":"List accessible businesses","description":"Returns the resolved list of businesses a member can see, with source info.","operationId":"list_accessible_businesses_api_v1_advisory_firms__firm_id__users__user_id__accessible_businesses_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AccessibleBusinessListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/reports":{"get":{"tags":["advisory-firm-reports"],"summary":"List available firm reports","description":"Get list of available reports for this advisory firm.","operationId":"list_firm_report_types_api_v1_advisory_firms__firm_id__reports_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListFirmReportTypesResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/reports/portfolio-overview":{"get":{"tags":["advisory-firm-reports"],"summary":"Get portfolio overview","description":"Quick access to the client portfolio overview report.","operationId":"get_portfolio_overview_api_v1_advisory_firms__firm_id__reports_portfolio_overview_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__SuccessEnvelope_GetPortfolioOverviewResponse___2"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/reports/work-queue":{"get":{"tags":["advisory-firm-reports"],"summary":"Get work queue","description":"Get prioritized work queue for the advisory firm.","operationId":"get_work_queue_api_v1_advisory_firms__firm_id__reports_work_queue_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__SuccessEnvelope_GetWorkQueueResponse___2"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/reports/{report_name}":{"get":{"tags":["advisory-firm-reports"],"summary":"Generate firm report","description":"Generate a specific report for an advisory firm.","operationId":"generate_firm_report_api_v1_advisory_firms__firm_id__reports__report_name__get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"report_name","in":"path","required":true,"schema":{"type":"string","title":"Report Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GenerateFirmReportResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/consolidated-reports/pnl":{"get":{"tags":["consolidated-reports"],"summary":"Get consolidated P&L","description":"Uneliminated income statement roll-up across all businesses assigned to the advisory firm.","operationId":"get_consolidated_pnl_api_v1_advisory_firms__firm_id__consolidated_reports_pnl_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","description":"Period start (YYYY-MM-DD)","title":"Start Date"},"description":"Period start (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","description":"Period end (YYYY-MM-DD)","title":"End Date"},"description":"Period end (YYYY-MM-DD)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetConsolidatedPnlResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/consolidated-reports/balance-sheet":{"get":{"tags":["consolidated-reports"],"summary":"Get consolidated balance sheet","description":"Uneliminated balance sheet roll-up across all businesses assigned to the advisory firm.","operationId":"get_consolidated_balance_sheet_api_v1_advisory_firms__firm_id__consolidated_reports_balance_sheet_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"as_of_date","in":"query","required":true,"schema":{"type":"string","description":"Point-in-time date (YYYY-MM-DD)","title":"As Of Date"},"description":"Point-in-time date (YYYY-MM-DD)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetConsolidatedBalanceSheetResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/templates":{"get":{"tags":["advisory-firm-templates"],"summary":"List firm templates","description":"List firm-level COA / Bank Rules / Review Checklist templates. Optionally filter by ``kind``.","operationId":"list_firm_templates_api_v1_advisory_firms__firm_id__templates_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by template kind","title":"Kind"},"description":"Filter by template kind"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FirmTemplateListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["advisory-firm-templates"],"summary":"Create a firm template","operationId":"create_firm_template_api_v1_advisory_firms__firm_id__templates_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirmTemplateCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FirmTemplateResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/advisory-firms/{firm_id}/templates/{template_id}":{"get":{"tags":["advisory-firm-templates"],"summary":"Get a firm template","operationId":"get_firm_template_api_v1_advisory_firms__firm_id__templates__template_id__get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FirmTemplateResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["advisory-firm-templates"],"summary":"Update a firm template","operationId":"update_firm_template_api_v1_advisory_firms__firm_id__templates__template_id__patch","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirmTemplateUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FirmTemplateResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}},"delete":{"tags":["advisory-firm-templates"],"summary":"Delete a firm template","operationId":"delete_firm_template_api_v1_advisory_firms__firm_id__templates__template_id__delete","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FirmTemplateDeleteResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/advisory-firms/{firm_id}/templates/{template_id}/deploy":{"post":{"tags":["advisory-firm-templates"],"summary":"Deploy a firm template to selected client businesses","description":"Bulk-applies the template to each business in ``business_ids``. COA templates use ``LedgerService.apply_coa``; bank-rule templates create new ``BankRule`` rows (duplicates by name are treated as skips so re-deploying is idempotent); review-checklist templates are recorded informationally.","operationId":"deploy_firm_template_api_v1_advisory_firms__firm_id__templates__template_id__deploy_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirmTemplateDeployRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FirmTemplateDeployResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/advisory-firms/{firm_id}/templates/{template_id}/deployments":{"get":{"tags":["advisory-firm-templates"],"summary":"List deployment history for a template","operationId":"list_firm_template_deployments_api_v1_advisory_firms__firm_id__templates__template_id__deployments_get","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FirmTemplateDeploymentListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tokens":{"post":{"tags":["api-tokens"],"summary":"Create token","description":"Create a new API token","operationId":"create_token_api_v1_tokens_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APITokenCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_APITokenCreateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["api-tokens"],"summary":"List tokens","description":"List all API tokens for current user","operationId":"list_tokens_api_v1_tokens_get","parameters":[{"name":"include_revoked","in":"query","required":false,"schema":{"type":"boolean","description":"Include revoked tokens","default":false,"title":"Include Revoked"},"description":"Include revoked tokens"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_APITokenListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tokens/{token_id}/revoke":{"post":{"tags":["api-tokens"],"summary":"Revoke token","description":"Revoke an API token.","operationId":"revoke_token_api_v1_tokens__token_id__revoke_post","parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","title":"Token Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/APITokenRevokeRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_APITokenRevokeResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tokens/{token_id}":{"delete":{"tags":["api-tokens"],"summary":"Delete token","description":"Permanently delete an API token","operationId":"delete_token_api_v1_tokens__token_id__delete","parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","title":"Token Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attention":{"get":{"tags":["attention"],"summary":"List attention items","description":"Get the merged list of inbox messages and live alerts. Items are sorted with action-required first, then by priority, then newest first. Inbox messages support cursor pagination; live alerts are always returned in full on the first page.","operationId":"list_attention_api_v1_attention_get","parameters":[{"name":"action_required","in":"query","required":false,"schema":{"type":"boolean","description":"Only show items requiring user action.","default":false,"title":"Action Required"},"description":"Only show items requiring user action."},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by category.","title":"Category"},"description":"Filter by category."},{"name":"priority","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by priority.","title":"Priority"},"description":"Filter by priority."},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type.","title":"Entity Type"},"description":"Filter by entity type."},{"name":"unread_only","in":"query","required":false,"schema":{"type":"boolean","description":"Hide read inbox messages and dismissed live alerts.","default":false,"title":"Unread Only"},"description":"Hide read inbox messages and dismissed live alerts."},{"name":"include_live","in":"query","required":false,"schema":{"type":"boolean","description":"Include live (computed) alerts alongside inbox rows.","default":true,"title":"Include Live"},"description":"Include live (computed) alerts alongside inbox rows."},{"name":"client_view","in":"query","required":false,"schema":{"type":"boolean","description":"If true, action URLs use the ``/client`` shell prefix instead of ``/books``.","default":false,"title":"Client View"},"description":"If true, action URLs use the ``/client`` shell prefix instead of ``/books``."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inbox pagination cursor.","title":"Cursor"},"description":"Inbox pagination cursor."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max inbox items per page.","default":20,"title":"Limit"},"description":"Max inbox items per page."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AttentionListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attention/summary":{"get":{"tags":["attention"],"summary":"Attention summary counts","description":"Counts used by the bell badge and the Action Items card. Combines unread inbox messages with live alert counts.","operationId":"get_attention_summary_api_v1_attention_summary_get","parameters":[{"name":"client_view","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Client View"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AttentionSummary_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attention/{item_id}":{"get":{"tags":["attention"],"summary":"Get single attention item","description":"Fetch a single attention item (inbox or live) by its prefixed ID. Optionally marks it read/dismissed.","operationId":"get_attention_item_api_v1_attention__item_id__get","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"auto_mark_read","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Auto Mark Read"}},{"name":"client_view","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Client View"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AttentionItem_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attention/{item_id}/read":{"post":{"tags":["attention"],"summary":"Mark item read or dismiss","description":"Mark an attention item read. Inbox items get ``read_at`` set; live alerts are dismissed for this user (until they clear dismissals).","operationId":"mark_item_read_api_v1_attention__item_id__read_post","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_MarkAttentionItemReadResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attention/mark-all-read":{"post":{"tags":["attention"],"summary":"Mark all read + clear dismissals","description":"Mark every inbox message read and clear all live alert dismissals so the bell shows zero.","operationId":"mark_all_read_api_v1_attention_mark_all_read_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_MarkAllAttentionReadResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attention/clear-dismissals":{"post":{"tags":["attention"],"summary":"Restore dismissed live alerts","description":"Clears the user's per-user live alert dismissals.","operationId":"clear_dismissals_api_v1_attention_clear_dismissals_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ClearAttentionDismissalsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/catalog":{"get":{"tags":["billing"],"summary":"Get Billing Catalog","description":"Return the Stripe price catalog (slug → price details).\n\nUsed by the frontend to get price IDs for checkout without hardcoding.\nAnnual variants are stored as ``<slug>_annual`` entries.","operationId":"get_billing_catalog_api_v1_billing_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetBillingCatalogResponse_"}}}}}}},"/api/v1/billing/pricing-config":{"get":{"tags":["billing"],"summary":"Get Pricing Config","description":"Return billing pricing configuration derived from the single discount knob.\n\nThe frontend uses this to render annual savings and badge labels without\nduplicating the discount percentage. Changing the discount on the backend\n(``ANNUAL_DISCOUNT_PCT``) automatically updates every UI surface.","operationId":"get_pricing_config_api_v1_billing_pricing_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetPricingConfigResponse_"}}}}}}},"/api/v1/billing/status":{"get":{"tags":["billing"],"summary":"Get Billing Status","description":"Return the current billing state for the authenticated business.","operationId":"get_billing_status_api_v1_billing_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetBillingStatusResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/ai-usage":{"get":{"tags":["billing"],"summary":"Get Ai Usage","description":"Return current daily and monthly AI request counts with plan limits.","operationId":"get_ai_usage_api_v1_billing_ai_usage_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetAiUsageResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/ai/pause":{"post":{"tags":["billing"],"summary":"Pause Ai Features","description":"Pause all AI features for the authenticated business.\n\nSets ``businesses.ai_paused_at`` so:\n- ``check_ai_quota`` returns ``allowed=False, paused=True`` for any\n  subsequent AI call (chat, panels, OCR, etc.).\n- ``track_business_usage`` short-circuits, stopping the Stripe\n  overage fire-and-forget.\n- ``AITransactionCleaner`` downshifts to rule-only cleaning during\n  Plaid sync (no LLM calls).\n\nIdempotent. Returns the refreshed AI usage payload so the widget /\nbanner can transition to the paused state without a second\nround-trip.","operationId":"pause_ai_features_api_v1_billing_ai_pause_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PauseAiFeaturesResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/ai/resume":{"post":{"tags":["billing"],"summary":"Resume Ai Features","description":"Resume AI features for the authenticated business.\n\nClears ``ai_paused_at`` and ``ai_paused_by_user_id``. Idempotent —\nresuming an already-active business is a no-op. Returns the\nrefreshed AI usage payload so the widget transitions back to the\nCalm / Warning / Overage state without a second round-trip.","operationId":"resume_ai_features_api_v1_billing_ai_resume_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ResumeAiFeaturesResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/checkout":{"post":{"tags":["billing"],"summary":"Create Checkout Session","description":"Create a Stripe Checkout session so the user can subscribe.","operationId":"create_checkout_session_api_v1_billing_checkout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreateCheckoutSessionResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/portal":{"post":{"tags":["billing"],"summary":"Create Portal Session","description":"Create a Stripe Billing Portal session for subscription management.","operationId":"create_portal_session_api_v1_billing_portal_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreatePortalSessionResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/addon/preview":{"post":{"tags":["billing"],"summary":"Preview Addon Change","description":"Preview the billing impact of adding or removing an add-on.\n\n**Request Body:**\n- `addon_slug`: Add-on module slug from AddOnModule enum\n- `action`: 'add' or 'remove'","operationId":"preview_addon_change_api_v1_billing_addon_preview_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonPreviewRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PreviewAddonChangeResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/addon":{"post":{"tags":["billing"],"summary":"Toggle Addon","description":"Add or remove an add-on from the business's Stripe subscription.\n\n**Request Body:**\n- `addon_slug`: Add-on module slug from AddOnModule enum\n- `action`: 'add' (charges prorated amount immediately) or 'remove' (effective at period end, no refund)\n\n**Effect:**\n- Adding: Stripe subscription is updated, prorated amount is charged immediately\n- Removing: Item removed with no proration, takes effect at period end","operationId":"toggle_addon_api_v1_billing_addon_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonToggleRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ToggleAddonResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/grandfathered-summary":{"get":{"tags":["billing"],"summary":"Get Grandfathered Summary","description":"Return a summary of the grandfathered business's current access and available plans.","operationId":"get_grandfathered_summary_api_v1_billing_grandfathered_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetGrandfatheredSummaryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/migrate-from-grandfathered":{"post":{"tags":["billing"],"summary":"Migrate grandfathered account to a paid plan","description":"Create a Stripe Checkout session to move from a grandfathered plan to a paid plan.\n\n**Request Body:**\n- `target_plan`: Plan tier to migrate to (`self_directed` or `managed`)\n- `success_url`: Redirect URL after successful payment\n- `cancel_url`: Redirect URL if checkout is canceled\n\n**Prerequisites:**\n- Business must currently be on the `grandfathered` plan tier\n\n**Effect:**\n- Creates a Stripe Checkout session\n- On payment completion, `plan_tier` is updated to the target plan","operationId":"migrate_from_grandfathered_api_v1_billing_migrate_from_grandfathered_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrandfatheredMigrateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_MigrateFromGrandfatheredResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/change-plan":{"post":{"tags":["billing"],"summary":"Change Plan","description":"Switch the base subscription plan to a different price.\n\n**Request Body:**\n- `price_id`: Stripe Price ID for the new plan\n\n**Effect:** The base plan line item is swapped and the proration is invoiced immediately.","operationId":"change_plan_api_v1_billing_change_plan_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanChangeRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ChangePlanResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/firm/client-usage":{"get":{"tags":["billing"],"summary":"Get Firm Client Usage","description":"Return the firm's active client count, tier cap, and remaining seats.\n\nFor non-advisory businesses (self-directed/managed) this returns\n``is_advisory_firm: false`` with no limit so callers can hide the\nclient/upgrade UI.","operationId":"get_firm_client_usage_api_v1_billing_firm_client_usage_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetFirmClientUsageResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/firm/change-tier":{"post":{"tags":["billing"],"summary":"Change Firm Tier","description":"Upgrade or downgrade the firm's plan tier, in-app.\n\nSwaps the per-client price, adds/removes the platform fee, and re-applies\nthe current client quantity in one prorated Stripe update. Requires the\ncaller to be an owner/admin of the firm. Blocks a downgrade that would drop\nthe firm below its current client count.","operationId":"change_firm_tier_api_v1_billing_firm_change_tier_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirmTierChangeRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ChangeFirmTierResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/invoices":{"get":{"tags":["billing"],"summary":"Get Invoice History","description":"Return the business's Stripe subscription invoice history.\n\nEach invoice includes a hosted URL for viewing and a PDF download link.","operationId":"get_invoice_history_api_v1_billing_invoices_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max invoices to return","default":24,"title":"Limit"},"description":"Max invoices to return"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetInvoiceHistoryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/ai-usage/details":{"get":{"tags":["billing"],"summary":"Get Ai Usage Details","description":"Return detailed AI usage stats: top users, model breakdown, daily trend.","operationId":"get_ai_usage_details_api_v1_billing_ai_usage_details_get","parameters":[{"name":"scope","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Set to 'firm' to aggregate across all firm businesses.","title":"Scope"},"description":"Set to 'firm' to aggregate across all firm businesses."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetAiUsageDetailsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-messages/firm/conversations":{"get":{"tags":["client-messages"],"summary":"List client conversations (firm)","description":"List all client conversations across the firm's businesses.","operationId":"list_firm_conversations_api_v1_client_messages_firm_conversations_get","parameters":[{"name":"firm_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Advisory firm ID (defaults to user's first firm)","title":"Firm Id"},"description":"Advisory firm ID (defaults to user's first firm)"},{"name":"business_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by business","title":"Business Id"},"description":"Filter by business"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by category","title":"Category"},"description":"Filter by category"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Total Count"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ConversationListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-messages/firm/conversations/{conversation_id}":{"get":{"tags":["client-messages"],"summary":"Get conversation detail (firm)","description":"Get a conversation with all messages as an advisor.","operationId":"get_firm_conversation_api_v1_client_messages_firm_conversations__conversation_id__get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"firm_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Advisory firm ID","title":"Firm Id"},"description":"Advisory firm ID"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ConversationDetailResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-messages/firm/conversations/{conversation_id}/messages":{"post":{"tags":["client-messages"],"summary":"Reply to a conversation (advisor)","description":"Add a message to a client conversation as an advisor.","operationId":"advisor_reply_api_v1_client_messages_firm_conversations__conversation_id__messages_post","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"firm_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Advisory firm ID","title":"Firm Id"},"description":"Advisory firm ID"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMessageRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ConversationDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-messages/firm/conversations/{conversation_id}/status":{"put":{"tags":["client-messages"],"summary":"Update conversation status","description":"Change a conversation's status (resolve, reopen, etc.).","operationId":"update_status_api_v1_client_messages_firm_conversations__conversation_id__status_put","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"firm_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Advisory firm ID","title":"Firm Id"},"description":"Advisory firm ID"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConversationStatusRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ConversationDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-messages/firm/unread-count":{"get":{"tags":["client-messages"],"summary":"Unread conversation count (firm)","description":"Get unread count for the advisor sidebar badge.","operationId":"firm_unread_count_api_v1_client_messages_firm_unread_count_get","parameters":[{"name":"firm_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Advisory firm ID","title":"Firm Id"},"description":"Advisory firm ID"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UnreadCountResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-messages/conversations":{"get":{"tags":["client-messages"],"summary":"List client conversations","description":"List conversations for the current business.","operationId":"list_client_conversations_api_v1_client_messages_conversations_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by category","title":"Category"},"description":"Filter by category"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Total Count"}},{"name":"x-business-id","in":"header","required":true,"schema":{"type":"string","title":"X-Business-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ConversationListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["client-messages"],"summary":"Create a conversation","description":"Start a new conversation with the advisory firm.","operationId":"create_conversation_api_v1_client_messages_conversations_post","parameters":[{"name":"x-business-id","in":"header","required":true,"schema":{"type":"string","title":"X-Business-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConversationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ConversationDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-messages/conversations/{conversation_id}":{"get":{"tags":["client-messages"],"summary":"Get conversation detail","description":"Get a conversation with all messages. Marks messages as read.","operationId":"get_client_conversation_api_v1_client_messages_conversations__conversation_id__get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"x-business-id","in":"header","required":true,"schema":{"type":"string","title":"X-Business-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ConversationDetailResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-messages/conversations/{conversation_id}/messages":{"post":{"tags":["client-messages"],"summary":"Reply to a conversation (client)","description":"Add a message to an existing conversation as a client.","operationId":"client_reply_api_v1_client_messages_conversations__conversation_id__messages_post","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"x-business-id","in":"header","required":true,"schema":{"type":"string","title":"X-Business-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMessageRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ConversationDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-messages/unread-count":{"get":{"tags":["client-messages"],"summary":"Unread conversation count","description":"Get the number of conversations with unread messages for sidebar badge.","operationId":"unread_count_api_v1_client_messages_unread_count_get","parameters":[{"name":"x-business-id","in":"header","required":true,"schema":{"type":"string","title":"X-Business-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UnreadCountResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/counterparty-defaults":{"get":{"tags":["counterparty-defaults"],"summary":"List counterparty defaults","description":"List all counterparty defaults configured for the current business.","operationId":"list_counterparty_defaults_api_v1_counterparty_defaults_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CounterpartyDefaultListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["counterparty-defaults"],"summary":"Create a counterparty default","description":"Create a new counterparty default.\n\nProvide either ``registry_id`` (preferred — survives renames) or a\nraw ``counterparty_name`` string. ``default_ledger_id`` must be a\nnon-bank ledger.","operationId":"create_counterparty_default_api_v1_counterparty_defaults_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterpartyDefaultCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CounterpartyDefaultResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/counterparty-defaults/{default_id}":{"patch":{"tags":["counterparty-defaults"],"summary":"Update a counterparty default","description":"Update fields on an existing counterparty default.","operationId":"update_counterparty_default_api_v1_counterparty_defaults__default_id__patch","parameters":[{"name":"default_id","in":"path","required":true,"schema":{"type":"string","title":"Default Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterpartyDefaultUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CounterpartyDefaultResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["counterparty-defaults"],"summary":"Delete a counterparty default","description":"Delete a counterparty default.","operationId":"delete_counterparty_default_api_v1_counterparty_defaults__default_id__delete","parameters":[{"name":"default_id","in":"path","required":true,"schema":{"type":"string","title":"Default Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/budgets":{"get":{"tags":["budgets"],"summary":"List budgets","description":"List all budgets for the business with optional filtering.","operationId":"list_budgets_api_v1_budgets_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: draft, active, closed","title":"Status"},"description":"Filter by status: draft, active, closed"},{"name":"fiscal_year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by fiscal year","title":"Fiscal Year"},"description":"Filter by fiscal year"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by budget name","title":"Search"},"description":"Search by budget name"},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Number of records to skip","title":"Offset"},"description":"Number of records to skip"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":100,"minimum":1},{"type":"null"}],"description":"Maximum records to return","default":50,"title":"Limit"},"description":"Maximum records to return"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Include total count (expensive - avoid if possible)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BudgetListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["budgets"],"summary":"Create budget","description":"Create a new budget for the business.","operationId":"create_budget_api_v1_budgets_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BudgetResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/budgets/{budget_id}":{"get":{"tags":["budgets"],"summary":"Get budget","description":"Get a budget with all its line items.","operationId":"get_budget_api_v1_budgets__budget_id__get","parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"string","title":"Budget Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BudgetDetailResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["budgets"],"summary":"Update budget","description":"Update a draft budget's metadata.","operationId":"update_budget_api_v1_budgets__budget_id__patch","parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"string","title":"Budget Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BudgetResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["budgets"],"summary":"Delete budget","description":"Delete a draft budget.","operationId":"delete_budget_api_v1_budgets__budget_id__delete","parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"string","title":"Budget Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/budgets/{budget_id}/activate":{"post":{"tags":["budgets"],"summary":"Activate budget","description":"Set a budget as the active budget (deactivates current active).","operationId":"activate_budget_api_v1_budgets__budget_id__activate_post","parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"string","title":"Budget Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BudgetResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/budgets/{budget_id}/copy":{"post":{"tags":["budgets"],"summary":"Copy budget","description":"Create a copy of a budget with optional percentage adjustment.","operationId":"copy_budget_api_v1_budgets__budget_id__copy_post","parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"string","title":"Budget Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetCopyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BudgetDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/budgets/{budget_id}/lines":{"get":{"tags":["budgets"],"summary":"List budget lines","description":"Get all line items for a budget.","operationId":"list_budget_lines_api_v1_budgets__budget_id__lines_get","parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"string","title":"Budget Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BudgetLineListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["budgets"],"summary":"Add budget line","description":"Add a budget line item for a ledger account.","operationId":"add_budget_line_api_v1_budgets__budget_id__lines_post","parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"string","title":"Budget Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetLineCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BudgetLineResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/budgets/{budget_id}/lines/{line_id}":{"patch":{"tags":["budgets"],"summary":"Update budget line","description":"Update amounts on a budget line.","operationId":"update_budget_line_api_v1_budgets__budget_id__lines__line_id__patch","parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"string","title":"Budget Id"}},{"name":"line_id","in":"path","required":true,"schema":{"type":"string","title":"Line Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetLineUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BudgetLineResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["budgets"],"summary":"Delete budget line","description":"Remove a budget line.","operationId":"delete_budget_line_api_v1_budgets__budget_id__lines__line_id__delete","parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"string","title":"Budget Id"}},{"name":"line_id","in":"path","required":true,"schema":{"type":"string","title":"Line Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/budgets/{budget_id}/vs-actual":{"get":{"tags":["budgets"],"summary":"Budget vs Actual","description":"Compare budgeted amounts to actual performance.","operationId":"get_budget_vs_actual_api_v1_budgets__budget_id__vs_actual_get","parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"string","title":"Budget Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Comparison period start date","title":"Start Date"},"description":"Comparison period start date"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Comparison period end date","title":"End Date"},"description":"Comparison period end date"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BudgetVsActualResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/budgets/forecast":{"post":{"tags":["budgets"],"summary":"Generate forecast","description":"Generate a financial forecast based on historical data.","operationId":"generate_forecast_api_v1_budgets_forecast_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateForecastRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ForecastResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/budgets/forecast/configs":{"get":{"tags":["budgets"],"summary":"List forecast configs","description":"List saved forecast configurations.","operationId":"list_forecast_configs_api_v1_budgets_forecast_configs_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_list_ForecastConfigResponse__"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["budgets"],"summary":"Create forecast config","description":"Save a forecast configuration for reuse.","operationId":"create_forecast_config_api_v1_budgets_forecast_configs_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastConfigCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ForecastConfigResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cfo-projection/actuals":{"get":{"tags":["cfo-projection"],"summary":"Get trailing actuals","description":"Trailing income statement actuals shaped for the projection page. Pass `start_month`/`end_month` (YYYY-MM) to pin an explicit window; otherwise the last `trailing_months` closed months are returned.","operationId":"get_actuals_api_v1_cfo_projection_actuals_get","parameters":[{"name":"trailing_months","in":"query","required":false,"schema":{"type":"integer","maximum":24,"minimum":1,"description":"Number of trailing months (used when start/end unset)","default":6,"title":"Trailing Months"},"description":"Number of trailing months (used when start/end unset)"},{"name":"start_month","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},{"type":"null"}],"description":"Inclusive window start in YYYY-MM. Required together with end_month.","title":"Start Month"},"description":"Inclusive window start in YYYY-MM. Required together with end_month."},{"name":"end_month","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},{"type":"null"}],"description":"Inclusive window end in YYYY-MM. Required together with start_month.","title":"End Month"},"description":"Inclusive window end in YYYY-MM. Required together with start_month."},{"name":"hide_zero_rows","in":"query","required":false,"schema":{"type":"boolean","description":"Exclude line items with all-zero values","default":false,"title":"Hide Zero Rows"},"description":"Exclude line items with all-zero values"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ProjectionActualsResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cfo-projection/scenarios":{"get":{"tags":["cfo-projection"],"summary":"List scenarios","description":"List all projection scenarios for the business.","operationId":"list_scenarios_api_v1_cfo_projection_scenarios_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListScenariosResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["cfo-projection"],"summary":"Create scenario","description":"Create a new projection scenario. Drivers are auto-seeded from trailing actuals when omitted.","operationId":"create_scenario_api_v1_cfo_projection_scenarios_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ScenarioResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cfo-projection/scenarios/active":{"get":{"tags":["cfo-projection"],"summary":"Get active scenario","description":"Get the currently active projection scenario, or null.","operationId":"get_active_scenario_api_v1_cfo_projection_scenarios_active_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ScenarioResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cfo-projection/scenarios/{scenario_id}":{"get":{"tags":["cfo-projection"],"summary":"Get scenario","description":"Get a projection scenario by ID.","operationId":"get_scenario_api_v1_cfo_projection_scenarios__scenario_id__get","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ScenarioResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["cfo-projection"],"summary":"Update scenario","description":"Partial update of scenario drivers.","operationId":"update_scenario_api_v1_cfo_projection_scenarios__scenario_id__patch","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ScenarioResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["cfo-projection"],"summary":"Delete scenario","description":"Soft delete a projection scenario.","operationId":"delete_scenario_api_v1_cfo_projection_scenarios__scenario_id__delete","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SuccessResponseModel_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cfo-projection/scenarios/from-budget/{budget_id}":{"post":{"tags":["cfo-projection"],"summary":"Create scenario from budget","description":"Derive a new projection scenario from an existing budget's line items.","operationId":"create_scenario_from_budget_api_v1_cfo_projection_scenarios_from_budget__budget_id__post","parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"string","title":"Budget Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ScenarioResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cfo-projection/scenarios/{scenario_id}/suggest-tax-rate":{"post":{"tags":["cfo-projection"],"summary":"Suggest tax rates","description":"Use AI to suggest effective income tax rates for a projection scenario.","operationId":"suggest_tax_rate_api_v1_cfo_projection_scenarios__scenario_id__suggest_tax_rate_post","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SuggestTaxRateResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cfo-projection/scenarios/{scenario_id}/projection":{"get":{"tags":["cfo-projection"],"summary":"Compute projection","description":"Compute a full N-month projected income statement from scenario drivers.","operationId":"compute_projection_api_v1_cfo_projection_scenarios__scenario_id__projection_get","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ProjectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notes":{"get":{"tags":["notes"],"summary":"List notes for a business","description":"Retrieve all notes for the current business, ordered by pinned then most recently updated.","operationId":"list_notes_api_v1_notes_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NoteListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["notes"],"summary":"Create a note","description":"Create a new note for the current business.","operationId":"create_note_api_v1_notes_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NoteResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notes/bulk":{"post":{"tags":["notes"],"summary":"Bulk-create notes (localStorage migration)","description":"Create multiple notes at once, used to migrate existing localStorage notes to the database.","operationId":"create_notes_bulk_api_v1_notes_bulk_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteBulkCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreateNotesBulkResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notes/reminders/{reminder_id}":{"delete":{"tags":["notes"],"summary":"Cancel a reminder","description":"Deactivate a scheduled reminder.","operationId":"delete_reminder_api_v1_notes_reminders__reminder_id__delete","parameters":[{"name":"reminder_id","in":"path","required":true,"schema":{"type":"string","title":"Reminder Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notes/{note_id}":{"get":{"tags":["notes"],"summary":"Get a single note","description":"Retrieve a single note by ID.","operationId":"get_note_api_v1_notes__note_id__get","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NoteResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["notes"],"summary":"Update a note","description":"Partially update a note's title, body, or pinned status.","operationId":"update_note_api_v1_notes__note_id__patch","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NoteResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["notes"],"summary":"Delete a note","description":"Soft-delete a note.","operationId":"delete_note_api_v1_notes__note_id__delete","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notes/{note_id}/notify":{"post":{"tags":["notes"],"summary":"Notify business users about a note","description":"Send an inbox notification about this note to all users of the business. The note must have a non-empty body.","operationId":"notify_business_api_v1_notes__note_id__notify_post","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NotifyBusinessResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notes/{note_id}/reminders":{"post":{"tags":["notes"],"summary":"Schedule a reminder for a note","description":"Set a one-time or recurring notification reminder for a note. Pick a date/time and optionally set recurrence (daily, weekly, monthly).","operationId":"create_reminder_api_v1_notes__note_id__reminders_post","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ReminderResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["notes"],"summary":"List reminders for a note","description":"Get all active reminders for a specific note.","operationId":"list_reminders_api_v1_notes__note_id__reminders_get","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ReminderListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notes/{note_id}/rewrite":{"post":{"tags":["notes"],"summary":"AI rewrite of note body","description":"Use AI to rewrite the note body. Returns a preview; the caller must PATCH to apply.","operationId":"rewrite_note_api_v1_notes__note_id__rewrite_post","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NoteRewriteResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notes/{note_id}/attachments/upload-url":{"post":{"tags":["notes"],"summary":"Get upload URL for note attachment","description":"Generate a presigned URL to upload a file to S3 for a note.","operationId":"get_attachment_upload_url_api_v1_notes__note_id__attachments_upload_url_post","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteAttachmentUploadUrlRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetAttachmentUploadUrlResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notes/{note_id}/attachments":{"post":{"tags":["notes"],"summary":"Register note attachment","description":"Register a new attachment for a note after successful S3 upload.","operationId":"create_attachment_api_v1_notes__note_id__attachments_post","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteAttachmentCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AttachmentResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notes/{note_id}/attachments/{attachment_id}/download-url":{"get":{"tags":["notes"],"summary":"Get download URL for note attachment","description":"Generate a presigned URL to download a note attachment.","operationId":"get_attachment_download_url_api_v1_notes__note_id__attachments__attachment_id__download_url_get","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}},{"name":"attachment_id","in":"path","required":true,"schema":{"type":"string","title":"Attachment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetAttachmentDownloadUrlResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notes/{note_id}/attachments/{attachment_id}":{"delete":{"tags":["notes"],"summary":"Delete note attachment","description":"Soft-delete a note attachment.","operationId":"delete_attachment_api_v1_notes__note_id__attachments__attachment_id__delete","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}},{"name":"attachment_id","in":"path","required":true,"schema":{"type":"string","title":"Attachment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/categorization-profile":{"get":{"tags":["categorization-profile"],"summary":"Get the current business's categorization profile","description":"Returns the categorization profile (accounting basis, key personnel, convention overrides, etc.) used by the engine and AI prompt for this business.  Returns ``{}`` if no profile has been configured.","operationId":"get_profile_api_v1_categorization_profile_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetProfileResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["categorization-profile"],"summary":"Upsert the current business's categorization profile","description":"Partial-update or create the categorization profile.  Accepted keys: accounting_basis, industry, key_personnel, convention_overrides, tax_remittance_ledger_id, notes.","operationId":"upsert_profile_api_v1_categorization_profile_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UpsertProfileResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/oauth2/token":{"post":{"tags":["oauth"],"summary":"Get Token","description":"Issue OAuth access + refresh tokens for a user.\n\nReturns standard ``access_token`` / ``refresh_token`` as Bearer\ncredentials for all subsequent API calls.","operationId":"get_token_api_v1_oauth2_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_get_token_api_v1_oauth2_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/oauth2/exchange":{"post":{"tags":["oauth"],"summary":"Exchange Code","description":"Exchange a single-use code or refresh token for access + refresh tokens.\n\nCalled from the SPA — no client credentials required.\nThe code was already authenticated when created via POST /oauth2/token.\n\n**Code exchange:** Provide ``code`` from the /token response.\n**Token refresh:** Provide ``refresh_token`` from a previous exchange.","operationId":"exchange_code_api_v1_oauth2_exchange_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_exchange_code_api_v1_oauth2_exchange_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/oauth2/refresh":{"post":{"tags":["oauth"],"summary":"Refresh Token","description":"Exchange refresh token for new access token.","operationId":"refresh_token_api_v1_oauth2_refresh_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_refresh_token_api_v1_oauth2_refresh_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/prepare-checkout":{"post":{"tags":["onboarding"],"summary":"Create Stripe Checkout session for onboarding","description":"Collects plan and add-on selections, creates a Stripe Checkout session with a 30-day trial. Business is NOT created until /complete is called.","operationId":"prepare_checkout_api_v1_onboarding_prepare_checkout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrepareCheckoutRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PrepareCheckoutResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"example":{"detail":"Rate limit exceeded"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/complete":{"post":{"tags":["onboarding"],"summary":"Complete onboarding after Stripe Checkout","description":"Called after the user completes Stripe Checkout. Retrieves the session, creates the business, firm, and HubSpot records.","operationId":"complete_onboarding_api_v1_onboarding_complete_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteOnboardingRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OnboardingResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"example":{"detail":"Rate limit exceeded"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/ai-discover":{"post":{"tags":["onboarding"],"summary":"Get next AI discovery question","description":"Given the account type and conversation so far, returns the next personalised question for the onboarding discovery flow.","operationId":"ai_discover_api_v1_onboarding_ai_discover_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIDiscoverRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AIDiscoverResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"example":{"detail":"Rate limit exceeded"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"example":{"detail":"Internal server error"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/profile":{"get":{"tags":["onboarding"],"summary":"Resume in-progress onboarding","description":"Returns the persisted onboarding profile (conversation, learned profile fields, recommendations, account_type) for the current user. Used by the Welcome wizard to restore wizard state after a refresh.","operationId":"get_onboarding_profile_api_v1_onboarding_profile_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OnboardingProfileResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/ai-recommend":{"post":{"tags":["onboarding"],"summary":"Generate personalised add-on recommendations","description":"Analyses the full discovery conversation, extracts a structured business profile, and returns personalised add-on recommendations.","operationId":"ai_recommend_api_v1_onboarding_ai_recommend_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIRecommendRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AIRecommendResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"example":{"detail":"Rate limit exceeded"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"example":{"detail":"Internal server error"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/upload-url":{"post":{"tags":["onboarding"],"summary":"Get pre-signed upload URL for onboarding assets","description":"Returns a pre-signed S3 PUT URL for uploading a firm logo during onboarding (no business context required).","operationId":"get_onboarding_upload_url_api_v1_onboarding_upload_url_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingUploadUrlRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OnboardingUploadUrlResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"example":{"detail":"Rate limit exceeded"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills":{"get":{"tags":["bills"],"summary":"List bills","description":"Retrieve all bills for a business with cursor-based pagination. Can filter by vendor name (fuzzy search) or associated journal entry.","operationId":"list_bills_api_v1_bills_get","parameters":[{"name":"vendor_search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fuzzy search bills by vendor name (uses PostgreSQL trigram matching)","title":"Vendor Search"},"description":"Fuzzy search bills by vendor name (uses PostgreSQL trigram matching)"},{"name":"journal_entry_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter bills by associated journal entry UUID","title":"Journal Entry Id"},"description":"Filter bills by associated journal entry UUID"},{"name":"payment_method","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter bills by payment method: 'Wire Transfer', 'ACH', 'Check', 'Credit Card'","title":"Payment Method"},"description":"Filter bills by payment method: 'Wire Transfer', 'ACH', 'Check', 'Credit Card'"},{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter bills by vendor UUID","title":"Vendor Id"},"description":"Filter bills by vendor UUID"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by bill status (e.g. draft, approved, received, paid, canceled)","title":"Status"},"description":"Filter by bill status (e.g. draft, approved, received, paid, canceled)"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search bills by bill number, description, or vendor name (case-insensitive partial match)","title":"Search"},"description":"Search bills by bill number, description, or vendor name (case-insensitive partial match)"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["bills"],"summary":"Create bill","description":"Create a new bill in draft status. Optionally include 'recurring' config to also create a recurring template.","operationId":"create_bill_api_v1_bills_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/ai-create":{"post":{"tags":["bills"],"summary":"AI-extract draft bills from documents","description":"Upload pasted text, PDFs, images, Excel files, or a CSV to extract draft bill entities using AI. Returns draft bills in 'received' status format ready for user review before creation.","operationId":"ai_create_bill_payload_api_v1_bills_ai_create_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillAICreatePayloadRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillAICreatePayloadResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/received":{"post":{"tags":["bills"],"summary":"Create bill in received status","description":"Create a new bill directly in 'received' status, ready for payment. Creates both the bill AND journal entry when ledger_id is provided.","operationId":"create_bill_received_api_v1_bills_received_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillReceivedCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/bulk":{"post":{"tags":["bills"],"summary":"Bulk create bills","description":"Create multiple bills from CSV data in a single request.","operationId":"create_bulk_bills_api_v1_bills_bulk_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillBulkRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillsListResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/metrics":{"get":{"tags":["bills"],"summary":"Get bill metrics","description":"Retrieve aggregated bill metrics for the business: total due and total balance due across all received and partially paid bills.","operationId":"get_bill_metrics_api_v1_bills_metrics_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillMetricsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/aging":{"get":{"tags":["bills"],"summary":"AP aging summary","description":"Returns accounts payable aging data grouped by vendor with Current, 1-30, 31-60, 61-90, and 91+ day buckets. Includes per-bill detail for drill-down.","operationId":"get_bill_aging_api_v1_bills_aging_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillAgingResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/expense-candidates":{"get":{"tags":["bills"],"summary":"List expense candidates","description":"Return outgoing transactions that may represent bill payments. Filters to posted expense transactions with unallocated balances, useful for the Record Payment modal on the bills page.","operationId":"list_expense_candidates_api_v1_bills_expense_candidates_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max results","default":200,"title":"Limit"},"description":"Max results"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListExpenseCandidatesResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/payment-suggestions":{"get":{"tags":["bills"],"summary":"List bill payment suggestions","description":"List auto-detected matches between bank transactions and open bills.","operationId":"list_bill_payment_suggestions_api_v1_bills_payment_suggestions_get","parameters":[{"name":"bill_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by bill UUID","title":"Bill Id"},"description":"Filter by bill UUID"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","default":"pending","title":"Status"},"description":"Filter by status"},{"name":"min_confidence","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Minimum confidence threshold","title":"Min Confidence"},"description":"Minimum confidence threshold"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Only include suggestions whose transaction date is on or after this date (YYYY-MM-DD)","title":"Start Date"},"description":"Only include suggestions whose transaction date is on or after this date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Only include suggestions whose transaction date is on or before this date (YYYY-MM-DD)","title":"End Date"},"description":"Only include suggestions whose transaction date is on or before this date (YYYY-MM-DD)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max results","default":100,"title":"Limit"},"description":"Max results"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillPaymentSuggestionsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/payments/batch":{"post":{"tags":["bills"],"summary":"Split one transaction across multiple bills","description":"Apply a single bank transaction to multiple bills in one atomic request. Validates the total allocation against the transaction's remaining unallocated balance before creating any payments.","operationId":"create_bill_payments_batch_api_v1_bills_payments_batch_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillBatchPaymentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillBatchPaymentResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/{bill_id}":{"get":{"tags":["bills"],"summary":"Get bill","description":"Retrieve a specific bill by ID.","operationId":"get_bill_api_v1_bills__bill_id__get","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["bills"],"summary":"Update bill","description":"Update an existing bill. Optionally include 'recurring' config to create a recurring template.","operationId":"update_bill_api_v1_bills__bill_id__put","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["bills"],"summary":"Delete bill","description":"Delete a bill and its associated records.","operationId":"delete_bill_api_v1_bills__bill_id__delete","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","description":"Force delete even if bill has associated records","default":false,"title":"Force"},"description":"Force delete even if bill has associated records"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/{bill_id}/approval":{"patch":{"tags":["bills"],"summary":"Approve bill","description":"Approve a bill and change status to 'forecasted'","operationId":"approve_bill_api_v1_bills__bill_id__approval_patch","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/{bill_id}/contract-comparison":{"post":{"tags":["bills"],"summary":"Compare bill against vendor contract","description":"Compare a bill's amount against the vendor's active contract/MSA.","operationId":"compare_bill_against_contract_api_v1_bills__bill_id__contract_comparison_post","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CompareBillAgainstContractResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/{bill_id}/receipt":{"patch":{"tags":["bills"],"summary":"Mark bill as received","description":"Mark a bill as received and create journal entry","operationId":"mark_bill_received_api_v1_bills__bill_id__receipt_patch","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillReceivedRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/{bill_id}/journal-entry":{"post":{"tags":["bills"],"summary":"Generate bill journal entry","description":"Create the outstanding AP journal entry for a received bill that has none linked.","operationId":"generate_bill_journal_entry_api_v1_bills__bill_id__journal_entry_post","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillJournalEntryGenerateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/{bill_id}/journal-entry/link":{"post":{"tags":["bills"],"summary":"Attach journal entry to bill","description":"Link an existing journal entry to a bill.","operationId":"attach_journal_entry_to_bill_api_v1_bills__bill_id__journal_entry_link_post","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryLinkRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/{bill_id}/cancellation":{"patch":{"tags":["bills"],"summary":"Cancel bill","description":"Cancel a bill and change status to 'canceled'","operationId":"cancel_bill_api_v1_bills__bill_id__cancellation_patch","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/{bill_id}/payments":{"post":{"tags":["bills"],"summary":"Add payment to bill","description":"Create a new payment for a specific bill.","operationId":"create_bill_payment_api_v1_bills__bill_id__payments_post","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillPaymentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillPaymentResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["bills"],"summary":"List bill payments","description":"Retrieve all payments for a specific bill.","operationId":"list_bill_payments_api_v1_bills__bill_id__payments_get","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListBillPaymentsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/{bill_id}/payments/{payment_id}":{"delete":{"tags":["bills"],"summary":"Remove payment from bill","description":"Un-link a payment record from a bill and recalculate status.","operationId":"delete_bill_payment_api_v1_bills__bill_id__payments__payment_id__delete","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/upload":{"post":{"tags":["bills"],"summary":"Upload bill document","description":"Upload a PDF or image file for a bill. Returns s3_key to use when creating/updating bills.","operationId":"upload_bill_file_api_v1_bills_upload_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_bill_file_api_v1_bills_upload_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UploadBillFileResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/{bill_id}/attachment":{"patch":{"tags":["bills"],"summary":"Attach file to existing bill","description":"Attach a document file to an existing bill by updating its s3_key.","operationId":"attach_file_to_bill_api_v1_bills__bill_id__attachment_patch","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_attach_file_to_bill_api_v1_bills__bill_id__attachment_patch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/suggest-payment-priority":{"post":{"tags":["bills"],"summary":"AI payment priority suggestions","description":"Get AI-powered bill payment priority recommendations.","operationId":"suggest_payment_priority_api_v1_bills_suggest_payment_priority_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SuggestPaymentPriorityResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/payment-suggestions/trigger":{"post":{"tags":["bills"],"summary":"Trigger bill payment matching","description":"Run the AP matching engine to find bank transactions that match open bills.","operationId":"trigger_bill_payment_matching_api_v1_bills_payment_suggestions_trigger_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerBillMatchingRequest","default":{"auto_match":false}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TriggerBillMatchingResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/payment-suggestions/{suggestion_id}/accept":{"post":{"tags":["bills"],"summary":"Accept a bill payment suggestion","description":"Accept a suggestion and create the actual BillPayment.","operationId":"accept_bill_payment_suggestion_api_v1_bills_payment_suggestions__suggestion_id__accept_post","parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"string","title":"Suggestion Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillPaymentResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/payment-suggestions/{suggestion_id}/reject":{"post":{"tags":["bills"],"summary":"Reject a bill payment suggestion","description":"Reject a suggestion so it is no longer shown.","operationId":"reject_bill_payment_suggestion_api_v1_bills_payment_suggestions__suggestion_id__reject_post","parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"string","title":"Suggestion Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BillPaymentSuggestionRejectResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bills/payment-suggestions/bulk-approve":{"post":{"tags":["bills"],"summary":"Bulk approve bill payment suggestions","description":"Accept all pending suggestions above a confidence threshold.","operationId":"bulk_approve_bill_suggestions_api_v1_bills_payment_suggestions_bulk_approve_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkApproveSuggestionsRequest","default":{"min_confidence":0.85}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkApproveSuggestionsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/nav-preferences":{"get":{"tags":["businesses"],"summary":"Get sidebar navigation preferences","description":"Get the per-business set of hidden nav items. Empty = show everything entitled.","operationId":"get_nav_preferences_api_v1_businesses_nav_preferences_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NavPreferencesResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["businesses"],"summary":"Update sidebar navigation preferences","description":"Replace the per-business hidden nav set. Send an empty list to show everything.","operationId":"update_nav_preferences_api_v1_businesses_nav_preferences_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NavPreferencesUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NavPreferencesResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/nav-preferences/suggest":{"post":{"tags":["businesses"],"summary":"AI-suggest which nav items to hide","description":"Given a business description and the hideable nav catalog, returns a proposed set of items to hide (with reasons) plus a one-line profile. Proposal only — nothing is saved; apply via PUT /nav-preferences.","operationId":"suggest_nav_preferences_api_v1_businesses_nav_preferences_suggest_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NavSuggestRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NavSuggestResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"example":{"detail":"Internal server error"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/user-preferences/table-views":{"get":{"tags":["businesses"],"summary":"List saved table views","description":"Return all DataTable saved views for the current user in the active business.","operationId":"list_table_views_api_v1_businesses_user_preferences_table_views_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TableViewsMapResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["businesses"],"summary":"Merge saved table views","description":"Upsert one or more table view blobs. Send empty views to remove a key. Include the expected ``version`` (or ``If-Match`` header) to avoid lost updates when multiple clients patch concurrently.","operationId":"patch_table_views_api_v1_businesses_user_preferences_table_views_patch","parameters":[{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableViewsPatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TableViewsMapResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/user-preferences/table-views/{table_key}":{"get":{"tags":["businesses"],"summary":"Get saved views for one table","description":"Return the saved-views blob for a single DataTable persistKey.","operationId":"get_table_views_api_v1_businesses_user_preferences_table_views__table_key__get","parameters":[{"name":"table_key","in":"path","required":true,"schema":{"type":"string","title":"Table Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TableSavedViewsDataSchema_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses":{"get":{"tags":["businesses"],"summary":"List businesses","description":"Retrieve businesses the authenticated user has access to.","operationId":"list_businesses_api_v1_businesses_get","parameters":[{"name":"id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"}},{"name":"name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},{"name":"teal_instance","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Instance"}},{"name":"stripe_account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Account Id"}},{"name":"shopify_shop_domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shopify Shop Domain"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BusinessCursorListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["businesses"],"summary":"Create business","description":"Create a new business entity with optional integrations.","operationId":"create_business_api_v1_businesses_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BusinessResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/validate-coa":{"post":{"tags":["businesses"],"summary":"Validate a custom COA template","description":"Validates a custom chart of accounts template against Teal API requirements without creating anything.","operationId":"validate_coa_template_api_v1_businesses_validate_coa_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ValidateCoaTemplateResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/generate-coa":{"post":{"tags":["businesses"],"summary":"Generate a COA template using AI","description":"Uses AI to generate a complete chart of accounts template based on a business description.","operationId":"generate_coa_template_api_v1_businesses_generate_coa_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoaGenerateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CoaGenerateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/mailbox":{"get":{"tags":["businesses"],"summary":"Check mailbox uniqueness","description":"Check if a mailbox is unique; validation and conflicts are handled by the service.\n\nRate-limited per user and per IP — the endpoint is otherwise an\nenumeration oracle for the mailbox namespace.","operationId":"check_mailbox_uniqueness_api_v1_businesses_mailbox_get","parameters":[{"name":"mailbox","in":"query","required":true,"schema":{"type":"string","description":"Mailbox to check for uniqueness","title":"Mailbox"},"description":"Mailbox to check for uniqueness"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_MailboxUniquenessResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"example":{"detail":"Rate limit exceeded"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/users":{"get":{"tags":["businesses"],"summary":"List business users","description":"Get users associated with a business, optionally including advisory firm users.","operationId":"list_business_users_api_v1_businesses_users_get","parameters":[{"name":"include_advisory_users","in":"query","required":false,"schema":{"type":"boolean","description":"Include users from the parent advisory firm if one exists.","default":false,"title":"Include Advisory Users"},"description":"Include users from the parent advisory firm if one exists."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AssociatedUserCursorListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["businesses"],"summary":"Add user to business","description":"Grant a user access to this business with a specified role.","operationId":"add_user_to_business_api_v1_businesses_users_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessUserAddRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AddUserToBusinessResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/teal-source-accounts":{"get":{"tags":["businesses"],"summary":"Get Teal source accounts","description":"List source accounts connected to Teal, including Plaid-linked and manually uploaded.","operationId":"get_teal_source_accounts_api_v1_businesses_teal_source_accounts_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GenericListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/teal-instances":{"get":{"tags":["businesses"],"summary":"Get Teal instances","description":"List Teal instances with cursor-based pagination.\n\n- **enriched**: Whether to enrich instances with business information (default: true)\n- **cursor**: Cursor for pagination\n- **limit**: Maximum number of records to return\n- **direction**: Pagination direction ('next' or 'prev')","operationId":"get_teal_instances_api_v1_businesses_teal_instances_get","parameters":[{"name":"enriched","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to enrich instances with business information","default":true,"title":"Enriched"},"description":"Whether to enrich instances with business information"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TealInstanceCursorListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}":{"get":{"tags":["businesses"],"summary":"Get business","description":"Retrieve full business details including integrations and settings.","operationId":"get_business_api_v1_businesses__business_id__get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BusinessResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["businesses"],"summary":"Update business","description":"Update business details.\n\nThis endpoint supports updating standard business information including:\n- Business name, mailbox, properties\n- Teal instance, Stripe account ID\n- Shopify integration details\n- Stripe subscription items (subscription_items)","operationId":"update_business_api_v1_businesses__business_id__put","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BusinessResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["businesses"],"summary":"Delete business","description":"Delete a business and all associated resources (async via Temporal).\n\n**Safety:** requires a JSON body with ``confirm_name`` matching the\nbusiness's name (case-insensitive, trimmed). Guards against single-click\nmuscle-memory deletes — this endpoint wipes ~80 related tables via a\nTemporal workflow and is irreversible.\n\n**Cleanup Process:**\n1. For each Plaid connection:\n   - Teal API cleanup (transactions, journal entries, source accounts, ledgers)\n   - Local DB cleanup (Transactions → Line Entries → Journal Entries → Ledgers)\n   - PlaidItem deletion\n   - Plaid token revocation\n2. Teal instance deletion\n3. User associations cleanup\n4. Business record deletion","operationId":"delete_business_api_v1_businesses__business_id__delete","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"confirm_delete","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Confirm Delete"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/BusinessDeleteRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/sync":{"get":{"tags":["businesses"],"summary":"Get sync status","description":"Get the current Teal sync status for a business. Lightweight endpoint for polling.","operationId":"get_business_sync_status_api_v1_businesses__business_id__sync_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SyncStatus_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/income-statement":{"get":{"tags":["businesses"],"summary":"Get income statement (sectioned)","description":"Income statement grouped by section. Each section contains ledger line items with period values as top-level keys.","operationId":"get_income_statement_api_v1_businesses__business_id__income_statement_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"hide_zero_rows","in":"query","required":false,"schema":{"type":"boolean","description":"Exclude line items with all-zero values","default":false,"title":"Hide Zero Rows"},"description":"Exclude line items with all-zero values"},{"name":"period_granularity","in":"query","required":false,"schema":{"type":"string","description":"Period grouping: monthly, quarterly, or yearly","default":"monthly","title":"Period Granularity"},"description":"Period grouping: monthly, quarterly, or yearly"},{"name":"tag_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Filter by tag UUIDs — only line entries tagged with at least one of these tags are included","default":[],"title":"Tag Ids"},"description":"Filter by tag UUIDs — only line entries tagged with at least one of these tags are included"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetIncomeStatementResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/income-statement-flat":{"get":{"tags":["businesses"],"summary":"Get income statement (flat)","description":"Pre-flattened income statement rows for display. No transformation needed.","operationId":"get_income_statement_flat_api_v1_businesses__business_id__income_statement_flat_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"hide_zero_rows","in":"query","required":false,"schema":{"type":"boolean","description":"Exclude line items with all-zero values","default":false,"title":"Hide Zero Rows"},"description":"Exclude line items with all-zero values"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetIncomeStatementFlatResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/ledger/{ledger_id}/vendor-breakdown":{"get":{"tags":["businesses"],"summary":"Get vendor/counterparty breakdown for a ledger account","description":"Returns vendors/counterparties that contributed to a ledger account total in the given date range, with amounts and percentages.","operationId":"get_ledger_vendor_breakdown_api_v1_businesses__business_id__ledger__ledger_id__vendor_breakdown_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","title":"Ledger Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"cash_flow","in":"query","required":false,"schema":{"type":"boolean","description":"When true, restrict to cash-touching journal entries and use cash flow sign convention","default":false,"title":"Cash Flow"},"description":"When true, restrict to cash-touching journal entries and use cash flow sign convention"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetLedgerVendorBreakdownResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/ledger/{ledger_id}/vendor-period-matrix":{"get":{"tags":["businesses"],"summary":"Get vendor breakdown across all periods for a ledger","description":"Returns vendor/counterparty breakdown with per-period amounts for pivot-table display.","operationId":"get_ledger_vendor_period_matrix_api_v1_businesses__business_id__ledger__ledger_id__vendor_period_matrix_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","title":"Ledger Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"period_granularity","in":"query","required":false,"schema":{"type":"string","description":"monthly, quarterly, or yearly","default":"monthly","title":"Period Granularity"},"description":"monthly, quarterly, or yearly"},{"name":"cash_flow","in":"query","required":false,"schema":{"type":"boolean","description":"When true, restrict to cash-touching journal entries and use cash flow sign convention","default":false,"title":"Cash Flow"},"description":"When true, restrict to cash-touching journal entries and use cash flow sign convention"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetLedgerVendorPeriodMatrixResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/ledger/{ledger_id}/vendor-transactions":{"get":{"tags":["businesses"],"summary":"Get individual transactions for a vendor within a ledger","description":"Returns individual line entries for a specific counterparty within a ledger and date range.","operationId":"get_ledger_vendor_transactions_api_v1_businesses__business_id__ledger__ledger_id__vendor_transactions_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","title":"Ledger Id"}},{"name":"counterparty_name","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Counterparty/vendor name","title":"Counterparty Name"},"description":"Counterparty/vendor name"},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetLedgerVendorTransactionsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/ledger/{ledger_id}/statement":{"get":{"tags":["businesses"],"summary":"Get ledger statement for a date range","description":"Returns beginning balance, transactions within the range, and ending balance for a specific ledger account.","operationId":"get_ledger_statement_api_v1_businesses__business_id__ledger__ledger_id__statement_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","title":"Ledger Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetLedgerStatementResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/line-entries/recategorize":{"patch":{"tags":["businesses"],"summary":"Recategorize line entries","description":"Move line entries to a different ledger. Used for journal-entry lines that have no bank transaction.","operationId":"recategorize_line_entries_api_v1_businesses__business_id__line_entries_recategorize_patch","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecategorizeLineEntriesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecategorizeLineEntriesResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/balance-sheet":{"get":{"tags":["businesses"],"summary":"Get balance sheet (sectioned)","description":"Balance sheet grouped by section (Assets, Liabilities, Equity). Each section contains ledger line items with ledger_id, ledger_name, sort_code, and total_amount.","operationId":"get_balance_sheet_api_v1_businesses__business_id__balance_sheet_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"as_of_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"As-of date (YYYY-MM-DD)","title":"As Of Date"},"description":"As-of date (YYYY-MM-DD)"},{"name":"hide_zero_rows","in":"query","required":false,"schema":{"type":"boolean","description":"Exclude line items with a zero balance","default":false,"title":"Hide Zero Rows"},"description":"Exclude line items with a zero balance"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetBalanceSheetResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cash-flow-statement":{"get":{"tags":["businesses"],"summary":"Get cash flow statement","description":"Cash flow statement (indirect method) grouped by operating, investing, and financing activities. The operating section walks Net Income through non-cash add-backs and working-capital changes to Net Cash from Operating Activities. Includes ASC 230 supplemental disclosures and §5 validation results. All amounts in cents.","operationId":"get_cash_flow_statement_api_v1_businesses__business_id__cash_flow_statement_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"hide_zero_rows","in":"query","required":false,"schema":{"type":"boolean","description":"Exclude line items with zero cash impact","default":false,"title":"Hide Zero Rows"},"description":"Exclude line items with zero cash impact"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetCashFlowStatementResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cash-flow-statement/periodic":{"get":{"tags":["businesses"],"summary":"Get cash flow statements for multiple periods","description":"Batch endpoint returning a cash flow statement for each period in the requested date range. Avoids N round-trips for monthly/quarterly views. All amounts in cents.","operationId":"get_cash_flow_statements_periodic_api_v1_businesses__business_id__cash_flow_statement_periodic_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"grouping","in":"query","required":false,"schema":{"type":"string","pattern":"^(monthly|quarterly)$","description":"Period grouping: 'monthly' or 'quarterly'","default":"monthly","title":"Grouping"},"description":"Period grouping: 'monthly' or 'quarterly'"},{"name":"hide_zero_rows","in":"query","required":false,"schema":{"type":"boolean","description":"Exclude line items with zero cash impact","default":false,"title":"Hide Zero Rows"},"description":"Exclude line items with zero cash impact"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetCashFlowStatementsPeriodicResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cash-flow-statement/outflow-breakdown":{"get":{"tags":["businesses"],"summary":"Top categories and vendors by cash outflow","description":"Returns the top N ledger categories and counterparties that powered cash outflows during the requested period, ranked by absolute cash leaving. Powers the 'Where the cash went' tile on /books/cash-flow.","operationId":"get_cash_flow_outflow_breakdown_api_v1_businesses__business_id__cash_flow_statement_outflow_breakdown_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Max rows per list (categories and vendors are returned separately)","default":5,"title":"Limit"},"description":"Max rows per list (categories and vendors are returned separately)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetCashFlowOutflowBreakdownResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/income-statement/analyze":{"post":{"tags":["businesses"],"summary":"AI analysis of income statement","description":"Uses AI to analyze the income statement for the given period and return structured insights.","operationId":"analyze_income_statement_api_v1_businesses__business_id__income_statement_analyze_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AnalyzeIncomeStatementResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/balance-sheet/analyze":{"post":{"tags":["businesses"],"summary":"AI analysis of balance sheet","description":"Uses AI to analyze the balance sheet as of a given date and return structured insights.","operationId":"analyze_balance_sheet_api_v1_businesses__business_id__balance_sheet_analyze_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AnalyzeBalanceSheetResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cash-flow/analyze":{"post":{"tags":["businesses"],"summary":"AI analysis of cash flow statement","description":"Uses AI to analyze the cash flow statement for the given period and return structured insights.","operationId":"analyze_cash_flow_api_v1_businesses__business_id__cash_flow_analyze_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AnalyzeCashFlowResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/entries-start":{"put":{"tags":["businesses"],"summary":"Update entries start date","description":"Set the date from which accounting entries should begin.","operationId":"update_entries_start_api_v1_businesses_entries_start_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEntriesStartRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UpdateEntriesStartResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/stripe-subscription":{"put":{"tags":["businesses"],"summary":"Update Stripe subscription","description":"Link a Stripe subscription to a business.","operationId":"update_stripe_subscription_api_v1_businesses__business_id__stripe_subscription_put","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStripeSubscriptionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UpdateStripeSubscriptionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/users/{user_id}":{"put":{"tags":["businesses"],"summary":"Update user role","description":"Change a user's access level in this business.","operationId":"update_user_role_in_business_api_v1_businesses_users__user_id__put","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessUserRoleUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UpdateUserRoleInBusinessResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["businesses"],"summary":"Remove user from business","description":"Remove a user from a specific business.\n\nIMPORTANT: This endpoint removes the user-business association ONLY.\nThe user record itself remains in the database and can still be associated with other businesses.\n\nTo completely delete a user from the system, use DELETE /users/{user_id} instead.","operationId":"remove_user_from_business_api_v1_businesses_users__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/users/{user_id}/role":{"get":{"tags":["businesses"],"summary":"Get user role","description":"Check a user's access level in this business.","operationId":"get_user_role_in_business_api_v1_businesses_users__user_id__role_get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetUserRoleInBusinessResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/auto-numbering":{"get":{"tags":["businesses"],"summary":"Get auto-numbering settings","description":"Get the current auto-numbering configuration for bills and invoices.","operationId":"get_auto_numbering_settings_api_v1_businesses_auto_numbering_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AutoNumberingSettingsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["businesses"],"summary":"Update auto-numbering settings","description":"Configure automatic bill and invoice number generation.","operationId":"update_auto_numbering_settings_api_v1_businesses_auto_numbering_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoNumberingSettingsUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AutoNumberingSettingsResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/auto-numbering/preview":{"get":{"tags":["businesses"],"summary":"Preview next auto-generated numbers","description":"See what the next bill and invoice numbers would be without incrementing.","operationId":"preview_auto_numbering_api_v1_businesses_auto_numbering_preview_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AutoNumberingPreviewResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/slack/status":{"get":{"tags":["businesses"],"summary":"Get Slack integration status","description":"Check whether a Slack webhook is configured for this business.","operationId":"get_slack_status_api_v1_businesses_slack_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SlackIntegrationStatus_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/slack":{"put":{"tags":["businesses"],"summary":"Save Slack webhook URL","description":"Configure a Slack Incoming Webhook URL for this business.","operationId":"save_business_slack_webhook_api_v1_businesses_slack_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackWebhookSaveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SlackIntegrationStatus_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/slack/{webhook_id}/preferences":{"put":{"tags":["businesses"],"summary":"Update Slack notification preferences","description":"Toggle which notification categories are sent to Slack.","operationId":"update_slack_notification_preferences_api_v1_businesses_slack__webhook_id__preferences_put","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackPreferencesUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SlackIntegrationStatus_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/slack/{webhook_id}/test":{"post":{"tags":["businesses"],"summary":"Test Slack webhook","description":"Send a test message to the business's configured Slack webhook.","operationId":"test_business_slack_webhook_api_v1_businesses_slack__webhook_id__test_post","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SlackTestSendResult_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/slack/test":{"post":{"tags":["businesses"],"summary":"Test Slack webhook","description":"Send a test message to the business's first configured Slack webhook (legacy).","operationId":"test_business_slack_webhook_legacy_api_v1_businesses_slack_test_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SlackTestSendResult_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/slack/{webhook_id}":{"delete":{"tags":["businesses"],"summary":"Disconnect Slack","description":"Remove the business's Slack webhook URL.","operationId":"disconnect_business_slack_api_v1_businesses_slack__webhook_id__delete","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SlackDisconnectResult_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/invoice-settings":{"get":{"tags":["businesses"],"summary":"Get invoice branding settings","description":"Get invoice branding configuration including footer text and logo sync status.","operationId":"get_invoice_settings_api_v1_businesses_invoice_settings_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceSettingsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["businesses"],"summary":"Update invoice branding settings","description":"Update the default footer text shown on invoice PDFs.","operationId":"update_invoice_settings_api_v1_businesses_invoice_settings_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceSettingsUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceSettingsResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/invoice-settings/sync-logo":{"post":{"tags":["businesses"],"summary":"Sync logo to Stripe branding","description":"Upload the business logo to Stripe for invoice branding.","operationId":"sync_logo_to_stripe_api_v1_businesses_invoice_settings_sync_logo_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SyncLogoBrandingResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/unit-economics":{"get":{"tags":["cfo-portal"],"summary":"Get CFO unit economics","operationId":"cfo_portal_get_unit_economics_api_v1_businesses__business_id__cfo_portal_unit_economics_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/configuration":{"get":{"tags":["cfo-portal"],"summary":"Get CFO configuration","operationId":"cfo_portal_get_configuration_api_v1_businesses__business_id__cfo_portal_configuration_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/monthly-close":{"get":{"tags":["cfo-portal"],"summary":"Get CFO monthly close status","operationId":"cfo_portal_get_monthly_close_api_v1_businesses__business_id__cfo_portal_monthly_close_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/ar-aging":{"get":{"tags":["cfo-portal"],"summary":"Get CFO AR aging","operationId":"cfo_portal_get_ar_aging_api_v1_businesses__business_id__cfo_portal_ar_aging_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/ap-aging":{"get":{"tags":["cfo-portal"],"summary":"Get CFO AP aging","operationId":"cfo_portal_get_ap_aging_api_v1_businesses__business_id__cfo_portal_ap_aging_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/landed-cogs":{"get":{"tags":["cfo-portal"],"summary":"Get CFO landed COGS","operationId":"cfo_portal_get_landed_cogs_api_v1_businesses__business_id__cfo_portal_landed_cogs_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/shipping-analysis":{"get":{"tags":["cfo-portal"],"summary":"Get CFO shipping analysis","operationId":"cfo_portal_get_shipping_analysis_api_v1_businesses__business_id__cfo_portal_shipping_analysis_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/shopify":{"get":{"tags":["cfo-portal"],"summary":"Get CFO Shopify metrics","operationId":"cfo_portal_get_shopify_api_v1_businesses__business_id__cfo_portal_shopify_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/reports-documents":{"get":{"tags":["cfo-portal"],"summary":"Get CFO reports and documents","operationId":"cfo_portal_get_reports_documents_api_v1_businesses__business_id__cfo_portal_reports_documents_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/debt-schedule":{"get":{"tags":["cfo-portal"],"summary":"Get CFO debt schedule","operationId":"cfo_portal_get_debt_schedule_api_v1_businesses__business_id__cfo_portal_debt_schedule_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/alerts":{"get":{"tags":["cfo-portal"],"summary":"Get CFO financial alerts","operationId":"cfo_portal_get_alerts_api_v1_businesses__business_id__cfo_portal_alerts_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/valuation":{"get":{"tags":["cfo-portal"],"summary":"Get CFO valuation inputs","operationId":"cfo_portal_get_valuation_api_v1_businesses__business_id__cfo_portal_valuation_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/benchmarks":{"get":{"tags":["cfo-portal"],"summary":"Get CFO benchmarks","operationId":"cfo_portal_get_benchmarks_api_v1_businesses__business_id__cfo_portal_benchmarks_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/recipe-book":{"get":{"tags":["cfo-portal"],"summary":"Get CFO recipe book","operationId":"cfo_portal_get_recipe_book_api_v1_businesses__business_id__cfo_portal_recipe_book_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/managerial-pl":{"get":{"tags":["cfo-portal"],"summary":"Get CFO managerial P&L","operationId":"cfo_portal_get_managerial_pl_api_v1_businesses__business_id__cfo_portal_managerial_pl_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/statements":{"get":{"tags":["cfo-portal"],"summary":"Get CFO statement bundle","operationId":"cfo_portal_get_statements_api_v1_businesses__business_id__cfo_portal_statements_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/flux":{"get":{"tags":["cfo-portal"],"summary":"Get CFO flux analysis","operationId":"cfo_portal_get_flux_api_v1_businesses__business_id__cfo_portal_flux_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/board-deck":{"get":{"tags":["cfo-portal"],"summary":"Get CFO board deck summary","operationId":"cfo_portal_get_board_deck_api_v1_businesses__business_id__cfo_portal_board_deck_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/summary":{"get":{"tags":["cfo-portal"],"summary":"Get CFO portal summary","operationId":"cfo_portal_get_summary_api_v1_businesses__business_id__cfo_portal_summary_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"include_series","in":"query","required":false,"schema":{"type":"boolean","description":"When true, include the 13-week trailing P&L series in ``data.pulse.weekly_series`` and run the heavier DB fan-out.","default":false,"title":"Include Series"},"description":"When true, include the 13-week trailing P&L series in ``data.pulse.weekly_series`` and run the heavier DB fan-out."},{"name":"include_weekly_pl","in":"query","required":false,"schema":{"type":"boolean","description":"When true, include the 4-week P&L table rows in ``data.weekly_pl_rows``.","default":true,"title":"Include Weekly Pl"},"description":"When true, include the 4-week P&L table rows in ``data.weekly_pl_rows``."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/purchase-orders":{"get":{"tags":["cfo-portal"],"summary":"Get CFO purchase order pipeline","operationId":"get_purchase_orders_handler_api_v1_businesses__business_id__cfo_portal_purchase_orders_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/cash-forecast":{"get":{"tags":["cfo-portal"],"summary":"Get CFO 13-week cash forecast","description":"Get the cash forecast section with optional budget selection.","operationId":"cfo_portal_get_cash_forecast_api_v1_businesses__business_id__cfo_portal_cash_forecast_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"budget_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Budget Id"}},{"name":"apply_overrides","in":"query","required":false,"schema":{"type":"boolean","description":"When true, the working override scope is folded into the computed cell values. Used by the Demand Planner tab. The live Cash Flow Forecast tab leaves this off so unsaved what-if values don't bleed across views.","default":false,"title":"Apply Overrides"},"description":"When true, the working override scope is folded into the computed cell values. Used by the Demand Planner tab. The live Cash Flow Forecast tab leaves this off so unsaved what-if values don't bleed across views."},{"name":"include_projected_replenishment","in":"query","required":false,"schema":{"type":"boolean","description":"When true, projected (not-yet-placed) replenishment POs from the SKU demand-forecast engine are added to a separate Projected Inventory row so operators see the cash impact of reorders they'll need to make. Off by default to keep the live Forecast tab byte-identical.","default":false,"title":"Include Projected Replenishment"},"description":"When true, projected (not-yet-placed) replenishment POs from the SKU demand-forecast engine are added to a separate Projected Inventory row so operators see the cash impact of reorders they'll need to make. Off by default to keep the live Forecast tab byte-identical."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/vendor-spend":{"get":{"tags":["cfo-portal"],"summary":"Get CFO vendor spend","description":"Get vendor spend with optional date range, grouping mode, and source filters.","operationId":"cfo_portal_get_vendor_spend_api_v1_businesses__business_id__cfo_portal_vendor_spend_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}},{"name":"group_by","in":"query","required":false,"schema":{"type":"string","default":"counterparty","title":"Group By"}},{"name":"sources","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Sources"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/unit-economics/settings":{"put":{"tags":["cfo-portal"],"summary":"Update Unit Economics configuration","description":"Save Unit Economics settings (Shopify vs manual AOV override).","operationId":"cfo_portal_update_unit_economics_settings_api_v1_businesses__business_id__cfo_portal_unit_economics_settings_put","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitEconomicsSettingsUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/settings":{"put":{"tags":["cfo-portal"],"summary":"Update Cash Forecast configuration","description":"Save Cash Forecast settings (excluded budget ledgers).","operationId":"cfo_portal_update_cash_forecast_settings_api_v1_businesses__business_id__cfo_portal_cash_forecast_settings_put","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashForecastSettingsUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/po-forecast-settings":{"get":{"tags":["cfo-portal"],"summary":"List open POs and which forecast column they flow through","description":"List every open PO with its forecast attribution.","operationId":"cfo_portal_po_forecast_settings_api_v1_businesses__business_id__cfo_portal_po_forecast_settings_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_POForecastSettingsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/one-time-items":{"get":{"tags":["cfo-portal"],"summary":"List one-time payment items applied to the cash forecast","description":"List all one-time payment items for this business.","operationId":"cfo_portal_list_one_time_items_api_v1_businesses__business_id__cfo_portal_cash_forecast_one_time_items_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CashForecastOneTimeItemList_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["cfo-portal"],"summary":"Create a one-time payment item","description":"Create a one-time payment item for the cash forecast.\n\n**Request Body:**\n- ``label``: Short description (e.g. \"Q2 estimated tax\").\n- ``amount_cents``: Positive = cash in, negative = cash out.\n- ``applies_on``: ISO date the cash event lands on.\n- ``notes``: Optional free-form notes.\n\n**Effect:** The item appears in the forecast week whose Sunday\nwindow contains ``applies_on``. The forecast's ``one_time_cents``\ncolumn on that week is incremented by ``amount_cents``.","operationId":"cfo_portal_create_one_time_item_api_v1_businesses__business_id__cfo_portal_cash_forecast_one_time_items_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashForecastOneTimeItemCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CashForecastOneTimeItem_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/one-time-items/{item_id}":{"patch":{"tags":["cfo-portal"],"summary":"Update a one-time payment item","description":"Partially update a one-time payment item.\n\nAny field omitted from the body is left unchanged.","operationId":"cfo_portal_update_one_time_item_api_v1_businesses__business_id__cfo_portal_cash_forecast_one_time_items__item_id__patch","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashForecastOneTimeItemUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CashForecastOneTimeItem_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["cfo-portal"],"summary":"Delete a one-time payment item","description":"Delete a one-time payment item.","operationId":"cfo_portal_delete_one_time_item_api_v1_businesses__business_id__cfo_portal_cash_forecast_one_time_items__item_id__delete","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/versions":{"get":{"tags":["cfo-portal"],"summary":"List saved cash forecast versions","description":"List saved versions for this business (summary view, no snapshot).","operationId":"cfo_portal_list_versions_api_v1_businesses__business_id__cfo_portal_cash_forecast_versions_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CashForecastVersionList_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["cfo-portal"],"summary":"Save the current cash forecast configuration as a named version","description":"Snapshot the current cash forecast configuration + output.\n\nThe version captures the chosen budget, excluded ledgers, and\nembedded one-time items, along with the full computed forecast\nJSON. The snapshot is what stays stable as live data drifts; the\nconfig is what's replayed against live data on load.","operationId":"cfo_portal_create_version_api_v1_businesses__business_id__cfo_portal_cash_forecast_versions_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashForecastVersionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CashForecastVersionDetail_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/versions/{version_id}":{"get":{"tags":["cfo-portal"],"summary":"Get a saved cash forecast version","description":"Get full detail for a saved version, including config + snapshot.","operationId":"cfo_portal_get_version_api_v1_businesses__business_id__cfo_portal_cash_forecast_versions__version_id__get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CashForecastVersionDetail_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["cfo-portal"],"summary":"Rename or describe a saved version","description":"Update a saved version's name or description.\n\nConfiguration and snapshot fields are immutable — save a new\nversion to capture a new scenario.","operationId":"cfo_portal_update_version_api_v1_businesses__business_id__cfo_portal_cash_forecast_versions__version_id__patch","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashForecastVersionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CashForecastVersionDetail_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["cfo-portal"],"summary":"Delete a saved cash forecast version","description":"Delete a saved version and any overrides pinned to it.","operationId":"cfo_portal_delete_version_api_v1_businesses__business_id__cfo_portal_cash_forecast_versions__version_id__delete","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/versions/{version_id}/apply":{"post":{"tags":["cfo-portal"],"summary":"Re-apply a saved version's config to the live forecast","description":"Load a saved version into the user's working scope.\n\nPushes the version's budget exclusion list to business settings\nand replays its overrides into the working scope so the live\nforecast recomputes against the saved configuration. The caller\nshould invalidate the cash-forecast query and use ``budget_id``\nfrom the response to sync any local budget-selector state.","operationId":"cfo_portal_apply_version_api_v1_businesses__business_id__cfo_portal_cash_forecast_versions__version_id__apply_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CashForecastVersionApplyResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/overrides":{"get":{"tags":["cfo-portal"],"summary":"List cell-level overrides for the cash forecast","description":"List overrides for either the working set or a saved version.","operationId":"cfo_portal_list_overrides_api_v1_businesses__business_id__cfo_portal_cash_forecast_overrides_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"version_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Saved version id to scope overrides to. Omit for the user's working override set.","title":"Version Id"},"description":"Saved version id to scope overrides to. Omit for the user's working override set."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CashForecastOverrideList_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["cfo-portal"],"summary":"Replace all cash forecast overrides in a scope","description":"Atomically replace every override row in the matching scope.\n\n**Request Body:**\n- ``version_id``: Optional. If null, replaces the working override\n  set; otherwise replaces overrides pinned to that saved version.\n- ``overrides``: List of cells to override (week_number / column /\n  amount_cents).\n\n**Effect:** All existing overrides in the scope are deleted, then\nthe provided rows are inserted. Use the empty list to clear the\nscope without deleting the URL.","operationId":"cfo_portal_upsert_overrides_api_v1_businesses__business_id__cfo_portal_cash_forecast_overrides_put","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashForecastOverridesUpsert"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CashForecastOverrideList_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["cfo-portal"],"summary":"Clear all cash forecast overrides in a scope","description":"Clear every override in the matching scope (working set or version).","operationId":"cfo_portal_clear_overrides_api_v1_businesses__business_id__cfo_portal_cash_forecast_overrides_delete","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"version_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/overrides/{override_id}":{"delete":{"tags":["cfo-portal"],"summary":"Delete a single cash forecast override row","description":"Delete a single override row by id.","operationId":"cfo_portal_delete_override_api_v1_businesses__business_id__cfo_portal_cash_forecast_overrides__override_id__delete","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"override_id","in":"path","required":true,"schema":{"type":"string","title":"Override Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/demand-plan":{"post":{"tags":["cfo-portal"],"summary":"Evaluate a what-if cash forecast scenario","description":"Run the canonical forecast twice (clean baseline + scenario) and\nreturn the per-week ending-cash delta.\n\nRead-only: ``overrides`` and ``inline_one_time_items`` apply only\nto the scenario pass and are never persisted. Persisting a\nscenario is a separate call to ``PUT /cash-forecast/overrides``.","operationId":"cfo_portal_evaluate_demand_plan_api_v1_businesses__business_id__cfo_portal_cash_forecast_demand_plan_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemandPlanScenarioRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DemandPlanScenarioResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/budget-vs-actual":{"get":{"tags":["cfo-portal"],"summary":"Get CFO budget vs actual","description":"Get the budget-vs-actual section with optional budget/date filters.","operationId":"cfo_portal_get_budget_vs_actual_api_v1_businesses__business_id__cfo_portal_budget_vs_actual_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"budget_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Budget Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/debt-schedule/parse-contract":{"post":{"tags":["cfo-portal"],"summary":"Parse debt contract into a draft payment schedule","description":"Parse an uploaded lending contract into structured terms and schedule.\n\n**Request Body:**\n- `s3_key`: S3 key of an uploaded contract document (required).","operationId":"cfo_portal_parse_debt_contract_api_v1_businesses__business_id__cfo_portal_debt_schedule_parse_contract_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebtContractParseRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ParseDebtContractResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/debt-schedule/approve-contract":{"post":{"tags":["cfo-portal"],"summary":"Approve parsed debt contract and create debt instrument","description":"Create a debt instrument from approved parsed contract terms.\n\n**Request Body:**\n- `contract`: ParsedDebtContract from the parse endpoint (required).\n- `contract_s3_key`: S3 key of the original PDF (optional, persisted\n  on the debt instrument for later retrieval).","operationId":"cfo_portal_approve_debt_contract_api_v1_businesses__business_id__cfo_portal_debt_schedule_approve_contract_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebtContractApproveRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DebtContractApproveResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/debt-schedule/instruments/{instrument_id}/payments":{"post":{"tags":["cfo-portal"],"summary":"Record a payment against a debt instrument","description":"Record a payment on a loan, posting a balanced principal/interest entry.\n\n**Request Body:**\n- `payment_amount_cents`: total payment, split into principal + interest.\n- `cash_ledger_id`: bank/cash account the money moves through.\n- `payment_date`: optional, defaults to today.\n- `memo`: optional journal-entry memo.\n\nThe principal and interest accounts are resolved by direction:\ndebt we owe pays down Long-Term Debt with Interest Expense; a note\nreceivable collects against Notes Receivable with Interest Income.\nDecrements the instrument's outstanding balance by the principal\nportion.","operationId":"cfo_portal_record_debt_payment_api_v1_businesses__business_id__cfo_portal_debt_schedule_instruments__instrument_id__payments_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"instrument_id","in":"path","required":true,"schema":{"type":"string","title":"Instrument Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebtPaymentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DebtPaymentResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/recipe-book/managerial-mappings":{"put":{"tags":["cfo-portal"],"summary":"Upsert managerial bucket assignments for GL accounts","description":"Save bucket assignments edited on the Recipe Book page.\n\nThe response is the refreshed Recipe Book section so the frontend\ncan swap state in one round-trip without a follow-up GET.","operationId":"cfo_portal_upsert_managerial_mappings_api_v1_businesses__business_id__cfo_portal_recipe_book_managerial_mappings_put","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagerialMappingUpsertRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/recipe-book/managerial-builders":{"put":{"tags":["cfo-portal"],"summary":"Upsert managerial builder line account selections","description":"Save account selections for CM1/CM2 and cash-outflow builder lines.","operationId":"cfo_portal_upsert_managerial_builders_api_v1_businesses__business_id__cfo_portal_recipe_book_managerial_builders_put","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagerialBuildersUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/recipe-book/auto-assign":{"post":{"tags":["cfo-portal"],"summary":"AI auto-assign ledgers to managerial buckets","description":"AI auto-assign ledgers to managerial buckets based on account names.","operationId":"cfo_portal_auto_assign_ledgers_api_v1_businesses__business_id__cfo_portal_recipe_book_auto_assign_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalSectionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/board-deck/memo":{"post":{"tags":["cfo-portal"],"summary":"Generate an AI board memo/report from CFO board-deck data","description":"Generate a board-ready memo using the latest board-deck metrics.","operationId":"cfo_portal_generate_board_memo_api_v1_businesses__business_id__cfo_portal_board_deck_memo_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalBoardMemoResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/board-deck/pdf":{"get":{"tags":["cfo-portal"],"summary":"Download board deck summary as PDF","description":"Build and download the board deck summary PDF on demand.","operationId":"cfo_portal_download_board_deck_pdf_api_v1_businesses__business_id__cfo_portal_board_deck_pdf_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/board-deck/memo/export":{"post":{"tags":["cfo-portal"],"summary":"Export AI board memo as PDF or HTML","description":"Export the current AI board memo in a user-selected format.","operationId":"cfo_portal_export_board_memo_api_v1_businesses__business_id__cfo_portal_board_deck_memo_export_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CfoPortalBoardMemoExportRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/ask":{"post":{"tags":["cfo-portal"],"summary":"Ask the CFO portal AI assistant a question","operationId":"cfo_portal_ask_api_v1_businesses__business_id__cfo_portal_ask_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CfoPortalAskRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CfoPortalAskResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/buckets":{"get":{"tags":["cfo-portal"],"summary":"List all managerial buckets (default + custom)","description":"Return all managerial buckets available for this business.\n\nThe response includes both the built-in default buckets and any\ncustom buckets defined by this business. Default buckets have\n``is_default: true`` rows are built-in buckets with fixed keys; use\nPUT ``.../buckets/{bucket_key}`` to customize ``label`` and ``color``.","operationId":"cfo_portal_list_buckets_api_v1_businesses__business_id__cfo_portal_buckets_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CustomBucketsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["cfo-portal"],"summary":"Create a custom managerial bucket","description":"Create a new custom managerial bucket for categorizing GL accounts.\n\nThe bucket key must be unique and cannot conflict with default\nbucket keys. Use lowercase letters, numbers, and underscores only.","operationId":"cfo_portal_create_bucket_api_v1_businesses__business_id__cfo_portal_buckets_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomBucketCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CustomBucketResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/businesses/{business_id}/cfo-portal/buckets/{bucket_key}":{"put":{"tags":["cfo-portal"],"summary":"Update a managerial bucket","description":"Update a managerial bucket.\n\nBuilt-in buckets accept ``label`` and ``color`` only (display\noverrides). Custom buckets accept any field included in the body.","operationId":"cfo_portal_update_bucket_api_v1_businesses__business_id__cfo_portal_buckets__bucket_key__put","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"bucket_key","in":"path","required":true,"schema":{"type":"string","title":"Bucket Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomBucketUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CustomBucketResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["cfo-portal"],"summary":"Delete or disable a managerial bucket","description":"Delete or disable a managerial bucket.\n\nThis also clears any GL account mappings that reference the\ndeleted bucket. Some built-in buckets are locked and cannot\nbe deleted.","operationId":"cfo_portal_delete_bucket_api_v1_businesses__business_id__cfo_portal_buckets__bucket_key__delete","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"bucket_key","in":"path","required":true,"schema":{"type":"string","title":"Bucket Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/credit-memos":{"get":{"tags":["credit-memos"],"summary":"List credit memos","description":"List all credit memos for the business with optional filtering.","operationId":"list_credit_memos_api_v1_credit_memos_get","parameters":[{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by customer ID","title":"Customer Id"},"description":"Filter by customer ID"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/CreditMemoStatusEnum"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"has_remaining_balance","in":"query","required":false,"schema":{"type":"boolean","description":"Only show memos with remaining balance","default":false,"title":"Has Remaining Balance"},"description":"Only show memos with remaining balance"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by credit memo number (e.g. CM-0001)","title":"Search"},"description":"Search by credit memo number (e.g. CM-0001)"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Limit"},"description":"Page size"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreditMemosListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["credit-memos"],"summary":"Create credit memo","description":"Create a new credit memo in draft status.","operationId":"create_credit_memo_api_v1_credit_memos_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditMemoCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreditMemoResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/credit-memos/{credit_memo_id}":{"get":{"tags":["credit-memos"],"summary":"Get credit memo","description":"Get a specific credit memo by ID.","operationId":"get_credit_memo_api_v1_credit_memos__credit_memo_id__get","parameters":[{"name":"credit_memo_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Memo Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreditMemoResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["credit-memos"],"summary":"Update credit memo","description":"Update a draft credit memo.","operationId":"update_credit_memo_api_v1_credit_memos__credit_memo_id__put","parameters":[{"name":"credit_memo_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Memo Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditMemoUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreditMemoResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["credit-memos"],"summary":"Delete credit memo","description":"Delete a draft credit memo.","operationId":"delete_credit_memo_api_v1_credit_memos__credit_memo_id__delete","parameters":[{"name":"credit_memo_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Memo Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/credit-memos/{credit_memo_id}/issue":{"post":{"tags":["credit-memos"],"summary":"Issue credit memo","description":"Issue a draft credit memo, making it available for application.","operationId":"issue_credit_memo_api_v1_credit_memos__credit_memo_id__issue_post","parameters":[{"name":"credit_memo_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Memo Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreditMemoResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/credit-memos/{credit_memo_id}/void":{"post":{"tags":["credit-memos"],"summary":"Void credit memo","description":"Void a credit memo. Requires a reason.","operationId":"void_credit_memo_api_v1_credit_memos__credit_memo_id__void_post","parameters":[{"name":"credit_memo_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Memo Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditMemoVoid"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreditMemoResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/credit-memos/{credit_memo_id}/apply":{"post":{"tags":["credit-memos"],"summary":"Apply credit memo to invoice","description":"Apply a portion or all of a credit memo to an invoice.","operationId":"apply_credit_memo_api_v1_credit_memos__credit_memo_id__apply_post","parameters":[{"name":"credit_memo_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Memo Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditMemoApplicationCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreditMemoApplicationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/credit-memos/customers/{customer_id}/credits":{"get":{"tags":["credit-memos"],"summary":"Get customer available credits","description":"Get summary of available credits for a customer.","operationId":"get_customer_credits_api_v1_credit_memos_customers__customer_id__credits_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CustomerCreditSummary_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/credit-memos/suggest":{"post":{"tags":["credit-memos"],"summary":"AI credit memo suggestions","description":"Get AI-powered credit memo suggestions based on customer patterns.","operationId":"suggest_credit_memos_api_v1_credit_memos_suggest_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SuggestCreditMemosResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers":{"post":{"tags":["customers"],"summary":"Create customer","description":"Create a new customer record for the business.","operationId":"create_customer_api_v1_customers_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CustomerResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["customers"],"summary":"List customers","description":"Retrieve all customers for the business with optional filtering.","operationId":"get_customers_api_v1_customers_get","parameters":[{"name":"id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by specific customer ID","title":"Id"},"description":"Filter by specific customer ID"},{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by customer email address","title":"Email"},"description":"Filter by customer email address"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"Fuzzy search customers by name (uses trigram matching)","title":"Search"},"description":"Fuzzy search customers by name (uses trigram matching)"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CustomerListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/bulk-upload":{"post":{"tags":["customers"],"summary":"Bulk upload customers from CSV","description":"Upload a CSV file to create multiple customers at once. Duplicate emails are skipped. Returns created/skipped counts and per-row errors.","operationId":"bulk_upload_customers_api_v1_customers_bulk_upload_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_bulk_upload_customers_api_v1_customers_bulk_upload_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CustomerBulkUploadResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/bulk-upload/template":{"get":{"tags":["customers"],"summary":"Download bulk customer upload CSV template","description":"Get a sample CSV template with the expected columns for bulk customer upload.","operationId":"download_customer_bulk_upload_template_api_v1_customers_bulk_upload_template_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TemplateResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}":{"get":{"tags":["customers"],"summary":"Get customer","description":"Retrieve a specific customer by their unique ID.","operationId":"get_customer_api_v1_customers__customer_id__get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CustomerResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["customers"],"summary":"Update customer","description":"Update an existing customer's information.","operationId":"update_customer_api_v1_customers__customer_id__put","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CustomerResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["customers"],"summary":"Delete customer","description":"Soft delete a customer record. The customer is marked as deleted and hidden from list endpoints, but remains retrievable by ID so existing references on invoices and other records stay intact.","operationId":"delete_customer_api_v1_customers__customer_id__delete","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/check-duplicates":{"post":{"tags":["customers"],"summary":"Check for duplicate customers","description":"Check if a customer already exists using name, email, tax ID similarity.","operationId":"check_duplicates_api_v1_customers_check_duplicates_post","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","description":"Customer name to check","title":"Name"},"description":"Customer name to check"},{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Email to check","title":"Email"},"description":"Email to check"},{"name":"tax_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Tax ID to check","title":"Tax Id"},"description":"Tax ID to check"},{"name":"exclude_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Customer ID to exclude (for updates)","title":"Exclude Id"},"description":"Customer ID to exclude (for updates)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DuplicateCheckResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/categorize":{"post":{"tags":["customers"],"summary":"AI categorize customer","description":"Use AI to suggest a category for a customer based on their information.","operationId":"categorize_customer_api_v1_customers_categorize_post","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","description":"Customer name","title":"Name"},"description":"Customer name"},{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Customer email","title":"Email"},"description":"Customer email"},{"name":"website","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Customer website","title":"Website"},"description":"Customer website"},{"name":"address","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Customer address","title":"Address"},"description":"Customer address"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CategorizationResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/auto-categorize":{"post":{"tags":["customers"],"summary":"Bulk AI auto-categorize uncategorized customers","description":"Schedule AI categorization for every customer in the business that currently has no category. Returns immediately; the actual LLM calls and DB writes happen in a background task. Refresh the customer list to observe progress.","operationId":"auto_categorize_customers_api_v1_customers_auto_categorize_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CustomerAutoCategorizeResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/contacts":{"get":{"tags":["customers"],"summary":"List customer contacts","description":"Retrieve all contacts for a customer.","operationId":"list_contacts_api_v1_customers__customer_id__contacts_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__SuccessEnvelope_ListContactsResponse___1"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["customers"],"summary":"Create customer contact","description":"Add a new contact to a customer.","operationId":"create_contact_api_v1_customers__customer_id__contacts_post","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityContactCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EntityContactResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/contacts/{contact_id}":{"get":{"tags":["customers"],"summary":"Get customer contact","description":"Retrieve a specific customer contact.","operationId":"get_contact_api_v1_customers__customer_id__contacts__contact_id__get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EntityContactResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["customers"],"summary":"Update customer contact","description":"Update an existing customer contact.","operationId":"update_contact_api_v1_customers__customer_id__contacts__contact_id__put","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityContactUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EntityContactResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["customers"],"summary":"Delete customer contact","description":"Delete a customer contact.","operationId":"delete_contact_api_v1_customers__customer_id__contacts__contact_id__delete","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/analyze-payment-behavior":{"post":{"tags":["customers"],"summary":"AI payment behavior analysis","description":"Get AI-powered customer payment behavior analysis.","operationId":"analyze_payment_behavior_api_v1_customers_analyze_payment_behavior_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AnalyzePaymentBehaviorResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/books/daily-brief":{"get":{"tags":["daily-brief"],"summary":"Books AI Daily Brief","description":"Aggregated home-screen payload for the Books shell. Returns four tiles: categorization, AP drafts, anomalies, close score. Each tile is computed independently and degrades gracefully if its upstream data isn't ready.","operationId":"get_daily_brief_api_v1_books_daily_brief_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetDailyBriefResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/books/standup":{"get":{"tags":["daily-brief"],"summary":"Books AI proactive morning standup","description":"Returns the proactive morning post Books AI would publish into the home shell chat: a greeting, a markdown summary, four highlight KPIs, and a list of action cards with pre-wired endpoints (Draft void, Approve bill, View blockers). The frontend renders this as the first message in the home conversation so the user can act without prompting.","operationId":"get_books_standup_api_v1_books_standup_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetBooksStandupResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/delayed-charges":{"get":{"tags":["delayed-charges"],"summary":"List delayed charges","description":"List all delayed charges for the business with optional filtering.","operationId":"list_delayed_charges_api_v1_delayed_charges_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search delayed charges by description","title":"Search"},"description":"Search delayed charges by description"},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by customer ID","title":"Customer Id"},"description":"Filter by customer ID"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/DelayedChargeStatusEnum"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/DelayedChargeTypeEnum"},{"type":"null"}],"description":"Filter by type","title":"Type"},"description":"Filter by type"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Limit"},"description":"Page size"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DelayedChargesListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["delayed-charges"],"summary":"Create delayed charge","description":"Create a new delayed charge or credit in pending status.","operationId":"create_delayed_charge_api_v1_delayed_charges_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DelayedChargeCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DelayedChargeResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/delayed-charges/{charge_id}":{"get":{"tags":["delayed-charges"],"summary":"Get delayed charge","description":"Get a specific delayed charge by ID.","operationId":"get_delayed_charge_api_v1_delayed_charges__charge_id__get","parameters":[{"name":"charge_id","in":"path","required":true,"schema":{"type":"string","title":"Charge Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DelayedChargeResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["delayed-charges"],"summary":"Update delayed charge","description":"Update a pending delayed charge.","operationId":"update_delayed_charge_api_v1_delayed_charges__charge_id__put","parameters":[{"name":"charge_id","in":"path","required":true,"schema":{"type":"string","title":"Charge Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DelayedChargeUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DelayedChargeResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["delayed-charges"],"summary":"Delete delayed charge","description":"Delete a pending delayed charge.","operationId":"delete_delayed_charge_api_v1_delayed_charges__charge_id__delete","parameters":[{"name":"charge_id","in":"path","required":true,"schema":{"type":"string","title":"Charge Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/delayed-charges/customers/{customer_id}/pending":{"get":{"tags":["delayed-charges"],"summary":"Get customer pending charges","description":"Get pending delayed charges for a specific customer.","operationId":"get_customer_pending_charges_api_v1_delayed_charges_customers__customer_id__pending_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CustomerPendingChargesSummary_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/estimates":{"get":{"tags":["estimates"],"summary":"List estimates","description":"List all estimates for the business with optional filtering.","operationId":"list_estimates_api_v1_estimates_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search estimates by description","title":"Search"},"description":"Search estimates by description"},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by customer ID","title":"Customer Id"},"description":"Filter by customer ID"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/EstimateStatusEnum"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Limit"},"description":"Page size"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EstimatesListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["estimates"],"summary":"Create estimate","description":"Create a new estimate in draft status.","operationId":"create_estimate_api_v1_estimates_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EstimateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/estimates/{estimate_id}":{"get":{"tags":["estimates"],"summary":"Get estimate","description":"Get a specific estimate by ID.","operationId":"get_estimate_api_v1_estimates__estimate_id__get","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EstimateResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["estimates"],"summary":"Update estimate","description":"Update a draft or sent estimate.","operationId":"update_estimate_api_v1_estimates__estimate_id__put","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EstimateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["estimates"],"summary":"Delete estimate","description":"Delete a draft estimate.","operationId":"delete_estimate_api_v1_estimates__estimate_id__delete","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/estimates/{estimate_id}/send":{"post":{"tags":["estimates"],"summary":"Send estimate","description":"Send an estimate to the customer (draft -> sent).","operationId":"send_estimate_api_v1_estimates__estimate_id__send_post","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EstimateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/estimates/{estimate_id}/accept":{"post":{"tags":["estimates"],"summary":"Accept estimate","description":"Accept an estimate (sent -> accepted).","operationId":"accept_estimate_api_v1_estimates__estimate_id__accept_post","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EstimateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/estimates/{estimate_id}/decline":{"post":{"tags":["estimates"],"summary":"Decline estimate","description":"Decline an estimate (sent -> declined).","operationId":"decline_estimate_api_v1_estimates__estimate_id__decline_post","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EstimateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/estimates/{estimate_id}/convert":{"post":{"tags":["estimates"],"summary":"Convert estimate to invoice","description":"Convert an accepted or draft estimate to an invoice.","operationId":"convert_estimate_api_v1_estimates__estimate_id__convert_post","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EstimateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/expense-reports":{"get":{"tags":["expense-reports"],"summary":"List expense reports","description":"List employee expense reports with optional filtering.","operationId":"list_expense_reports_api_v1_expense_reports_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ExpenseReportStatusEnum"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search title, description, or number","title":"Search"},"description":"Search title, description, or number"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ExpenseReportsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["expense-reports"],"summary":"Create expense report","description":"Create a draft expense report with line items.","operationId":"create_expense_report_api_v1_expense_reports_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ExpenseReportDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/expense-reports/{report_id}":{"get":{"tags":["expense-reports"],"summary":"Get expense report","description":"Get a single expense report with line items.","operationId":"get_expense_report_api_v1_expense_reports__report_id__get","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ExpenseReportDetailResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["expense-reports"],"summary":"Update expense report","description":"Update a draft expense report.","operationId":"update_expense_report_api_v1_expense_reports__report_id__put","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ExpenseReportDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["expense-reports"],"summary":"Delete expense report","description":"Delete a draft expense report.","operationId":"delete_expense_report_api_v1_expense_reports__report_id__delete","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/expense-reports/{report_id}/submit":{"post":{"tags":["expense-reports"],"summary":"Submit expense report","description":"Submit a draft expense report for approval.","operationId":"submit_expense_report_api_v1_expense_reports__report_id__submit_post","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ExpenseReportDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/expense-reports/{report_id}/approve":{"post":{"tags":["expense-reports"],"summary":"Approve expense report","description":"Approve a submitted expense report.","operationId":"approve_expense_report_api_v1_expense_reports__report_id__approve_post","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ExpenseReportDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/expense-reports/{report_id}/reimburse":{"post":{"tags":["expense-reports"],"summary":"Reimburse expense report","description":"Mark an approved expense report as reimbursed.","operationId":"reimburse_expense_report_api_v1_expense_reports__report_id__reimburse_post","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ExpenseReportDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-requisitions":{"get":{"tags":["purchase-requisitions"],"summary":"List purchase requisitions","description":"List purchase requisitions with optional filtering.","operationId":"list_purchase_requisitions_api_v1_purchase_requisitions_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/PurchaseRequisitionStatusEnum"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by vendor ID","title":"Vendor Id"},"description":"Filter by vendor ID"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search description or number","title":"Search"},"description":"Search description or number"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PurchaseRequisitionsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["purchase-requisitions"],"summary":"Create purchase requisition","description":"Create a draft purchase requisition with line items.","operationId":"create_purchase_requisition_api_v1_purchase_requisitions_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseRequisitionCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PurchaseRequisitionDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-requisitions/{requisition_id}":{"get":{"tags":["purchase-requisitions"],"summary":"Get purchase requisition","description":"Get a single purchase requisition with line items.","operationId":"get_purchase_requisition_api_v1_purchase_requisitions__requisition_id__get","parameters":[{"name":"requisition_id","in":"path","required":true,"schema":{"type":"string","title":"Requisition Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PurchaseRequisitionDetailResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["purchase-requisitions"],"summary":"Update purchase requisition","description":"Update a draft purchase requisition.","operationId":"update_purchase_requisition_api_v1_purchase_requisitions__requisition_id__put","parameters":[{"name":"requisition_id","in":"path","required":true,"schema":{"type":"string","title":"Requisition Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseRequisitionUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PurchaseRequisitionDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["purchase-requisitions"],"summary":"Delete purchase requisition","description":"Soft-delete a draft purchase requisition.","operationId":"delete_purchase_requisition_api_v1_purchase_requisitions__requisition_id__delete","parameters":[{"name":"requisition_id","in":"path","required":true,"schema":{"type":"string","title":"Requisition Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-requisitions/{requisition_id}/submit":{"post":{"tags":["purchase-requisitions"],"summary":"Submit purchase requisition","description":"Submit a draft requisition for approval.","operationId":"submit_purchase_requisition_api_v1_purchase_requisitions__requisition_id__submit_post","parameters":[{"name":"requisition_id","in":"path","required":true,"schema":{"type":"string","title":"Requisition Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PurchaseRequisitionDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-requisitions/{requisition_id}/approve":{"post":{"tags":["purchase-requisitions"],"summary":"Approve purchase requisition","description":"Approve a submitted purchase requisition.","operationId":"approve_purchase_requisition_api_v1_purchase_requisitions__requisition_id__approve_post","parameters":[{"name":"requisition_id","in":"path","required":true,"schema":{"type":"string","title":"Requisition Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PurchaseRequisitionDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-requisitions/{requisition_id}/reject":{"post":{"tags":["purchase-requisitions"],"summary":"Reject purchase requisition","description":"Reject a submitted purchase requisition.","operationId":"reject_purchase_requisition_api_v1_purchase_requisitions__requisition_id__reject_post","parameters":[{"name":"requisition_id","in":"path","required":true,"schema":{"type":"string","title":"Requisition Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseRequisitionRejectRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PurchaseRequisitionDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-requisitions/{requisition_id}/convert":{"post":{"tags":["purchase-requisitions"],"summary":"Convert purchase requisition","description":"Convert an approved requisition to a purchase order or bill.","operationId":"convert_purchase_requisition_api_v1_purchase_requisitions__requisition_id__convert_post","parameters":[{"name":"requisition_id","in":"path","required":true,"schema":{"type":"string","title":"Requisition Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseRequisitionConvertRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PurchaseRequisitionConvertResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fixed-assets/categories":{"get":{"tags":["fixed-assets"],"summary":"List asset categories","description":"List all asset categories.","operationId":"list_asset_categories_api_v1_fixed_assets_categories_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AssetCategoryListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["fixed-assets"],"summary":"Create asset category","description":"Create a new asset category.\n\n**Request Body:**\n- `name`: Category name, 1-255 chars (required)\n- `description`: Category description, max 1000 chars (optional)\n- `default_useful_life_months`: Default useful life in months, 1-600 (optional, defaults to 60)\n- `default_depreciation_method`: Default depreciation method - straight_line, declining_balance, double_declining, units_of_production (optional, defaults to 'straight_line')\n- `default_salvage_percent`: Default salvage percentage, 0-100 (optional, defaults to 0)\n- `asset_ledger_id`: Ledger ID for asset account (optional)\n- `depreciation_expense_ledger_id`: Ledger ID for depreciation expense (optional)\n- `accumulated_depreciation_ledger_id`: Ledger ID for accumulated depreciation (optional)","operationId":"create_asset_category_api_v1_fixed_assets_categories_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetCategoryCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AssetCategoryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fixed-assets/categories/{category_id}":{"get":{"tags":["fixed-assets"],"summary":"Get asset category","description":"Get a specific asset category.","operationId":"get_asset_category_api_v1_fixed_assets_categories__category_id__get","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AssetCategoryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["fixed-assets"],"summary":"Update asset category","description":"Update an asset category.","operationId":"update_asset_category_api_v1_fixed_assets_categories__category_id__patch","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetCategoryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AssetCategoryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["fixed-assets"],"summary":"Delete asset category","description":"Delete an asset category.","operationId":"delete_asset_category_api_v1_fixed_assets_categories__category_id__delete","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fixed-assets/categories/seed-defaults":{"post":{"tags":["fixed-assets"],"summary":"Seed default categories","description":"Seed default asset categories (Equipment, Vehicles, etc.).","operationId":"seed_default_categories_api_v1_fixed_assets_categories_seed_defaults_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AssetCategoryListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fixed-assets":{"get":{"tags":["fixed-assets"],"summary":"List fixed assets","description":"List all fixed assets.","operationId":"list_fixed_assets_api_v1_fixed_assets_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"category_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by category","title":"Category Id"},"description":"Filter by category"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by asset name","title":"Search"},"description":"Search by asset name"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Limit"},"description":"Page size"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FixedAssetListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["fixed-assets"],"summary":"Create fixed asset","description":"Create a new fixed asset.\n\n**Request Body:**\n- `name`: Asset name, 1-255 chars (required)\n- `purchase_date`: Purchase date in YYYY-MM-DD format (required)\n- `original_cost`: Original cost in cents, must be >= 0 (required)\n- `description`: Asset description (optional)\n- `asset_number`: Asset number, max 50 chars (optional)\n- `serial_number`: Serial number, max 100 chars (optional)\n- `salvage_value`: Salvage value in cents, must be >= 0 and < original_cost (optional, defaults to 0)\n- `useful_life_months`: Useful life in months, 1-600 (optional, defaults to 60)\n- `depreciation_method`: Depreciation method - straight_line, declining_balance, double_declining, units_of_production (optional, defaults to 'straight_line')\n- `location`: Asset location, max 255 chars (optional)\n- `notes`: Additional notes (optional)\n- `category_id`: Asset category UUID (optional)\n- `vendor_id`: Vendor UUID (optional)\n- `in_service_date`: Date asset was placed in service, YYYY-MM-DD format (optional)\n- `total_expected_units`: Total expected units for units_of_production method, must be >= 1 (optional)","operationId":"create_fixed_asset_api_v1_fixed_assets_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FixedAssetCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FixedAssetResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fixed-assets/{asset_id}":{"get":{"tags":["fixed-assets"],"summary":"Get fixed asset","description":"Get a specific fixed asset.","operationId":"get_fixed_asset_api_v1_fixed_assets__asset_id__get","parameters":[{"name":"asset_id","in":"path","required":true,"schema":{"type":"string","title":"Asset Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FixedAssetResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["fixed-assets"],"summary":"Update fixed asset","description":"Update a fixed asset.","operationId":"update_fixed_asset_api_v1_fixed_assets__asset_id__patch","parameters":[{"name":"asset_id","in":"path","required":true,"schema":{"type":"string","title":"Asset Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FixedAssetUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FixedAssetResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["fixed-assets"],"summary":"Delete fixed asset","description":"Delete a fixed asset (only draft assets can be deleted).","operationId":"delete_fixed_asset_api_v1_fixed_assets__asset_id__delete","parameters":[{"name":"asset_id","in":"path","required":true,"schema":{"type":"string","title":"Asset Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fixed-assets/{asset_id}/place-in-service":{"post":{"tags":["fixed-assets"],"summary":"Place asset in service","description":"Place an asset in service to begin depreciation.\n\nThis changes the asset status from 'draft' to 'active' and sets the\nin-service date from which depreciation will be calculated.","operationId":"place_asset_in_service_api_v1_fixed_assets__asset_id__place_in_service_post","parameters":[{"name":"asset_id","in":"path","required":true,"schema":{"type":"string","title":"Asset Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceInServiceRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FixedAssetResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fixed-assets/{asset_id}/dispose":{"post":{"tags":["fixed-assets"],"summary":"Dispose asset","description":"Dispose of an asset (sell, trade, scrap, etc.).\n\nRecords the disposal and calculates any gain or loss on the sale.","operationId":"dispose_asset_api_v1_fixed_assets__asset_id__dispose_post","parameters":[{"name":"asset_id","in":"path","required":true,"schema":{"type":"string","title":"Asset Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisposeAssetRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DisposalResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fixed-assets/{asset_id}/depreciation-schedule":{"get":{"tags":["fixed-assets"],"summary":"Get depreciation schedule","description":"Get the full depreciation schedule for an asset.\n\nShows the expected depreciation for each period over the asset's useful life.","operationId":"get_depreciation_schedule_api_v1_fixed_assets__asset_id__depreciation_schedule_get","parameters":[{"name":"asset_id","in":"path","required":true,"schema":{"type":"string","title":"Asset Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DepreciationScheduleResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fixed-assets/{asset_id}/depreciation-entries":{"get":{"tags":["fixed-assets"],"summary":"Get depreciation entries","description":"Get all depreciation entries for an asset.","operationId":"get_depreciation_entries_api_v1_fixed_assets__asset_id__depreciation_entries_get","parameters":[{"name":"asset_id","in":"path","required":true,"schema":{"type":"string","title":"Asset Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DepreciationEntryListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fixed-assets/depreciation-preview":{"get":{"tags":["fixed-assets"],"summary":"Preview depreciation","description":"Preview the next depreciation run.\n\nShows which assets will be depreciated and the amounts, without actually\ncreating the entries.","operationId":"preview_depreciation_api_v1_fixed_assets_depreciation_preview_get","parameters":[{"name":"period_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Period date (first of month)","title":"Period Date"},"description":"Period date (first of month)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DepreciationPreviewResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fixed-assets/run-depreciation":{"post":{"tags":["fixed-assets"],"summary":"Run depreciation","description":"Run depreciation for a period.\n\nCreates depreciation entries for all active assets (or specified assets)\nfor the given period. Optionally creates journal entries.","operationId":"run_depreciation_api_v1_fixed_assets_run_depreciation_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunDepreciationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RunDepreciationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fixed-assets/suggest-capitalization":{"post":{"tags":["fixed-assets"],"summary":"AI capitalization suggestions","description":"Get AI-powered suggestions for transactions that should be capitalized.","operationId":"suggest_capitalization_api_v1_fixed_assets_suggest_capitalization_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SuggestCapitalizationResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/anomalies":{"get":{"tags":["anomalies"],"summary":"List transaction anomalies","description":"Return the latest pre-computed anomaly scan for the current business. Results are written by background jobs (daily cron & post-sync). Dismissed anomalies are excluded by default.","operationId":"list_anomalies_api_v1_anomalies_get","parameters":[{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by severity: low, medium, high","title":"Severity"},"description":"Filter by severity: low, medium, high"},{"name":"anomaly_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by anomaly type (e.g. duplicate_payment, unusual_amount)","title":"Anomaly Type"},"description":"Filter by anomaly type (e.g. duplicate_payment, unusual_amount)"},{"name":"show_dismissed","in":"query","required":false,"schema":{"type":"boolean","description":"Include previously dismissed anomalies","default":false,"title":"Show Dismissed"},"description":"Include previously dismissed anomalies"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Optional inclusive lower bound for anomaly date window (YYYY-MM-DD).","title":"Start Date"},"description":"Optional inclusive lower bound for anomaly date window (YYYY-MM-DD)."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Optional inclusive upper bound for anomaly date window (YYYY-MM-DD).","title":"End Date"},"description":"Optional inclusive upper bound for anomaly date window (YYYY-MM-DD)."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListAnomaliesResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/anomalies/{fingerprint}":{"get":{"tags":["anomalies"],"summary":"Get anomaly finding detail","description":"Return the hydrated detail for a single anomaly fingerprint, including the recommended_action payload and the evidence rows shown in the side-by-side panel on the AnomaliesPage.","operationId":"get_anomaly_detail_api_v1_anomalies__fingerprint__get","parameters":[{"name":"fingerprint","in":"path","required":true,"schema":{"type":"string","title":"Fingerprint"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetAnomalyDetailResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/anomalies/{fingerprint}/resolve":{"post":{"tags":["anomalies"],"summary":"Execute a recommended action and dismiss the anomaly","description":"Run the `recommended_action` attached to the finding (e.g. Draft void duplicate payments, merge duplicate vendors) and record a `resolved` dismissal in the same call. For void actions the endpoint records the user's intent and stages the dismissal; the actual journal-entry mutation must be confirmed on the transaction itself to keep posting side-effects observable to the audit log.","operationId":"resolve_anomaly_api_v1_anomalies__fingerprint__resolve_post","parameters":[{"name":"fingerprint","in":"path","required":true,"schema":{"type":"string","title":"Fingerprint"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResolveRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ResolveAnomalyResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/anomalies/dismiss":{"post":{"tags":["anomalies"],"summary":"Dismiss an anomaly","description":"Mark a detected anomaly as dismissed with a reason and optional notes.","operationId":"dismiss_anomaly_api_v1_anomalies_dismiss_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__v1__schemas__anomaly__DismissRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DismissAnomalyResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/anomalies/restore":{"post":{"tags":["anomalies"],"summary":"Restore a dismissed anomaly","description":"Remove a dismissal so the anomaly appears in active results again.","operationId":"restore_anomaly_api_v1_anomalies_restore_post","parameters":[{"name":"fingerprint","in":"query","required":true,"schema":{"type":"string","description":"Fingerprint of the anomaly to restore","title":"Fingerprint"},"description":"Fingerprint of the anomaly to restore"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RestoreAnomalyResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/anomalies/dismiss-type":{"post":{"tags":["anomalies"],"summary":"Bulk dismiss all anomalies of a given type","description":"Dismiss every active anomaly matching the specified type in one operation.","operationId":"bulk_dismiss_type_api_v1_anomalies_dismiss_type_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDismissRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkDismissTypeResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/anomalies/dismiss-all":{"post":{"tags":["anomalies"],"summary":"Bulk dismiss all active anomalies","description":"Dismiss every active anomaly in the latest scan for the current business. Used by the notifications inbox when clearing the anomaly topic in bulk.","operationId":"bulk_dismiss_all_api_v1_anomalies_dismiss_all_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDismissAllRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkDismissAllResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/anomalies/dismiss-by-period":{"post":{"tags":["anomalies"],"summary":"Bulk dismiss anomalies in a date range","description":"Dismiss every active anomaly whose date metadata overlaps the given period. Used by the close checklist's 'Dismiss all anomalies' CTA for historical periods that were reviewed offline.","operationId":"bulk_dismiss_by_period_api_v1_anomalies_dismiss_by_period_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDismissByPeriodRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkDismissByPeriodResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/anomalies/rescan":{"post":{"tags":["anomalies"],"summary":"Trigger an on-demand anomaly rescan","description":"Start a Temporal workflow that re-runs the anomaly detection engine for the current business and refreshes the cached scan results. Returns immediately; clients should refetch `GET /anomalies` shortly afterwards. Rate-limited to one rescan per business every 5 minutes.","operationId":"rescan_anomalies_api_v1_anomalies_rescan_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RescanAnomaliesResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"example":{"detail":"Rate limit exceeded"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications":{"get":{"tags":["notifications"],"summary":"List notifications","description":"Get the caller's notification feed across all scopes","operationId":"list_notifications_api_v1_notifications_get","parameters":[{"name":"scope","in":"query","required":false,"schema":{"$ref":"#/components/schemas/NotificationScopeEnum","description":"Scope: 'me' (default), 'business', or 'firm'","default":"me"},"description":"Scope: 'me' (default), 'business', or 'firm'"},{"name":"scope_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required when scope is 'business' or 'firm'","title":"Scope Id"},"description":"Required when scope is 'business' or 'firm'"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NotificationStatusEnum"}},{"type":"null"}],"description":"Filter to one or more statuses","title":"Status"},"description":"Filter to one or more statuses"},{"name":"topic","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NotificationTopicEnum"}},{"type":"null"}],"description":"Filter to one or more topics","title":"Topic"},"description":"Filter to one or more topics"},{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NotificationSeverityEnum"}},{"type":"null"}],"description":"Filter to one or more severities","title":"Severity"},"description":"Filter to one or more severities"},{"name":"include_terminal","in":"query","required":false,"schema":{"type":"boolean","description":"Include resolved + dismissed rows","default":false,"title":"Include Terminal"},"description":"Include resolved + dismissed rows"},{"name":"include_snoozed","in":"query","required":false,"schema":{"type":"boolean","description":"Include snoozed rows whose timer hasn't elapsed","default":false,"title":"Include Snoozed"},"description":"Include snoozed rows whose timer hasn't elapsed"},{"name":"include_live","in":"query","required":false,"schema":{"type":"boolean","description":"Merge live alerts (low cash, plaid stale, etc.) as virtual rows when a business context is available.","default":true,"title":"Include Live"},"description":"Merge live alerts (low cash, plaid stale, etc.) as virtual rows when a business context is available."},{"name":"live_business_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When scope='me', merge live alerts for this specific business id.  Ignored for scope='business' which uses scope_id as the business context.","title":"Live Business Id"},"description":"When scope='me', merge live alerts for this specific business id.  Ignored for scope='business' which uses scope_id as the business context."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Page size","default":50,"title":"Limit"},"description":"Page size"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NotificationListResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/count":{"get":{"tags":["notifications"],"summary":"Notification count","description":"Unread (``new`` only) count for the bell badge by default. Pass ``unread_only=false`` for the legacy open (new + seen) count.","operationId":"open_count_api_v1_notifications_count_get","parameters":[{"name":"scope_business_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional: scope to a single business","title":"Scope Business Id"},"description":"Optional: scope to a single business"},{"name":"business_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Deprecated alias for `scope_business_id`","deprecated":true,"title":"Business Id"},"description":"Deprecated alias for `scope_business_id`","deprecated":true},{"name":"unread_only","in":"query","required":false,"schema":{"type":"boolean","description":"When true (default), count only unread (``new``) rows. When false, count open rows (``new`` + ``seen`` + expired snoozes).","default":true,"title":"Unread Only"},"description":"When true (default), count only unread (``new``) rows. When false, count open rows (``new`` + ``seen`` + expired snoozes)."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NotificationCountResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/topic-counts":{"get":{"tags":["notifications"],"summary":"Per-topic notification counts","description":"Counts grouped by topic for the filter chip row","operationId":"topic_counts_api_v1_notifications_topic_counts_get","parameters":[{"name":"scope_business_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional: scope to a single business","title":"Scope Business Id"},"description":"Optional: scope to a single business"},{"name":"business_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Deprecated alias for `scope_business_id`","deprecated":true,"title":"Business Id"},"description":"Deprecated alias for `scope_business_id`","deprecated":true},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NotificationTopicCountsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/stream":{"get":{"tags":["notifications"],"summary":"Stream notifications (SSE)","description":"Server-Sent Events stream of new notifications for the caller.","operationId":"stream_notifications_api_v1_notifications_stream_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/bulk/seen":{"post":{"tags":["notifications"],"summary":"Bulk mark seen","description":"Mark a batch of notifications as seen.","operationId":"bulk_mark_seen_api_v1_notifications_bulk_seen_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkIdsRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkOpResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/bulk/dismiss":{"post":{"tags":["notifications"],"summary":"Bulk dismiss","description":"Dismiss a batch of notifications.","operationId":"bulk_dismiss_api_v1_notifications_bulk_dismiss_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkIdsRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkOpResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/mark-all-seen":{"post":{"tags":["notifications"],"summary":"Mark all matching notifications seen","description":"Server-authoritative: marks EVERY notification the caller can see that matches the optional scope/topic/severity filters as seen — not just the page the client has loaded.","operationId":"mark_all_seen_api_v1_notifications_mark_all_seen_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkAllRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkOpResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/dismiss-all":{"post":{"tags":["notifications"],"summary":"Dismiss all matching notifications","description":"Server-authoritative: dismisses EVERY open notification the caller can see that matches the optional scope/topic/severity filters (plus matching live alerts) — not just the page the client has loaded.","operationId":"dismiss_all_api_v1_notifications_dismiss_all_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkAllRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkOpResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/{notification_id}":{"get":{"tags":["notifications"],"summary":"Get a single notification","description":"Fetch a notification by ID. Auto-marks 'new' rows as 'seen'.","operationId":"get_notification_api_v1_notifications__notification_id__get","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NotificationResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/{notification_id}/seen":{"post":{"tags":["notifications"],"summary":"Mark notification as seen","description":"Manually mark a notification as seen","operationId":"mark_seen_api_v1_notifications__notification_id__seen_post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NotificationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/{notification_id}/resolve":{"post":{"tags":["notifications"],"summary":"Resolve a notification","description":"Mark resolved (terminal — no further transitions)","operationId":"resolve_api_v1_notifications__notification_id__resolve_post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NotificationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/{notification_id}/dismiss":{"post":{"tags":["notifications"],"summary":"Dismiss a notification","description":"Dismiss (terminal). Virtual notifications use the dismissal table.","operationId":"dismiss_api_v1_notifications__notification_id__dismiss_post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NotificationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/{notification_id}/snooze":{"post":{"tags":["notifications"],"summary":"Snooze a notification","description":"Snooze a notification until a specific timestamp.","operationId":"snooze_api_v1_notifications__notification_id__snooze_post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnoozeRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NotificationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/{notification_id}/pin":{"put":{"tags":["notifications"],"summary":"Pin or unpin a notification","description":"Toggle whether a notification is pinned to the top of the feed.","operationId":"set_pinned_api_v1_notifications__notification_id__pin_put","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPinnedRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NotificationResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intents/route":{"post":{"tags":["intents"],"summary":"Route user intent","description":"Classify a Command-K query and return the appropriate action.","operationId":"route_intent_api_v1_intents_route_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_IntentResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/preferences/notifications/topics":{"get":{"tags":["notification-preferences"],"summary":"Get Topic Overrides Endpoint","description":"Return the per-topic channel overrides for the current user.","operationId":"get_topic_overrides_endpoint_api_v1_preferences_notifications_topics_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TopicChannelOverridesResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["notification-preferences"],"summary":"Update Topic Overrides Endpoint","description":"Replace the per-topic channel override map for the current user.\n\nValidation is permissive: unknown topics or unknown channels\nare silently dropped by ``extract_topic_overrides`` rather\nthan rejected, so a forward-compatible client (e.g. one that\nknows about a topic the server hasn't deployed yet) won't\nbreak the save.","operationId":"update_topic_overrides_endpoint_api_v1_preferences_notifications_topics_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopicChannelOverridesUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TopicChannelOverridesResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invitations/{token}/preview":{"get":{"tags":["invitations"],"summary":"Preview invitation details (public)","description":"Returns non-sensitive invitation details for rendering the invite signup page. No authentication required -- the token itself is the proof.","operationId":"preview_invitation_api_v1_invitations__token__preview_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvitationPreviewResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invitations/{token}/accept":{"post":{"tags":["invitations"],"summary":"Accept a pending invitation","description":"Process a pending invitation for the authenticated user. Adds the user to the firm (and grants business access for client invitations) then marks the invitation as accepted. Idempotent: returns success if already accepted.","operationId":"accept_invitation_api_v1_invitations__token__accept_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AcceptInvitationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices":{"post":{"tags":["invoices"],"summary":"Create invoice","description":"Create a new invoice for a customer. Optionally include 'recurring' config to also create a recurring template.","operationId":"create_invoice_api_v1_invoices_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["invoices"],"summary":"List invoices","description":"Retrieve invoices with optional filtering by customer, product, or status.","operationId":"get_invoices_api_v1_invoices_get","parameters":[{"name":"id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by specific invoice UUID","title":"Id"},"description":"Filter by specific invoice UUID"},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by customer UUID","title":"Customer Id"},"description":"Filter by customer UUID"},{"name":"product_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by product UUID","title":"Product Id"},"description":"Filter by product UUID"},{"name":"variant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by variant UUID","title":"Variant Id"},"description":"Filter by variant UUID"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by status. Supports repeated params (?status=open&status=partially-paid) or bracket notation (?status[]=open&status[]=partially-paid).","title":"Status"},"description":"Filter by status. Supports repeated params (?status=open&status=partially-paid) or bracket notation (?status[]=open&status[]=partially-paid)."},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search invoices by number, description, or customer name (case-insensitive partial match)","title":"Search"},"description":"Search invoices by number, description, or customer name (case-insensitive partial match)"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/ai-create":{"post":{"tags":["invoices"],"summary":"AI-extract draft invoices from documents","description":"Upload pasted text, PDFs, images, Excel files, or a CSV to extract draft invoice entities using AI. Returns draft invoices ready for user review before creation.","operationId":"ai_create_invoice_payload_api_v1_invoices_ai_create_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceAICreatePayloadRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceAICreatePayloadResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/bulk":{"post":{"tags":["invoices"],"summary":"Bulk create invoices","description":"Create multiple invoices from CSV data in a single request.","operationId":"create_bulk_invoices_api_v1_invoices_bulk_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceBulkRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceListResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["invoices"],"summary":"List all invoices (bulk)","description":"Retrieve all invoices with efficient cursor-based pagination.","operationId":"get_bulk_invoices_api_v1_invoices_bulk_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/batch":{"post":{"tags":["invoices"],"summary":"Batch create invoices","description":"Create invoices for multiple customers in one action, optionally sweeping delayed charges.","operationId":"create_batch_invoices_api_v1_invoices_batch_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchInvoiceRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreateBatchInvoicesResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/metrics":{"get":{"tags":["invoices"],"summary":"Get invoice metrics","description":"Retrieve aggregated invoice metrics for the business: total outstanding and total overdue across all open invoices.","operationId":"get_invoice_metrics_api_v1_invoices_metrics_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceMetricsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/aging":{"get":{"tags":["invoices"],"summary":"AR aging summary","description":"Returns accounts receivable aging data grouped by customer with Current, 1-30, 31-60, 61-90, and 91+ day buckets. Includes per-invoice detail for drill-down.","operationId":"get_invoice_aging_api_v1_invoices_aging_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceAgingResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/collections":{"get":{"tags":["invoices"],"summary":"AR collections dashboard","description":"Returns overdue invoices plus AR collection workflow run history and recorded collection reminder emails when present in the database.","operationId":"get_invoice_collections_api_v1_invoices_collections_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceCollectionsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/cash-receipts":{"get":{"tags":["invoices"],"summary":"Weekly cash receipts reconciliation","description":"Returns a weekly breakdown of cash received (bank deposits) versus amounts applied to invoices and bills. Highlights unapplied deposits to aid reconciliation.","operationId":"get_cash_receipts_api_v1_invoices_cash_receipts_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Report start date (YYYY-MM-DD). Default: 12 weeks ago.","title":"Start Date"},"description":"Report start date (YYYY-MM-DD). Default: 12 weeks ago."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Report end date (YYYY-MM-DD). Default: today.","title":"End Date"},"description":"Report end date (YYYY-MM-DD). Default: today."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CashReceiptsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/cash-receipts/week-detail":{"get":{"tags":["invoices"],"summary":"Cash receipts week detail","description":"Returns individual deposit transactions for a given week, including which invoices and bills each deposit was applied to.","operationId":"get_cash_receipts_week_detail_api_v1_invoices_cash_receipts_week_detail_get","parameters":[{"name":"week_start","in":"query","required":true,"schema":{"type":"string","description":"Monday of the target week (YYYY-MM-DD).","title":"Week Start"},"description":"Monday of the target week (YYYY-MM-DD)."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_WeekDetailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/cash-receipts/dismiss":{"post":{"tags":["invoices"],"summary":"Dismiss a transaction from cash receipts","description":"Mark a bank transaction as not a customer deposit so it is excluded from the Cash Receipts Reconciliation totals and weekly breakdown.","operationId":"dismiss_cash_receipt_api_v1_invoices_cash_receipts_dismiss_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashReceiptDismissRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CashReceiptDismissResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/cash-receipts/restore":{"post":{"tags":["invoices"],"summary":"Restore a dismissed cash receipt","description":"Un-dismiss a transaction so it reappears in the Cash Receipts Reconciliation report and totals.","operationId":"restore_cash_receipt_api_v1_invoices_cash_receipts_restore_post","parameters":[{"name":"transaction_id","in":"query","required":true,"schema":{"type":"string","description":"UUID of the transaction to restore.","title":"Transaction Id"},"description":"UUID of the transaction to restore."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CashReceiptDismissResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/match":{"post":{"tags":["invoices"],"summary":"Trigger payment matching","description":"Run the payment matching engine to find likely bank transactions for open invoices. When auto_match is true, high-confidence matches (>= 0.85) are auto-linked; otherwise all matches are surfaced as suggestions.","operationId":"trigger_matching_api_v1_invoices_match_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/MatchTriggerRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_MatchTriggerResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/suggestions":{"get":{"tags":["invoices"],"summary":"List payment suggestions","description":"List auto-detected payment match suggestions for the business.","operationId":"list_suggestions_api_v1_invoices_suggestions_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: pending, accepted, rejected, expired","default":"pending","title":"Status"},"description":"Filter by status: pending, accepted, rejected, expired"},{"name":"min_confidence","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"description":"Minimum confidence","title":"Min Confidence"},"description":"Minimum confidence"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max results","default":100,"title":"Limit"},"description":"Max results"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListSuggestionsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/suggestions/{suggestion_id}/accept":{"post":{"tags":["invoices"],"summary":"Accept payment suggestion","description":"Accept an auto-detected payment suggestion. Creates an InvoicePayment record and updates the invoice status.","operationId":"accept_suggestion_api_v1_invoices_suggestions__suggestion_id__accept_post","parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Suggestion Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoicePaymentResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/suggestions/{suggestion_id}/reject":{"post":{"tags":["invoices"],"summary":"Reject payment suggestion","description":"Dismiss an auto-detected payment suggestion.","operationId":"reject_suggestion_api_v1_invoices_suggestions__suggestion_id__reject_post","parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Suggestion Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RejectSuggestionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/deposit-candidates":{"get":{"tags":["invoices"],"summary":"List deposit candidates","description":"Return income transactions that may represent customer deposits. Filters to posted income transactions with unallocated balances, useful for the AI deposit sidebar on the invoices page.","operationId":"list_deposit_candidates_api_v1_invoices_deposit_candidates_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max results","default":50,"title":"Limit"},"description":"Max results"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListDepositCandidatesResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}":{"get":{"tags":["invoices"],"summary":"Get invoice","description":"Retrieve a specific invoice with all details and line items.","operationId":"get_invoice_api_v1_invoices__invoice_id__get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}},"put":{"tags":["invoices"],"summary":"Update invoice","description":"Update invoice details. Optionally include 'recurring' config to create a recurring template.","operationId":"update_invoice_api_v1_invoices__invoice_id__put","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}},"delete":{"tags":["invoices"],"summary":"Delete invoice","description":"Permanently delete a draft invoice.","operationId":"delete_invoice_api_v1_invoices__invoice_id__delete","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}/payment-link":{"get":{"tags":["invoices"],"summary":"Get invoice payment link","description":"Return the Stripe-hosted payment link for an invoice so it can be paid online. Read-only — available once the invoice has been finalized/sent.","operationId":"get_invoice_payment_link_api_v1_invoices__invoice_id__payment_link_get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoicePaymentLinkResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}/void":{"put":{"tags":["invoices"],"summary":"Void invoice","description":"Cancel an invoice by setting its status to void.","operationId":"void_invoice_api_v1_invoices__invoice_id__void_put","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}/uncollectible":{"put":{"tags":["invoices"],"summary":"Mark invoice uncollectible","description":"Write off an invoice's remaining balance as bad debt.","operationId":"mark_invoice_uncollectible_api_v1_invoices__invoice_id__uncollectible_put","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}/finalize":{"put":{"tags":["invoices"],"summary":"Finalize invoice","description":"Lock an invoice and change status from draft to pending.","operationId":"finalize_invoice_api_v1_invoices__invoice_id__finalize_put","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}/journal-entry":{"post":{"tags":["invoices"],"summary":"Generate invoice journal entry","description":"Create the finalization journal entry for an invoice that has none linked.","operationId":"generate_invoice_journal_entry_api_v1_invoices__invoice_id__journal_entry_post","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}/journal-entry/link":{"post":{"tags":["invoices"],"summary":"Attach journal entry to invoice","description":"Link an existing journal entry to an invoice.","operationId":"attach_journal_entry_to_invoice_api_v1_invoices__invoice_id__journal_entry_link_post","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryLinkRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}/paid":{"put":{"tags":["invoices"],"summary":"Mark Invoice Paid","description":"Mark an invoice as paid.","operationId":"mark_invoice_paid_api_v1_invoices__invoice_id__paid_put","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}/delivered":{"put":{"tags":["invoices"],"summary":"Mark Invoice Delivered","description":"Mark an invoice as delivered to the customer.","operationId":"mark_invoice_delivered_api_v1_invoices__invoice_id__delivered_put","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"delivered_on","in":"query","required":true,"schema":{"type":"string","description":"Delivered date (ISO 8601 format: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ)","title":"Delivered On"},"description":"Delivered date (ISO 8601 format: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}/payments":{"post":{"tags":["invoices"],"summary":"Add payment to invoice","description":"Link a bank transaction as payment against an invoice. Supports split payments (one transaction paying multiple invoices) and partial payments (multiple transactions paying one invoice).","operationId":"create_invoice_payment_api_v1_invoices__invoice_id__payments_post","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePaymentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoicePaymentResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["invoices"],"summary":"List invoice payments","description":"Retrieve all payment records for a specific invoice.","operationId":"list_invoice_payments_api_v1_invoices__invoice_id__payments_get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListInvoicePaymentsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}/payments/{payment_id}":{"patch":{"tags":["invoices"],"summary":"Update payment on invoice","description":"Edit the amount or date of an existing payment record.","operationId":"update_invoice_payment_api_v1_invoices__invoice_id__payments__payment_id__patch","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Payment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePaymentUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoicePaymentResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["invoices"],"summary":"Remove payment from invoice","description":"Un-link a payment record from an invoice and recalculate status.","operationId":"delete_invoice_payment_api_v1_invoices__invoice_id__payments__payment_id__delete","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Payment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}/pdf":{"get":{"tags":["invoices"],"summary":"Get fresh invoice PDF URL","description":"Get a fresh PDF download URL for this invoice from Stripe. URLs expire, so call this when you need to download.","operationId":"get_invoice_pdf_url_api_v1_invoices__invoice_id__pdf_get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetInvoicePdfUrlResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}/send":{"post":{"tags":["invoices"],"summary":"Send invoice via email","description":"Send an invoice to the customer via email. Optionally attach the PDF and CC the sender.","operationId":"send_invoice_email_api_v1_invoices__invoice_id__send_post","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InvoiceSendEmailRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InvoiceSendEmailResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}/suggestions":{"get":{"tags":["invoices"],"summary":"List suggestions for invoice","description":"List auto-detected payment match suggestions for a specific invoice.","operationId":"list_invoice_suggestions_api_v1_invoices__invoice_id__suggestions_get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","default":"pending","title":"Status"},"description":"Filter by status"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListInvoiceSuggestionsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/payments":{"get":{"tags":["inventory:payments"],"summary":"List inventory payments","description":"Retrieve payments made to vendors for inventory orders.","operationId":"get_payments_api_v1_inventory_payments_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PaymentListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/products":{"post":{"tags":["inventory:products"],"summary":"Create product","description":"Create a new product for the specified business. A connected Stripe account is **not** required; Stripe Catalog sync happens later when variants are added with Stripe connected.","operationId":"create_product_api_v1_inventory_products_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ProductResponse_"}}}},"400":{"description":"Bad request - invalid data"},"404":{"description":"Business not found"},"409":{"description":"Product with same identifier already exists"},"422":{"description":"Validation error"}}},"get":{"tags":["inventory:products"],"summary":"List products","description":"Retrieve all products with optional filtering and pagination.","operationId":"list_products_api_v1_inventory_products_get","parameters":[{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by product type ('manual' or 'shopify')","title":"Type"},"description":"Filter by product type ('manual' or 'shopify')"},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by category (e.g. 'Finished Goods', 'Ingredients', 'Packaging')","title":"Category"},"description":"Filter by category (e.g. 'Finished Goods', 'Ingredients', 'Packaging')"},{"name":"include_variants","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether to include variant details","default":false,"title":"Include Variants"},"description":"Whether to include variant details"},{"name":"archived","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by archived status (true/false/null for all)","title":"Archived"},"description":"Filter by archived status (true/false/null for all)"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"Fuzzy search term (trigram-similarity matching against the entity's primary text columns). Trimmed; ignored when blank.","title":"Search"},"description":"Fuzzy search term (trigram-similarity matching against the entity's primary text columns). Trimmed; ignored when blank."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ProductsListResponse_"}}}},"404":{"description":"Business not found"},"422":{"description":"Invalid query parameters"}}}},"/api/v1/inventory/products/variants":{"post":{"tags":["inventory:products"],"summary":"Create product variant","description":"Create a new product variant. When the business has Stripe connected, the variant is mirrored to Stripe Catalog (Product + Price); otherwise the variant is created locally with empty Stripe IDs and can be synced later.","operationId":"create_variant_api_v1_inventory_products_variants_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VariantResponse_"}}}},"400":{"description":"Bad request - invalid data"},"404":{"description":"Business or product not found"},"409":{"description":"Variant with same SKU already exists"},"422":{"description":"Validation error"}}},"get":{"tags":["inventory:products"],"summary":"List product variants","description":"Retrieve all variants with optional filtering by product.","operationId":"list_variants_api_v1_inventory_products_variants_get","parameters":[{"name":"product_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by parent product ID","title":"Product Id"},"description":"Filter by parent product ID"},{"name":"archived","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by archived status","title":"Archived"},"description":"Filter by archived status"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VariantsListResponse_"}}}},"404":{"description":"Business not found"},"422":{"description":"Invalid query parameters"}}}},"/api/v1/inventory/products/unit-costs/export":{"get":{"tags":["inventory:products"],"summary":"Export unit costs CSV","description":"Download a CSV of active variants with current unit costs. Edit the new_unit_cost column and re-upload via the bulk update flow.","operationId":"export_unit_costs_csv_api_v1_inventory_products_unit_costs_export_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/products/unit-costs/preview":{"post":{"tags":["inventory:products"],"summary":"Preview unit cost bulk update","description":"Validate parsed CSV rows and preview cost changes before applying.","operationId":"preview_unit_cost_bulk_update_api_v1_inventory_products_unit_costs_preview_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitCostBulkPreviewRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UnitCostBulkPreviewResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/products/unit-costs/apply":{"post":{"tags":["inventory:products"],"summary":"Apply unit cost bulk update","description":"Apply confirmed unit-cost updates from a validated CSV upload.","operationId":"apply_unit_cost_bulk_update_api_v1_inventory_products_unit_costs_apply_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitCostBulkApplyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UnitCostBulkApplyResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/products/variants/{id}":{"get":{"tags":["inventory:products"],"summary":"Get product variant","description":"Retrieve a specific variant by ID.","operationId":"get_variant_api_v1_inventory_products_variants__id__get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VariantResponse_"}}}},"404":{"description":"Business or variant not found"},"422":{"description":"Invalid variant ID"}}},"put":{"tags":["inventory:products"],"summary":"Update product variant","description":"Update an existing variant.","operationId":"update_variant_api_v1_inventory_products_variants__id__put","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VariantResponse_"}}}},"400":{"description":"Bad request - invalid data"},"404":{"description":"Business or variant not found"},"422":{"description":"Validation error"}}},"delete":{"tags":["inventory:products"],"summary":"Delete product variant","description":"Delete or archive a variant.","operationId":"delete_variant_api_v1_inventory_products_variants__id__delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"product_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/products/lookup":{"get":{"tags":["inventory:products"],"summary":"Lookup variant by barcode or SKU","description":"Resolve a single variant by a scannable identifier. Tries barcode first, then falls back to SKU. Used by receiving, cycle counting, and point-of-sale flows.","operationId":"lookup_variant_api_v1_inventory_products_lookup_get","parameters":[{"name":"barcode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Scannable barcode (UPC/EAN/QR).","title":"Barcode"},"description":"Scannable barcode (UPC/EAN/QR)."},{"name":"sku","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Stock Keeping Unit fallback.","title":"Sku"},"description":"Stock Keeping Unit fallback."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VariantResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/products/variants/{id}/location-quantities":{"put":{"tags":["inventory:products"],"summary":"Set variant location opening quantities","description":"Set absolute on-hand quantities for this variant at each location without creating inventory adjustment journal entries.","operationId":"set_variant_location_quantities_api_v1_inventory_products_variants__id__location_quantities_put","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetVariantLocationQuantitiesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VariantResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/products/variants/{variant_id}/locations/{location_id}/reorder-settings":{"patch":{"tags":["inventory:products"],"summary":"Update variant reorder settings at a location","description":"Set or clear the per-location reorder point and reorder quantity for a variant.","operationId":"update_reorder_settings_api_v1_inventory_products_variants__variant_id__locations__location_id__reorder_settings_patch","parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Variant Id"}},{"name":"location_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReorderSettingsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ReorderSettingsResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/products/{id}":{"get":{"tags":["inventory:products"],"summary":"Get product","description":"Retrieve a specific product by ID.","operationId":"get_product_api_v1_inventory_products__id__get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"include_variants","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether to include variant details","default":false,"title":"Include Variants"},"description":"Whether to include variant details"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ProductResponse_"}}}},"404":{"description":"Business or product not found"},"422":{"description":"Invalid product ID"}}},"put":{"tags":["inventory:products"],"summary":"Update product","description":"Update an existing product.","operationId":"update_product_api_v1_inventory_products__id__put","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"include_variants","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether to include variant details","default":false,"title":"Include Variants"},"description":"Whether to include variant details"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ProductResponse_"}}}},"400":{"description":"Bad request - invalid data"},"404":{"description":"Business or product not found"},"422":{"description":"Validation error"}}},"delete":{"tags":["inventory:products"],"summary":"Delete product","description":"Delete or archive a product.","operationId":"delete_product_api_v1_inventory_products__id__delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/products/{id}/convert-to-variant":{"post":{"tags":["inventory:products"],"summary":"Convert product to variant","description":"Move a product's variants under another product and archive the source.","operationId":"convert_product_to_variant_api_v1_inventory_products__id__convert_to_variant_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertProductToVariantRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ConvertProductToVariantResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/shipments":{"get":{"tags":["inventory:shipments"],"summary":"List shipments","description":"Retrieve all shipments for inventory orders.","operationId":"get_shipments_api_v1_inventory_shipments_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ShipmentListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["inventory:shipments"],"summary":"Create shipment","description":"Record a received shipment and update inventory.","operationId":"create_shipment_api_v1_inventory_shipments_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ShipmentResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/shipments/{id}":{"get":{"tags":["inventory:shipments"],"summary":"Get shipment","description":"Retrieve a specific shipment with line items.","operationId":"get_shipment_api_v1_inventory_shipments__id__get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ShipmentResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["inventory:shipments"],"summary":"Delete shipment","description":"Delete a shipment record.","operationId":"delete_shipment_api_v1_inventory_shipments__id__delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["inventory:shipments"],"summary":"Update shipment","description":"Update a shipment's details.","operationId":"update_shipment_api_v1_inventory_shipments__id__put","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ShipmentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/adjustments":{"post":{"tags":["inventory:adjustments"],"summary":"Create manual inventory adjustment","description":"Create a manual inventory adjustment for a variant at a specific location. If no location is specified, the adjustment is applied to the default location.","operationId":"create_inventory_adjustment_api_v1_inventory_adjustments_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryAdjustmentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InventoryAdjustmentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/locations":{"get":{"tags":["inventory:locations"],"summary":"List inventory locations","description":"List all inventory locations for the business with optional filtering.","operationId":"list_locations_api_v1_inventory_locations_get","parameters":[{"name":"location_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/LocationTypeEnum"},{"type":"null"}],"description":"Filter by location type","title":"Location Type"},"description":"Filter by location type"},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","description":"Include archived locations","default":false,"title":"Include Archived"},"description":"Include archived locations"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Limit"},"description":"Page size"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Include total count","default":false,"title":"Include Total Count"},"description":"Include total count"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LocationListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["inventory:locations"],"summary":"Create location","description":"Create a new inventory location.","operationId":"create_location_api_v1_inventory_locations_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LocationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/locations/default":{"get":{"tags":["inventory:locations"],"summary":"Get default location","description":"Get the default location for the business.","operationId":"get_default_location_api_v1_inventory_locations_default_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LocationResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/locations/{location_id}":{"get":{"tags":["inventory:locations"],"summary":"Get location","description":"Get a specific location by ID.","operationId":"get_location_api_v1_inventory_locations__location_id__get","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LocationResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["inventory:locations"],"summary":"Update location","description":"Update an existing location.","operationId":"update_location_api_v1_inventory_locations__location_id__put","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LocationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["inventory:locations"],"summary":"Delete location","description":"Delete a location. Cannot delete if it has inventory or is the default.","operationId":"delete_location_api_v1_inventory_locations__location_id__delete","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/locations/{location_id}/archive":{"post":{"tags":["inventory:locations"],"summary":"Archive location","description":"Archive a location (soft delete). Cannot archive the default location.","operationId":"archive_location_api_v1_inventory_locations__location_id__archive_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LocationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/locations/{location_id}/set-default":{"post":{"tags":["inventory:locations"],"summary":"Set as default location","description":"Set a location as the default for new inventory.","operationId":"set_default_location_api_v1_inventory_locations__location_id__set_default_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LocationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/locations/{location_id}/inventory":{"get":{"tags":["inventory:locations"],"summary":"Get inventory at location","description":"Get all inventory levels at a specific location.","operationId":"get_location_inventory_api_v1_inventory_locations__location_id__inventory_get","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Limit"},"description":"Page size"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetLocationInventoryResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/locations/{location_id}/summary":{"get":{"tags":["inventory:locations"],"summary":"Get location inventory summary","description":"Get summary of inventory at a location.","operationId":"get_location_summary_api_v1_inventory_locations__location_id__summary_get","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LocationInventorySummary_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/transfers":{"get":{"tags":["inventory:transfers"],"summary":"List inventory transfers","description":"List all inventory transfers for the business with optional filtering.","operationId":"list_transfers_api_v1_inventory_transfers_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/TransferStatusEnum"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"from_location_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by source location","title":"From Location Id"},"description":"Filter by source location"},{"name":"to_location_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by destination location","title":"To Location Id"},"description":"Filter by destination location"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search transfer number, locations, tracking, carrier, or notes","title":"Search"},"description":"Search transfer number, locations, tracking, carrier, or notes"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransferListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["inventory:transfers"],"summary":"Create transfer","description":"Create a new inventory transfer between locations.","operationId":"create_transfer_api_v1_inventory_transfers_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransferResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/transfers/in-transit":{"get":{"tags":["inventory:transfers"],"summary":"List in-transit transfers","description":"Get all transfers currently in transit with cursor-based pagination.","operationId":"list_in_transit_transfers_api_v1_inventory_transfers_in_transit_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search transfer number, locations, tracking, carrier, or notes","title":"Search"},"description":"Search transfer number, locations, tracking, carrier, or notes"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransferListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/transfers/pending":{"get":{"tags":["inventory:transfers"],"summary":"List pending transfers","description":"Get all draft and pending transfers awaiting shipment with cursor-based pagination.","operationId":"list_pending_transfers_api_v1_inventory_transfers_pending_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search transfer number, locations, tracking, carrier, or notes","title":"Search"},"description":"Search transfer number, locations, tracking, carrier, or notes"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransferListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/transfers/summary":{"get":{"tags":["inventory:transfers"],"summary":"Get transfer summary","description":"Get summary of transfers by status and in-transit inventory.","operationId":"get_transfer_summary_api_v1_inventory_transfers_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetTransferSummaryResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/transfers/{transfer_id}":{"get":{"tags":["inventory:transfers"],"summary":"Get transfer","description":"Get a specific transfer by ID.","operationId":"get_transfer_api_v1_inventory_transfers__transfer_id__get","parameters":[{"name":"transfer_id","in":"path","required":true,"schema":{"type":"string","title":"Transfer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransferResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["inventory:transfers"],"summary":"Update transfer","description":"Update an existing transfer. Only draft/pending transfers can be updated.","operationId":"update_transfer_api_v1_inventory_transfers__transfer_id__put","parameters":[{"name":"transfer_id","in":"path","required":true,"schema":{"type":"string","title":"Transfer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransferResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["inventory:transfers"],"summary":"Delete transfer","description":"Delete a transfer. Only draft/pending transfers can be deleted.","operationId":"delete_transfer_api_v1_inventory_transfers__transfer_id__delete","parameters":[{"name":"transfer_id","in":"path","required":true,"schema":{"type":"string","title":"Transfer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/transfers/{transfer_id}/ship":{"post":{"tags":["inventory:transfers"],"summary":"Ship transfer","description":"Mark transfer as shipped (in-transit). Deducts inventory from source location.","operationId":"ship_transfer_api_v1_inventory_transfers__transfer_id__ship_post","parameters":[{"name":"transfer_id","in":"path","required":true,"schema":{"type":"string","title":"Transfer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferShipRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransferResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/transfers/{transfer_id}/receive":{"post":{"tags":["inventory:transfers"],"summary":"Receive transfer","description":"Mark transfer as received. Adds inventory to destination location.","operationId":"receive_transfer_api_v1_inventory_transfers__transfer_id__receive_post","parameters":[{"name":"transfer_id","in":"path","required":true,"schema":{"type":"string","title":"Transfer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferReceiveRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransferResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/transfers/{transfer_id}/cancel":{"post":{"tags":["inventory:transfers"],"summary":"Cancel transfer","description":"Cancel a transfer. Reverses inventory changes if already shipped.","operationId":"cancel_transfer_api_v1_inventory_transfers__transfer_id__cancel_post","parameters":[{"name":"transfer_id","in":"path","required":true,"schema":{"type":"string","title":"Transfer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferCancelRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransferResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/transfers/{transfer_id}/items":{"post":{"tags":["inventory:transfers"],"summary":"Add item to transfer","description":"Add an item to an existing transfer. Only works for draft/pending transfers.","operationId":"add_transfer_item_api_v1_inventory_transfers__transfer_id__items_post","parameters":[{"name":"transfer_id","in":"path","required":true,"schema":{"type":"string","title":"Transfer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferItemAddRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransferResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/transfers/{transfer_id}/items/{item_id}":{"delete":{"tags":["inventory:transfers"],"summary":"Remove item from transfer","description":"Remove an item from a transfer. Only works for draft/pending transfers.","operationId":"remove_transfer_item_api_v1_inventory_transfers__transfer_id__items__item_id__delete","parameters":[{"name":"transfer_id","in":"path","required":true,"schema":{"type":"string","title":"Transfer Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransferResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/production/recipes":{"post":{"tags":["inventory:production"],"summary":"Create recipe","description":"Create a new production recipe with materials, output variants, and processing steps.","operationId":"create_recipe_api_v1_inventory_production_recipes_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecipeResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}},"get":{"tags":["inventory:production"],"summary":"List recipes","description":"List production recipes for the business.","operationId":"list_recipes_api_v1_inventory_production_recipes_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecipeListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/production/recipes/{recipe_id}":{"get":{"tags":["inventory:production"],"summary":"Get recipe","description":"Get a production recipe with all children.","operationId":"get_recipe_api_v1_inventory_production_recipes__recipe_id__get","parameters":[{"name":"recipe_id","in":"path","required":true,"schema":{"type":"string","title":"Recipe Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecipeResponse_"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["inventory:production"],"summary":"Update recipe","description":"Update a production recipe.  Children are replaced if provided.","operationId":"update_recipe_api_v1_inventory_production_recipes__recipe_id__put","parameters":[{"name":"recipe_id","in":"path","required":true,"schema":{"type":"string","title":"Recipe Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecipeResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}},"delete":{"tags":["inventory:production"],"summary":"Delete recipe","description":"Soft-delete a production recipe.","operationId":"delete_recipe_api_v1_inventory_production_recipes__recipe_id__delete","parameters":[{"name":"recipe_id","in":"path","required":true,"schema":{"type":"string","title":"Recipe Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/production/recipes/{recipe_id}/duplicate":{"post":{"tags":["inventory:production"],"summary":"Duplicate recipe","description":"Deep-clone a recipe and all its children.","operationId":"duplicate_recipe_api_v1_inventory_production_recipes__recipe_id__duplicate_post","parameters":[{"name":"recipe_id","in":"path","required":true,"schema":{"type":"string","title":"Recipe Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecipeResponse_"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/production/runs":{"post":{"tags":["inventory:production"],"summary":"Create production run","description":"Create a new production run from a recipe.  Costs are computed immediately.","operationId":"create_run_api_v1_inventory_production_runs_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RunResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}},"get":{"tags":["inventory:production"],"summary":"List production runs","description":"List production runs for the business.","operationId":"list_runs_api_v1_inventory_production_runs_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RunListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/production/runs/{run_id}":{"get":{"tags":["inventory:production"],"summary":"Get production run","description":"Get a production run with its cost breakdown.","operationId":"get_run_api_v1_inventory_production_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RunResponse_"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["inventory:production"],"summary":"Update production run","description":"Update run parameters and recalculate costs.","operationId":"update_run_api_v1_inventory_production_runs__run_id__put","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RunResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/production/runs/{run_id}/calculate":{"post":{"tags":["inventory:production"],"summary":"What-if calculation","description":"Recalculate costs without persisting.  Override total_units and/or unit_sale_price.","operationId":"calculate_run_api_v1_inventory_production_runs__run_id__calculate_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCalculateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CostBreakdown_"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/production/runs/{run_id}/complete":{"post":{"tags":["inventory:production"],"summary":"Complete production run","description":"Mark a run as completed.","operationId":"complete_run_api_v1_inventory_production_runs__run_id__complete_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RunResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/import/analyze":{"post":{"tags":["inventory:import"],"summary":"Analyze spreadsheet (async)","description":"Upload an Excel or CSV file. Returns a task_id immediately; the AI analysis runs in the background. Poll GET /analyze/{task_id} for the result.","operationId":"analyze_spreadsheet_api_v1_inventory_import_analyze_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_analyze_spreadsheet_api_v1_inventory_import_analyze_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AnalyzeTaskResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/import/analyze/{task_id}":{"get":{"tags":["inventory:import"],"summary":"Poll analysis status","description":"Returns 'pending', 'completed' (with result), or 'failed'.","operationId":"get_analyze_status_api_v1_inventory_import_analyze__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AnalyzeStatusResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/import/preview":{"post":{"tags":["inventory:import"],"summary":"Preview import","description":"After reviewing the AI analysis, confirm column mappings and sheet selections. Returns a full preview of locations, products, and inventory levels to be created.","operationId":"preview_import_api_v1_inventory_import_preview_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PreviewResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/import/apply":{"post":{"tags":["inventory:import"],"summary":"Apply import","description":"Execute the confirmed import: create locations, products, variants, and set inventory levels. All changes happen in a single transaction.","operationId":"apply_import_api_v1_inventory_import_apply_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApplyResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/po-import/analyze":{"post":{"tags":["inventory:po_import"],"summary":"Analyze manufacturer PO spreadsheet (async)","description":"Upload an Excel or CSV manufacturer purchase order. Returns a task_id immediately; poll GET /analyze/{task_id} for column mappings and metadata.","operationId":"analyze_po_spreadsheet_api_v1_inventory_po_import_analyze_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_analyze_po_spreadsheet_api_v1_inventory_po_import_analyze_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_POAnalyzeTaskResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/po-import/analyze/{task_id}":{"get":{"tags":["inventory:po_import"],"summary":"Poll PO analysis status","description":"Returns 'pending', 'completed' (with result), or 'failed'.","operationId":"get_po_analyze_status_api_v1_inventory_po_import_analyze__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_POAnalyzeStatusResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/po-import/preview":{"post":{"tags":["inventory:po_import"],"summary":"Preview PO import with SKU matching","description":"After reviewing AI column mappings, returns line items with SKU match status against the product catalog.","operationId":"preview_po_import_api_v1_inventory_po_import_preview_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/POPreviewRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_POPreviewResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/po-import/apply":{"post":{"tags":["inventory:po_import"],"summary":"Create purchase order from import","description":"Create a draft purchase order from confirmed line items and vendor. Unmatched SKUs require variant_id overrides or must be skipped.","operationId":"apply_po_import_api_v1_inventory_po_import_apply_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/POApplyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_POApplyResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/supply-chain":{"get":{"tags":["inventory:supply_chain"],"summary":"Get inventory supply chain map","description":"Return a single payload of nodes (locations with on-hand + alerts) and edges (open POs + in-transit transfers) for the Supply Chain Map.","operationId":"get_supply_chain_map_api_v1_inventory_supply_chain_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SupplyChainResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/accounts-payable":{"get":{"tags":["inventory:accounts_payable"],"summary":"List Inventory AP bills","description":"List bills generated by a Purchase Order (those with source_inventory_order_id set). Supports optional status filtering.","operationId":"list_inventory_ap_bills_api_v1_inventory_accounts_payable_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of bill statuses to include.","title":"Status"},"description":"Comma-separated list of bill statuses to include."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max bills to return.","default":100,"title":"Limit"},"description":"Max bills to return."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_APInventoryListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/accounts-payable/{bill_id}/three-way-match":{"post":{"tags":["inventory:accounts_payable"],"summary":"Recompute the three-way match for a bill","description":"Forces a fresh PO -> Receipt -> Invoice comparison for the bill and writes the outcome onto `bill.match_status` and the variance columns. Idempotent.","operationId":"recompute_three_way_match_api_v1_inventory_accounts_payable__bill_id__three_way_match_post","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"qty_tolerance","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Unit tolerance before a qty drift is flagged.","default":0,"title":"Qty Tolerance"},"description":"Unit tolerance before a qty drift is flagged."},{"name":"price_tolerance_cents","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Cents tolerance before a price drift is flagged.","default":500,"title":"Price Tolerance Cents"},"description":"Cents tolerance before a price drift is flagged."},{"name":"price_tolerance_pct","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0,"description":"Percent-of-PO-total tolerance (combined with cents floor).","default":0.01,"title":"Price Tolerance Pct"},"description":"Percent-of-PO-total tolerance (combined with cents floor)."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ThreeWayMatchResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/cost-history":{"get":{"tags":["inventory:cost_history"],"summary":"Landed COGS history","description":"Return cost snapshots grouped by variant for the last N months. Powers the Landed COGS sparkline + material/freight/processing breakdown.","operationId":"get_cost_history_api_v1_inventory_cost_history_get","parameters":[{"name":"months","in":"query","required":false,"schema":{"type":"integer","maximum":36,"minimum":1,"description":"Window size in months (default 12).","default":12,"title":"Months"},"description":"Window size in months (default 12)."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CostHistoryResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/activity":{"get":{"tags":["inventory:activity"],"summary":"List inventory activity","description":"Return the N most recent inventory activity events (PO submit/ready/shipped/received/canceled, etc.).","operationId":"list_inventory_activity_api_v1_inventory_activity_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_InventoryActivityResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/reorder/suggestions":{"get":{"tags":["inventory:reorder"],"summary":"Suggest reorders from reorder points","description":"Return vendor-grouped reorder suggestions for variants whose available quantity has fallen to or below the per-location reorder point. Read-only.","operationId":"list_reorder_suggestions_api_v1_inventory_reorder_suggestions_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ReorderSuggestionsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/reorder/draft":{"post":{"tags":["inventory:reorder"],"summary":"Draft purchase orders from reorder suggestions","description":"Materialize reorder suggestions as draft purchase orders, one per vendor. Variants without a preferred vendor are skipped.","operationId":"create_draft_reorders_api_v1_inventory_reorder_draft_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CreateDraftReordersRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreateDraftReordersResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/reorder/cash-impact":{"post":{"tags":["inventory:reorder"],"summary":"Preview the cash impact of a reorder","description":"Model the effect of placing one or more (not-yet-created) purchase orders on the 13-week cash forecast. Runs the live forecast with and without the proposed POs and returns the delta -- including how far the projected cash low point moves -- so the operator can see the cash impact of a reorder before committing to it.","operationId":"reorder_cash_impact_api_v1_inventory_reorder_cash_impact_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderCashImpactRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ReorderCashImpactResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/forecast/skus":{"get":{"tags":["inventory:forecast"],"summary":"List per-SKU demand forecasts","description":"Return the most recently computed statistical demand forecast for each SKU, including the weekly forecast curve, service-level safety stock, suggested reorder point, order-up-to level, and backtest accuracy. Read-only.","operationId":"list_sku_forecasts_api_v1_inventory_forecast_skus_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SkuForecastListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/forecast/skus/{variant_id}":{"get":{"tags":["inventory:forecast"],"summary":"Get one SKU's demand forecast detail","description":"Return a single SKU's statistical forecast (curve, safety stock, reorder point, order-up-to, accuracy) together with its recent actual weekly demand history, so the UI can overlay history vs forecast with a confidence band. Read-only.","operationId":"get_sku_forecast_detail_api_v1_inventory_forecast_skus__variant_id__get","parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","title":"Variant Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SkuForecastDetailResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/forecast/recompute":{"post":{"tags":["inventory:forecast"],"summary":"Recompute SKU demand forecasts","description":"Recompute and persist statistical demand forecasts and safety stock for every SKU with recent sales. Normally run nightly by a background job; this endpoint forces an immediate refresh.","operationId":"recompute_sku_forecasts_api_v1_inventory_forecast_recompute_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecomputeForecastResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/transfer-suggestions/suggestions":{"get":{"tags":["inventory:transfer_suggestions"],"summary":"Suggest site-to-site transfers","description":"Return (donor, receiver, quantity) suggestions for variants with surplus at one location and deficit at another.","operationId":"list_transfer_suggestions_api_v1_inventory_transfer_suggestions_suggestions_get","parameters":[{"name":"surplus_pct","in":"query","required":false,"schema":{"type":"number","maximum":2.0,"minimum":0.0,"description":"Donor must hold this much above its own reorder point.","default":0.25,"title":"Surplus Pct"},"description":"Donor must hold this much above its own reorder point."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransferSuggestionsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/reports/valuation":{"get":{"tags":["inventory:reports"],"summary":"Current inventory valuation","description":"Return the current on-hand inventory value (in cents) computed from remaining FIFO cost lots, grouped by location, category, or vendor.","operationId":"get_valuation_api_v1_inventory_reports_valuation_get","parameters":[{"name":"group_by","in":"query","required":false,"schema":{"enum":["location","category","vendor"],"type":"string","description":"Bucketing dimension: 'location' (default), 'category', or 'vendor'.","default":"location","title":"Group By"},"description":"Bucketing dimension: 'location' (default), 'category', or 'vendor'."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ValuationResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/reports/aging":{"get":{"tags":["inventory:reports"],"summary":"Inventory aging report","description":"Bucket remaining cost-lot quantities (and dollars) by lot age (0-30 / 31-60 / 61-90 / 91-180 / 180+ days). Optionally returns the per-variant detail with the oldest received_at.","operationId":"get_aging_api_v1_inventory_reports_aging_get","parameters":[{"name":"detail","in":"query","required":false,"schema":{"type":"boolean","description":"Include per-variant breakdown sorted by oldest lot age.","default":false,"title":"Detail"},"description":"Include per-variant breakdown sorted by oldest lot age."},{"name":"detail_limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Cap on per-variant detail rows when `detail=true`.","default":100,"title":"Detail Limit"},"description":"Cap on per-variant detail rows when `detail=true`."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AgingResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/reports/margin-by-sku":{"get":{"tags":["inventory:reports"],"summary":"Margin-by-SKU report (landed cost + sales velocity)","description":"Returns per-variant landed cost (latest cost snapshot), current sell price, gross margin, and trailing Shopify sales over the configured lookback window. Powers the Landed COGS 'Truth' tab.","operationId":"get_margin_by_sku_api_v1_inventory_reports_margin_by_sku_get","parameters":[{"name":"lookback_days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"description":"Trailing window (days) used to compute revenue + units sold.","default":30,"title":"Lookback Days"},"description":"Trailing window (days) used to compute revenue + units sold."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Max variants returned (sorted by trailing revenue desc).","default":100,"title":"Limit"},"description":"Max variants returned (sorted by trailing revenue desc)."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_MarginByVariantResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/reports/adjustment-reasons":{"get":{"tags":["inventory:reports"],"summary":"Adjustments grouped by reason","description":"Aggregates `inventory` ledger rows whose `correction_reason` is set (i.e. manual adjustments and cycle-count posts) by reason code. Returns count, signed units, and a $-impact estimate using each variant's stored `unit_cost`. Use ``since``/``until`` ISO-8601 strings to scope the window (defaults to all-time).","operationId":"get_adjustment_reasons_api_v1_inventory_reports_adjustment_reasons_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Inclusive lower bound (ISO-8601). Omit for all-time.","title":"Since"},"description":"Inclusive lower bound (ISO-8601). Omit for all-time."},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Exclusive upper bound (ISO-8601). Omit for now.","title":"Until"},"description":"Exclusive upper bound (ISO-8601). Omit for now."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AdjustmentReasonsResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/counts":{"post":{"tags":["inventory:counts"],"summary":"Start a cycle count","description":"Create a draft cycle / physical count at a location.","operationId":"start_count_api_v1_inventory_counts_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartCountRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_StartCountResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}},"get":{"tags":["inventory:counts"],"summary":"List cycle counts","description":"List recent cycle counts, optionally filtered by status.","operationId":"list_counts_api_v1_inventory_counts_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: draft | in_progress | posted | cancelled.","title":"Status"},"description":"Filter by status: draft | in_progress | posted | cancelled."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListCountsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/counts/{count_id}":{"get":{"tags":["inventory:counts"],"summary":"Get a cycle count","description":"Return one cycle count with all lines + variant metadata.","operationId":"get_count_api_v1_inventory_counts__count_id__get","parameters":[{"name":"count_id","in":"path","required":true,"schema":{"type":"string","title":"Count Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetCountResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/counts/{count_id}/lines":{"post":{"tags":["inventory:counts"],"summary":"Add or scan a line","description":"Add a line by `variant_id`, `barcode`, or `sku`. Re-scans of the same variant update the existing line.","operationId":"add_count_line_api_v1_inventory_counts__count_id__lines_post","parameters":[{"name":"count_id","in":"path","required":true,"schema":{"type":"string","title":"Count Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCountLineRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AddCountLineResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/counts/{count_id}/lines/{line_id}":{"put":{"tags":["inventory:counts"],"summary":"Record a counted quantity","description":"Record / update the counter's measured quantity on a line.","operationId":"submit_count_line_api_v1_inventory_counts__count_id__lines__line_id__put","parameters":[{"name":"count_id","in":"path","required":true,"schema":{"type":"string","title":"Count Id"}},{"name":"line_id","in":"path","required":true,"schema":{"type":"string","title":"Line Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitCountLineRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SubmitCountLineResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/counts/{count_id}/cancel":{"post":{"tags":["inventory:counts"],"summary":"Cancel a cycle count","description":"Mark a count as cancelled without posting adjustments.","operationId":"cancel_count_api_v1_inventory_counts__count_id__cancel_post","parameters":[{"name":"count_id","in":"path","required":true,"schema":{"type":"string","title":"Count Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CancelCountResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/counts/{count_id}/post":{"post":{"tags":["inventory:counts"],"summary":"Post a cycle count","description":"Finalize the count, emitting one manual inventory adjustment per non-zero variance line.","operationId":"post_count_api_v1_inventory_counts__count_id__post_post","parameters":[{"name":"count_id","in":"path","required":true,"schema":{"type":"string","title":"Count Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PostCountRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PostCountResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/inventory/lots/expiring":{"get":{"tags":["inventory:lots"],"summary":"List expiring cost lots","description":"Return non-exhausted cost lots with an `expiration_date` within the next `within_days` days. Powers the 'Expiring soon' badge on the inventory overview.","operationId":"list_expiring_lots_api_v1_inventory_lots_expiring_get","parameters":[{"name":"within_days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":0,"description":"Lookahead window in days (default 30).","default":30,"title":"Within Days"},"description":"Lookahead window in days (default 30)."},{"name":"include_expired","in":"query","required":false,"schema":{"type":"boolean","description":"When false, exclude lots whose `expiration_date` is already in the past.","default":true,"title":"Include Expired"},"description":"When false, exclude lots whose `expiration_date` is already in the past."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ExpiringLotsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}},"/api/v1/journal-entries":{"get":{"tags":["journal-entries"],"summary":"List journal entries","description":"Retrieve journal entries with filtering by date, ledger, source, and text search.","operationId":"get_journal_entries_api_v1_journal_entries_get","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Filter by journal entry IDs (comma-separated UUIDs)","default":[],"title":"Id"},"description":"Filter by journal entry IDs (comma-separated UUIDs)"},{"name":"description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by description (partial match)","title":"Description"},"description":"Filter by description (partial match)"},{"name":"invoice_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by linked invoice UUID","title":"Invoice Id"},"description":"Filter by linked invoice UUID"},{"name":"ledger_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by ledger account UUID (returns entries with line entries affecting this ledger)","title":"Ledger Id"},"description":"Filter by ledger account UUID (returns entries with line entries affecting this ledger)"},{"name":"source","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Filter by one or more backend origins: manual, invoice, bill, credit_memo, transaction, stripe, shopify, plaid, ramp, square, system, teal","default":[],"title":"Source"},"description":"Filter by one or more backend origins: manual, invoice, bill, credit_memo, transaction, stripe, shopify, plaid, ramp, square, system, teal"},{"name":"creation_method","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/JournalEntryCreationMethodEnum"},{"type":"null"}],"description":"Filter by creation method: ai (system-generated) or manual (user-typed)","title":"Creation Method"},"description":"Filter by creation method: ai (system-generated) or manual (user-typed)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter entries on or after this date (ISO 8601: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ)","title":"Start Date"},"description":"Filter entries on or after this date (ISO 8601: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter entries on or before this date (ISO 8601: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ)","title":"End Date"},"description":"Filter entries on or before this date (ISO 8601: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ)"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search journal entries by description (case-insensitive partial match)","title":"Search"},"description":"Search journal entries by description (case-insensitive partial match)"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_JournalEntryListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["journal-entries"],"summary":"Create journal entry","description":"Create a new double-entry journal entry with balanced line entries.","operationId":"create_journal_entry_api_v1_journal_entries_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_JournalEntryResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/journal-entries/{journal_entry_id}":{"get":{"tags":["journal-entries"],"summary":"Get journal entry","description":"Retrieve a single journal entry with all its line entries.","operationId":"get_journal_entry_api_v1_journal_entries__journal_entry_id__get","parameters":[{"name":"journal_entry_id","in":"path","required":true,"schema":{"type":"string","title":"Journal Entry Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_JournalEntryResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["journal-entries"],"summary":"Update journal entry","description":"Update an existing journal entry's description, date, or line entries.","operationId":"update_journal_entry_api_v1_journal_entries__journal_entry_id__put","parameters":[{"name":"journal_entry_id","in":"path","required":true,"schema":{"type":"string","title":"Journal Entry Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_JournalEntryResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["journal-entries"],"summary":"Delete journal entry","description":"Delete a journal entry and all its associated line entries.","operationId":"delete_journal_entry_api_v1_journal_entries__journal_entry_id__delete","parameters":[{"name":"journal_entry_id","in":"path","required":true,"schema":{"type":"string","title":"Journal Entry Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/journal-entries/{journal_entry_id}/reverse":{"post":{"tags":["journal-entries"],"summary":"Reverse journal entry","description":"Create an offsetting journal entry that mirrors the original with flipped debits and credits.","operationId":"reverse_journal_entry_api_v1_journal_entries__journal_entry_id__reverse_post","parameters":[{"name":"journal_entry_id","in":"path","required":true,"schema":{"type":"string","title":"Journal Entry Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/JournalEntryReverseRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_JournalEntryReverseResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/journal-entries/{journal_entry_id}/attachment":{"patch":{"tags":["journal-entries"],"summary":"Attach file to journal entry","description":"Upload and attach a document file to a journal entry.","operationId":"attach_file_to_journal_entry_api_v1_journal_entries__journal_entry_id__attachment_patch","parameters":[{"name":"journal_entry_id","in":"path","required":true,"schema":{"type":"string","title":"Journal Entry Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_attach_file_to_journal_entry_api_v1_journal_entries__journal_entry_id__attachment_patch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_JournalEntryResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/journal-entries/bulk-upload/preview":{"post":{"tags":["journal-entries"],"summary":"Preview bulk journal entry upload","description":"Parse and validate a CSV/Excel file of journal entries without creating anything. Returns a structured preview with per-entry validation.","operationId":"preview_bulk_je_upload_api_v1_journal_entries_bulk_upload_preview_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkJournalEntryUploadRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PreviewBulkJeUploadResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/journal-entries/bulk-upload/post":{"post":{"tags":["journal-entries"],"summary":"Post bulk journal entries","description":"Create all journal entries from a previously validated bulk upload file. Call the preview endpoint first to validate.","operationId":"post_bulk_je_upload_api_v1_journal_entries_bulk_upload_post_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkJournalEntryUploadRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PostBulkJeUploadResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/journal-entries/bulk-upload/template":{"get":{"tags":["journal-entries"],"summary":"Download bulk JE upload template","description":"Get a bulk journal entry XLS template pre-populated with the business's chart of accounts.","operationId":"download_bulk_je_upload_template_api_v1_journal_entries_bulk_upload_template_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TemplateResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ledgers":{"get":{"tags":["ledgers"],"summary":"List ledgers","description":"Retrieve chart of accounts (ledgers) for the business.","operationId":"get_ledgers_api_v1_ledgers_get","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Filter by specific ledger UUIDs","default":[],"title":"Id"},"description":"Filter by specific ledger UUIDs"},{"name":"name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by ledger name (partial match)","title":"Name"},"description":"Filter by ledger name (partial match)"},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by type: asset, liability, equity, revenue, expense","title":"Type"},"description":"Filter by type: asset, liability, equity, revenue, expense"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: active, inactive","title":"Status"},"description":"Filter by status: active, inactive"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LedgerListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["ledgers"],"summary":"Create ledger","description":"Create a new account in the chart of accounts.","operationId":"create_ledger_api_v1_ledgers_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LedgerResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ledgers/{ledger_id}":{"get":{"tags":["ledgers"],"summary":"Get ledger","description":"Retrieve a specific ledger/account with full details.","operationId":"get_ledger_api_v1_ledgers__ledger_id__get","parameters":[{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","title":"Ledger Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LedgerResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["ledgers"],"summary":"Update ledger","description":"Update an existing ledger account.","operationId":"update_ledger_api_v1_ledgers__ledger_id__put","parameters":[{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","title":"Ledger Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LedgerResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["ledgers"],"summary":"Delete ledger","description":"Permanently delete a ledger/account.","operationId":"delete_ledger_api_v1_ledgers__ledger_id__delete","parameters":[{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","title":"Ledger Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ledgers/apply-coa":{"post":{"tags":["ledgers"],"summary":"Apply AI-generated COA","description":"Apply an AI-generated or custom chart of accounts template to the business, upserting over existing ledgers. Protected ledgers (system, required, bank-linked) are skipped. Existing custom ledgers not present in the template are deactivated.","operationId":"apply_coa_api_v1_ledgers_apply_coa_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomCoaTemplate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApplyCoaResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ledgers/merge":{"post":{"tags":["ledgers"],"summary":"Merge ledgers","description":"Merge one or more source ledgers into a target ledger, reassigning all transactions and journal entries.","operationId":"merge_ledgers_api_v1_ledgers_merge_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerMergeRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LedgerMergeResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ledgers/suggest-cleanup":{"post":{"tags":["ledgers"],"summary":"AI account cleanup suggestions","description":"Get AI-powered suggestions for chart of accounts cleanup. Read-only; rate limited per user and gated on monthly AI quota.","operationId":"suggest_cleanup_api_v1_ledgers_suggest_cleanup_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SuggestAccountCleanupResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"example":{"detail":"Rate limit exceeded"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ledgers/suggest-cash-flow":{"post":{"tags":["ledgers"],"summary":"Suggest cash flow classifications","description":"Get deterministic suggestions for cash flow statement classifications based on ledger types and sub-types.","operationId":"suggest_cash_flow_api_v1_ledgers_suggest_cash_flow_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SuggestCashFlowResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ledgers/bulk-update":{"post":{"tags":["ledgers"],"summary":"Bulk update ledgers","description":"Update multiple ledgers in a single request.","operationId":"bulk_update_ledgers_api_v1_ledgers_bulk_update_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerBulkUpdateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LedgerBulkUpdateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ap-approval":{"get":{"tags":["ap-approval"],"summary":"Get AP approval workflow","description":"Get the AP approval workflow for the current business's firm.","operationId":"get_ap_approval_workflow_api_v1_ap_approval_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApApprovalGetResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ap-approval/provision":{"post":{"tags":["ap-approval"],"summary":"Provision AP approval workflow for firm","description":"Create or retrieve the AP approval workflow for the firm associated with this business.","operationId":"provision_ap_approval_workflow_api_v1_ap_approval_provision_post","parameters":[{"name":"auto_approve_max_cents","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Max amount in cents for auto-approval (default: $500)","default":50000,"title":"Auto Approve Max Cents"},"description":"Max amount in cents for auto-approval (default: $500)"},{"name":"ops_approve_max_cents","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Max amount in cents for ops approval (default: $5,000)","default":500000,"title":"Ops Approve Max Cents"},"description":"Max amount in cents for ops approval (default: $5,000)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApApprovalProvisionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ap-approval/pending":{"get":{"tags":["ap-approval"],"summary":"List pending AP approvals","description":"List bills currently suspended at an AP approval gate.","operationId":"list_pending_approvals_api_v1_ap_approval_pending_get","parameters":[{"name":"tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to a specific tier: 'ops', 'advisor', or 'owner'.","title":"Tier"},"description":"Filter to a specific tier: 'ops', 'advisor', or 'owner'."},{"name":"mine","in":"query","required":false,"schema":{"type":"boolean","description":"When true, only show approvals whose gate tier the caller is configured as an approver for.","default":false,"title":"Mine"},"description":"When true, only show approvals whose gate tier the caller is configured as an approver for."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PendingApprovalsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ap-approval/approvers":{"get":{"tags":["ap-approval"],"summary":"Get approvers by tier","description":"Return the configured approver user IDs grouped by tier.","operationId":"get_approvers_api_v1_ap_approval_approvers_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApproversResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ap-approval/approvers/{tier}":{"put":{"tags":["ap-approval"],"summary":"Update approvers for a tier","description":"Replace the approver list for a tier in the workflow graph.","operationId":"update_approvers_api_v1_ap_approval_approvers__tier__put","parameters":[{"name":"tier","in":"path","required":true,"schema":{"type":"string","title":"Tier"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetApproversRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApproversResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ap-approval/thresholds":{"patch":{"tags":["ap-approval"],"summary":"Update approval thresholds","description":"Update amount thresholds and/or escalation timeout without re-provisioning. Only provided fields are changed; the rest retain their current values.","operationId":"update_thresholds_api_v1_ap_approval_thresholds_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThresholdsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UpdateThresholdsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ap-approval/batch-approve":{"post":{"tags":["ap-approval"],"summary":"Batch approve pending items","description":"Approve multiple suspended workflow executions in a single request.","operationId":"batch_approve_api_v1_ap_approval_batch_approve_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchApproveRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BatchApproveResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ap-approval/vendor/{vendor_id}/history":{"get":{"tags":["ap-approval"],"summary":"Vendor payment history","description":"Return recent bill history for a vendor to provide context at approval time.","operationId":"get_vendor_history_api_v1_ap_approval_vendor__vendor_id__history_get","parameters":[{"name":"vendor_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Number of recent bills to return.","default":10,"title":"Limit"},"description":"Number of recent bills to return."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorHistoryResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ap-approval/analytics":{"get":{"tags":["ap-approval"],"summary":"Approval queue analytics","description":"Return queue health stats: pending counts by tier, average age, and oldest pending item.","operationId":"get_analytics_api_v1_ap_approval_analytics_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AnalyticsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ap-approval/risk-score":{"post":{"tags":["ap-approval"],"summary":"AI approval risk scores","description":"Get AI-powered risk scores for pending bill approvals.","operationId":"score_approval_risk_api_v1_ap_approval_risk_score_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApprovalRiskResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payment-advisory/recommendations":{"get":{"tags":["payment-advisory"],"summary":"Get payment recommendations","description":"Get prioritized payment recommendations for outstanding bills.","operationId":"get_payment_recommendations_api_v1_payment_advisory_recommendations_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetPaymentRecommendationsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payment-advisory/firm-summary":{"get":{"tags":["payment-advisory"],"summary":"Get consolidated AP summary for firm","description":"Get AP outstanding/overdue summary across all firm client businesses.","operationId":"get_firm_ap_summary_api_v1_payment_advisory_firm_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetFirmApSummaryResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payment-terms":{"get":{"tags":["payment-terms"],"summary":"List payment terms","description":"List all payment terms for the business.","operationId":"list_payment_terms_api_v1_payment_terms_get","parameters":[{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only show active terms","default":true,"title":"Active Only"},"description":"Only show active terms"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PaymentTermsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["payment-terms"],"summary":"Create payment term","description":"Create a new payment term.","operationId":"create_payment_term_api_v1_payment_terms_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTermCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PaymentTermResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payment-terms/default":{"get":{"tags":["payment-terms"],"summary":"Get default payment term","description":"Get the default payment term for the business.","operationId":"get_default_payment_term_api_v1_payment_terms_default_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PaymentTermResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payment-terms/{term_id}":{"get":{"tags":["payment-terms"],"summary":"Get payment term","description":"Get details of a specific payment term.","operationId":"get_payment_term_api_v1_payment_terms__term_id__get","parameters":[{"name":"term_id","in":"path","required":true,"schema":{"type":"string","title":"Term Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PaymentTermResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["payment-terms"],"summary":"Update payment term","description":"Update an existing payment term.","operationId":"update_payment_term_api_v1_payment_terms__term_id__put","parameters":[{"name":"term_id","in":"path","required":true,"schema":{"type":"string","title":"Term Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTermUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PaymentTermResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["payment-terms"],"summary":"Deactivate payment term","description":"Deactivate a payment term (soft delete).","operationId":"deactivate_payment_term_api_v1_payment_terms__term_id__delete","parameters":[{"name":"term_id","in":"path","required":true,"schema":{"type":"string","title":"Term Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payment-terms/seed-defaults":{"post":{"tags":["payment-terms"],"summary":"Seed default payment terms","description":"Seed default payment terms for the business (if none exist).","operationId":"seed_default_terms_api_v1_payment_terms_seed_defaults_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PaymentTermsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/catalog-items":{"get":{"tags":["catalog-items"],"summary":"List catalog items","description":"List Products & Services catalog items for the business.","operationId":"list_catalog_items_api_v1_catalog_items_get","parameters":[{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only show active items.","default":true,"title":"Active Only"},"description":"Only show active items."},{"name":"item_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by type: service, non_inventory, inventory, bundle.","title":"Item Type"},"description":"Filter by type: service, non_inventory, inventory, bundle."},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fuzzy match on name or SKU.","title":"Search"},"description":"Fuzzy match on name or SKU."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CatalogItemsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["catalog-items"],"summary":"Create catalog item","description":"Create a new Products & Services catalog item.","operationId":"create_catalog_item_api_v1_catalog_items_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogItemCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CatalogItemResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/catalog-items/{item_id}":{"get":{"tags":["catalog-items"],"summary":"Get catalog item","description":"Get details of a specific catalog item.","operationId":"get_catalog_item_api_v1_catalog_items__item_id__get","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CatalogItemResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["catalog-items"],"summary":"Update catalog item","description":"Update an existing catalog item.","operationId":"update_catalog_item_api_v1_catalog_items__item_id__put","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogItemUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CatalogItemResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["catalog-items"],"summary":"Deactivate catalog item","description":"Deactivate a catalog item (soft delete).","operationId":"deactivate_catalog_item_api_v1_catalog_items__item_id__delete","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sales-receipts":{"get":{"tags":["sales-receipts"],"summary":"List sales receipts","description":"List sales receipts and refund receipts for the business.","operationId":"list_sales_receipts_api_v1_sales_receipts_get","parameters":[{"name":"receipt_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by type: sale or refund.","title":"Receipt Type"},"description":"Filter by type: sale or refund."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: posted or void.","title":"Status"},"description":"Filter by status: posted or void."},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by customer.","title":"Customer Id"},"description":"Filter by customer."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SalesReceiptsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["sales-receipts"],"summary":"Create sales receipt","description":"Create and post a sales receipt (or refund receipt).","operationId":"create_sales_receipt_api_v1_sales_receipts_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesReceiptCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SalesReceiptResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sales-receipts/{receipt_id}":{"get":{"tags":["sales-receipts"],"summary":"Get sales receipt","description":"Get details of a specific sales/refund receipt.","operationId":"get_sales_receipt_api_v1_sales_receipts__receipt_id__get","parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"string","title":"Receipt Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SalesReceiptResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sales-receipts/{receipt_id}/void":{"post":{"tags":["sales-receipts"],"summary":"Void sales receipt","description":"Void a sales/refund receipt and post a reversing journal entry.","operationId":"void_sales_receipt_api_v1_sales_receipts__receipt_id__void_post","parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"string","title":"Receipt Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SalesReceiptResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customer-statements/{customer_id}":{"get":{"tags":["customer-statements"],"summary":"Get customer statement","description":"Build an A/R statement for a customer over a date range.","operationId":"get_customer_statement_api_v1_customer_statements__customer_id__get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Start of the statement period (defaults to 1 year ago).","title":"Start Date"},"description":"Start of the statement period (defaults to 1 year ago)."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"End of the statement period (defaults to today).","title":"End Date"},"description":"End of the statement period (defaults to today)."},{"name":"as_of_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Aging as-of date (defaults to end_date).","title":"As Of Date"},"description":"Aging as-of date (defaults to end_date)."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CustomerStatementResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customer-statements/{customer_id}/send":{"post":{"tags":["customer-statements"],"summary":"Email customer statement","description":"Build and email an A/R statement to the customer.","operationId":"send_customer_statement_api_v1_customer_statements__customer_id__send_post","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendStatementRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SendStatementResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bank-deposits/undeposited":{"get":{"tags":["bank-deposits"],"summary":"List undeposited funds","description":"List posted sales receipts in Undeposited Funds awaiting deposit.","operationId":"list_undeposited_api_v1_bank_deposits_undeposited_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UndepositedItemsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bank-deposits":{"get":{"tags":["bank-deposits"],"summary":"List bank deposits","description":"List bank deposits for the business.","operationId":"list_bank_deposits_api_v1_bank_deposits_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: posted or void.","title":"Status"},"description":"Filter by status: posted or void."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BankDepositsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["bank-deposits"],"summary":"Create bank deposit","description":"Group undeposited receipts and ad-hoc lines into a bank deposit.","operationId":"create_bank_deposit_api_v1_bank_deposits_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankDepositCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BankDepositResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bank-deposits/{deposit_id}":{"get":{"tags":["bank-deposits"],"summary":"Get bank deposit","description":"Get details of a specific bank deposit.","operationId":"get_bank_deposit_api_v1_bank_deposits__deposit_id__get","parameters":[{"name":"deposit_id","in":"path","required":true,"schema":{"type":"string","title":"Deposit Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BankDepositResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bank-deposits/{deposit_id}/void":{"post":{"tags":["bank-deposits"],"summary":"Void bank deposit","description":"Void a deposit, reversing the entry and releasing its receipts.","operationId":"void_bank_deposit_api_v1_bank_deposits__deposit_id__void_post","parameters":[{"name":"deposit_id","in":"path","required":true,"schema":{"type":"string","title":"Deposit Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BankDepositResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-dimensions/pnl":{"get":{"tags":["accounting-dimensions"],"summary":"Dimensional P&L","description":"Profit & loss broken down by class or location for a date range.","operationId":"dimensional_pnl_api_v1_accounting_dimensions_pnl_get","parameters":[{"name":"dimension_type","in":"query","required":true,"schema":{"type":"string","description":"'class' or 'location'.","title":"Dimension Type"},"description":"'class' or 'location'."},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Period start (inclusive).","title":"Start Date"},"description":"Period start (inclusive)."},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Period end (inclusive).","title":"End Date"},"description":"Period end (inclusive)."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DimensionalPnLResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-dimensions":{"get":{"tags":["accounting-dimensions"],"summary":"List classes/locations","description":"List accounting dimensions, optionally filtered by type.","operationId":"list_dimensions_api_v1_accounting_dimensions_get","parameters":[{"name":"dimension_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by 'class' or 'location'.","title":"Dimension Type"},"description":"Filter by 'class' or 'location'."},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AccountingDimensionsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["accounting-dimensions"],"summary":"Create class/location","description":"Create a new accounting dimension.","operationId":"create_dimension_api_v1_accounting_dimensions_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingDimensionCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AccountingDimensionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting-dimensions/{dimension_id}":{"get":{"tags":["accounting-dimensions"],"summary":"Get class/location","description":"Get a single accounting dimension.","operationId":"get_dimension_api_v1_accounting_dimensions__dimension_id__get","parameters":[{"name":"dimension_id","in":"path","required":true,"schema":{"type":"string","title":"Dimension Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AccountingDimensionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["accounting-dimensions"],"summary":"Update class/location","description":"Update an accounting dimension.","operationId":"update_dimension_api_v1_accounting_dimensions__dimension_id__put","parameters":[{"name":"dimension_id","in":"path","required":true,"schema":{"type":"string","title":"Dimension Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingDimensionUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AccountingDimensionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["accounting-dimensions"],"summary":"Deactivate class/location","description":"Soft-delete (deactivate) an accounting dimension.","operationId":"deactivate_dimension_api_v1_accounting_dimensions__dimension_id__delete","parameters":[{"name":"dimension_id","in":"path","required":true,"schema":{"type":"string","title":"Dimension Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AccountingDimensionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/projects/profitability":{"get":{"tags":["projects"],"summary":"Project profitability","description":"Revenue, expense, and net profit broken down by project.","operationId":"project_profitability_api_v1_projects_profitability_get","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Period start (inclusive).","title":"Start Date"},"description":"Period start (inclusive)."},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Period end (inclusive).","title":"End Date"},"description":"Period end (inclusive)."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ProjectProfitabilityResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/projects":{"get":{"tags":["projects"],"summary":"List projects","description":"List projects, optionally filtered by status or customer.","operationId":"list_projects_api_v1_projects_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: active, completed, on_hold.","title":"Status"},"description":"Filter by status: active, completed, on_hold."},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by customer.","title":"Customer Id"},"description":"Filter by customer."},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ProjectsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["projects"],"summary":"Create project","description":"Create a new project.","operationId":"create_project_api_v1_projects_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ProjectResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/projects/{project_id}":{"get":{"tags":["projects"],"summary":"Get project","description":"Get a single project.","operationId":"get_project_api_v1_projects__project_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ProjectResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["projects"],"summary":"Update project","description":"Update an existing project. All fields optional.","operationId":"update_project_api_v1_projects__project_id__put","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ProjectResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["projects"],"summary":"Deactivate project","description":"Soft-delete (deactivate) a project.","operationId":"deactivate_project_api_v1_projects__project_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ProjectResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/projects/{project_id}/profitability":{"get":{"tags":["projects"],"summary":"Single project profitability","description":"Revenue, expense, and net profit for one project.","operationId":"single_project_profitability_api_v1_projects__project_id__profitability_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Period start (inclusive).","title":"Start Date"},"description":"Period start (inclusive)."},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Period end (inclusive).","title":"End Date"},"description":"Period end (inclusive)."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ProjectProfitabilityResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/time-entries/billable":{"get":{"tags":["time-entries"],"summary":"List billable time","description":"Unbilled, billable time entries with computed billable amount.","operationId":"list_billable_api_v1_time_entries_billable_get","parameters":[{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by customer.","title":"Customer Id"},"description":"Filter by customer."},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by project.","title":"Project Id"},"description":"Filter by project."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TimeEntriesListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/time-entries/add-to-invoice":{"post":{"tags":["time-entries"],"summary":"Add time to invoice","description":"Append billable time entries to a draft invoice and mark billed.","operationId":"add_to_invoice_api_v1_time_entries_add_to_invoice_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddToInvoiceRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AddToInvoiceResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/time-entries":{"get":{"tags":["time-entries"],"summary":"List time entries","description":"List time entries, optionally filtered by customer/project/status.","operationId":"list_time_entries_api_v1_time_entries_get","parameters":[{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by customer.","title":"Customer Id"},"description":"Filter by customer."},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by project.","title":"Project Id"},"description":"Filter by project."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: unbilled, billed.","title":"Status"},"description":"Filter by status: unbilled, billed."},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TimeEntriesListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["time-entries"],"summary":"Create time entry","description":"Log a new time entry.","operationId":"create_time_entry_api_v1_time_entries_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeEntryCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TimeEntryResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/time-entries/{time_entry_id}":{"get":{"tags":["time-entries"],"summary":"Get time entry","description":"Get a single time entry.","operationId":"get_time_entry_api_v1_time_entries__time_entry_id__get","parameters":[{"name":"time_entry_id","in":"path","required":true,"schema":{"type":"string","title":"Time Entry Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TimeEntryResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["time-entries"],"summary":"Update time entry","description":"Update a time entry. All fields optional.","operationId":"update_time_entry_api_v1_time_entries__time_entry_id__put","parameters":[{"name":"time_entry_id","in":"path","required":true,"schema":{"type":"string","title":"Time Entry Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeEntryUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TimeEntryResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["time-entries"],"summary":"Delete time entry","description":"Soft-delete (deactivate) a time entry.","operationId":"delete_time_entry_api_v1_time_entries__time_entry_id__delete","parameters":[{"name":"time_entry_id","in":"path","required":true,"schema":{"type":"string","title":"Time Entry Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TimeEntryResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contractors/1099-report":{"get":{"tags":["contractors"],"summary":"1099 year-end report","description":"Total payments per 1099 contractor for the tax year.","operationId":"report_1099_api_v1_contractors_1099_report_get","parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"integer","maximum":2100,"minimum":2000,"description":"Tax year, e.g. 2025.","title":"Year"},"description":"Tax year, e.g. 2025."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_Contractor1099ReportResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contractors":{"get":{"tags":["contractors"],"summary":"List contractors","description":"List vendors, optionally only those flagged as 1099 contractors.","operationId":"list_contractors_api_v1_contractors_get","parameters":[{"name":"only_1099","in":"query","required":false,"schema":{"type":"boolean","description":"Only 1099-flagged vendors.","default":false,"title":"Only 1099"},"description":"Only 1099-flagged vendors."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ContractorsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contractors/{vendor_id}":{"put":{"tags":["contractors"],"summary":"Update contractor 1099 fields","description":"Set the 1099 flag, tax id, tax id type, and default box.","operationId":"update_contractor_api_v1_contractors__vendor_id__put","parameters":[{"name":"vendor_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractorUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ContractorResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fx/rates":{"get":{"tags":["fx-rates"],"summary":"List FX rates","description":"List stored FX rates for the business.","operationId":"list_fx_rates_api_v1_fx_rates_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FxRatesListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["fx-rates"],"summary":"Upsert FX rate","description":"Create or update an FX rate for a (base, quote) pair on a date.","operationId":"upsert_fx_rate_api_v1_fx_rates_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FxRateUpsertRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FxRateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fx/exposure":{"get":{"tags":["fx-rates"],"summary":"FX exposure preview","description":"Per-currency open AR/AP exposure and unrealized gain/loss.","operationId":"fx_exposure_api_v1_fx_exposure_get","parameters":[{"name":"as_of_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Revaluation date.","title":"As Of Date"},"description":"Revaluation date."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FxRevaluationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fx/revalue":{"post":{"tags":["fx-rates"],"summary":"Post FX revaluation","description":"Revalue open foreign AR/AP and post the adjusting JE.","operationId":"fx_revalue_api_v1_fx_revalue_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FxRevaluationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FxRevaluationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders":{"post":{"tags":["purchase-orders"],"summary":"Create inventory order","description":"Create a new purchase order for inventory restocking.","operationId":"create_order_api_v1_purchase_orders_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryOrderCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OrderResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["purchase-orders"],"summary":"List inventory orders","description":"Retrieve all purchase orders with their status and totals.","operationId":"get_orders_api_v1_purchase_orders_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by order status","title":"Status"},"description":"Filter by order status"},{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by vendor ID","title":"Vendor Id"},"description":"Filter by vendor ID"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search PO number, name, description, vendor, or status","title":"Search"},"description":"Search PO number, name, description, vendor, or status"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OrderListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/{id}":{"get":{"tags":["purchase-orders"],"summary":"Get inventory order","description":"Retrieve a specific purchase order with line items.","operationId":"get_order_api_v1_purchase_orders__id__get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"order_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OrderResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["purchase-orders"],"summary":"Update inventory order","description":"Update purchase order details with optimistic locking support.","operationId":"update_order_api_v1_purchase_orders__id__put","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryOrderUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OrderResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["purchase-orders"],"summary":"Delete inventory order","description":"Permanently delete a purchase order.","operationId":"delete_order_api_v1_purchase_orders__id__delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/{id}/payments":{"post":{"tags":["purchase-orders"],"summary":"Record payment for purchase order","description":"Link a bank transaction to a purchase order as a payment.","operationId":"record_order_payment_api_v1_purchase_orders__id__payments_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPaymentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OrderPaymentResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/pdf":{"get":{"tags":["purchase-orders"],"summary":"Get order PDFs","description":"Get download URLs for order PDFs.","operationId":"get_order_pdfs_api_v1_purchase_orders_pdf_get","parameters":[{"name":"order_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated order UUIDs","title":"Order Ids"},"description":"Comma-separated order UUIDs"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetOrderPdfsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/{order_id}/pdf":{"post":{"tags":["purchase-orders"],"summary":"Generate order PDF","description":"Generate or regenerate a PDF purchase order document.","operationId":"generate_order_pdf_api_v1_purchase_orders__order_id__pdf_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Order Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GenerateOrderPdfResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/{id}/recalculate-totals":{"post":{"tags":["purchase-orders"],"summary":"Recalculate order totals","description":"Recalculate order total from line items and payments.","operationId":"recalculate_order_totals_api_v1_purchase_orders__id__recalculate_totals_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OrderResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/{id}/submit":{"post":{"tags":["purchase-orders"],"summary":"Submit purchase order","description":"Transition PO to 'submitted' and create a forecasted bill.","operationId":"submit_order_api_v1_purchase_orders__id__submit_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OrderResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/{id}/mark-in-production":{"post":{"tags":["purchase-orders"],"summary":"Mark purchase order in production","description":"Transition PO to 'in_production'.","operationId":"mark_in_production_api_v1_purchase_orders__id__mark_in_production_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OrderResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/{id}/mark-ready":{"post":{"tags":["purchase-orders"],"summary":"Mark purchase order ready","description":"Transition PO to 'ready' (goods produced, not yet shipped).","operationId":"mark_ready_api_v1_purchase_orders__id__mark_ready_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OrderResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/{id}/mark-shipped":{"post":{"tags":["purchase-orders"],"summary":"Mark purchase order shipped","description":"Transition PO to 'shipped' and create an in-transit transfer.","operationId":"mark_shipped_api_v1_purchase_orders__id__mark_shipped_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OrderResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/{id}/mark-partially-received":{"post":{"tags":["purchase-orders"],"summary":"Mark purchase order partially received","description":"Transition PO to 'partially_received'. Set by the shipment flow when at least one shipment has been received but more is still pending against the PO.","operationId":"mark_partially_received_api_v1_purchase_orders__id__mark_partially_received_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OrderResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/{id}/receive":{"post":{"tags":["purchase-orders"],"summary":"Receive purchase order","description":"Transition PO to 'received', flip linked Bill from forecasted to received, mark linked transfer as received, write cost snapshots, and post received quantities to on-hand inventory at ship_to_location_id (skipped when a received shipment is already associated with the PO, since that path writes inventory itself).","operationId":"receive_order_api_v1_purchase_orders__id__receive_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OrderResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/{id}/cancel":{"post":{"tags":["purchase-orders"],"summary":"Cancel purchase order","description":"Cancel a PO and reverse any in-transit transfer.","operationId":"cancel_order_api_v1_purchase_orders__id__cancel_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_OrderResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendors":{"get":{"tags":["vendors"],"summary":"List vendors","description":"Retrieve all suppliers/vendors for the business.","operationId":"list_vendors_api_v1_vendors_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"Fuzzy search vendors by name (uses trigram matching)","title":"Search"},"description":"Fuzzy search vendors by name (uses trigram matching)"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["vendors"],"summary":"Create vendor","description":"Add a new supplier/vendor.","operationId":"create_vendor_api_v1_vendors_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendors/bulk-upload":{"post":{"tags":["vendors"],"summary":"Bulk upload vendors from CSV","description":"Upload a CSV file to create multiple vendors at once. Duplicate emails are skipped. Returns created/skipped counts and per-row errors.","operationId":"bulk_upload_vendors_api_v1_vendors_bulk_upload_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_bulk_upload_vendors_api_v1_vendors_bulk_upload_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorBulkUploadResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendors/bulk-upload/template":{"get":{"tags":["vendors"],"summary":"Download bulk vendor upload CSV template","description":"Get a sample CSV template with the expected columns for bulk vendor upload.","operationId":"download_vendor_bulk_upload_template_api_v1_vendors_bulk_upload_template_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TemplateResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendors/check-duplicates":{"get":{"tags":["vendors"],"summary":"Check for duplicate vendors","description":"Check if a vendor already exists using name, email, tax ID similarity.","operationId":"check_duplicates_api_v1_vendors_check_duplicates_get","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","description":"Vendor name to check","title":"Name"},"description":"Vendor name to check"},{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Email to check","title":"Email"},"description":"Email to check"},{"name":"tax_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Tax ID to check","title":"Tax Id"},"description":"Tax ID to check"},{"name":"exclude_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Vendor ID to exclude (for updates)","title":"Exclude Id"},"description":"Vendor ID to exclude (for updates)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorDuplicateCheckResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendors/{id}":{"get":{"tags":["vendors"],"summary":"Get vendor","description":"Retrieve a specific vendor by ID.","operationId":"get_vendor_api_v1_vendors__id__get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["vendors"],"summary":"Delete vendor","description":"Soft delete a vendor record. The vendor is marked as deleted and hidden from list endpoints, but remains retrievable by ID so existing references on bills and other records stay intact.","operationId":"delete_vendor_api_v1_vendors__id__delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["vendors"],"summary":"Update vendor","description":"Update vendor contact information.","operationId":"update_vendor_api_v1_vendors__id__put","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendors/{vendor_id}/contacts":{"get":{"tags":["vendors"],"summary":"List vendor contacts","description":"Retrieve all contacts for a vendor.","operationId":"list_contacts_api_v1_vendors__vendor_id__contacts_get","parameters":[{"name":"vendor_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__SuccessEnvelope_ListContactsResponse___2"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["vendors"],"summary":"Create vendor contact","description":"Add a new contact to a vendor.","operationId":"create_contact_api_v1_vendors__vendor_id__contacts_post","parameters":[{"name":"vendor_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityContactCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EntityContactResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendors/{vendor_id}/contacts/{contact_id}":{"get":{"tags":["vendors"],"summary":"Get vendor contact","description":"Retrieve a specific vendor contact.","operationId":"get_contact_api_v1_vendors__vendor_id__contacts__contact_id__get","parameters":[{"name":"vendor_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EntityContactResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["vendors"],"summary":"Update vendor contact","description":"Update an existing vendor contact.","operationId":"update_contact_api_v1_vendors__vendor_id__contacts__contact_id__put","parameters":[{"name":"vendor_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityContactUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EntityContactResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["vendors"],"summary":"Delete vendor contact","description":"Delete a vendor contact.","operationId":"delete_contact_api_v1_vendors__vendor_id__contacts__contact_id__delete","parameters":[{"name":"vendor_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendor-contracts":{"get":{"tags":["vendor-contracts"],"summary":"List vendor contracts","description":"List all vendor contracts/MSAs for the business.","operationId":"list_vendor_contracts_api_v1_vendor_contracts_get","parameters":[{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by vendor UUID","title":"Vendor Id"},"description":"Filter by vendor UUID"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: draft, active, expired, terminated","title":"Status"},"description":"Filter by status: draft, active, expired, terminated"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorContractListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["vendor-contracts"],"summary":"Create vendor contract","description":"Create a new vendor contract/MSA.","operationId":"create_vendor_contract_api_v1_vendor_contracts_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorContractCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorContractResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendor-contracts/{contract_id}":{"get":{"tags":["vendor-contracts"],"summary":"Get vendor contract","description":"Get details of a specific vendor contract.","operationId":"get_vendor_contract_api_v1_vendor_contracts__contract_id__get","parameters":[{"name":"contract_id","in":"path","required":true,"schema":{"type":"string","title":"Contract Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorContractResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["vendor-contracts"],"summary":"Update vendor contract","description":"Update an existing vendor contract.","operationId":"update_vendor_contract_api_v1_vendor_contracts__contract_id__put","parameters":[{"name":"contract_id","in":"path","required":true,"schema":{"type":"string","title":"Contract Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorContractUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorContractResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["vendor-contracts"],"summary":"Delete vendor contract","description":"Delete a vendor contract.","operationId":"delete_vendor_contract_api_v1_vendor_contracts__contract_id__delete","parameters":[{"name":"contract_id","in":"path","required":true,"schema":{"type":"string","title":"Contract Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendor-contracts/analyze":{"post":{"tags":["vendor-contracts"],"summary":"AI contract analysis","description":"Get AI-powered vendor contract analysis.","operationId":"analyze_contracts_api_v1_vendor_contracts_analyze_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AnalyzeContractsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendor-credits":{"get":{"tags":["vendor-credits"],"summary":"List vendor credits","description":"List all vendor credits for the business with optional filtering.","operationId":"list_vendor_credits_api_v1_vendor_credits_get","parameters":[{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by vendor ID","title":"Vendor Id"},"description":"Filter by vendor ID"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/VendorCreditStatusEnum"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"has_remaining_balance","in":"query","required":false,"schema":{"type":"boolean","description":"Only show credits with remaining balance","default":false,"title":"Has Remaining Balance"},"description":"Only show credits with remaining balance"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by vendor credit number (e.g. VC-0001)","title":"Search"},"description":"Search by vendor credit number (e.g. VC-0001)"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Limit"},"description":"Page size"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorCreditsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["vendor-credits"],"summary":"Create vendor credit","description":"Create a new vendor credit in draft status.","operationId":"create_vendor_credit_api_v1_vendor_credits_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCreditCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorCreditResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendor-credits/{vendor_credit_id}":{"get":{"tags":["vendor-credits"],"summary":"Get vendor credit","description":"Get a specific vendor credit by ID.","operationId":"get_vendor_credit_api_v1_vendor_credits__vendor_credit_id__get","parameters":[{"name":"vendor_credit_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Credit Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorCreditResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["vendor-credits"],"summary":"Update vendor credit","description":"Update a draft vendor credit.","operationId":"update_vendor_credit_api_v1_vendor_credits__vendor_credit_id__put","parameters":[{"name":"vendor_credit_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Credit Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCreditUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorCreditResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["vendor-credits"],"summary":"Delete vendor credit","description":"Delete a vendor credit. Applied credits are removed from linked bills and those bills are recalculated. Void credits cannot be deleted.","operationId":"delete_vendor_credit_api_v1_vendor_credits__vendor_credit_id__delete","parameters":[{"name":"vendor_credit_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Credit Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendor-credits/{vendor_credit_id}/issue":{"post":{"tags":["vendor-credits"],"summary":"Issue vendor credit","description":"Issue a draft vendor credit, making it available for application to bills.","operationId":"issue_vendor_credit_api_v1_vendor_credits__vendor_credit_id__issue_post","parameters":[{"name":"vendor_credit_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Credit Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorCreditResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendor-credits/{vendor_credit_id}/void":{"post":{"tags":["vendor-credits"],"summary":"Void vendor credit","description":"Void a vendor credit. Only allowed for unapplied (draft or issued) credits.","operationId":"void_vendor_credit_api_v1_vendor_credits__vendor_credit_id__void_post","parameters":[{"name":"vendor_credit_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Credit Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCreditVoid"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorCreditResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendor-credits/{vendor_credit_id}/apply":{"post":{"tags":["vendor-credits"],"summary":"Apply vendor credit to bill","description":"Apply a portion or all of a vendor credit to a bill.","operationId":"apply_vendor_credit_api_v1_vendor_credits__vendor_credit_id__apply_post","parameters":[{"name":"vendor_credit_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Credit Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCreditApplicationCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorCreditApplicationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vendor-credits/vendors/{vendor_id}/credits":{"get":{"tags":["vendor-credits"],"summary":"Get vendor available credits","description":"Get summary of available vendor credits for a vendor.","operationId":"get_vendor_credits_summary_api_v1_vendor_credits_vendors__vendor_id__credits_get","parameters":[{"name":"vendor_id","in":"path","required":true,"schema":{"type":"string","title":"Vendor Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_VendorCreditSummary_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reconciliations":{"post":{"tags":["reconciliations"],"summary":"Create reconciliation","description":"Create a new bank reconciliation (with S3 key).\n\nUse this endpoint if you've already uploaded the statement to S3.\nFor direct file upload, use POST /reconciliations/upload instead.\n\n**Request Body:**\n- `ledger_id`: UUID of ledger to reconcile against (required)\n- `statement_s3_key`: S3 key of uploaded bank statement (required)\n- `start_date`: Statement period start date in ISO 8601 format (required)\n- `end_date`: Statement period end date in ISO 8601 format (required)\n- `statement_filename`: Original filename (optional)\n- `opening_balance`: Opening balance in cents (optional)\n- `closing_balance`: Closing balance in cents (optional)\n- `auto_start`: Auto-start processing workflow (optional, defaults to true)","operationId":"create_reconciliation_api_v1_reconciliations_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconciliationCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__SuccessEnvelope_CreateReconciliationResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["reconciliations"],"summary":"List reconciliations","description":"List reconciliations for the business.","operationId":"list_reconciliations_api_v1_reconciliations_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":100,"minimum":1},{"type":"null"}],"description":"Page size","default":50,"title":"Limit"},"description":"Page size"},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Pagination offset","title":"Offset"},"description":"Pagination offset"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Include total count (expensive - avoid if possible)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListReconciliationsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reconciliations/upload":{"post":{"tags":["reconciliations"],"summary":"Create reconciliation with upload","description":"Create a new bank reconciliation with direct file upload.\n\nSupports PDF, CSV, and Excel bank statements.\nThe file is uploaded to S3 and processed automatically.\n\nThe workflow will:\n1. Upload file to S3\n2. Parse the bank statement using AI (handles any format)\n3. Fetch ledger transactions for the period\n4. Run AI matching to suggest matches\n5. Store results for review\n\n**Error 413:** File too large (max 50 MB).","operationId":"create_reconciliation_with_upload_api_v1_reconciliations_upload_post","parameters":[{"name":"ledger_id","in":"query","required":true,"schema":{"type":"string","description":"ID of ledger to reconcile against","title":"Ledger Id"},"description":"ID of ledger to reconcile against"},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Statement period start date","title":"Start Date"},"description":"Statement period start date"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Statement period end date","title":"End Date"},"description":"Statement period end date"},{"name":"opening_balance","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Opening balance in cents","title":"Opening Balance"},"description":"Opening balance in cents"},{"name":"closing_balance","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Closing balance in cents","title":"Closing Balance"},"description":"Closing balance in cents"},{"name":"auto_start","in":"query","required":false,"schema":{"type":"boolean","description":"Auto-start processing workflow","default":true,"title":"Auto Start"},"description":"Auto-start processing workflow"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_reconciliation_with_upload_api_v1_reconciliations_upload_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreateReconciliationWithUploadResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reconciliations/{reconciliation_id}":{"get":{"tags":["reconciliations"],"summary":"Get reconciliation","description":"Get reconciliation details.\n\nIncludes full transaction data, AI matches, and approved matches.","operationId":"get_reconciliation_api_v1_reconciliations__reconciliation_id__get","parameters":[{"name":"reconciliation_id","in":"path","required":true,"schema":{"type":"string","title":"Reconciliation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetReconciliationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reconciliations/{reconciliation_id}/start":{"post":{"tags":["reconciliations"],"summary":"Start reconciliation processing","description":"Start or restart reconciliation processing.\n\nUse this to retry a failed reconciliation or start a reconciliation\nthat was created without auto_start.","operationId":"start_reconciliation_processing_api_v1_reconciliations__reconciliation_id__start_post","parameters":[{"name":"reconciliation_id","in":"path","required":true,"schema":{"type":"string","title":"Reconciliation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_StartReconciliationProcessingResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reconciliations/{reconciliation_id}/matches/approve":{"post":{"tags":["reconciliations"],"summary":"Approve match","description":"Approve a transaction match.","operationId":"approve_match_api_v1_reconciliations__reconciliation_id__matches_approve_post","parameters":[{"name":"reconciliation_id","in":"path","required":true,"schema":{"type":"string","title":"Reconciliation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchApprovalRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApproveMatchResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reconciliations/{reconciliation_id}/matches/reject":{"post":{"tags":["reconciliations"],"summary":"Reject match","description":"Reject/remove an approved match.","operationId":"reject_match_api_v1_reconciliations__reconciliation_id__matches_reject_post","parameters":[{"name":"reconciliation_id","in":"path","required":true,"schema":{"type":"string","title":"Reconciliation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchRejectionRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RejectMatchResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reconciliations/{reconciliation_id}/matches/bulk-approve":{"post":{"tags":["reconciliations"],"summary":"Bulk approve matches","description":"Bulk approve transaction matches.","operationId":"bulk_approve_matches_api_v1_reconciliations__reconciliation_id__matches_bulk_approve_post","parameters":[{"name":"reconciliation_id","in":"path","required":true,"schema":{"type":"string","title":"Reconciliation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkApproveRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkApproveMatchesResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reconciliations/{reconciliation_id}/matches/bulk-reject":{"post":{"tags":["reconciliations"],"summary":"Bulk reject matches","description":"Bulk reject/remove approved matches.","operationId":"bulk_reject_matches_api_v1_reconciliations__reconciliation_id__matches_bulk_reject_post","parameters":[{"name":"reconciliation_id","in":"path","required":true,"schema":{"type":"string","title":"Reconciliation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRejectRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkRejectMatchesResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reconciliations/{reconciliation_id}/balance":{"get":{"tags":["reconciliations"],"summary":"Get balance validation","description":"Get balance validation for the reconciliation.\n\nReturns whether the reconciliation balances and details:\n- Opening balance + Net matched transactions = Closing balance\n\nUseful to check before completing the reconciliation.","operationId":"get_balance_validation_api_v1_reconciliations__reconciliation_id__balance_get","parameters":[{"name":"reconciliation_id","in":"path","required":true,"schema":{"type":"string","title":"Reconciliation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetBalanceValidationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reconciliations/{reconciliation_id}/complete":{"post":{"tags":["reconciliations"],"summary":"Complete reconciliation","description":"Complete and lock the reconciliation.","operationId":"complete_reconciliation_api_v1_reconciliations__reconciliation_id__complete_post","parameters":[{"name":"reconciliation_id","in":"path","required":true,"schema":{"type":"string","title":"Reconciliation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CompleteRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__SuccessEnvelope_CompleteReconciliationResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reconciliations/{reconciliation_id}/pdf":{"get":{"tags":["reconciliations"],"summary":"Download reconciliation PDF","description":"Download reconciliation report as PDF.\n\nPDF is generated on-demand from stored data.\nOnly available for completed reconciliations.","operationId":"download_reconciliation_pdf_api_v1_reconciliations__reconciliation_id__pdf_get","parameters":[{"name":"reconciliation_id","in":"path","required":true,"schema":{"type":"string","title":"Reconciliation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DownloadReconciliationPdfResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reconciliations/{reconciliation_id}/explain-matches":{"post":{"tags":["reconciliations"],"summary":"AI match explanations","description":"Get AI-powered explanations for reconciliation matches.","operationId":"explain_matches_api_v1_reconciliations__reconciliation_id__explain_matches_post","parameters":[{"name":"reconciliation_id","in":"path","required":true,"schema":{"type":"string","title":"Reconciliation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ExplainMatchesResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/recurring":{"get":{"tags":["recurring"],"summary":"List recurring templates","description":"List all recurring templates for the business with optional filtering.","operationId":"list_recurring_templates_api_v1_recurring_get","parameters":[{"name":"recurrence_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/app__models__recurring_templates__RecurrenceTypeEnum"},{"type":"null"}],"description":"Filter by type (invoice or bill)","title":"Recurrence Type"},"description":"Filter by type (invoice or bill)"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/RecurringStatusEnum"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by customer ID (for invoice templates)","title":"Customer Id"},"description":"Filter by customer ID (for invoice templates)"},{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by vendor ID (for bill templates)","title":"Vendor Id"},"description":"Filter by vendor ID (for bill templates)"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search name, description, frequency, status, or counterparty","title":"Search"},"description":"Search name, description, frequency, status, or counterparty"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecurringTemplateListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["recurring"],"summary":"Create recurring template","description":"Create a new recurring invoice or bill template.","operationId":"create_recurring_template_api_v1_recurring_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringTemplateCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecurringTemplateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/recurring/invoices":{"get":{"tags":["recurring"],"summary":"List recurring invoice templates","description":"List all recurring invoice templates for the business.","operationId":"list_recurring_invoice_templates_api_v1_recurring_invoices_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/RecurringStatusEnum"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by customer ID","title":"Customer Id"},"description":"Filter by customer ID"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecurringTemplateListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/recurring/bills":{"get":{"tags":["recurring"],"summary":"List recurring bill templates","description":"List all recurring bill templates for the business.","operationId":"list_recurring_bill_templates_api_v1_recurring_bills_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/RecurringStatusEnum"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by vendor ID","title":"Vendor Id"},"description":"Filter by vendor ID"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecurringTemplateListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/recurring/{template_id}":{"get":{"tags":["recurring"],"summary":"Get recurring template","description":"Get a specific recurring template by ID.","operationId":"get_recurring_template_api_v1_recurring__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecurringTemplateResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["recurring"],"summary":"Update recurring template","description":"Update an existing recurring template.","operationId":"update_recurring_template_api_v1_recurring__template_id__put","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringTemplateUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecurringTemplateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["recurring"],"summary":"Delete recurring template","description":"Delete a recurring template. This action cannot be undone.","operationId":"delete_recurring_template_api_v1_recurring__template_id__delete","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/recurring/{template_id}/pause":{"post":{"tags":["recurring"],"summary":"Pause recurring template","description":"Pause an active recurring template. No new documents will be generated until resumed.","operationId":"pause_recurring_template_api_v1_recurring__template_id__pause_post","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecurringTemplateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/recurring/{template_id}/resume":{"post":{"tags":["recurring"],"summary":"Resume recurring template","description":"Resume a paused recurring template. Next occurrence will be recalculated.","operationId":"resume_recurring_template_api_v1_recurring__template_id__resume_post","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecurringTemplateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/recurring/{template_id}/cancel":{"post":{"tags":["recurring"],"summary":"Cancel recurring template","description":"Cancel a recurring template. This cannot be undone.","operationId":"cancel_recurring_template_api_v1_recurring__template_id__cancel_post","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecurringTemplateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/recurring/{template_id}/history":{"get":{"tags":["recurring"],"summary":"Get recurring template history","description":"Get all bills or invoices generated from this recurring template.","operationId":"get_recurring_template_history_api_v1_recurring__template_id__history_get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum items to return","default":50,"title":"Limit"},"description":"Maximum items to return"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecurringTemplateHistoryResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/recurring/{template_id}/clone":{"post":{"tags":["recurring"],"summary":"Clone recurring template","description":"Create a copy of an existing recurring template with optional overrides.","operationId":"clone_recurring_template_api_v1_recurring__template_id__clone_post","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringTemplateClone"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecurringTemplateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/recurring/{template_id}/skip":{"post":{"tags":["recurring"],"summary":"Skip next occurrence","description":"Skip the next scheduled occurrence without generating a document.","operationId":"skip_recurring_template_occurrence_api_v1_recurring__template_id__skip_post","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SkipOccurrenceResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/recurring/suggest-templates":{"post":{"tags":["recurring"],"summary":"AI recurring template suggestions","description":"Get AI-powered suggestions for recurring transaction templates.","operationId":"suggest_templates_api_v1_recurring_suggest_templates_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SuggestRecurringTemplatesResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/types":{"get":{"tags":["reports"],"summary":"Get supported report types","description":"Retrieve a list of all supported report types with their metadata.","operationId":"get_report_types_api_v1_reports_types_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ReportTypesResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports":{"get":{"tags":["reports"],"summary":"List reports","description":"Retrieve all reports for a business with pagination.","operationId":"list_reports_api_v1_reports_get","parameters":[{"name":"client_visible_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Client Visible Only"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ReportsListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["reports"],"summary":"Generate report","description":"Queue a report for generation and return task ID for tracking.","operationId":"generate_report_api_v1_reports_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportCreateRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ReportTaskResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/download":{"get":{"tags":["reports"],"summary":"Download report (proxy)","description":"Stream a report file from S3. Same-origin proxy avoids CORS issues when opening links in new tabs.","operationId":"download_report_api_v1_reports_download_get","parameters":[{"name":"s3_key","in":"query","required":true,"schema":{"type":"string","title":"S3 Key"}},{"name":"filename","in":"query","required":false,"schema":{"type":"string","default":"report","title":"Filename"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/{report_id}":{"get":{"tags":["reports"],"summary":"Get report","description":"Retrieve a specific report by ID.","operationId":"get_report_api_v1_reports__report_id__get","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ReportResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/subledger-gl-reconciliation":{"get":{"tags":["reports"],"summary":"Sub-ledger to GL reconciliation","description":"Compare AR/AP sub-ledger open balances against their GL control-account balances.","operationId":"get_subledger_gl_reconciliation_api_v1_reports_subledger_gl_reconciliation_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SubledgerGlReconciliationResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/suggest":{"post":{"tags":["reports"],"summary":"AI report suggestions","description":"Get AI-powered report suggestions for the business.","operationId":"suggest_reports_api_v1_reports_suggest_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SuggestReportResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-reporting/decks":{"get":{"tags":["ai-reporting"],"summary":"List generated decks","description":"Cursor-paginated list of AI-generated decks for the business.","operationId":"list_decks_api_v1_ai_reporting_decks_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CursorPaginatedResponse_DeckListItem__"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["ai-reporting"],"summary":"Generate a new AI deck","description":"Build a new deck from live data + AI commentary and persist it. Returns the full DeckSpec ready to render.","operationId":"generate_deck_api_v1_ai_reporting_decks_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateDeckRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GenerateDeckResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-reporting/decks/{deck_id}":{"get":{"tags":["ai-reporting"],"summary":"Get a deck","description":"Fetch the full DeckSpec for a single deck.","operationId":"get_deck_api_v1_ai_reporting_decks__deck_id__get","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DeckSpec_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["ai-reporting"],"summary":"Delete a deck","description":"Soft-delete a deck. Existing share links continue to 404.","operationId":"delete_deck_api_v1_ai_reporting_decks__deck_id__delete","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-reporting/decks/{deck_id}/slides/{slide_id}":{"patch":{"tags":["ai-reporting"],"summary":"Edit a slide","description":"Patch the slide title, commentary (headline/claims/recommendation) or hidden flag. Use this for the 'edit commentary' button.","operationId":"update_slide_api_v1_ai_reporting_decks__deck_id__slides__slide_id__patch","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}},{"name":"slide_id","in":"path","required":true,"schema":{"type":"string","title":"Slide Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSlideRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_Annotated_Union_CoverSlide__ExecSummarySlide__PnlSummarySlide__ArAgingSlide__CashPositionSlide__InventoryCogsSlide__CustomerConcentrationSlide__AsksSlide__CustomSlideSpec___FieldInfo_annotation_NoneType__required_True__discriminator__slide_type____"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-reporting/decks/{deck_id}/slides/{slide_id}/toggle-hidden":{"post":{"tags":["ai-reporting"],"summary":"Toggle slide visibility","description":"Flip the ``hidden`` flag on a single slide. No body required.","operationId":"toggle_slide_hidden_api_v1_ai_reporting_decks__deck_id__slides__slide_id__toggle_hidden_post","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}},{"name":"slide_id","in":"path","required":true,"schema":{"type":"string","title":"Slide Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_Annotated_Union_CoverSlide__ExecSummarySlide__PnlSummarySlide__ArAgingSlide__CashPositionSlide__InventoryCogsSlide__CustomerConcentrationSlide__AsksSlide__CustomSlideSpec___FieldInfo_annotation_NoneType__required_True__discriminator__slide_type____"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-reporting/decks/{deck_id}/slides/reorder":{"post":{"tags":["ai-reporting"],"summary":"Reorder slides","description":"Set a new slide order via a list of slide_ids.","operationId":"reorder_slides_api_v1_ai_reporting_decks__deck_id__slides_reorder_post","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderSlidesRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DeckSpec_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-reporting/decks/{deck_id}/export":{"post":{"tags":["ai-reporting"],"summary":"Export a deck","description":"Export an already-generated deck to PPTX or PDF. The client uploads rendered slide PNGs as multipart parts; the server assembles them via python-pptx (PPTX) or ReportLab (PDF fallback). Returns the file as a streaming response with a content-disposition header.","operationId":"export_deck_api_v1_ai_reporting_decks__deck_id__export_post","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(pptx|pdf)$","default":"pptx","title":"Format"}},{"name":"commentary","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Commentary"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_export_deck_api_v1_ai_reporting_decks__deck_id__export_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ExportDeckResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-reporting/decks/{deck_id}/share":{"post":{"tags":["ai-reporting"],"summary":"Create a public share link for a deck","description":"Mint a SHA-256 token-protected public share URL. The raw token is returned in this response exactly once — store or display it immediately. Subsequent listings only show metadata (no token).","operationId":"create_share_api_v1_ai_reporting_decks__deck_id__share_post","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateShareRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ShareLinkResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-reporting/decks/{deck_id}/shares":{"get":{"tags":["ai-reporting"],"summary":"List share links for a deck","description":"All share links (active and revoked) ordered newest first.","operationId":"list_shares_api_v1_ai_reporting_decks__deck_id__shares_get","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DeckShareList_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-reporting/shares/{share_id}":{"delete":{"tags":["ai-reporting"],"summary":"Revoke a share link","description":"Mark the share as revoked. The public viewer returns 404 after.","operationId":"revoke_share_api_v1_ai_reporting_shares__share_id__delete","parameters":[{"name":"share_id","in":"path","required":true,"schema":{"type":"string","title":"Share Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/month-end-packages":{"get":{"tags":["month-end-packages"],"summary":"List month-end packages","description":"List all month-end packages requested for the business.","operationId":"list_packages_api_v1_month_end_packages_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: queued, in_progress, ready, failed","title":"Status"},"description":"Filter by status: queued, in_progress, ready, failed"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_MonthEndPackagesListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["month-end-packages"],"summary":"Queue a month-end package build","description":"Persist a queued package row and start the Temporal build workflow.","operationId":"create_package_api_v1_month_end_packages_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonthEndPackageCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_MonthEndPackageQueuedResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/month-end-packages/{package_id}":{"get":{"tags":["month-end-packages"],"summary":"Get month-end package","description":"Get a single month-end package by id (poll for build progress).","operationId":"get_package_api_v1_month_end_packages__package_id__get","parameters":[{"name":"package_id","in":"path","required":true,"schema":{"type":"string","title":"Package Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_MonthEndPackageResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/month-end-packages/{package_id}/download":{"get":{"tags":["month-end-packages"],"summary":"Get download URL","description":"Generate a short-lived presigned S3 URL for the package zip.","operationId":"get_download_url_api_v1_month_end_packages__package_id__download_get","parameters":[{"name":"package_id","in":"path","required":true,"schema":{"type":"string","title":"Package Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_MonthEndPackageDownloadResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/search":{"get":{"tags":["search"],"summary":"Global search","description":"Search across products, variants, customers, invoices, vendors, and more.","operationId":"search_entities_api_v1_search_get","parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Limit to: products, variants, customers, invoices, vendors, transactions, journal_entries, ledgers, emails","title":"Entity Type"},"description":"Limit to: products, variants, customers, invoices, vendors, transactions, journal_entries, ledgers, emails"},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Results after this date (ISO 8601: YYYY-MM-DD)","title":"Date From"},"description":"Results after this date (ISO 8601: YYYY-MM-DD)"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Results before this date (ISO 8601: YYYY-MM-DD)","title":"Date To"},"description":"Results before this date (ISO 8601: YYYY-MM-DD)"},{"name":"search_term","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Search Term"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SearchResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/search/natural":{"post":{"tags":["search"],"summary":"AI natural language search","description":"Search using natural language queries.","operationId":"natural_language_search_api_v1_search_natural_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_NLSearchResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/quickbooks/oauth/callback":{"get":{"tags":["quickbooks"],"summary":"QuickBooks OAuth callback","description":"Handle the Intuit OAuth redirect. Called by Intuit, not the frontend.","operationId":"quickbooks_oauth_callback_api_v1_quickbooks_oauth_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","description":"Authorization code from Intuit","title":"Code"},"description":"Authorization code from Intuit"},{"name":"state","in":"query","required":true,"schema":{"type":"string","description":"OAuth state nonce","title":"State"},"description":"OAuth state nonce"},{"name":"realmId","in":"query","required":true,"schema":{"type":"string","description":"QBO company id","title":"Realmid"},"description":"QBO company id"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/quickbooks/connect-url":{"get":{"tags":["quickbooks"],"summary":"Get QuickBooks OAuth connect URL","description":"Generate a URL to redirect the user to Intuit for authorization.","operationId":"get_connect_url_api_v1_quickbooks_connect_url_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__SuccessEnvelope_GetConnectUrlResponse___4"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/quickbooks/status":{"get":{"tags":["quickbooks"],"summary":"QuickBooks connection status","description":"Returns connection health and migration import status.","operationId":"get_connection_status_api_v1_quickbooks_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__SuccessEnvelope_GetConnectionStatusResponse___5"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/quickbooks/import":{"post":{"tags":["quickbooks"],"summary":"Start QuickBooks migration import","description":"Import everything from the chosen start date forward (accounts, customers, vendors, items, documents, transactions, payments, and journals) plus a single opening-balance JE as of the day before.","operationId":"start_import_api_v1_quickbooks_import_post","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Import everything dated on/after this date (YYYY-MM-DD). The opening balance is posted as of the day before.","title":"Start Date"},"description":"Import everything dated on/after this date (YYYY-MM-DD). The opening balance is posted as of the day before."},{"name":"phases","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Optional subset of document/posting sections to import (e.g. invoices, bills, payments). Omit to import everything. Master data and the opening balance always import.","title":"Phases"},"description":"Optional subset of document/posting sections to import (e.g. invoices, bills, payments). Omit to import everything. Master data and the opening balance always import."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_StartImportResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/quickbooks/migration-report":{"get":{"tags":["quickbooks"],"summary":"QuickBooks migration QA report","description":"Compare the QuickBooks Trial Balance against local ledger balances.","operationId":"get_migration_report_api_v1_quickbooks_migration_report_get","parameters":[{"name":"as_of_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"As-of date (YYYY-MM-DD)","title":"As Of Date"},"description":"As-of date (YYYY-MM-DD)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetMigrationReportResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/quickbooks/coverage-report":{"get":{"tags":["quickbooks"],"summary":"QuickBooks import coverage report","description":"Enumerate every supported QuickBooks object type, its DayZero native target model, and how many were imported.","operationId":"get_coverage_report_api_v1_quickbooks_coverage_report_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetCoverageReportResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/quickbooks/disconnect":{"delete":{"tags":["quickbooks"],"summary":"Disconnect QuickBooks","description":"Remove the QuickBooks integration and revoke stored credentials.","operationId":"disconnect_api_v1_quickbooks_disconnect_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_QuickBooksDisconnectResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/subscriptions/":{"get":{"tags":["subscriptions"],"summary":"List detected recurring transactions","description":"Detect recurring transactions from transaction history using counterparty and frequency analysis.","operationId":"list_subscriptions_api_v1_subscriptions__get","parameters":[{"name":"lookback_days","in":"query","required":false,"schema":{"type":"integer","maximum":730,"minimum":30,"description":"Days to look back","default":180,"title":"Lookback Days"},"description":"Days to look back"},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","description":"Sort: cost_desc, cost_asc, frequency, confidence_desc, recent, occurrences_desc","default":"cost_desc","title":"Sort By"},"description":"Sort: cost_desc, cost_asc, frequency, confidence_desc, recent, occurrences_desc"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListSubscriptionsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["subscriptions"],"summary":"Update a detected recurring transaction","description":"Override the display name, monthly cost, frequency, or add notes to a detected recurring transaction.","operationId":"update_subscription_api_v1_subscriptions__put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSubscriptionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UpdateSubscriptionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/subscriptions/summary":{"get":{"tags":["subscriptions"],"summary":"Recurring transactions summary for dashboard","description":"Returns total monthly cost, budget limit, and top 5 recurring transactions.","operationId":"get_summary_api_v1_subscriptions_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SubscriptionSummaryResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/subscriptions/history":{"get":{"tags":["subscriptions"],"summary":"Monthly spend history for recurring transactions","description":"Returns per-month totals and per-counterparty breakdown for charting.","operationId":"get_spend_history_api_v1_subscriptions_history_get","parameters":[{"name":"lookback_days","in":"query","required":false,"schema":{"type":"integer","maximum":730,"minimum":30,"description":"Days to look back","default":365,"title":"Lookback Days"},"description":"Days to look back"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SpendHistoryResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/subscriptions/dismiss":{"post":{"tags":["subscriptions"],"summary":"Dismiss a detected recurring transaction","description":"Mark a counterparty as not recurring. It won't appear in future results.","operationId":"dismiss_subscription_api_v1_subscriptions_dismiss_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__v1__schemas__subscriptions__DismissRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DismissSubscriptionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/subscriptions/restore":{"post":{"tags":["subscriptions"],"summary":"Restore a dismissed recurring transaction","description":"Undo a previous dismissal so the recurring transaction appears again.","operationId":"restore_subscription_api_v1_subscriptions_restore_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RestoreSubscriptionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/subscriptions/settings":{"get":{"tags":["subscriptions"],"summary":"Get recurring transaction budget settings","operationId":"get_settings_api_v1_subscriptions_settings_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetSettingsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["subscriptions"],"summary":"Set monthly recurring transaction limit","description":"Set or remove the monthly recurring transaction budget. Pass null to remove the limit.","operationId":"update_settings_api_v1_subscriptions_settings_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetLimitRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UpdateSettingsResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/subscriptions/analyze":{"post":{"tags":["subscriptions"],"summary":"AI subscription analysis","description":"Get AI-powered subscription analysis for optimization opportunities.","operationId":"analyze_subscriptions_api_v1_subscriptions_analyze_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AnalyzeSubscriptionsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tag-groups":{"get":{"tags":["tags"],"summary":"List tag groups","description":"Retrieve all tag groups for the current business","operationId":"list_tag_groups_api_v1_tag_groups_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TagGroupListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tags"],"summary":"Create tag group","description":"Create a new tag group for organizing tags","operationId":"create_tag_group_api_v1_tag_groups_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagGroupCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TagGroupResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tag-groups/{tag_group_id}":{"get":{"tags":["tags"],"summary":"Get tag group","description":"Retrieve a specific tag group by ID","operationId":"get_tag_group_api_v1_tag_groups__tag_group_id__get","parameters":[{"name":"tag_group_id","in":"path","required":true,"schema":{"type":"string","title":"Tag Group Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TagGroupResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["tags"],"summary":"Update tag group","description":"Update an existing tag group","operationId":"update_tag_group_api_v1_tag_groups__tag_group_id__put","parameters":[{"name":"tag_group_id","in":"path","required":true,"schema":{"type":"string","title":"Tag Group Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagGroupUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TagGroupResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tags"],"summary":"Delete tag group","description":"Delete a tag group. This will also delete all tags in the group.","operationId":"delete_tag_group_api_v1_tag_groups__tag_group_id__delete","parameters":[{"name":"tag_group_id","in":"path","required":true,"schema":{"type":"string","title":"Tag Group Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tags":{"get":{"tags":["tags"],"summary":"List tags","description":"Retrieve all tags for the current business, optionally filtered by tag group or fuzzy name search","operationId":"list_tags_api_v1_tags_get","parameters":[{"name":"tag_group_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter tags by tag group ID","title":"Tag Group Id"},"description":"Filter tags by tag group ID"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":255},{"type":"null"}],"description":"Fuzzy search tags by name (trigram similarity)","title":"Search"},"description":"Fuzzy search tags by name (trigram similarity)"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TagListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tags"],"summary":"Create tag","description":"Create a new tag, optionally in a tag group","operationId":"create_tag_api_v1_tags_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TagResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tags/suggest":{"post":{"tags":["tags"],"summary":"AI tag suggestions","description":"Get AI-powered tag name suggestions based on existing tags and optional context","operationId":"suggest_tags_api_v1_tags_suggest_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagSuggestRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TagSuggestResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tags/{tag_id}":{"get":{"tags":["tags"],"summary":"Get tag","description":"Retrieve a specific tag by ID","operationId":"get_tag_api_v1_tags__tag_id__get","parameters":[{"name":"tag_id","in":"path","required":true,"schema":{"type":"string","title":"Tag Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TagResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["tags"],"summary":"Update tag","description":"Update an existing tag","operationId":"update_tag_api_v1_tags__tag_id__put","parameters":[{"name":"tag_id","in":"path","required":true,"schema":{"type":"string","title":"Tag Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TagResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tags"],"summary":"Delete tag","description":"Delete a tag. This will remove the tag from all entities.","operationId":"delete_tag_api_v1_tags__tag_id__delete","parameters":[{"name":"tag_id","in":"path","required":true,"schema":{"type":"string","title":"Tag Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/entity-tags/{model_type}/{model_id}":{"get":{"tags":["tags"],"summary":"Get tags for an entity","description":"Retrieve all tags attached to a specific entity with cursor-based pagination","operationId":"get_entity_tags_api_v1_entity_tags__model_type___model_id__get","parameters":[{"name":"model_type","in":"path","required":true,"schema":{"type":"string","title":"Model Type"}},{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EntityTagListResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/entity-tags":{"post":{"tags":["tags"],"summary":"Attach tag to entity","description":"Attach a tag to a specific entity (transaction, invoice, bill, etc.). Idempotent: re-attaching the same tag returns the existing attachment.","operationId":"attach_tag_api_v1_entity_tags_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityTagCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_EntityTagResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/entity-tags/{tag_id}/{model_type}/{model_id}":{"delete":{"tags":["tags"],"summary":"Detach tag from entity","description":"Remove a tag from a specific entity","operationId":"detach_tag_api_v1_entity_tags__tag_id___model_type___model_id__delete","parameters":[{"name":"tag_id","in":"path","required":true,"schema":{"type":"string","title":"Tag Id"}},{"name":"model_type","in":"path","required":true,"schema":{"type":"string","title":"Model Type"}},{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/entity-tags/bulk-attach":{"post":{"tags":["tags"],"summary":"Bulk attach tags to an entity","description":"Attach multiple tags to a single entity at once","operationId":"bulk_attach_tags_api_v1_entity_tags_bulk_attach_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEntityTagCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkEntityTagAttachResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/entity-tags/bulk-detach":{"post":{"tags":["tags"],"summary":"Bulk detach tags from an entity","description":"Remove multiple tags from a single entity at once","operationId":"bulk_detach_tags_api_v1_entity_tags_bulk_detach_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEntityTagRemove"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkEntityTagDetachResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/entity-tags/batch":{"post":{"tags":["tags"],"summary":"Batch fetch tags for multiple entities","description":"Fetch tags for many entities of the same type in a single request. Returns a mapping of entity id -> its tags; entities with no tags are omitted. Replaces per-row GET /entity-tags/{model_type}/{model_id} calls to avoid request fan-out (and the edge rate limiting it causes).","operationId":"get_entity_tags_batch_api_v1_entity_tags_batch_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEntityTagsRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkEntityTagsResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tags/{tag_id}/entities/{model_type}":{"get":{"tags":["tags"],"summary":"Get entities with a tag","description":"Retrieve all entities of a specific type that have a particular tag","operationId":"get_tagged_entities_api_v1_tags__tag_id__entities__model_type__get","parameters":[{"name":"tag_id","in":"path","required":true,"schema":{"type":"string","title":"Tag Id"}},{"name":"model_type","in":"path","required":true,"schema":{"type":"string","title":"Model Type"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TaggedEntitiesListResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tax/rates":{"get":{"tags":["tax"],"summary":"List tax rates","description":"List all tax rates for the business.","operationId":"list_tax_rates_api_v1_tax_rates_get","parameters":[{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only show active rates","default":true,"title":"Active Only"},"description":"Only show active rates"},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by country","title":"Country"},"description":"Filter by country"},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by state","title":"State"},"description":"Filter by state"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TaxRatesListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tax"],"summary":"Create tax rate","description":"Create a new tax rate.","operationId":"create_tax_rate_api_v1_tax_rates_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRateCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TaxRateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tax/dedupe-imported":{"post":{"tags":["tax"],"summary":"Dedupe imported tax data","description":"Deactivate duplicate tax rates and codes created by integration imports.","operationId":"dedupe_imported_tax_api_v1_tax_dedupe_imported_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TaxDedupeResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tax/rates/default":{"get":{"tags":["tax"],"summary":"Get default tax rate","description":"Get the default tax rate for the business.","operationId":"get_default_tax_rate_api_v1_tax_rates_default_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TaxRateResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tax/rates/{rate_id}":{"get":{"tags":["tax"],"summary":"Get tax rate","description":"Get details of a specific tax rate.","operationId":"get_tax_rate_api_v1_tax_rates__rate_id__get","parameters":[{"name":"rate_id","in":"path","required":true,"schema":{"type":"string","title":"Rate Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TaxRateResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["tax"],"summary":"Update tax rate","description":"Update an existing tax rate.","operationId":"update_tax_rate_api_v1_tax_rates__rate_id__put","parameters":[{"name":"rate_id","in":"path","required":true,"schema":{"type":"string","title":"Rate Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRateUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TaxRateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tax"],"summary":"Deactivate tax rate","description":"Deactivate a tax rate (soft delete).","operationId":"deactivate_tax_rate_api_v1_tax_rates__rate_id__delete","parameters":[{"name":"rate_id","in":"path","required":true,"schema":{"type":"string","title":"Rate Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tax/codes":{"get":{"tags":["tax"],"summary":"List tax codes","description":"List all tax codes for the business.","operationId":"list_tax_codes_api_v1_tax_codes_get","parameters":[{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only show active codes","default":true,"title":"Active Only"},"description":"Only show active codes"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TaxCodesListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tax"],"summary":"Create tax code","description":"Create a new tax code.","operationId":"create_tax_code_api_v1_tax_codes_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCodeCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TaxCodeResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tax/codes/{code_id}":{"get":{"tags":["tax"],"summary":"Get tax code","description":"Get details of a specific tax code.","operationId":"get_tax_code_api_v1_tax_codes__code_id__get","parameters":[{"name":"code_id","in":"path","required":true,"schema":{"type":"string","title":"Code Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TaxCodeResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["tax"],"summary":"Update tax code","description":"Update an existing tax code.","operationId":"update_tax_code_api_v1_tax_codes__code_id__put","parameters":[{"name":"code_id","in":"path","required":true,"schema":{"type":"string","title":"Code Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCodeUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TaxCodeResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tax"],"summary":"Deactivate tax code","description":"Deactivate a tax code (soft delete).","operationId":"deactivate_tax_code_api_v1_tax_codes__code_id__delete","parameters":[{"name":"code_id","in":"path","required":true,"schema":{"type":"string","title":"Code Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tax/codes/seed-defaults":{"post":{"tags":["tax"],"summary":"Seed default tax codes","description":"Seed default tax codes for the business (if none exist).","operationId":"seed_default_codes_api_v1_tax_codes_seed_defaults_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TaxCodesListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tax/suggest-rates":{"post":{"tags":["tax"],"summary":"AI tax rate suggestions","description":"Get AI-powered tax rate suggestions for the business.","operationId":"suggest_rates_api_v1_tax_suggest_rates_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SuggestTaxRatesResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions":{"get":{"tags":["transactions"],"summary":"List transactions","description":"Retrieve bank transactions with filtering by date, ledger, source account, counter ledger, journal entry, or tags.","operationId":"list_transactions_api_v1_transactions_get","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Filter by specific transaction UUIDs","default":[],"title":"Id"},"description":"Filter by specific transaction UUIDs"},{"name":"ledger_id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Filter by bank account ledger UUIDs","default":[],"title":"Ledger Id"},"description":"Filter by bank account ledger UUIDs"},{"name":"opposing_ledger_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by opposing ledger UUID (the category/expense ledger from journal entry line entries)","title":"Opposing Ledger Id"},"description":"Filter by opposing ledger UUID (the category/expense ledger from journal entry line entries)"},{"name":"source_account_id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Filter by Teal source account IDs (bank accounts from Plaid)","default":[],"title":"Source Account Id"},"description":"Filter by Teal source account IDs (bank accounts from Plaid)"},{"name":"tag_id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Filter by assigned tag UUIDs","default":[],"title":"Tag Id"},"description":"Filter by assigned tag UUIDs"},{"name":"journal_entry_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by associated journal entry UUID","title":"Journal Entry Id"},"description":"Filter by associated journal entry UUID"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Include transactions from this date (ISO 8601)","title":"Start Date"},"description":"Include transactions from this date (ISO 8601)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Include transactions up to this date (ISO 8601)","title":"End Date"},"description":"Include transactions up to this date (ISO 8601)"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search transactions by description or counterparty name (case-insensitive partial match)","title":"Search"},"description":"Search transactions by description or counterparty name (case-insensitive partial match)"},{"name":"amount_direction","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by amount direction: 'inflow' for positive amounts (money in), 'outflow' for negative amounts (money out)","title":"Amount Direction"},"description":"Filter by amount direction: 'inflow' for positive amounts (money in), 'outflow' for negative amounts (money out)"},{"name":"only_uncategorized","in":"query","required":false,"schema":{"type":"boolean","description":"Filter to show only uncategorized transactions (those without a journal entry or linked to system uncategorized ledgers)","default":false,"title":"Only Uncategorized"},"description":"Filter to show only uncategorized transactions (those without a journal entry or linked to system uncategorized ledgers)"},{"name":"missing_counterparty","in":"query","required":false,"schema":{"type":"boolean","description":"Filter to show only transactions with no counterparty assigned (empty or NULL). Useful for surfacing wires / miscellaneous deposits that the auto-detection pipeline intentionally left blank for the bookkeeper to fill in.","default":false,"title":"Missing Counterparty"},"description":"Filter to show only transactions with no counterparty assigned (empty or NULL). Useful for surfacing wires / miscellaneous deposits that the auto-detection pipeline intentionally left blank for the bookkeeper to fill in."},{"name":"review_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by review status. Accepts 'reviewed', 'unreviewed', or a comma-separated combination. Must mirror the same flag on the export endpoint so the visible list and the exported file stay in sync.","title":"Review Status"},"description":"Filter by review status. Accepts 'reviewed', 'unreviewed', or a comma-separated combination. Must mirror the same flag on the export endpoint so the visible list and the exported file stay in sync."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransactionListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["transactions"],"summary":"Create transaction","description":"Manually create a transaction record (not synced from bank).","operationId":"create_transaction_api_v1_transactions_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransactionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/{transaction_id}":{"get":{"tags":["transactions"],"summary":"Get transaction","description":"Retrieve a specific transaction with all details.","operationId":"get_transaction_api_v1_transactions__transaction_id__get","parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","title":"Transaction Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransactionResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["transactions"],"summary":"Update transaction","description":"Update transaction metadata like tags, review status, or description.","operationId":"update_transaction_api_v1_transactions__transaction_id__put","parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","title":"Transaction Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransactionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["transactions"],"summary":"Delete or hide transaction","description":"Permanently delete a manual/CSV-imported transaction, or soft-delete (hide) a Plaid-synced transaction on the DayZero local engine.","operationId":"delete_transaction_api_v1_transactions__transaction_id__delete","parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","title":"Transaction Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/{transaction_id}/allocations":{"get":{"tags":["transactions"],"summary":"Get transaction allocations","description":"Return how much of a transaction has been allocated to invoices/bills and the remaining unallocated balance. All amounts in cents.","operationId":"get_transaction_allocations_api_v1_transactions__transaction_id__allocations_get","parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","title":"Transaction Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GetTransactionAllocationsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/suggested-matches/batch":{"post":{"tags":["transactions"],"summary":"Suggested matches for a batch of transactions","description":"Score a batch of bank transactions against open invoices (for money in) and open bills (for money out) and return ranked suggested matches, QBO-style. Used to render the inline 'N matches found' badge for the visible page of the Transactions list. Results are ephemeral (no suggestion records are persisted).","operationId":"get_bulk_suggested_matches_api_v1_transactions_suggested_matches_batch_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkSuggestedMatchesRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkSuggestedMatchesResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/suggested-matches/dismiss":{"post":{"tags":["transactions"],"summary":"Dismiss a suggested match","description":"Hide a specific invoice or bill suggestion for a bank transaction. Dismissed pairs are excluded from future inline suggested-match scoring until restored.","operationId":"dismiss_suggested_match_api_v1_transactions_suggested_matches_dismiss_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DismissSuggestedMatchRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DismissSuggestedMatchResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/{transaction_id}/suggested-matches":{"get":{"tags":["transactions"],"summary":"Suggested matches for a transaction","description":"Return ranked suggested matches for a single bank transaction. Income transactions are matched against open invoices; expense transactions against open bills. Matches are scored by amount, date proximity, memo, and counterparty similarity.","operationId":"get_transaction_suggested_matches_api_v1_transactions__transaction_id__suggested_matches_get","parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","title":"Transaction Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Max suggested matches","default":10,"title":"Limit"},"description":"Max suggested matches"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransactionSuggestedMatchesResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/batch/review-status":{"patch":{"tags":["transactions"],"summary":"Batch update review status","description":"Mark multiple transactions as reviewed or unreviewed in one request.","operationId":"update_transactions_review_status_api_v1_transactions_batch_review_status_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionMarkReviewedRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransactionListResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/batch/mark-reviewed-by-period":{"post":{"tags":["transactions"],"summary":"Mark all unreviewed transactions in a period as reviewed","description":"Bulk-mark every unreviewed transaction whose date falls within [period_start, period_end] as reviewed. Used by the monthly close checklist's 'Mark all reviewed' CTA.","operationId":"mark_period_transactions_reviewed_api_v1_transactions_batch_mark_reviewed_by_period_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionMarkReviewedByPeriodRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransactionMarkReviewedByPeriodResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/batch/reconciliation-status":{"patch":{"tags":["transactions"],"summary":"Batch update reconciliation status","description":"Mark multiple transactions as reconciled or unreconciled.","operationId":"update_transactions_reconciliation_status_api_v1_transactions_batch_reconciliation_status_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionMarkReconciledRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransactionListResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/batch/category":{"patch":{"tags":["transactions"],"summary":"Batch update category","description":"Batch update category for multiple transactions. Updates the opposing line entries' ledger to the specified ledger, effectively recategorizing the transactions.","operationId":"update_transactions_category_api_v1_transactions_batch_category_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionBulkUpdateCategoryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransactionListResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/batch/counterparty":{"patch":{"tags":["transactions"],"summary":"Batch update counterparty","description":"Set the counterparty name for multiple transactions at once.","operationId":"update_transactions_counterparty_api_v1_transactions_batch_counterparty_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionBulkUpdateCounterpartyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransactionListResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/batch/delete":{"post":{"tags":["transactions"],"summary":"Delete selected transactions","description":"Permanently delete manual/bulk-uploaded transactions, hard-delete Plaid transactions on the Teal engine (via Teal API), or soft-delete (hide) Plaid transactions on the DayZero local engine, by explicit IDs.","operationId":"bulk_delete_transactions_api_v1_transactions_batch_delete_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionBulkDeleteRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransactionBulkDeleteResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/by-date-range":{"delete":{"tags":["transactions"],"summary":"Delete transactions by date range","description":"Permanently delete every transaction for the current business whose date falls between ``start_date`` and ``end_date`` (inclusive). Journal entries that become orphaned are deleted along with their line entries, and for businesses still backed by the legacy Teal engine the matching Teal transactions and journal entries are removed remotely as well. This action is irreversible.","operationId":"delete_transactions_by_date_range_api_v1_transactions_by_date_range_delete","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Inclusive start date (YYYY-MM-DD). Transactions on or after this date are deleted.","title":"Start Date"},"description":"Inclusive start date (YYYY-MM-DD). Transactions on or after this date are deleted."},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Inclusive end date (YYYY-MM-DD). Transactions on or before this date are deleted.","title":"End Date"},"description":"Inclusive end date (YYYY-MM-DD). Transactions on or before this date are deleted."},{"name":"ledger_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional ledger ID to restrict the deletion to a single bank account.","title":"Ledger Id"},"description":"Optional ledger ID to restrict the deletion to a single bank account."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransactionDateRangeDeleteResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/{transaction_id}/restore":{"post":{"tags":["transactions"],"summary":"Restore a hidden transaction","description":"Un-hide a previously soft-deleted Plaid transaction on the DayZero local accounting engine. Re-creates the auto journal entry using the same categorization rules a fresh sync would apply.","operationId":"restore_transaction_api_v1_transactions__transaction_id__restore_post","parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","title":"Transaction Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RestoreTransactionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/bulk":{"post":{"tags":["transactions"],"summary":"Bulk create transactions","description":"Create multiple manual transactions in a single request.","operationId":"create_bulk_transactions_api_v1_transactions_bulk_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkTransactionCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkTransactionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/bulk-upload":{"post":{"tags":["transactions"],"summary":"Bulk upload transactions to new source account","description":"Upload historical transactions from a CSV/Excel file to a new source account.\n\n**Workflow (via Temporal for durability):**\n\n*Local engine:*\n1. Gets/creates ledger\n2. Reads transactions from the CSV/Excel file in S3\n3. Creates Transaction + Journal Entry rows with categorization\n4. Runs AI categorization pass for uncategorized transactions\n\n*Teal engine:*\n1. Gets/creates ledger and personal source account in Teal\n2. Reads transactions from the CSV/Excel file in S3\n3. Posts transactions to Teal source account\n4. Imports journal entries created by Teal\n\n**Supported File Formats:** .csv, .xlsx, .xls\n\n**CSV/Excel Columns (flexible naming):**\n- date/datetime/transaction_date: Transaction date (YYYY-MM-DD or ISO format)\n- amount/transaction_amount/value: Amount in dollars (positive or negative)\n- description/memo/name: Transaction description","operationId":"bulk_upload_transactions_api_v1_transactions_bulk_upload_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkTransactionUploadRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkTransactionUploadResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/bulk-upload/preview":{"post":{"tags":["transactions"],"summary":"Preview bulk transaction upload","description":"Preview and validate a CSV/Excel file before uploading transactions.\n\nThis endpoint allows you to:\n- Validate the file format and structure\n- See how many transactions will be uploaded\n- Preview sample transactions\n- Check for duplicate transactions (optional)\n- Apply date range filtering\n\n**Supported File Formats:** .csv, .xlsx, .xls","operationId":"preview_bulk_transaction_upload_api_v1_transactions_bulk_upload_preview_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkTransactionUploadPreviewRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkTransactionUploadPreviewResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/bulk-upload/paste":{"post":{"tags":["transactions"],"summary":"Upload pasted transaction text","description":"Accept raw CSV/TSV text (e.g. copied from a bank export or spreadsheet) and\nstore it as a CSV file in S3. Returns an `s3_key` that can be passed directly\nto the existing `/bulk-upload/preview` and `/bulk-upload` endpoints.\n\nThis lets users skip the file-save-and-upload step — they can copy transaction\ndata from their bank and paste it straight into DayZero.","operationId":"paste_transaction_text_api_v1_transactions_bulk_upload_paste_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasteTransactionTextRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PasteTransactionTextResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/bulk-upload/headers":{"post":{"tags":["transactions"],"summary":"Get CSV/Excel column headers for mapping","description":"Return the column headers, sample rows, and a suggested mapping for a previously\nuploaded CSV/Excel file. Use this before preview to let the user map their file's\ncolumns to DayZero fields (date, amount, description).","operationId":"get_bulk_upload_headers_api_v1_transactions_bulk_upload_headers_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUploadHeadersRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkUploadHeadersResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/bulk-upload/template":{"get":{"tags":["transactions"],"summary":"Download bulk transaction upload CSV template","description":"Get a sample CSV template with the expected columns for bulk transaction upload.","operationId":"download_bulk_upload_template_api_v1_transactions_bulk_upload_template_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TemplateResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/{transaction_id}/attachment":{"patch":{"tags":["transactions"],"summary":"Attach file to transaction","description":"Upload and attach a document file (receipt, invoice, etc.) to a transaction.","operationId":"attach_file_to_transaction_api_v1_transactions__transaction_id__attachment_patch","parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","title":"Transaction Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_attach_file_to_transaction_api_v1_transactions__transaction_id__attachment_patch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_TransactionResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/suggest-categories":{"post":{"tags":["transactions"],"summary":"Category suggestions","description":"Suggest ledger categories for uncategorized transactions.  By default only fast pattern-matching layers run (<1 s).  Pass include_ai=true to also run LLM categorization for transactions the pattern layers could not resolve.","operationId":"suggest_categories_api_v1_transactions_suggest_categories_post","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}},{"name":"only_uncategorized","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Only Uncategorized"}},{"name":"include_ai","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Ai"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_SuggestCategoriesResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/categorize-all":{"post":{"tags":["transactions"],"summary":"AI-categorize all uncategorized transactions","description":"Triggers the full AI categorization workflow (Temporal) which processes all uncategorized transactions using bank rules, historical patterns, and LLM categorization. High-confidence results are auto-applied and bank rules are created for future transactions. Returns immediately with a workflow ID.","operationId":"categorize_all_api_v1_transactions_categorize_all_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CategorizeAllResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transactions/recategorize-by-counterparty":{"post":{"tags":["transactions"],"summary":"Recategorize all transactions for a counterparty","description":"Move all uncategorized transactions for a given counterparty to the specified ledger.","operationId":"recategorize_by_counterparty_api_v1_transactions_recategorize_by_counterparty_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecategorizeByCounterpartyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecategorizeByCounterpartyResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transaction-clarifications/firm/transactions/{transaction_id}":{"post":{"tags":["transaction-clarifications"],"summary":"Ask the client about a transaction (firm)","description":"Attach a question to a transaction for the client to answer.","operationId":"create_clarification_api_v1_transaction_clarifications_firm_transactions__transaction_id__post","parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","title":"Transaction Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateClarificationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ClarificationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transaction-clarifications/firm":{"get":{"tags":["transaction-clarifications"],"summary":"List clarifications (firm)","description":"List all transaction questions across the firm's businesses.","operationId":"list_firm_clarifications_api_v1_transaction_clarifications_firm_get","parameters":[{"name":"firm_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Advisory firm ID","title":"Firm Id"},"description":"Advisory firm ID"},{"name":"business_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by business","title":"Business Id"},"description":"Filter by business"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Total Count"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ClarificationListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transaction-clarifications/firm/count":{"get":{"tags":["transaction-clarifications"],"summary":"Open clarification count (firm)","description":"Number of unanswered questions across the firm.","operationId":"firm_clarification_count_api_v1_transaction_clarifications_firm_count_get","parameters":[{"name":"firm_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Advisory firm ID","title":"Firm Id"},"description":"Advisory firm ID"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ClarificationCountResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transaction-clarifications/firm/{clarification_id}/resolve":{"post":{"tags":["transaction-clarifications"],"summary":"Resolve a clarification (firm)","description":"Close the loop after applying the client's answer.","operationId":"resolve_clarification_api_v1_transaction_clarifications_firm__clarification_id__resolve_post","parameters":[{"name":"clarification_id","in":"path","required":true,"schema":{"type":"string","title":"Clarification Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveClarificationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ClarificationResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transaction-clarifications":{"get":{"tags":["transaction-clarifications"],"summary":"List transaction clarifications (client)","description":"List questions your bookkeeper has asked about your transactions.","operationId":"list_client_clarifications_api_v1_transaction_clarifications_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: open, answered, resolved","title":"Status"},"description":"Filter by status: open, answered, resolved"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Total Count"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ClarificationListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transaction-clarifications/count":{"get":{"tags":["transaction-clarifications"],"summary":"Open clarification count (client)","description":"Number of unanswered questions for the sidebar badge.","operationId":"client_clarification_count_api_v1_transaction_clarifications_count_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ClarificationCountResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transaction-clarifications/{clarification_id}/answer":{"post":{"tags":["transaction-clarifications"],"summary":"Answer a clarification (client)","description":"Provide an answer to a question your bookkeeper asked.","operationId":"answer_clarification_api_v1_transaction_clarifications__clarification_id__answer_post","parameters":[{"name":"clarification_id","in":"path","required":true,"schema":{"type":"string","title":"Clarification Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerClarificationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ClarificationResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document-requests/firm/businesses/{business_id}":{"post":{"tags":["document-requests"],"summary":"Request a document from a client (firm)","description":"Ask a client business to upload a specific document.","operationId":"create_document_request_api_v1_document_requests_firm_businesses__business_id__post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDocumentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DocumentRequestResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document-requests/firm":{"get":{"tags":["document-requests"],"summary":"List document requests (firm)","description":"List all document requests across the firm's businesses.","operationId":"list_firm_document_requests_api_v1_document_requests_firm_get","parameters":[{"name":"firm_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Advisory firm ID","title":"Firm Id"},"description":"Advisory firm ID"},{"name":"business_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by business","title":"Business Id"},"description":"Filter by business"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Total Count"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DocumentRequestListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document-requests/firm/count":{"get":{"tags":["document-requests"],"summary":"Open document request count (firm)","description":"Number of still-pending document requests across the firm.","operationId":"firm_document_request_count_api_v1_document_requests_firm_count_get","parameters":[{"name":"firm_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Advisory firm ID","title":"Firm Id"},"description":"Advisory firm ID"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DocumentRequestCountResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document-requests/firm/{request_id}/download":{"get":{"tags":["document-requests"],"summary":"Download an uploaded document (firm)","description":"Get a short-lived link to the file the client uploaded.","operationId":"download_firm_document_api_v1_document_requests_firm__request_id__download_get","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DocumentDownloadResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document-requests/firm/{request_id}/cancel":{"post":{"tags":["document-requests"],"summary":"Cancel a document request (firm)","description":"Withdraw a request the client no longer needs to fulfill.","operationId":"cancel_document_request_api_v1_document_requests_firm__request_id__cancel_post","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DocumentRequestResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document-requests":{"get":{"tags":["document-requests"],"summary":"List document requests (client)","description":"List documents your accountant has asked you to upload.","operationId":"list_client_document_requests_api_v1_document_requests_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: open, fulfilled, cancelled","title":"Status"},"description":"Filter by status: open, fulfilled, cancelled"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Total Count"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DocumentRequestListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document-requests/count":{"get":{"tags":["document-requests"],"summary":"Open document request count (client)","description":"Number of pending document requests for the sidebar badge.","operationId":"client_document_request_count_api_v1_document_requests_count_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DocumentRequestCountResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document-requests/{request_id}/fulfill":{"post":{"tags":["document-requests"],"summary":"Upload a requested document (client)","description":"Securely upload the file your accountant requested.","operationId":"fulfill_document_request_api_v1_document_requests__request_id__fulfill_post","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_fulfill_document_request_api_v1_document_requests__request_id__fulfill_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DocumentRequestResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document-requests/{request_id}/download":{"get":{"tags":["document-requests"],"summary":"Download an uploaded document (client)","description":"Get a short-lived link to the file you uploaded.","operationId":"download_client_document_api_v1_document_requests__request_id__download_get","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DocumentDownloadResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users":{"get":{"tags":["user"],"summary":"List users","description":"List users with optional filtering. Pass x-business-id header or business_id for business-scoped view; firm_id for firm-wide view.","operationId":"list_users_api_v1_users_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search users by name or email","title":"Search"},"description":"Search users by name or email"},{"name":"id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by user UUID","title":"Id"},"description":"Filter by user UUID"},{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by exact email address","title":"Email"},"description":"Filter by exact email address"},{"name":"business_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by business UUID. Returns users in that business only.","title":"Business Id"},"description":"Filter by business UUID. Returns users in that business only."},{"name":"firm_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by advisory firm UUID. Firm-wide: all users in that firm.","title":"Firm Id"},"description":"Filter by advisory firm UUID. Firm-wide: all users in that firm."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"name":"x-firm-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Advisory firm UUID for firm-wide view. Same as firm_id query param.","title":"X-Firm-Id"},"description":"Advisory firm UUID for firm-wide view. Same as firm_id query param."},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Business UUID for business-scoped view. Same as business_id query param.","title":"X-Business-Id"},"description":"Business UUID for business-scoped view. Same as business_id query param."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UserCursorListResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["user"],"summary":"Create user","description":"Create a new user account in the system.","operationId":"create_user_api_v1_users_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UserResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/me/last-business":{"get":{"tags":["user"],"summary":"Get last-selected business","description":"Return the authenticated user's last-selected business and firm IDs.","operationId":"get_last_business_api_v1_users_me_last_business_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LastBusinessResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["user"],"summary":"Set last-selected business","description":"Persist the authenticated user's last-selected business and optional firm ID.","operationId":"set_last_business_api_v1_users_me_last_business_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LastBusinessUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_LastBusinessResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/me/mfa-status":{"get":{"tags":["user"],"summary":"Get MFA enforcement status","description":"Return whether MFA is required and satisfied for the authenticated user based on Clerk session claims and firm policy.","operationId":"get_mfa_status_api_v1_users_me_mfa_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_MfaStatusResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}":{"get":{"tags":["user"],"summary":"Get user","description":"Retrieve a specific user's profile by their UUID.","operationId":"get_user_api_v1_users__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UserResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["user"],"summary":"Update user","description":"Update a user's profile information.","operationId":"update_user_api_v1_users__user_id__put","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UserResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["user"],"summary":"Delete user","description":"Permanently delete a user and all their business associations.","operationId":"delete_user_api_v1_users__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AIDiscoverRequest":{"properties":{"account_type":{"type":"string","pattern":"^(self-managed|dz-managed|advisory-firm)$","title":"Account Type","description":"Account type determines the discovery question path"},"conversation":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","maxItems":20,"title":"Conversation","description":"Conversation so far as [{role: 'assistant'|'user', content: '...'}]"}},"type":"object","required":["account_type"],"title":"AIDiscoverRequest","description":"Request body for the AI onboarding discovery endpoint.\n\nSends the current conversation and account type so the AI can generate\nthe next contextual question for the user's onboarding path."},"AIDiscoverResponse":{"properties":{"question":{"type":"string","title":"Question","description":"Next question for the user"},"quick_replies":{"items":{"type":"string"},"type":"array","title":"Quick Replies","description":"Suggested quick-reply options the user can tap"},"done":{"type":"boolean","title":"Done","description":"True when the AI has gathered enough info and discovery is complete","default":false},"learned":{"additionalProperties":true,"type":"object","title":"Learned","description":"Partial profile snapshot of what the AI has learned so far"}},"type":"object","required":["question"],"title":"AIDiscoverResponse","description":"Response from the AI discovery endpoint — the next question to ask."},"AIMatch":{"properties":{"statement_txn_id":{"type":"string","title":"Statement Txn Id"},"ledger_txn_ids":{"items":{"type":"string"},"type":"array","title":"Ledger Txn Ids"},"confidence":{"type":"number","title":"Confidence"},"reasoning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning"},"statement_txn":{"anyOf":[{"$ref":"#/components/schemas/StatementTxn"},{"type":"null"}]},"ledger_txns":{"anyOf":[{"items":{"$ref":"#/components/schemas/LedgerTxn"},"type":"array"},{"type":"null"}],"title":"Ledger Txns"}},"additionalProperties":true,"type":"object","required":["statement_txn_id","ledger_txn_ids","confidence"],"title":"AIMatch","description":"AI-suggested reconciliation match."},"AIOverageBreakdown":{"properties":{"light":{"type":"integer","title":"Light"},"standard":{"type":"integer","title":"Standard"},"heavy":{"type":"integer","title":"Heavy"}},"additionalProperties":true,"type":"object","required":["light","standard","heavy"],"title":"AIOverageBreakdown"},"AIOverageRatesCents":{"properties":{"light":{"type":"integer","title":"Light"},"standard":{"type":"integer","title":"Standard"},"heavy":{"type":"integer","title":"Heavy"}},"additionalProperties":true,"type":"object","required":["light","standard","heavy"],"title":"AIOverageRatesCents"},"AIRecommendRequest":{"properties":{"account_type":{"type":"string","pattern":"^(self-managed|dz-managed|advisory-firm)$","title":"Account Type"},"conversation":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","maxItems":20,"minItems":1,"title":"Conversation","description":"Full discovery conversation"}},"type":"object","required":["account_type","conversation"],"title":"AIRecommendRequest","description":"Request body for the AI recommendation endpoint.\n\nSends the full discovery conversation so the AI can extract a structured\nprofile and generate personalised add-on recommendations."},"AIRecommendResponse":{"properties":{"recommendations":{"items":{"$ref":"#/components/schemas/AddonRecommendation"},"type":"array","title":"Recommendations","description":"Recommended add-ons sorted by priority"},"profile":{"additionalProperties":true,"type":"object","title":"Profile","description":"Structured profile data extracted from the conversation"},"summary":{"type":"string","title":"Summary","description":"One-paragraph personalised summary for the user","default":""}},"type":"object","title":"AIRecommendResponse","description":"Response from the AI recommendation endpoint."},"AIUpgradeSuggestion":{"properties":{"addon_or_plan_slug":{"type":"string","title":"Addon Or Plan Slug"},"label":{"type":"string","title":"Label"},"monthly_quota":{"type":"integer","title":"Monthly Quota"},"monthly_price_cents":{"type":"integer","title":"Monthly Price Cents"},"would_save_cents":{"type":"integer","title":"Would Save Cents"}},"additionalProperties":true,"type":"object","required":["addon_or_plan_slug","label","monthly_quota","monthly_price_cents","would_save_cents"],"title":"AIUpgradeSuggestion"},"AIUsageByModel":{"properties":{"model":{"type":"string","title":"Model"},"requests":{"type":"integer","title":"Requests"},"tokens":{"type":"integer","title":"Tokens"},"pct":{"type":"number","title":"Pct"}},"additionalProperties":true,"type":"object","required":["model","requests","tokens","pct"],"title":"AIUsageByModel"},"AIUsageDaily":{"properties":{"date":{"type":"string","title":"Date"},"requests":{"type":"integer","title":"Requests"},"tokens":{"type":"integer","title":"Tokens"}},"additionalProperties":true,"type":"object","required":["date","requests","tokens"],"title":"AIUsageDaily"},"AIUsageDetailsSummary":{"properties":{"requests_used":{"type":"integer","title":"Requests Used"},"monthly_limit":{"type":"integer","title":"Monthly Limit"},"is_unlimited":{"type":"boolean","title":"Is Unlimited"},"total_tokens":{"type":"integer","title":"Total Tokens"},"estimated_cost_usd":{"type":"number","title":"Estimated Cost Usd"},"unique_users":{"type":"integer","title":"Unique Users"},"plan_tier":{"type":"string","title":"Plan Tier"},"has_ai_pro":{"type":"boolean","title":"Has Ai Pro"},"is_trial":{"type":"boolean","title":"Is Trial"}},"additionalProperties":true,"type":"object","required":["requests_used","monthly_limit","is_unlimited","total_tokens","estimated_cost_usd","unique_users","plan_tier","has_ai_pro","is_trial"],"title":"AIUsageDetailsSummary"},"AIUsageTopUser":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"name":{"type":"string","title":"Name"},"requests":{"type":"integer","title":"Requests"},"tokens":{"type":"integer","title":"Tokens"},"pct":{"type":"number","title":"Pct"}},"additionalProperties":true,"type":"object","required":["name","requests","tokens","pct"],"title":"AIUsageTopUser"},"APITokenCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Token name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description"},"expires_in_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Days","description":"Expiration in days (1-365, default: 365)","default":365}},"type":"object","required":["name"],"title":"APITokenCreate","description":"Request schema for creating a new API token."},"APITokenCreateResponse":{"properties":{"token":{"type":"string","title":"Token","description":"The JWT token - save it now, you won't see it again!"},"token_info":{"$ref":"#/components/schemas/APITokenResponse","description":"Token metadata"}},"type":"object","required":["token","token_info"],"title":"APITokenCreateResponse","description":"Response schema when creating a new token (includes the JWT)."},"APITokenListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/APITokenResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"APITokenListResponse","description":"Paginated list of API tokens with cursor-based navigation."},"APITokenResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Token record ID"},"jti":{"type":"string","title":"Jti","description":"Unique token identifier (JWT ID)"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Human-readable token name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional token description"},"token_prefix":{"type":"string","title":"Token Prefix","description":"First characters of the token for display (e.g. dz_abc...)"},"token_type":{"type":"string","title":"Token Type","description":"Token type (always 'api')","default":"api"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the token was created"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At","description":"Last time the token was used for authentication"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"When the token expires (null = never)"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At","description":"When the token was revoked (null = active)"},"revocation_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revocation Reason","description":"Reason the token was revoked"}},"type":"object","required":["id","jti","token_prefix","created_at"],"title":"APITokenResponse","description":"Response schema for API token metadata (without the actual JWT)."},"APITokenRevokeRequest":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Optional reason for revocation"}},"type":"object","title":"APITokenRevokeRequest","description":"Request schema for revoking a token."},"APITokenRevokeResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Token record ID"},"jti":{"type":"string","title":"Jti","description":"JWT ID of the revoked token"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Token name"},"revoked_at":{"type":"string","format":"date-time","title":"Revoked At","description":"When the token was revoked"},"revoked_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revoked By","description":"Email of the user who revoked the token"},"revocation_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revocation Reason","description":"Reason for revocation"}},"type":"object","required":["id","jti","revoked_at"],"title":"APITokenRevokeResponse","description":"Response schema for token revocation."},"APInventoryListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BillResponse"},"type":"array","title":"Items"}},"type":"object","title":"APInventoryListResponse","description":"Envelope for the Inventory -> AP tab listing."},"AcceptInvitationResponse":{"properties":{"status":{"type":"string","title":"Status"},"invitation_type":{"anyOf":[{"type":"string","enum":["client","staff"]},{"type":"null"}],"title":"Invitation Type"},"firm_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Name"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["status"],"title":"AcceptInvitationResponse"},"AccessibleBusinessListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AccessibleBusinessResponse"},"type":"array","title":"Items"}},"additionalProperties":true,"type":"object","required":["items"],"title":"AccessibleBusinessListResponse","description":"Resolved accessible businesses for a firm member."},"AccessibleBusinessResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"source":{"type":"string","title":"Source","description":"Access source: 'all', 'direct', 'team', or 'both'."},"source_details":{"items":{"type":"string"},"type":"array","title":"Source Details","description":"Detailed sources: 'direct', 'team:Tax Team', etc."}},"additionalProperties":true,"type":"object","required":["id","source"],"title":"AccessibleBusinessResponse","description":"A business in the resolved access list for a firm member."},"AccountCleanupSuggestionItem":{"properties":{"type":{"type":"string","enum":["merge","cleanup","reclassify","unused"],"title":"Type","description":"Kind of suggestion: merge, cleanup, reclassify, or unused."},"title":{"type":"string","title":"Title","description":"Short headline (<=80 chars)."},"description":{"type":"string","title":"Description","description":"Explanation of the suggestion (<=240 chars)."},"affected_accounts":{"items":{"type":"string"},"type":"array","title":"Affected Accounts","description":"Display names of the accounts affected."},"affected_ledger_ids":{"items":{"type":"string"},"type":"array","title":"Affected Ledger Ids","description":"Resolved ledger UUIDs for the affected accounts. Use these when taking action (e.g. calling /ledgers/merge)."},"suggested_target_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Target Ledger Id","description":"For 'merge' suggestions, the recommended target ledger UUID to merge the others into. Null for non-merge suggestions."}},"type":"object","required":["type","title","description"],"title":"AccountCleanupSuggestionItem","description":"A single chart-of-accounts cleanup suggestion from the AI.\n\n``affected_ledger_ids`` is the server-resolved list of real ledger\nUUIDs the suggestion refers to — clients should use these IDs (not\n``affected_accounts``, which is display text) when acting on a\nsuggestion (e.g. wiring a \"merge these\" button to\n:class:`LedgerMergeRequest`)."},"AccountSchema":{"properties":{"plaid_account_id":{"type":"string","title":"Plaid Account Id","description":"Plaid's unique account ID."},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"Linked ledger UUID in chart of accounts."},"teal_source_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Source Account Id","description":"Teal accounting system source account ID."},"balance":{"$ref":"#/components/schemas/BalanceSchema","description":"Current account balances."},"mask":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mask","description":"Last 4 digits of account number (e.g., '1234')."},"name":{"type":"string","title":"Name","description":"Account name from the bank."},"official_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Official Name","description":"Official account name from the bank."},"subtype":{"type":"string","title":"Subtype","description":"Account subtype (e.g., 'checking', 'savings', 'credit card')."},"type":{"type":"string","title":"Type","description":"Account type: depository, credit, loan, investment."},"last_synced":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced","description":"When transactions were last synced."},"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id","description":"Business UUID."},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When account was linked."},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code","description":"Plaid error code if sync failed."},"error":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Error","description":"Error details if sync failed."},"is_linked":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Linked","description":"Whether account is saved in our database."},"is_synced_to_teal":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Synced To Teal","description":"Whether account is synced to Teal accounting."}},"additionalProperties":true,"type":"object","required":["plaid_account_id","balance","name","subtype","type"],"title":"AccountSchema","description":"Schema for a bank account connected via Plaid.\n\nRepresents a single bank account (checking, savings, credit card, etc.)\nthat is linked to the business through a Plaid connection.\n\n**Account Types:**\n- `depository`: Checking, savings accounts\n- `credit`: Credit cards\n- `loan`: Loans, mortgages\n- `investment`: Brokerage, retirement accounts","example":{"balance":{"available":1523450,"current":1548200,"iso_currency_code":"USD"},"business_id":"019ab37c-bus1-7000-8000-000000000001","is_linked":true,"is_synced_to_teal":true,"last_synced":"2024-01-15T14:00:00Z","ledger_id":"019ab37c-led1-7000-8000-000000000001","mask":"1234","name":"Chase Business Checking","official_name":"CHASE BUSINESS COMPLETE CHECKING","plaid_account_id":"plaid_acc_abc123","subtype":"checking","teal_source_account_id":"teal_src_xyz789","type":"depository"}},"AccountingDimensionCreateRequest":{"properties":{"dimension_type":{"type":"string","enum":["class","location"],"title":"Dimension Type","description":"Either 'class' or 'location'."},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Code"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id","description":"Optional parent dimension (for sub-classes/locations)."}},"type":"object","required":["dimension_type","name"],"title":"AccountingDimensionCreateRequest","description":"Request schema for creating a class or location."},"AccountingDimensionResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"dimension_type":{"type":"string","title":"Dimension Type"},"name":{"type":"string","title":"Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","dimension_type","name","is_active","created_at","updated_at"],"title":"AccountingDimensionResponse","description":"Response schema for a dimension."},"AccountingDimensionUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name"},"code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Code"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"AccountingDimensionUpdateRequest","description":"Request schema for updating a dimension."},"AccountingDimensionsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AccountingDimensionResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AccountingDimensionsListResponse","description":"A flat list of dimensions."},"AccountingPeriodCreateRequest":{"properties":{"period_start":{"type":"string","format":"date","title":"Period Start","description":"Start date of the accounting period"},"period_end":{"type":"string","format":"date","title":"Period End","description":"End date of the accounting period"}},"type":"object","required":["period_start","period_end"],"title":"AccountingPeriodCreateRequest","description":"Request schema for creating an accounting period.","example":{"period_end":"2026-01-31","period_start":"2026-01-01"}},"AccountingPeriodResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Period UUID"},"business_id":{"type":"string","title":"Business Id","description":"Business UUID"},"period_start":{"type":"string","format":"date","title":"Period Start","description":"Start date of the period"},"period_end":{"type":"string","format":"date","title":"Period End","description":"End date of the period"},"status":{"type":"string","title":"Status","description":"Status: open, closed, or locked"},"closed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Closed At","description":"When period was closed"},"closed_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Closed By User Id","description":"User who closed the period"},"lock_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lock Reason","description":"Reason period was closed"},"reopen_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reopen Reason","description":"Reason period was reopened"},"reopened_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reopened At","description":"When period was reopened"},"reopened_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reopened By User Id","description":"User who reopened the period"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["id","business_id","period_start","period_end","status","created_at","updated_at"],"title":"AccountingPeriodResponse","description":"Response schema for an accounting period."},"AccountingPeriodsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AccountingPeriodResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"AccountingPeriodsListResponse","description":"Paginated list of accounting periods."},"AcknowledgeCloseStepRequest":{"properties":{"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional free-form note"}},"type":"object","title":"AcknowledgeCloseStepRequest","description":"Body for upserting a close-checklist acknowledgement."},"ActualsCostLineItem":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id"},"name":{"type":"string","title":"Name"},"data":{"items":{"type":"integer"},"type":"array","title":"Data","description":"Per-month amounts in cents, oldest first"},"type":{"$ref":"#/components/schemas/CostClassification","default":"fix"},"esc":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Esc","description":"Estimated annual escalation for fixed costs"},"growth":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Growth","description":"Estimated MoM growth rate"}},"type":"object","required":["ledger_id","name","data"],"title":"ActualsCostLineItem","description":"Cost line with a classification hint derived from trailing data."},"ActualsLineItem":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id"},"name":{"type":"string","title":"Name"},"data":{"items":{"type":"integer"},"type":"array","title":"Data","description":"Per-month amounts in cents, oldest first"}},"type":"object","required":["ledger_id","name","data"],"title":"ActualsLineItem","description":"A single line (ledger account) with per-month actuals."},"ActualsOtherLineItem":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id"},"name":{"type":"string","title":"Name"},"data":{"items":{"type":"integer"},"type":"array","title":"Data","description":"Per-month amounts in cents, oldest first"},"neg":{"type":"boolean","title":"Neg","description":"True if this is an expense (negative)","default":false}},"type":"object","required":["ledger_id","name","data"],"title":"ActualsOtherLineItem","description":"Other income/expense line."},"AddCountLineRequest":{"properties":{"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Variant UUID."},"barcode":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Barcode"},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Sku"},"counted_quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Counted Quantity","description":"Optional initial count. If omitted, the line is added with expected_quantity only and the user records the count later."},"reason":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Reason"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes"}},"type":"object","title":"AddCountLineRequest","description":"Add a line by variant id, barcode, or SKU."},"AddCountLineResponse":{"properties":{"id":{"type":"string","title":"Id"},"count_id":{"type":"string","title":"Count Id"},"variant_id":{"type":"string","title":"Variant Id"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"barcode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Barcode"},"expected_quantity":{"type":"number","title":"Expected Quantity","default":0},"counted_quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Counted Quantity"},"variance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Variance"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"adjustment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Adjustment Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"additionalProperties":true,"type":"object","required":["id","count_id","variant_id"],"title":"AddCountLineResponse","description":"Response for ``add_count_line``."},"AddTeamBusinessResponse":{"properties":{},"additionalProperties":true,"type":"object","title":"AddTeamBusinessResponse","description":"Envelope data for ``add_team_business`` (mutation-only; no payload)."},"AddTeamMemberResponse":{"properties":{},"additionalProperties":true,"type":"object","title":"AddTeamMemberResponse","description":"Envelope data for ``add_team_member`` (mutation-only; no payload)."},"AddToInvoiceRequest":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id","description":"Target invoice (must be draft)."},"time_entry_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Time Entry Ids","description":"Time entries to bill."}},"type":"object","required":["invoice_id","time_entry_ids"],"title":"AddToInvoiceRequest","description":"Request to add billable time entries to an existing invoice."},"AddToInvoiceResponse":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id"},"added_count":{"type":"integer","title":"Added Count"},"added_amount":{"type":"integer","title":"Added Amount","description":"Total amount added, in cents.","default":0},"invoice_total":{"type":"integer","title":"Invoice Total","description":"New invoice total, in cents.","default":0}},"type":"object","required":["invoice_id","added_count"],"title":"AddToInvoiceResponse","description":"Result of adding time to an invoice."},"AddUserToBusinessResponse":{"properties":{"business_id":{"type":"string","title":"Business Id"},"user_id":{"type":"string","title":"User Id"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"additionalProperties":true,"type":"object","required":["business_id","user_id"],"title":"AddUserToBusinessResponse","description":"Envelope data for ``add_user_to_business``."},"AddonPreviewRequest":{"properties":{"addon_slug":{"type":"string","title":"Addon Slug","description":"Add-on module slug (e.g. 'ai_pro')."},"action":{"type":"string","enum":["add","remove"],"title":"Action","description":"'add' or 'remove'."}},"type":"object","required":["addon_slug","action"],"title":"AddonPreviewRequest"},"AddonRecommendation":{"properties":{"addon_id":{"type":"string","title":"Addon Id","description":"Add-on module ID (e.g. ai_pro, commerce)"},"name":{"type":"string","title":"Name","description":"Human-readable add-on name"},"reason":{"type":"string","title":"Reason","description":"Why this add-on is recommended for this user"},"priority":{"type":"string","enum":["must_have","recommended","optional"],"title":"Priority","description":"must_have, recommended, or optional","default":"recommended"}},"type":"object","required":["addon_id","name","reason"],"title":"AddonRecommendation","description":"A single add-on recommendation with reasoning."},"AddonToggleRequest":{"properties":{"addon_slug":{"type":"string","title":"Addon Slug","description":"Add-on module slug (e.g. 'ai_pro')."},"action":{"type":"string","enum":["add","remove"],"title":"Action","description":"'add' or 'remove'."}},"type":"object","required":["addon_slug","action"],"title":"AddonToggleRequest"},"AdjustmentReasonRow":{"properties":{"reason":{"type":"string","title":"Reason"},"label":{"type":"string","title":"Label"},"adjustment_count":{"type":"integer","title":"Adjustment Count"},"total_units":{"type":"number","title":"Total Units","description":"Sum of `inventory.delta` for this reason (signed)."},"total_value_cents":{"type":"integer","title":"Total Value Cents","description":"Total $-value impact (cents) using each variant's `unit_cost` as a proxy for the GL impact."},"is_canonical":{"type":"boolean","title":"Is Canonical","description":"True when the reason matches a known enum value."}},"type":"object","required":["reason","label","adjustment_count","total_units","total_value_cents","is_canonical"],"title":"AdjustmentReasonRow","description":"One row of the adjustments-by-reason widget."},"AdjustmentReasonsResponse":{"properties":{"since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"},"until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Until"},"rows":{"items":{"$ref":"#/components/schemas/AdjustmentReasonRow"},"type":"array","title":"Rows"},"total_adjustments":{"type":"integer","title":"Total Adjustments","default":0},"total_value_cents":{"type":"integer","title":"Total Value Cents","default":0}},"type":"object","title":"AdjustmentReasonsResponse"},"AdvisoryFirmCreateRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Firm name."},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"Firm business address."},"ein":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ein","description":"Tax Employer Identification Number."},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url","description":"URL or S3 key for the firm logo."},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id","description":"Stripe customer ID for subscription billing."},"client_messaging_enabled":{"type":"boolean","title":"Client Messaging Enabled","description":"Whether clients can use the messaging portal.","default":false},"ap_automation_enabled":{"type":"boolean","title":"Ap Automation Enabled","description":"Whether clients see the AP automation bills page in the client portal.","default":false},"client_visible_integrations":{"items":{"type":"string"},"type":"array","title":"Client Visible Integrations","description":"Integration IDs visible to clients in the client portal."},"client_ai_assistant_enabled":{"type":"boolean","title":"Client Ai Assistant Enabled","description":"Whether clients can use the read-only AI assistant in the client portal.","default":false},"client_digest_email_enabled":{"type":"boolean","title":"Client Digest Email Enabled","description":"Whether clients receive the proactive financial digest email.","default":false},"client_digest_frequency":{"type":"string","enum":["weekly","monthly"],"title":"Client Digest Frequency","description":"Cadence of the client digest email: 'weekly' or 'monthly'.","default":"monthly"},"mfa_enforced":{"type":"boolean","title":"Mfa Enforced","description":"When true, firm owners/admins must use Clerk MFA for sensitive actions.","default":true}},"type":"object","required":["name"],"title":"AdvisoryFirmCreateRequest","description":"Request schema for creating an advisory firm.","example":{"address":"100 Financial District, Suite 500, San Francisco, CA 94105","ein":"12-3456789","name":"Smith & Associates CPA"}},"AdvisoryFirmListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdvisoryFirmResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"AdvisoryFirmListResponse","description":"Paginated list of advisory firms."},"AdvisoryFirmResponse":{"properties":{"name":{"type":"string","title":"Name","description":"Firm name."},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"Firm business address."},"ein":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ein","description":"Tax Employer Identification Number."},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url","description":"URL or S3 key for the firm logo."},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id","description":"Stripe customer ID for subscription billing."},"client_messaging_enabled":{"type":"boolean","title":"Client Messaging Enabled","description":"Whether clients can use the messaging portal.","default":false},"ap_automation_enabled":{"type":"boolean","title":"Ap Automation Enabled","description":"Whether clients see the AP automation bills page in the client portal.","default":false},"client_visible_integrations":{"items":{"type":"string"},"type":"array","title":"Client Visible Integrations","description":"Integration IDs visible to clients in the client portal."},"client_ai_assistant_enabled":{"type":"boolean","title":"Client Ai Assistant Enabled","description":"Whether clients can use the read-only AI assistant in the client portal.","default":false},"client_digest_email_enabled":{"type":"boolean","title":"Client Digest Email Enabled","description":"Whether clients receive the proactive financial digest email.","default":false},"client_digest_frequency":{"type":"string","enum":["weekly","monthly"],"title":"Client Digest Frequency","description":"Cadence of the client digest email: 'weekly' or 'monthly'.","default":"monthly"},"mfa_enforced":{"type":"boolean","title":"Mfa Enforced","description":"When true, firm owners/admins must use Clerk MFA for sensitive actions.","default":true},"id":{"type":"string","title":"Id","description":"Advisory firm UUID."},"slack_connected":{"type":"boolean","title":"Slack Connected","description":"Whether a Slack webhook URL is configured.","default":false},"slack_webhook_url_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Webhook Url Masked","description":"Masked Slack webhook URL (never exposes the full secret)."}},"type":"object","required":["name","id"],"title":"AdvisoryFirmResponse","description":"Response schema for an advisory firm.","example":{"address":"100 Financial District, Suite 500, San Francisco, CA 94105","ein":"12-3456789","id":"019ab37c-firm-7000-8000-000000000001","name":"Smith & Associates CPA","slack_connected":false,"stripe_customer_id":"cus_abc123xyz"}},"AdvisoryFirmUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"ein":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ein"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id"},"client_messaging_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Client Messaging Enabled"},"ap_automation_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ap Automation Enabled"},"client_ai_assistant_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Client Ai Assistant Enabled"},"client_digest_email_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Client Digest Email Enabled"},"client_digest_frequency":{"anyOf":[{"type":"string","enum":["weekly","monthly"]},{"type":"null"}],"title":"Client Digest Frequency"},"slack_webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Webhook Url","description":"Slack Incoming Webhook URL. Set to empty string to disconnect."},"client_visible_integrations":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Client Visible Integrations","description":"Integration IDs visible to clients. Valid values: stripe, plaid, ramp, square, shopify, slack."},"mfa_enforced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Mfa Enforced","description":"Require Clerk MFA for firm owners/admins on sensitive actions."}},"type":"object","title":"AdvisoryFirmUpdateRequest"},"AgingBillItem":{"properties":{"id":{"type":"string","title":"Id"},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Number"},"vendor_id":{"type":"string","title":"Vendor Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"status":{"type":"string","title":"Status"},"amount":{"type":"integer","title":"Amount","description":"Bill amount in cents."},"total_paid":{"type":"integer","title":"Total Paid","description":"Total paid in cents.","default":0},"balance_due":{"type":"integer","title":"Balance Due","description":"Remaining balance in cents."},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date"},"days_past_due":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Past Due"},"bucket":{"type":"string","title":"Bucket","description":"Aging bucket: 'current', '1_30', '31_60', '61_90', '91_plus'."}},"type":"object","required":["id","vendor_id","status","amount","balance_due","bucket"],"title":"AgingBillItem","description":"A single bill with its aging bucket assignment."},"AgingBucket":{"properties":{"bucket":{"type":"string","title":"Bucket","description":"Aging band: 0-30 / 31-60 / 61-90 / 91-180 / 180+."},"on_hand_units":{"type":"number","title":"On Hand Units"},"total_value_cents":{"type":"integer","title":"Total Value Cents"},"lot_count":{"type":"integer","title":"Lot Count"}},"type":"object","required":["bucket","on_hand_units","total_value_cents","lot_count"],"title":"AgingBucket","description":"Aging bucket totals (in dollars and units)."},"AgingCustomerSummary":{"properties":{"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"current":{"type":"integer","title":"Current","default":0},"days_1_30":{"type":"integer","title":"Days 1 30","default":0},"days_31_60":{"type":"integer","title":"Days 31 60","default":0},"days_61_90":{"type":"integer","title":"Days 61 90","default":0},"days_91_plus":{"type":"integer","title":"Days 91 Plus","default":0},"total":{"type":"integer","title":"Total","default":0}},"type":"object","title":"AgingCustomerSummary","description":"Per-customer aging bucket totals (all amounts in cents)."},"AgingInvoiceItem":{"properties":{"id":{"type":"string","title":"Id"},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number"},"customer_id":{"type":"string","title":"Customer Id"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"status":{"type":"string","title":"Status"},"total":{"type":"integer","title":"Total","description":"Invoice total in cents."},"total_paid":{"type":"integer","title":"Total Paid","description":"Total paid in cents.","default":0},"balance_due":{"type":"integer","title":"Balance Due","description":"Remaining balance in cents."},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date"},"days_past_due":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Past Due"},"bucket":{"type":"string","title":"Bucket","description":"Aging bucket: 'current', '1_30', '31_60', '61_90', '91_plus'."}},"type":"object","required":["id","customer_id","status","total","balance_due","bucket"],"title":"AgingInvoiceItem","description":"A single invoice with its aging bucket assignment."},"AgingResponse":{"properties":{"total_value_cents":{"type":"integer","title":"Total Value Cents","default":0},"total_on_hand_units":{"type":"number","title":"Total On Hand Units","default":0},"buckets":{"items":{"$ref":"#/components/schemas/AgingBucket"},"type":"array","title":"Buckets"},"variants":{"items":{"$ref":"#/components/schemas/AgingVariantRow"},"type":"array","title":"Variants"}},"type":"object","title":"AgingResponse"},"AgingVariantRow":{"properties":{"variant_id":{"type":"string","title":"Variant Id"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"oldest_received_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Oldest Received At"},"days_oldest":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Oldest"},"on_hand_units":{"type":"number","title":"On Hand Units"},"total_value_cents":{"type":"integer","title":"Total Value Cents"}},"type":"object","required":["variant_id","on_hand_units","total_value_cents"],"title":"AgingVariantRow","description":"Per-variant aging summary (only when `detail=true`)."},"AgingVendorSummary":{"properties":{"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"current":{"type":"integer","title":"Current","default":0},"days_1_30":{"type":"integer","title":"Days 1 30","default":0},"days_31_60":{"type":"integer","title":"Days 31 60","default":0},"days_61_90":{"type":"integer","title":"Days 61 90","default":0},"days_91_plus":{"type":"integer","title":"Days 91 Plus","default":0},"total":{"type":"integer","title":"Total","default":0}},"type":"object","title":"AgingVendorSummary","description":"Per-vendor aging bucket totals (all amounts in cents)."},"AnalyticsResponse":{"properties":{"pending_count":{"type":"integer","title":"Pending Count","description":"Total suspended approval executions."},"pending_by_tier":{"additionalProperties":{"type":"integer"},"type":"object","title":"Pending By Tier","description":"Suspended count per tier (ops, advisor, owner)."},"avg_pending_age_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Pending Age Hours","description":"Average age of pending items in hours. Null when queue is empty."},"oldest_pending_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Oldest Pending Hours","description":"Age of the oldest pending item in hours. Null when queue is empty."},"workflow_enabled":{"type":"boolean","title":"Workflow Enabled","description":"Whether an AP approval workflow is provisioned for this business."}},"type":"object","required":["pending_count","workflow_enabled"],"title":"AnalyticsResponse","description":"Response for ``GET /ap-approval/analytics``.\n\nProvides a snapshot of the current approval queue health for the business."},"AnalyzeBalanceSheetResponse":{"properties":{"summary":{"type":"string","title":"Summary"},"insights":{"items":{"$ref":"#/components/schemas/FinancialInsight"},"type":"array","title":"Insights"},"generated_at":{"type":"string","title":"Generated At"}},"additionalProperties":true,"type":"object","required":["summary","insights","generated_at"],"title":"AnalyzeBalanceSheetResponse","description":"Response for ``analyze_balance_sheet``."},"AnalyzeCashFlowResponse":{"properties":{"summary":{"type":"string","title":"Summary"},"insights":{"items":{"$ref":"#/components/schemas/FinancialInsight"},"type":"array","title":"Insights"},"generated_at":{"type":"string","title":"Generated At"}},"additionalProperties":true,"type":"object","required":["summary","insights","generated_at"],"title":"AnalyzeCashFlowResponse","description":"Response for ``analyze_cash_flow``."},"AnalyzeContractsResponse":{"properties":{"insights":{"items":{"$ref":"#/components/schemas/ContractInsightItem"},"type":"array","title":"Insights"}},"type":"object","title":"AnalyzeContractsResponse"},"AnalyzeIncomeStatementResponse":{"properties":{"summary":{"type":"string","title":"Summary"},"insights":{"items":{"$ref":"#/components/schemas/FinancialInsight"},"type":"array","title":"Insights"},"generated_at":{"type":"string","title":"Generated At"}},"additionalProperties":true,"type":"object","required":["summary","insights","generated_at"],"title":"AnalyzeIncomeStatementResponse","description":"Response for ``analyze_income_statement``."},"AnalyzePaymentBehaviorResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PaymentBehaviorItem"},"type":"array","title":"Items"}},"type":"object","title":"AnalyzePaymentBehaviorResponse"},"AnalyzeResponse":{"properties":{"file_id":{"type":"string","title":"File Id","description":"Temporary ID to reference the cached file."},"sheets":{"items":{"$ref":"#/components/schemas/SheetAnalysis"},"type":"array","title":"Sheets"},"detected_entities":{"$ref":"#/components/schemas/DetectedEntities"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"Top-level warnings (e.g. AI analysis returned empty results)."}},"type":"object","required":["file_id"],"title":"AnalyzeResponse","description":"Response from POST /inventory/import/analyze."},"AnalyzeStatusResponse":{"properties":{"status":{"type":"string","enum":["pending","completed","failed"],"title":"Status","default":"pending"},"result":{"anyOf":[{"$ref":"#/components/schemas/AnalyzeResponse"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"AnalyzeStatusResponse","description":"Polling response from GET /analyze/{task_id}."},"AnalyzeSubscriptionsResponse":{"properties":{"insights":{"items":{"$ref":"#/components/schemas/SubscriptionInsightItem"},"type":"array","title":"Insights"},"total_monthly_spend":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Monthly Spend","description":"Total monthly spend in cents"}},"type":"object","title":"AnalyzeSubscriptionsResponse"},"AnalyzeTaskResponse":{"properties":{"task_id":{"type":"string","title":"Task Id","description":"Poll GET /analyze/{task_id} for results."}},"type":"object","required":["task_id"],"title":"AnalyzeTaskResponse","description":"Immediate response from POST /analyze — analysis runs in background."},"AnomalyDismissalState":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"dismissed_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dismissed By"},"dismissed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dismissed At"}},"additionalProperties":true,"type":"object","title":"AnomalyDismissalState"},"AnomalyFindingItem":{"properties":{"anomaly_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anomaly Type"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"transaction_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Transaction Ids"},"entity_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Entity Ids"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fingerprint"},"recommended_action":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Recommended Action"},"evidence":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Evidence"},"dismissed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Dismissed"},"dismissal":{"anyOf":[{"$ref":"#/components/schemas/AnomalyDismissalState"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"AnomalyFindingItem"},"AnomalyResolutionDismissal":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fingerprint"},"anomaly_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anomaly Type"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"additionalProperties":true,"type":"object","title":"AnomalyResolutionDismissal"},"AnomalySummary":{"properties":{"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"},"by_type":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"By Type"},"by_severity":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"By Severity"},"dismissed_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dismissed Count"}},"additionalProperties":true,"type":"object","title":"AnomalySummary"},"AnswerClarificationRequest":{"properties":{"answer":{"type":"string","maxLength":4000,"minLength":1,"title":"Answer","description":"The client's answer."}},"type":"object","required":["answer"],"title":"AnswerClarificationRequest","description":"Client answers an open clarification."},"ApApprovalGetResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"True when a published workflow exists for the firm."},"workflow":{"anyOf":[{"$ref":"#/components/schemas/ApApprovalWorkflowSummary"},{"type":"null"}],"description":"Workflow summary, or null when not enabled."}},"type":"object","required":["enabled"],"title":"ApApprovalGetResponse","description":"Response for ``GET /ap-approval``.\n\n``enabled=False`` means the firm hasn't provisioned a workflow yet; the\npage should offer a \"Set up approval policy\" CTA."},"ApApprovalProvisionResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id","description":"Provisioned workflow UUID."},"name":{"type":"string","title":"Name","description":"Workflow name."},"is_published":{"type":"boolean","title":"Is Published","description":"Whether the workflow is published."},"version":{"type":"integer","title":"Version","description":"Workflow version."},"graph":{"$ref":"#/components/schemas/WorkflowGraphSchema-Output","description":"Workflow graph."},"auto_approve_max_cents":{"type":"integer","title":"Auto Approve Max Cents","description":"Auto-approve threshold in cents."},"ops_approve_max_cents":{"type":"integer","title":"Ops Approve Max Cents","description":"Ops approval threshold in cents."}},"type":"object","required":["workflow_id","name","is_published","version","graph","auto_approve_max_cents","ops_approve_max_cents"],"title":"ApApprovalProvisionResponse","description":"Response for ``POST /ap-approval/provision``."},"ApApprovalWorkflowSummary":{"properties":{"id":{"type":"string","title":"Id","description":"Workflow UUID."},"name":{"type":"string","title":"Name","description":"Human-readable workflow name."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Workflow description."},"graph":{"$ref":"#/components/schemas/WorkflowGraphSchema-Output","description":"Workflow graph (nodes + edges)."},"is_published":{"type":"boolean","title":"Is Published","description":"Whether the workflow is published."},"version":{"type":"integer","title":"Version","description":"Workflow version (monotonic)."},"auto_approve_max_cents":{"type":"integer","title":"Auto Approve Max Cents","description":"Max bill amount (cents) eligible for auto-approval."},"ops_approve_max_cents":{"type":"integer","title":"Ops Approve Max Cents","description":"Max bill amount (cents) routed to operations approval. Bills above this require advisor + owner sign-off."}},"type":"object","required":["id","name","graph","is_published","version","auto_approve_max_cents","ops_approve_max_cents"],"title":"ApApprovalWorkflowSummary","description":"Summary of a provisioned AP approval workflow."},"ApplyCoaResponse":{"properties":{"created":{"type":"integer","title":"Created","description":"Number of new ledgers created.","default":0},"updated":{"type":"integer","title":"Updated","description":"Number of existing ledgers updated.","default":0},"skipped":{"type":"integer","title":"Skipped","description":"Number of protected ledgers skipped (system, bank-linked).","default":0},"deactivated":{"type":"integer","title":"Deactivated","description":"Number of old custom ledgers deactivated (not in template).","default":0},"skipped_names":{"items":{"type":"string"},"type":"array","title":"Skipped Names","description":"Names of protected ledgers that were skipped."},"total":{"type":"integer","title":"Total","description":"Total ledgers in the submitted template.","default":0}},"type":"object","title":"ApplyCoaResponse","description":"Response from applying an AI-generated or custom COA template.\n\nProvides counts and details for each action taken: created (new ledgers),\nupdated (existing unlocked ledgers whose sort_code matched), skipped\n(protected system/bank-connected ledgers), and deactivated (existing\ncustom ledgers whose sort_code was not in the new template)."},"ApplyLevelDecision":{"properties":{"variant_name":{"type":"string","title":"Variant Name"},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id"},"location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Name"},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id"},"on_hand":{"type":"number","title":"On Hand","default":0},"reorder_point":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reorder Point"},"reorder_quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reorder Quantity"},"action":{"type":"string","enum":["set","skip"],"title":"Action","default":"set"}},"type":"object","required":["variant_name"],"title":"ApplyLevelDecision"},"ApplyLocationDecision":{"properties":{"name":{"type":"string","title":"Name"},"action":{"type":"string","enum":["create","match","skip"],"title":"Action","default":"create"},"existing_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Existing Location Id"},"location_type":{"type":"string","title":"Location Type","default":"warehouse"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},"type":"object","required":["name"],"title":"ApplyLocationDecision"},"ApplyProductDecision":{"properties":{"name":{"type":"string","title":"Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"action":{"type":"string","enum":["create","match","skip"],"title":"Action","default":"create"},"existing_product_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Existing Product Id"},"variants":{"items":{"$ref":"#/components/schemas/ApplyVariantDecision"},"type":"array","title":"Variants"}},"type":"object","required":["name"],"title":"ApplyProductDecision"},"ApplyRequest":{"properties":{"file_id":{"type":"string","title":"File Id"},"locations":{"items":{"$ref":"#/components/schemas/ApplyLocationDecision"},"type":"array","title":"Locations"},"products":{"items":{"$ref":"#/components/schemas/ApplyProductDecision"},"type":"array","title":"Products"},"levels":{"items":{"$ref":"#/components/schemas/ApplyLevelDecision"},"type":"array","title":"Levels"}},"type":"object","required":["file_id"],"title":"ApplyRequest","description":"Request body for POST /inventory/import/apply."},"ApplyResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"summary":{"$ref":"#/components/schemas/ApplyResultSummary"}},"type":"object","title":"ApplyResponse","description":"Response from POST /inventory/import/apply."},"ApplyResultSummary":{"properties":{"locations_created":{"type":"integer","title":"Locations Created","default":0},"products_created":{"type":"integer","title":"Products Created","default":0},"variants_created":{"type":"integer","title":"Variants Created","default":0},"levels_set":{"type":"integer","title":"Levels Set","default":0},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","title":"ApplyResultSummary"},"ApplyVariantDecision":{"properties":{"name":{"type":"string","title":"Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"unit_cost_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Cost Cents"},"unit_cost_precise":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unit Cost Precise"},"uom":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uom"},"action":{"type":"string","enum":["create","match","skip"],"title":"Action","default":"create"},"existing_variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Existing Variant Id"},"default_vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Vendor Id"}},"type":"object","required":["name"],"title":"ApplyVariantDecision","description":"Per-variant decision from the user for apply phase."},"ApprovalRiskItem":{"properties":{"bill_id":{"type":"string","title":"Bill Id","description":"Bill UUID (as string)."},"vendor_name":{"type":"string","title":"Vendor Name","description":"Vendor name as resolved at scoring time.","default":""},"amount":{"anyOf":[{"type":"number"},{"type":"integer"}],"title":"Amount","description":"Amount in dollars (display value).","default":0},"risk_score":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Risk Score","description":"Risk score (0-100, higher = riskier).","default":0},"risk_factors":{"items":{"type":"string"},"type":"array","title":"Risk Factors","description":"Up to 3 short risk factor strings."}},"type":"object","required":["bill_id"],"title":"ApprovalRiskItem","description":"One AI-scored bill in the approval risk queue."},"ApprovalRiskResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ApprovalRiskItem"},"type":"array","title":"Items","description":"Risk-scored bills."}},"type":"object","title":"ApprovalRiskResponse","description":"Response for ``POST /ap-approval/risk-score``."},"ApproveMatchResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"match":{"anyOf":[{"$ref":"#/components/schemas/CommittedMatch"},{"additionalProperties":true,"type":"object"}],"title":"Match"}},"additionalProperties":true,"type":"object","required":["match"],"title":"ApproveMatchResponse","description":"``SuccessEnvelope[ApproveMatchResponse]`` inner payload."},"ApproversResponse":{"properties":{"approvers":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Approvers","description":"Approver user IDs grouped by tier ('ops', 'advisor', 'owner')."}},"type":"object","title":"ApproversResponse","description":"Response for ``GET /ap-approval/approvers`` and the PUT counterpart.\n\n``approvers`` is a map from tier name → list of user UUID strings. Tiers\nwith no approvers configured are absent (or empty), and the run-time\nenforcement falls back to \"anyone on the business\" for those tiers."},"ArAgingBucket":{"properties":{"label":{"type":"string","title":"Label"},"amount_cents":{"type":"integer","title":"Amount Cents"},"invoice_count":{"type":"integer","title":"Invoice Count"}},"additionalProperties":false,"type":"object","required":["label","amount_cents","invoice_count"],"title":"ArAgingBucket"},"ArAgingOverdue":{"properties":{"customer_name":{"type":"string","title":"Customer Name"},"amount_cents":{"type":"integer","title":"Amount Cents"},"days_past_due":{"type":"integer","title":"Days Past Due"}},"additionalProperties":false,"type":"object","required":["customer_name","amount_cents","days_past_due"],"title":"ArAgingOverdue"},"ArAgingSlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"ar_aging","title":"Slide Type","default":"ar_aging"},"data":{"$ref":"#/components/schemas/ArAgingSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"ArAgingSlide"},"ArAgingSlideData":{"properties":{"total_outstanding_cents":{"type":"integer","title":"Total Outstanding Cents"},"buckets":{"items":{"$ref":"#/components/schemas/ArAgingBucket"},"type":"array","maxItems":8,"title":"Buckets"},"top_overdue":{"items":{"$ref":"#/components/schemas/ArAgingOverdue"},"type":"array","maxItems":12,"title":"Top Overdue"}},"additionalProperties":false,"type":"object","required":["total_outstanding_cents"],"title":"ArAgingSlideData"},"AskItem":{"properties":{"title":{"type":"string","title":"Title"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"kind":{"anyOf":[{"type":"string","enum":["decision","fyi","discussion"]},{"type":"null"}],"title":"Kind"}},"additionalProperties":false,"type":"object","required":["title"],"title":"AskItem"},"AsksSlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"asks","title":"Slide Type","default":"asks"},"data":{"$ref":"#/components/schemas/AsksSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"AsksSlide"},"AsksSlideData":{"properties":{"asks":{"items":{"$ref":"#/components/schemas/AskItem"},"type":"array","maxItems":10,"title":"Asks"}},"additionalProperties":false,"type":"object","title":"AsksSlideData"},"AssetCategoryCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Category name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Category description"},"default_useful_life_months":{"type":"integer","maximum":600.0,"minimum":1.0,"title":"Default Useful Life Months","description":"Default useful life in months for assets in this category","default":60},"default_depreciation_method":{"$ref":"#/components/schemas/DepreciationMethod","description":"Default depreciation method","default":"straight_line"},"default_salvage_percent":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Default Salvage Percent","description":"Default salvage value as percentage of cost","default":0},"asset_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset Ledger Id","description":"Ledger account for asset cost"},"depreciation_expense_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Depreciation Expense Ledger Id","description":"Ledger account for depreciation expense"},"accumulated_depreciation_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accumulated Depreciation Ledger Id","description":"Ledger account for accumulated depreciation"}},"type":"object","required":["name"],"title":"AssetCategoryCreate","description":"Schema for creating an asset category."},"AssetCategoryListResponse":{"properties":{"categories":{"items":{"$ref":"#/components/schemas/AssetCategoryResponse"},"type":"array","title":"Categories","description":"Asset categories"},"count":{"type":"integer","title":"Count","description":"Total number of categories"}},"type":"object","required":["count"],"title":"AssetCategoryListResponse","description":"Schema for listing asset categories."},"AssetCategoryResponse":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Category name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Category description"},"default_useful_life_months":{"type":"integer","maximum":600.0,"minimum":1.0,"title":"Default Useful Life Months","description":"Default useful life in months for assets in this category","default":60},"default_depreciation_method":{"$ref":"#/components/schemas/DepreciationMethod","description":"Default depreciation method","default":"straight_line"},"default_salvage_percent":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Default Salvage Percent","description":"Default salvage value as percentage of cost","default":0},"id":{"type":"string","title":"Id","description":"Category ID"},"asset_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset Ledger Id","description":"Ledger account for asset cost"},"depreciation_expense_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Depreciation Expense Ledger Id","description":"Ledger account for depreciation expense"},"accumulated_depreciation_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accumulated Depreciation Ledger Id","description":"Ledger account for accumulated depreciation"},"asset_count":{"type":"integer","title":"Asset Count","description":"Number of assets in this category","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Record creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["name","id","created_at","updated_at"],"title":"AssetCategoryResponse","description":"Schema for asset category response."},"AssetCategoryUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name","description":"Category name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Category description"},"default_useful_life_months":{"anyOf":[{"type":"integer","maximum":600.0,"minimum":1.0},{"type":"null"}],"title":"Default Useful Life Months","description":"Default useful life in months"},"default_depreciation_method":{"anyOf":[{"$ref":"#/components/schemas/DepreciationMethod"},{"type":"null"}],"description":"Default depreciation method"},"default_salvage_percent":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Default Salvage Percent","description":"Default salvage value as percentage of cost"},"asset_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset Ledger Id","description":"Ledger account for asset cost"},"depreciation_expense_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Depreciation Expense Ledger Id","description":"Ledger account for depreciation expense"},"accumulated_depreciation_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accumulated Depreciation Ledger Id","description":"Ledger account for accumulated depreciation"}},"type":"object","title":"AssetCategoryUpdate","description":"Schema for updating an asset category."},"AssetStatus":{"type":"string","enum":["draft","active","fully_depreciated","disposed"],"title":"AssetStatus","description":"Fixed asset lifecycle status."},"AssociatedUserCursorListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AssociatedUserResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"AssociatedUserCursorListResponse","description":"Paginated list of associated users with cursor-based navigation."},"AssociatedUserResponse":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"User email address (unique identifier)."},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"User's first name."},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"User's last name."},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Photo Url","description":"URL to user's profile photo."},"onboarded":{"type":"boolean","title":"Onboarded","description":"Whether user has completed onboarding.","default":false},"props":{"additionalProperties":true,"type":"object","title":"Props","description":"Additional user properties/settings."},"id":{"type":"string","title":"Id","description":"User UUID."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Account creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last profile update timestamp."},"firm_ids":{"items":{"type":"string"},"type":"array","title":"Firm Ids","description":"Advisory firm UUIDs the user belongs to."},"role":{"$ref":"#/components/schemas/Role","description":"Role: owner, admin, member, or viewer"},"source":{"$ref":"#/components/schemas/UserSource","description":"Source of association: business_user (direct) or advisor_user (via advisory firm)."}},"type":"object","required":["email","id","created_at","updated_at","role","source"],"title":"AssociatedUserResponse","description":"Response schema for a user associated with a business.\n\nIncludes the user's role and source indicating whether they are a direct\nbusiness user or an advisor firm user.","example":{"created_at":"2024-01-10T10:30:00Z","email":"john.doe@example.com","firm_ids":[],"first_name":"John","id":"019ab37c-user-7000-8000-000000000001","last_name":"Doe","onboarded":true,"photo_url":"https://example.com/photos/john.jpg","props":{"timezone":"America/Los_Angeles"},"updated_at":"2024-01-15T14:00:00Z"}},"AttachmentResponse":{"properties":{"id":{"type":"string","title":"Id"},"note_id":{"type":"string","title":"Note Id"},"file_name":{"type":"string","title":"File Name"},"file_size":{"type":"integer","title":"File Size"},"mime_type":{"type":"string","title":"Mime Type"},"uploaded_by":{"type":"string","title":"Uploaded By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","note_id","file_name","file_size","mime_type","uploaded_by","created_at"],"title":"AttachmentResponse","description":"A file attachment for a note."},"AttentionCategory":{"type":"string","enum":["action_required","alert","info","announcement","system"],"title":"AttentionCategory","description":"Functional category of an attention item."},"AttentionItem":{"properties":{"id":{"type":"string","title":"Id","description":"Opaque identifier. Format: ``inbox:<uuid>`` for persistent messages or ``live:<alert_id>`` for computed signals."},"source":{"$ref":"#/components/schemas/AttentionSource"},"category":{"$ref":"#/components/schemas/AttentionCategory"},"priority":{"$ref":"#/components/schemas/AttentionPriority"},"title":{"type":"string","title":"Title"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body","description":"Optional longer description of the item."},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon","description":"Icon hint for the frontend (CSS icon name)."},"action_required":{"type":"boolean","title":"Action Required","description":"Whether resolving this item requires user action. Items with ``action_required=True`` appear in the Action Items dashboard card; all items appear in the notification bell.","default":false},"action_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Url","description":"In-app deep link the user should follow to resolve."},"action_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Label","description":"Short label for the action button (e.g. 'Review')."},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type","description":"Related entity kind, e.g. ``invoices``, ``bills``."},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id","description":"Related entity ID if applicable."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"read":{"type":"boolean","title":"Read","description":"True if the item is read (inbox) or has been dismissed by the user (live).","default":false},"starred":{"type":"boolean","title":"Starred","description":"Inbox-only star state.","default":false},"dismissible":{"type":"boolean","title":"Dismissible","description":"Whether the user can mark this read/dismiss. Always true for inbox; live items are dismissible per-user via user.props.","default":true},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Optional source-specific extra data."}},"type":"object","required":["id","source","category","priority","title","created_at"],"title":"AttentionItem","description":"A single thing the user should pay attention to.\n\nThe ``source`` field tells the client whether the item is a real inbox row\n(``inbox``) — which supports archive/star/delete — or a computed live\nsignal (``live``) which can only be read or dismissed."},"AttentionListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AttentionItem"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Inbox cursor for the next page (live items are not paginated)."},"has_more":{"type":"boolean","title":"Has More","description":"True if more inbox messages exist.","default":false}},"type":"object","required":["items"],"title":"AttentionListResponse","description":"Paginated list of attention items."},"AttentionPriority":{"type":"string","enum":["urgent","high","normal","low"],"title":"AttentionPriority","description":"Priority level. Sort order is urgent > high > normal > low."},"AttentionSource":{"type":"string","enum":["inbox","live"],"title":"AttentionSource","description":"Where an attention item came from."},"AttentionSummary":{"properties":{"total":{"type":"integer","title":"Total","description":"All unread/undismissed items."},"action_required":{"type":"integer","title":"Action Required","description":"Items requiring user action (drives the action items card)."},"urgent":{"type":"integer","title":"Urgent","description":"Urgent priority items."},"high":{"type":"integer","title":"High","description":"High priority items."},"inbox_unread":{"type":"integer","title":"Inbox Unread","description":"Persistent inbox unread count (separate from live alerts)."},"live_alerts":{"type":"integer","title":"Live Alerts","description":"Active live alerts (overdue bills, low balance, ...)."}},"type":"object","required":["total","action_required","urgent","high","inbox_unread","live_alerts"],"title":"AttentionSummary","description":"Counts used by the bell badge and dashboards."},"AutoNumberingPreviewResponse":{"properties":{"next_bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Bill Number","description":"Preview of next bill number (e.g., 'BILL-0001'). None if auto-numbering disabled."},"next_invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Invoice Number","description":"Preview of next invoice number (e.g., 'INV-0001'). None if auto-numbering disabled."},"next_journal_entry_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Journal Entry Number","description":"Preview of next journal entry number (e.g., 'JE-0001')."}},"type":"object","title":"AutoNumberingPreviewResponse","description":"Response schema for previewing next auto-generated numbers."},"AutoNumberingSettingsResponse":{"properties":{"auto_number_bills":{"type":"boolean","title":"Auto Number Bills","description":"Whether automatic bill numbering is enabled"},"auto_number_invoices":{"type":"boolean","title":"Auto Number Invoices","description":"Whether automatic invoice numbering is enabled"},"bill_number_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Number Prefix","description":"Prefix for auto-generated bill numbers (e.g., 'BILL-')"},"invoice_number_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number Prefix","description":"Prefix for auto-generated invoice numbers (e.g., 'INV-')"},"next_bill_number":{"type":"integer","title":"Next Bill Number","description":"Next sequential number for bill auto-numbering"},"next_invoice_number":{"type":"integer","title":"Next Invoice Number","description":"Next sequential number for invoice auto-numbering"},"journal_entry_number_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Number Prefix","description":"Prefix for auto-generated journal entry numbers (e.g., 'JE-')"},"next_journal_entry_number":{"type":"integer","title":"Next Journal Entry Number","description":"Next sequential number for journal entry auto-numbering"}},"type":"object","required":["auto_number_bills","auto_number_invoices","next_bill_number","next_invoice_number","next_journal_entry_number"],"title":"AutoNumberingSettingsResponse","description":"Response schema for auto-numbering configuration."},"AutoNumberingSettingsUpdateRequest":{"properties":{"auto_number_bills":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Number Bills","description":"Enable/disable automatic bill numbering"},"auto_number_invoices":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Number Invoices","description":"Enable/disable automatic invoice numbering"},"bill_number_prefix":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Bill Number Prefix","description":"Prefix for auto-generated bill numbers (e.g., 'BILL-', '2024-'). Max 20 chars."},"invoice_number_prefix":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Invoice Number Prefix","description":"Prefix for auto-generated invoice numbers (e.g., 'INV-', '2024-'). Max 20 chars."},"next_bill_number":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Next Bill Number","description":"Set next bill number (minimum 1). Useful when migrating from another system."},"next_invoice_number":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Next Invoice Number","description":"Set next invoice number (minimum 1). Useful when migrating from another system."},"journal_entry_number_prefix":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Journal Entry Number Prefix","description":"Prefix for auto-generated journal entry numbers (e.g., 'JE-'). Max 20 chars."},"next_journal_entry_number":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Next Journal Entry Number","description":"Set next journal entry number (minimum 1). Useful when migrating."}},"type":"object","title":"AutoNumberingSettingsUpdateRequest","description":"Request schema for updating auto-numbering settings.\n\nAll fields are optional - only fields provided will be updated."},"BalanceSchema":{"properties":{"available":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Available","description":"Available balance in cents (what can be spent now)."},"current":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current","description":"Current balance in cents (includes pending transactions)."},"iso_currency_code":{"type":"string","title":"Iso Currency Code","description":"ISO 4217 currency code (e.g., 'USD')."},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Credit limit in cents (for credit cards)."},"unofficial_currency_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unofficial Currency Code","description":"Unofficial currency code if ISO code unavailable."},"is_available":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Available","description":"Whether available balance is reported (0 or 1)."}},"additionalProperties":true,"type":"object","required":["iso_currency_code"],"title":"BalanceSchema","description":"Schema for a bank account balance from Plaid.\n\nAmounts are in cents (e.g., 150000 = $1,500.00).","example":{"available":1523450,"current":1548200,"is_available":1,"iso_currency_code":"USD"}},"BalanceSheetRow":{"properties":{"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id"},"ledger_name":{"type":"string","title":"Ledger Name"},"sort_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort Code"},"sub_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Type"},"total_amount":{"type":"integer","title":"Total Amount"}},"additionalProperties":true,"type":"object","required":["ledger_name","total_amount"],"title":"BalanceSheetRow","description":"Ledger row within a balance-sheet section."},"BalanceSheetSectionBlock":{"properties":{"section":{"type":"string","title":"Section"},"total_amount":{"type":"integer","title":"Total Amount"},"rows":{"items":{"$ref":"#/components/schemas/BalanceSheetRow"},"type":"array","title":"Rows"}},"additionalProperties":true,"type":"object","required":["section","total_amount","rows"],"title":"BalanceSheetSectionBlock","description":"Assets / Liabilities / Equity section."},"BankDepositCreateRequest":{"properties":{"deposit_to_ledger_id":{"type":"string","title":"Deposit To Ledger Id","description":"Bank/cash account the money lands in."},"deposit_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Deposit Date","description":"Deposit date. Defaults to today."},"sales_receipt_ids":{"items":{"type":"string"},"type":"array","title":"Sales Receipt Ids","description":"Undeposited sales receipts to group into this deposit."},"other_lines":{"items":{"$ref":"#/components/schemas/OtherDepositLine"},"type":"array","title":"Other Lines","description":"Optional ad-hoc deposit lines (non-undeposited sources)."},"number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Number"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"},"currency":{"type":"string","maxLength":3,"title":"Currency","default":"USD"}},"type":"object","required":["deposit_to_ledger_id"],"title":"BankDepositCreateRequest","description":"Request schema for creating (and posting) a bank deposit."},"BankDepositResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"status":{"type":"string","title":"Status"},"deposit_date":{"type":"string","format":"date","title":"Deposit Date"},"deposit_to_ledger_id":{"type":"string","title":"Deposit To Ledger Id"},"deposit_to_ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deposit To Ledger Name"},"sales_receipt_ids":{"items":{"type":"string"},"type":"array","title":"Sales Receipt Ids"},"other_lines":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Other Lines"},"undeposited_total":{"type":"integer","title":"Undeposited Total"},"total":{"type":"integer","title":"Total"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"},"currency":{"type":"string","title":"Currency"},"journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Id"},"void_journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Void Journal Entry Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","status","deposit_date","deposit_to_ledger_id","undeposited_total","total","currency","created_at","updated_at"],"title":"BankDepositResponse","description":"Response schema for a bank deposit."},"BankDepositsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BankDepositResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"BankDepositsListResponse","description":"Paginated list of bank deposits."},"BatchApproveRequest":{"properties":{"execution_ids":{"items":{"type":"string"},"type":"array","maxItems":50,"minItems":1,"title":"Execution Ids","description":"List of workflow execution UUIDs to approve."},"comment":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Comment","description":"Optional comment applied to all approvals in the batch."}},"type":"object","required":["execution_ids"],"title":"BatchApproveRequest","description":"Body for ``POST /ap-approval/batch-approve``."},"BatchApproveResponse":{"properties":{"total":{"type":"integer","title":"Total","description":"Total executions submitted."},"succeeded":{"type":"integer","title":"Succeeded","description":"Number of successful approvals."},"failed":{"type":"integer","title":"Failed","description":"Number of failed approvals."},"results":{"items":{"$ref":"#/components/schemas/BatchApproveResultItem"},"type":"array","title":"Results","description":"Per-execution results."}},"type":"object","required":["total","succeeded","failed"],"title":"BatchApproveResponse","description":"Response for ``POST /ap-approval/batch-approve``."},"BatchApproveResultItem":{"properties":{"execution_id":{"type":"string","title":"Execution Id","description":"Execution UUID."},"success":{"type":"boolean","title":"Success","description":"Whether this approval succeeded."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if the approval failed."}},"type":"object","required":["execution_id","success"],"title":"BatchApproveResultItem","description":"Result for a single execution in a batch-approve request."},"BatchInvoiceError":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"error":{"type":"string","title":"Error"}},"additionalProperties":true,"type":"object","required":["customer_id","error"],"title":"BatchInvoiceError"},"BatchInvoiceItem":{"properties":{"customer_id":{"type":"string","title":"Customer Id","description":"Customer ID"},"line_items":{"items":{"$ref":"#/components/schemas/BatchInvoiceLineItem"},"type":"array","minItems":1,"title":"Line Items","description":"Line items"},"due_date":{"type":"string","title":"Due Date","description":"Due date YYYY-MM-DD"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Invoice description"}},"type":"object","required":["customer_id","line_items","due_date"],"title":"BatchInvoiceItem","description":"A single invoice to create in a batch."},"BatchInvoiceLineItem":{"properties":{"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Product variant ID or null for custom"},"description":{"type":"string","title":"Description","description":"Line item description"},"quantity":{"type":"integer","minimum":1.0,"title":"Quantity","description":"Quantity","default":1},"unit_price":{"type":"integer","title":"Unit Price","description":"Unit price in cents"},"amount":{"type":"integer","title":"Amount","description":"Total amount in cents (qty * unit_price)"}},"type":"object","required":["description","unit_price","amount"],"title":"BatchInvoiceLineItem","description":"Line item for a batch invoice."},"BatchInvoiceRequest":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BatchInvoiceItem"},"type":"array","minItems":1,"title":"Items","description":"List of invoices to create"},"include_delayed_charges":{"type":"boolean","title":"Include Delayed Charges","description":"If true, sweep pending delayed charges for each customer into their invoice","default":false},"finalize":{"type":"boolean","title":"Finalize","description":"Auto-finalize invoices after creation","default":false}},"type":"object","required":["items"],"title":"BatchInvoiceRequest","description":"Request schema for creating multiple invoices at once."},"BillAICreatePayloadRequest":{"properties":{"pasted_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pasted Text","description":"Raw text content to extract a bill from. Limit 1 bill per text input. Mutually exclusive with pasted_text_s3_key."},"pasted_text_s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pasted Text S3 Key","description":"S3 key of pasted text content. Limit 1 bill per text input. Mutually exclusive with pasted_text."},"single_bill_s3_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Single Bill S3 Keys","description":"S3 keys of individual bill documents (PDFs, images, Excel). Each file is processed independently."},"multi_bill_s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Multi Bill S3 Key","description":"S3 key of a CSV file containing multiple bills."}},"type":"object","title":"BillAICreatePayloadRequest","description":"Request schema for AI-powered bill extraction from uploaded documents.\n\nProvide one or more source inputs. The AI will analyze each source and\nextract draft bill entities from the content.\n\nSource types:\n- pasted_text: Raw text content to extract a bill from (limit 1 bill)\n- pasted_text_s3_key: S3 key of pasted text content (limit 1 bill)\n- single_bill_s3_keys: S3 keys of individual bill documents (PDFs, images, Excel)\n- multi_bill_s3_key: S3 key of a CSV or Excel file containing multiple bills","example":{"single_bill_s3_keys":["business-id/uuid-bill1.pdf","business-id/uuid-bill2.png"]}},"BillAICreatePayloadResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DraftBill"},"type":"array","title":"Items","description":"List of draft bill entities extracted by AI."},"errors":{"items":{"$ref":"#/components/schemas/FileProcessingError"},"type":"array","title":"Errors","description":"List of per-file errors for files that could not be processed."}},"type":"object","required":["items"],"title":"BillAICreatePayloadResponse","description":"Response schema for AI-powered bill extraction.\n\nReturns a list of draft bill entities extracted from the uploaded documents.\nEach draft bill contains all fields needed to create a bill in 'received' status.\nFiles that fail are reported in the ``errors`` list rather than causing\nthe entire request to fail.","example":{"errors":[],"items":[{"amount":15000,"bill_number":"INV-12345","confidence":0.92,"currency":"USD","description":"Office supplies","expense_category":"Office Supplies","source":"single_file","type":"one_time","vendor_name":"Office Depot"}]}},"BillAgingResponse":{"properties":{"as_of_date":{"type":"string","title":"As Of Date","description":"Report date in YYYY-MM-DD format."},"vendors":{"items":{"$ref":"#/components/schemas/AgingVendorSummary"},"type":"array","title":"Vendors","description":"Per-vendor aging summary rows."},"bills":{"items":{"$ref":"#/components/schemas/AgingBillItem"},"type":"array","title":"Bills","description":"Individual bills with aging bucket for drill-down."},"totals":{"$ref":"#/components/schemas/AgingVendorSummary","description":"Grand totals across all vendors."}},"type":"object","required":["as_of_date","vendors","bills","totals"],"title":"BillAgingResponse","description":"AP Aging Summary with per-vendor buckets and bill-level detail."},"BillBatchPaymentAllocation":{"properties":{"bill_id":{"type":"string","title":"Bill Id","description":"UUID of the bill receiving this slice of the transaction."},"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Amount in cents to allocate to this bill. Must be > 0."}},"type":"object","required":["bill_id","amount"],"title":"BillBatchPaymentAllocation","description":"A single bill allocation inside a batch payment request."},"BillBatchPaymentRequest":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the bank transaction representing the payment."},"allocations":{"items":{"$ref":"#/components/schemas/BillBatchPaymentAllocation"},"type":"array","minItems":1,"title":"Allocations","description":"One allocation per bill (1+). Each `bill_id` must be unique."},"paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid On","description":"Override payment date applied to every allocation. Defaults to the transaction datetime if omitted."}},"type":"object","required":["transaction_id","allocations"],"title":"BillBatchPaymentRequest","description":"Schema for splitting a single bank transaction across multiple bills.\n\nAll allocations are applied atomically *after* up-front validation: if\nthe total allocation would exceed the transaction's remaining\nunallocated balance, or any bill is invalid, no payment records are\ncreated.","example":{"allocations":[{"amount":50000,"bill_id":"019ab37c-bill-7000-8000-000000000001"},{"amount":75000,"bill_id":"019ab37c-bill-7000-8000-000000000002"}],"transaction_id":"019ab37c-txn1-7000-8000-000000000001"}},"BillBatchPaymentResponse":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"Bank transaction UUID."},"total_allocated":{"type":"integer","title":"Total Allocated","description":"Total cents allocated across all bills in this batch."},"payment_count":{"type":"integer","title":"Payment Count","description":"Number of BillPayment records created."},"payments":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Payments","description":"Per-bill payment payloads (mirrors BillPaymentResponse)."}},"type":"object","required":["transaction_id","total_allocated","payment_count"],"title":"BillBatchPaymentResponse","description":"Response for a batch payment split across multiple bills."},"BillBulkRequest":{"properties":{"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key","description":"S3 key of the uploaded CSV file containing bill data."},"approve":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Approve","description":"If true, created bills are set to 'forecasted' status (approved). If false, bills remain as 'draft'.","default":false},"create_as_received":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Create As Received","description":"If true, every row is created in 'received' status with an accounting journal entry. Each row must have a resolvable expense ledger (ledger_id, ledger_name, or expense_account column) and a valid amount. Overrides `approve` when set.","default":false},"attachments":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Attachments","description":"Optional mapping of source filename → pre-uploaded S3 key (from POST /bills/upload). Rows whose `attachment_filename` matches a key in this map have the corresponding document attached."}},"additionalProperties":true,"type":"object","title":"BillBulkRequest","description":"Request schema for bulk bill creation via CSV upload.\n\nUpload a CSV file to S3 first, then provide the s3_key here.\n\nCSV columns (required):\n- vendor_email: Email of the vendor (must exist in the system)\n- expected_amount: Expected bill amount in dollars. Accepts plain numbers\n  (1500.00, 1500), currency symbols ($1,500.00), and thousands separators.\n\nCSV columns (optional):\n- description: Description of the bill\n- bill_number: Vendor's bill/invoice number (auto-generated when blank)\n- type: 'recurring' or 'one_time' (defaults to 'one_time')\n- currency: USD/CAD/AUD/EUR/GBP (defaults to business default)\n- due_date: Payment due date (YYYY-MM-DD)\n- expected_paid_on_date: Expected payment date (YYYY-MM-DD)\n- received_on: Date bill was received (YYYY-MM-DD). Required when\n  create_as_received=True.\n- journal_entry_date: Date for accounting journal entry (YYYY-MM-DD).\n  Defaults to received_on when create_as_received=True.\n- ledger_id / ledger_name / expense_account: Expense ledger for the\n  journal entry. Required when create_as_received=True. ledger_id takes\n  precedence; ledger_name/expense_account are matched (case-insensitive)\n  against active expense ledgers in the business.\n- attachment_filename: Filename matching a key in the request `attachments`\n  map. The corresponding s3_key is attached to the created bill.","example":{"approve":false,"attachments":{"rent-jan.pdf":"attachments/019c30bb-dc4c-7e7e-8f9a-aaa","supplies-feb.pdf":"attachments/019c30bb-dc4c-7e7e-8f9a-bbb"},"create_as_received":false,"s3_key":"uploads/bills/batch-2024-01.csv"}},"BillCreateRequest":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of what the bill is for."},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Currency for the bill (USD, CAD, AUD, EUR, or GBP). Defaults to business default.","default":"USD"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"UUID of the vendor this bill is from."},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"Bill type: 'recurring' (monthly rent, subscriptions) or 'one_time'."},"expected_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Amount","description":"Expected bill amount in cents."},"expected_paid_on_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Expected Paid On Date","description":"Expected payment date (ISO 8601 format)."},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key","description":"S3 key of uploaded bill document (PDF/image)."},"recurring":{"anyOf":[{"$ref":"#/components/schemas/RecurringConfig"},{"type":"null"}],"description":"If provided, creates a recurring template for this bill."},"submitted_for_review":{"type":"boolean","title":"Submitted For Review","description":"When true, marks this draft as a client-submitted expense and notifies the assigned advisor to confirm or deny it.","default":false}},"type":"object","title":"BillCreateRequest","description":"Schema for creating a new bill (expense from a vendor).\n\nBills track money owed to vendors for goods or services received.\nThey progress through statuses: draft → forecasted → received → paid.","example":{"description":"Monthly office rent - January 2024","expected_amount":250000,"expected_paid_on_date":"2024-01-31T00:00:00Z","type":"recurring","vendor_id":"019ab37c-vend-7000-8000-000000000001"}},"BillJournalEntryGenerateRequest":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id","description":"UUID of the expense ledger account to debit."},"journal_entry_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date"},{"type":"string"},{"type":"null"}],"title":"Journal Entry Date","description":"Date for the accounting journal entry (ISO 8601 or YYYY-MM-DD). Defaults to received_on."}},"type":"object","required":["ledger_id"],"title":"BillJournalEntryGenerateRequest","description":"Generate the outstanding AP journal entry for a received bill."},"BillMetricsResponse":{"properties":{"total_due":{"type":"integer","title":"Total Due","description":"Sum of the amount for all bills in 'received' or 'partially_paid' status (in cents)."},"total_balance_due":{"type":"integer","title":"Total Balance Due","description":"Sum of (amount - total_paid) for all bills in 'received' or 'partially_paid' status (in cents)."}},"type":"object","required":["total_due","total_balance_due"],"title":"BillMetricsResponse","description":"Response schema for bill aggregate metrics."},"BillPaymentRequest":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the bank transaction representing the payment."},"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Payment amount in cents. Must be > 0."},"paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid On","description":"Override payment date (ISO 8601). Defaults to the transaction datetime if omitted."}},"type":"object","required":["transaction_id","amount"],"title":"BillPaymentRequest","description":"Schema for recording a payment against a bill.\n\nLinks a bank transaction to a bill to track partial or full payment.\nSupports split payments (one transaction paying multiple bills) and\npartial payments (multiple transactions paying one bill).","example":{"amount":125000,"transaction_id":"019ab37c-txn1-7000-8000-000000000001"}},"BillPaymentResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Payment record UUID."},"bill_id":{"type":"string","title":"Bill Id","description":"UUID of the bill being paid."},"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the bank transaction."},"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount","description":"Payment amount in cents."},"currency":{"type":"string","title":"Currency","description":"Currency for the payment (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"paid_on":{"type":"string","format":"date-time","title":"Paid On","description":"Payment date."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Record creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."}},"type":"object","required":["id","bill_id","transaction_id","amount","paid_on","created_at","updated_at","business_id"],"title":"BillPaymentResponse","description":"Response schema for a bill payment record.\n\nRepresents a payment made against a bill, linking to the bank transaction.","example":{"amount":250000,"bill_id":"019ab37c-bill-7000-8000-000000000001","business_id":"019ab37c-bus1-7000-8000-000000000001","created_at":"2024-01-25T10:30:00Z","id":"019ab37c-pay1-7000-8000-000000000001","paid_on":"2024-01-25T00:00:00Z","transaction_id":"019ab37c-txn1-7000-8000-000000000001","updated_at":"2024-01-25T10:30:00Z"}},"BillPaymentSuggestionRejectResponse":{"properties":{"status":{"type":"string","title":"Status"},"suggestion_id":{"type":"string","title":"Suggestion Id"}},"additionalProperties":true,"type":"object","required":["status","suggestion_id"],"title":"BillPaymentSuggestionRejectResponse","description":"Acknowledgement for ``reject_bill_payment_suggestion``."},"BillPaymentSuggestionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Suggestion UUID"},"bill_id":{"type":"string","title":"Bill Id","description":"Bill UUID"},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Number","description":"Bill number"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name","description":"Vendor name"},"transaction_id":{"type":"string","title":"Transaction Id","description":"Transaction UUID"},"transaction_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Description","description":"Transaction description"},"transaction_counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Counterparty","description":"Transaction counterparty"},"transaction_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Transaction Date","description":"Date of the transaction"},"transaction_account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Account Name","description":"Name of the ledger/bank account the transaction posted to"},"business_id":{"type":"string","title":"Business Id","description":"Business UUID"},"amount":{"type":"integer","title":"Amount","description":"Suggested payment amount in cents"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"Match confidence (0–1)"},"signals":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Signals","description":"Signal score breakdown"},"match_group_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Group Id","description":"Group ID for multi-bill matches"},"status":{"type":"string","title":"Status","description":"pending | accepted | rejected | expired"},"reviewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reviewed At","description":"When reviewed"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When created"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"When updated"}},"type":"object","required":["id","bill_id","transaction_id","business_id","amount","confidence","status"],"title":"BillPaymentSuggestionResponse","description":"Response schema for a bill payment suggestion."},"BillPaymentSuggestionsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BillPaymentSuggestionResponse"},"type":"array","title":"Items","description":"List of suggestions"},"pending_count":{"type":"integer","title":"Pending Count","description":"Total pending suggestions","default":0}},"type":"object","title":"BillPaymentSuggestionsListResponse","description":"Response schema for listing bill payment suggestions."},"BillReceivedCreateRequest":{"properties":{"vendor_id":{"type":"string","title":"Vendor Id","description":"UUID of the vendor this bill is from (required)."},"amount":{"type":"integer","title":"Amount","description":"Bill amount in cents (required)."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of what the bill is for."},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Number","description":"Bill/invoice number from the vendor. Auto-generated if not provided."},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Currency for the bill (USD, CAD, AUD, EUR, or GBP). Defaults to business default.","default":"USD"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"Bill type: 'recurring' or 'one_time'. Defaults to 'one_time'.","default":"one_time"},"received_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Received On","description":"Date the bill was received (ISO 8601). Defaults to now."},"due_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Due On","description":"Payment due date (ISO 8601)."},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key","description":"S3 key of uploaded bill document (PDF/image)."},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"UUID of the expense ledger for journal entry creation. If provided, creates journal entry automatically. Ignored when line_items is provided."},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/JournalEntryLineItem"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Split journal entry lines. Each line specifies a debit account and amount. The credit side is always Accounts Payable. When provided, ledger_id is ignored."},"journal_entry_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date"},{"type":"string"},{"type":"null"}],"title":"Journal Entry Date","description":"Date for the accounting journal entry (ISO 8601 or YYYY-MM-DD). Defaults to received_on if not provided."}},"type":"object","required":["vendor_id","amount"],"title":"BillReceivedCreateRequest","description":"Schema for creating a bill directly in 'received' status.\n\nThis endpoint bypasses the draft stage and creates a bill that's ready\nfor payment. Useful for manually entering bills that have already been received.\n\nWhen ledger_id is provided, this endpoint will also create the associated\njournal entry (debit to expense ledger, credit to accounts payable).\n\nFor split journal entries, provide line_items instead of ledger_id.\nEach line_item specifies a debit account and amount; the credit side\nis always Accounts Payable for the full bill amount.","example":{"amount":56135,"bill_number":"P054","currency":"USD","description":"Purchase Order (P054) issued by Artisan AI LLC","due_on":"2025-03-29T12:00:00Z","journal_entry_date":"2025-02-27T12:00:00Z","ledger_id":"019ab37c-led1-7000-8000-000000000001","received_on":"2025-02-27T12:00:00Z","s3_key":"attachments/019c30bb-dc4c-7e7e-8f9a-123456789abc","type":"one_time","vendor_id":"019ab37c-vend-7000-8000-000000000001"}},"BillReceivedRequest":{"properties":{"bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Id","description":"UUID of the bill (set automatically from URL path)."},"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Actual bill amount in cents. Must be greater than 0."},"ledger_id":{"type":"string","title":"Ledger Id","description":"UUID of the expense ledger account to categorize this bill. Required for creating the journal entry."},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key","description":"S3 key of the bill document."},"journal_entry_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date"},{"type":"string"},{"type":"null"}],"title":"Journal Entry Date","description":"Date for the accounting journal entry (ISO 8601 or YYYY-MM-DD)."},"received_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date"},{"type":"string"},{"type":"null"}],"title":"Received On","description":"Date the bill/goods were received (ISO 8601 or YYYY-MM-DD)."},"due_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date"},{"type":"string"},{"type":"null"}],"title":"Due On","description":"Payment due date (ISO 8601 or YYYY-MM-DD)."}},"type":"object","required":["amount","ledger_id"],"title":"BillReceivedRequest","description":"Schema for marking a bill as received and creating journal entries.\n\nWhen a bill is marked as received, accounting journal entries are created\nto record the liability (Accounts Payable).","example":{"amount":250000,"due_on":"2024-01-31T00:00:00Z","journal_entry_date":"2024-01-15T00:00:00Z","ledger_id":"019ab37c-led1-7000-8000-000000000001","received_on":"2024-01-15T00:00:00Z"}},"BillResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Bill UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"currency":{"type":"string","title":"Currency","description":"Currency for the bill (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"status":{"anyOf":[{"type":"integer"},{"type":"string"}],"title":"Status","description":"Bill status (see schema description)."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Bill description."},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Number","description":"Bill/invoice number from vendor."},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Vendor UUID."},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name","description":"Vendor name (resolved)."},"vendor_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Email","description":"Vendor email (resolved)."},"type":{"anyOf":[{"type":"integer"},{"type":"string"}],"title":"Type","description":"Type: 'recurring' or 'one_time'."},"expected_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Amount","description":"Expected amount in cents."},"expected_paid_on_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Paid On Date","description":"Expected payment date."},"total_paid":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Paid","description":"Total amount paid so far in cents."},"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount","description":"Actual bill amount in cents."},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key","description":"S3 key of attached document."},"received_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Received On","description":"Date bill/goods received."},"due_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due On","description":"Payment due date."},"paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid On","description":"Date fully paid."},"payment_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Method","description":"Payment method (Wire Transfer, ACH, Check, Credit Card). Prefers the user-set override; otherwise inferred from a linked payment."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"signed_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signed Url","description":"Signed URL to view attached document."},"payments":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Payments","description":"List of payments made.","default":[]},"journal_entries":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Journal Entries","description":"Associated accounting entries.","default":[]},"recurring_template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recurring Template Id","description":"ID of recurring template if this bill was generated from one, or if one was created."},"source_inventory_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Inventory Order Id","description":"Source PO that produced this bill via the PO lifecycle. Non-null means this bill is visible on the Inventory -> Accounts Payable tab."},"match_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Status","description":"Three-way match outcome: matched, qty_variance, price_variance, qty_and_price_variance, unmatched, no_po. None until the matcher has run on the bill."},"match_variance_qty":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Match Variance Qty","description":"Signed unit variance across all lines (received - ordered). Positive = over-received; negative = short."},"match_variance_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Match Variance Amount Cents","description":"Signed amount variance in cents (bill amount - PO total). Positive = vendor billed more than ordered; negative = less."},"thread":{"anyOf":[{"$ref":"#/components/schemas/BillThreadResponse"},{"type":"null"}],"description":"Discussion thread and comment summary for this bill"}},"type":"object","required":["id","business_id","status","type","created_at","updated_at"],"title":"BillResponse","description":"Response schema for a bill.\n\nContains all bill details including vendor info, payment status,\nand associated journal entries for accounting.\n\n**Status values:**\n- `draft`: Bill created but not yet approved\n- `forecasted`: Approved, expected to be paid\n- `received`: Bill/goods received, liability recorded\n- `partially_paid`: Some payments made\n- `paid`: Fully paid\n- `canceled`: Cancelled, will not be paid","example":{"amount":250000,"business_id":"019ab37c-bus1-7000-8000-000000000001","created_at":"2024-01-10T10:30:00Z","description":"Monthly office rent - January 2024","due_on":"2024-01-31T00:00:00Z","expected_amount":250000,"id":"019ab37c-bill-7000-8000-000000000001","journal_entries":[],"payments":[],"received_on":"2024-01-15T00:00:00Z","status":"received","type":"recurring","updated_at":"2024-01-15T14:00:00Z","vendor_email":"billing@abcproperty.com","vendor_id":"019ab37c-vend-7000-8000-000000000001","vendor_name":"ABC Property Management"}},"BillThreadResponse":{"properties":{"thread_id":{"type":"string","title":"Thread Id","description":"Thread UUID"},"comment_count":{"type":"integer","title":"Comment Count","description":"Number of comments on the thread"},"comments":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Comments","description":"Thread comments (detail view)"}},"additionalProperties":true,"type":"object","required":["thread_id","comment_count"],"title":"BillThreadResponse","description":"Thread summary embedded on bill detail responses."},"BillUpdateRequest":{"properties":{"status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Number"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"expected_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Amount"},"expected_paid_on_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date"},{"type":"string"},{"type":"null"}],"title":"Expected Paid On Date"},"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount"},"due_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date"},{"type":"string"},{"type":"null"}],"title":"Due On"},"received_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date"},{"type":"string"},{"type":"null"}],"title":"Received On"},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key"},"source_inventory_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Inventory Order Id"},"payment_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Method","description":"Payment method override: 'Wire Transfer', 'ACH', 'Check', 'Credit Card', or empty string to clear. Takes precedence over the method inferred from a linked payment transaction."},"recurring":{"anyOf":[{"$ref":"#/components/schemas/RecurringConfig"},{"type":"null"}],"description":"If provided, creates a recurring template from this bill."}},"type":"object","title":"BillUpdateRequest","description":"Schema for updating a bill."},"BillingInvoiceItem":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"amount_due":{"type":"integer","title":"Amount Due","default":0},"amount_paid":{"type":"integer","title":"Amount Paid","default":0},"currency":{"type":"string","title":"Currency","default":"usd"},"created":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created"},"period_start":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Period End"},"hosted_invoice_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hosted Invoice Url"},"invoice_pdf":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Pdf"}},"additionalProperties":true,"type":"object","title":"BillingInvoiceItem"},"BillsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BillResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"BillsListResponse","description":"Paginated list of bills with cursor-based navigation."},"Body_analyze_po_spreadsheet_api_v1_inventory_po_import_analyze_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_analyze_po_spreadsheet_api_v1_inventory_po_import_analyze_post"},"Body_analyze_spreadsheet_api_v1_inventory_import_analyze_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_analyze_spreadsheet_api_v1_inventory_import_analyze_post"},"Body_attach_file_to_bill_api_v1_bills__bill_id__attachment_patch":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_attach_file_to_bill_api_v1_bills__bill_id__attachment_patch"},"Body_attach_file_to_journal_entry_api_v1_journal_entries__journal_entry_id__attachment_patch":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_attach_file_to_journal_entry_api_v1_journal_entries__journal_entry_id__attachment_patch"},"Body_attach_file_to_transaction_api_v1_transactions__transaction_id__attachment_patch":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_attach_file_to_transaction_api_v1_transactions__transaction_id__attachment_patch"},"Body_bulk_upload_customers_api_v1_customers_bulk_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"CSV file with customer data"}},"type":"object","required":["file"],"title":"Body_bulk_upload_customers_api_v1_customers_bulk_upload_post"},"Body_bulk_upload_vendors_api_v1_vendors_bulk_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"CSV file with vendor data"}},"type":"object","required":["file"],"title":"Body_bulk_upload_vendors_api_v1_vendors_bulk_upload_post"},"Body_create_reconciliation_with_upload_api_v1_reconciliations_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Bank statement file (PDF, CSV, or Excel)"}},"type":"object","required":["file"],"title":"Body_create_reconciliation_with_upload_api_v1_reconciliations_upload_post"},"Body_exchange_code_api_v1_oauth2_exchange_post":{"properties":{"code":{"type":"string","title":"Code","description":"Single-use authorization code"},"refresh_token":{"type":"string","title":"Refresh Token","description":"Refresh token for renewal"}},"type":"object","title":"Body_exchange_code_api_v1_oauth2_exchange_post"},"Body_export_deck_api_v1_ai_reporting_decks__deck_id__export_post":{"properties":{"slides":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Slides"}},"type":"object","required":["slides"],"title":"Body_export_deck_api_v1_ai_reporting_decks__deck_id__export_post"},"Body_fulfill_document_request_api_v1_document_requests__request_id__fulfill_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_fulfill_document_request_api_v1_document_requests__request_id__fulfill_post"},"Body_get_token_api_v1_oauth2_token_post":{"properties":{"user_email":{"type":"string","title":"User Email","description":"User's email address"}},"type":"object","required":["user_email"],"title":"Body_get_token_api_v1_oauth2_token_post"},"Body_refresh_token_api_v1_oauth2_refresh_post":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token","description":"Refresh token from previous /token response"}},"type":"object","required":["refresh_token"],"title":"Body_refresh_token_api_v1_oauth2_refresh_post"},"Body_upload_bill_file_api_v1_bills_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_bill_file_api_v1_bills_upload_post"},"BudgetCalculationItem":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id"},"ledger_name":{"type":"string","title":"Ledger Name"},"amount_cents":{"type":"integer","title":"Amount Cents"}},"type":"object","required":["ledger_id","ledger_name","amount_cents"],"title":"BudgetCalculationItem","description":"A single ledger's contribution to a week's budgeted total."},"BudgetCalculationWeekBreakdown":{"properties":{"revenue_items":{"items":{"$ref":"#/components/schemas/BudgetCalculationItem"},"type":"array","title":"Revenue Items"},"expense_items":{"items":{"$ref":"#/components/schemas/BudgetCalculationItem"},"type":"array","title":"Expense Items"}},"type":"object","title":"BudgetCalculationWeekBreakdown","description":"Breakdown of budget calculations for a single week."},"BudgetCopyRequest":{"properties":{"name":{"type":"string","maxLength":255,"title":"Name","description":"Name for the new budget copy."},"fiscal_year":{"type":"integer","maximum":2100.0,"minimum":2000.0,"title":"Fiscal Year","description":"Fiscal year for the new budget."},"start_date":{"type":"string","format":"date","title":"Start Date","description":"Start date for the new budget."},"end_date":{"type":"string","format":"date","title":"End Date","description":"End date for the new budget."},"adjustment_percent":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":-100.0},{"type":"null"}],"title":"Adjustment Percent","description":"Percentage adjustment to apply to all amounts (e.g., 5 = +5%, -10 = -10%).","default":0}},"type":"object","required":["name","fiscal_year","start_date","end_date"],"title":"BudgetCopyRequest","description":"Request schema for copying a budget."},"BudgetCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"title":"Name","description":"Budget name (e.g., '2026 Annual Budget')."},"fiscal_year":{"type":"integer","maximum":2100.0,"minimum":2000.0,"title":"Fiscal Year","description":"Fiscal year for the budget."},"start_date":{"type":"string","format":"date","title":"Start Date","description":"Budget period start date."},"end_date":{"type":"string","format":"date","title":"End Date","description":"Budget period end date."},"period_type":{"$ref":"#/components/schemas/BudgetPeriodTypeEnum","description":"Period granularity: monthly, quarterly, or annual.","default":"monthly"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Budget description."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Additional notes."},"source_scenario_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Scenario Id","description":"CFO projection scenario that generated this budget."}},"type":"object","required":["name","fiscal_year","start_date","end_date"],"title":"BudgetCreateRequest","description":"Request schema for creating a budget.","example":{"description":"Annual operating budget for fiscal year 2026","end_date":"2026-12-31","fiscal_year":2026,"name":"2026 Annual Budget","period_type":"monthly","start_date":"2026-01-01"}},"BudgetDetailResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Budget UUID."},"name":{"type":"string","title":"Name","description":"Budget name."},"fiscal_year":{"type":"integer","title":"Fiscal Year","description":"Fiscal year."},"start_date":{"type":"string","format":"date","title":"Start Date","description":"Budget period start date."},"end_date":{"type":"string","format":"date","title":"End Date","description":"Budget period end date."},"status":{"$ref":"#/components/schemas/BudgetStatusEnum","description":"Budget status: draft, active, or closed."},"period_type":{"$ref":"#/components/schemas/BudgetPeriodTypeEnum","description":"Period granularity."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Budget description."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Additional notes."},"line_count":{"type":"integer","title":"Line Count","description":"Number of budget lines.","default":0},"total_budgeted_revenue":{"type":"integer","title":"Total Budgeted Revenue","description":"Total budgeted revenue in cents.","default":0},"total_budgeted_expenses":{"type":"integer","title":"Total Budgeted Expenses","description":"Total budgeted expenses in cents.","default":0},"budgeted_net_income":{"type":"integer","title":"Budgeted Net Income","description":"Budgeted net income (revenue - expenses) in cents.","default":0},"source_scenario_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Scenario Id","description":"CFO projection scenario UUID that generated this budget."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"lines":{"items":{"$ref":"#/components/schemas/BudgetLineResponse"},"type":"array","title":"Lines","description":"Budget line items."}},"type":"object","required":["id","name","fiscal_year","start_date","end_date","status","period_type","business_id","created_at","updated_at"],"title":"BudgetDetailResponse","description":"Detailed budget response including all lines."},"BudgetLineCreateRequest":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id","description":"Ledger account UUID for this budget line."},"jan_amount":{"type":"integer","title":"Jan Amount","description":"January budget amount in cents.","default":0},"feb_amount":{"type":"integer","title":"Feb Amount","description":"February budget amount in cents.","default":0},"mar_amount":{"type":"integer","title":"Mar Amount","description":"March budget amount in cents.","default":0},"apr_amount":{"type":"integer","title":"Apr Amount","description":"April budget amount in cents.","default":0},"may_amount":{"type":"integer","title":"May Amount","description":"May budget amount in cents.","default":0},"jun_amount":{"type":"integer","title":"Jun Amount","description":"June budget amount in cents.","default":0},"jul_amount":{"type":"integer","title":"Jul Amount","description":"July budget amount in cents.","default":0},"aug_amount":{"type":"integer","title":"Aug Amount","description":"August budget amount in cents.","default":0},"sep_amount":{"type":"integer","title":"Sep Amount","description":"September budget amount in cents.","default":0},"oct_amount":{"type":"integer","title":"Oct Amount","description":"October budget amount in cents.","default":0},"nov_amount":{"type":"integer","title":"Nov Amount","description":"November budget amount in cents.","default":0},"dec_amount":{"type":"integer","title":"Dec Amount","description":"December budget amount in cents.","default":0},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes","description":"Optional notes for this line."}},"type":"object","required":["ledger_id"],"title":"BudgetLineCreateRequest","description":"Request schema for adding a budget line.","example":{"apr_amount":530000,"aug_amount":520000,"dec_amount":700000,"feb_amount":520000,"jan_amount":500000,"jul_amount":510000,"jun_amount":560000,"ledger_id":"019ab37c-led1-7000-8000-000000000001","mar_amount":550000,"may_amount":540000,"nov_amount":650000,"oct_amount":600000,"sep_amount":580000}},"BudgetLineListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BudgetLineResponse"},"type":"array","title":"Items","description":"Budget line items."}},"type":"object","title":"BudgetLineListResponse","description":"List of budget lines for a budget."},"BudgetLineResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Budget line UUID."},"budget_id":{"type":"string","title":"Budget Id","description":"Parent budget UUID."},"ledger_id":{"type":"string","title":"Ledger Id","description":"Ledger account UUID."},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name","description":"Ledger account name."},"ledger_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Type","description":"Ledger account type (revenue, expense, etc.)."},"jan_amount":{"type":"integer","title":"Jan Amount","description":"January budget amount in cents."},"feb_amount":{"type":"integer","title":"Feb Amount","description":"February budget amount in cents."},"mar_amount":{"type":"integer","title":"Mar Amount","description":"March budget amount in cents."},"apr_amount":{"type":"integer","title":"Apr Amount","description":"April budget amount in cents."},"may_amount":{"type":"integer","title":"May Amount","description":"May budget amount in cents."},"jun_amount":{"type":"integer","title":"Jun Amount","description":"June budget amount in cents."},"jul_amount":{"type":"integer","title":"Jul Amount","description":"July budget amount in cents."},"aug_amount":{"type":"integer","title":"Aug Amount","description":"August budget amount in cents."},"sep_amount":{"type":"integer","title":"Sep Amount","description":"September budget amount in cents."},"oct_amount":{"type":"integer","title":"Oct Amount","description":"October budget amount in cents."},"nov_amount":{"type":"integer","title":"Nov Amount","description":"November budget amount in cents."},"dec_amount":{"type":"integer","title":"Dec Amount","description":"December budget amount in cents."},"annual_amount":{"type":"integer","title":"Annual Amount","description":"Total annual budget amount in cents."},"quarterly_amounts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Quarterly Amounts","description":"Amounts by quarter (q1, q2, q3, q4)."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Line notes."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."}},"type":"object","required":["id","budget_id","ledger_id","jan_amount","feb_amount","mar_amount","apr_amount","may_amount","jun_amount","jul_amount","aug_amount","sep_amount","oct_amount","nov_amount","dec_amount","annual_amount","quarterly_amounts","business_id","created_at","updated_at"],"title":"BudgetLineResponse","description":"Response schema for a budget line."},"BudgetLineUpdateRequest":{"properties":{"jan_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Jan Amount","description":"January budget amount in cents."},"feb_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Feb Amount","description":"February budget amount in cents."},"mar_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mar Amount","description":"March budget amount in cents."},"apr_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Apr Amount","description":"April budget amount in cents."},"may_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"May Amount","description":"May budget amount in cents."},"jun_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Jun Amount","description":"June budget amount in cents."},"jul_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Jul Amount","description":"July budget amount in cents."},"aug_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Aug Amount","description":"August budget amount in cents."},"sep_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sep Amount","description":"September budget amount in cents."},"oct_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Oct Amount","description":"October budget amount in cents."},"nov_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Nov Amount","description":"November budget amount in cents."},"dec_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dec Amount","description":"December budget amount in cents."},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes","description":"Optional notes for this line."}},"type":"object","title":"BudgetLineUpdateRequest","description":"Request schema for updating a budget line."},"BudgetListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BudgetResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"BudgetListResponse","description":"Paginated list of budgets."},"BudgetPeriodTypeEnum":{"type":"string","enum":["monthly","quarterly","annual"],"title":"BudgetPeriodTypeEnum","description":"Budget period granularity."},"BudgetResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Budget UUID."},"name":{"type":"string","title":"Name","description":"Budget name."},"fiscal_year":{"type":"integer","title":"Fiscal Year","description":"Fiscal year."},"start_date":{"type":"string","format":"date","title":"Start Date","description":"Budget period start date."},"end_date":{"type":"string","format":"date","title":"End Date","description":"Budget period end date."},"status":{"$ref":"#/components/schemas/BudgetStatusEnum","description":"Budget status: draft, active, or closed."},"period_type":{"$ref":"#/components/schemas/BudgetPeriodTypeEnum","description":"Period granularity."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Budget description."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Additional notes."},"line_count":{"type":"integer","title":"Line Count","description":"Number of budget lines.","default":0},"total_budgeted_revenue":{"type":"integer","title":"Total Budgeted Revenue","description":"Total budgeted revenue in cents.","default":0},"total_budgeted_expenses":{"type":"integer","title":"Total Budgeted Expenses","description":"Total budgeted expenses in cents.","default":0},"budgeted_net_income":{"type":"integer","title":"Budgeted Net Income","description":"Budgeted net income (revenue - expenses) in cents.","default":0},"source_scenario_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Scenario Id","description":"CFO projection scenario UUID that generated this budget."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."}},"type":"object","required":["id","name","fiscal_year","start_date","end_date","status","period_type","business_id","created_at","updated_at"],"title":"BudgetResponse","description":"Response schema for a budget."},"BudgetStatusEnum":{"type":"string","enum":["draft","active","closed"],"title":"BudgetStatusEnum","description":"Budget lifecycle status."},"BudgetUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name","description":"Budget name."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Budget description."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Additional notes."},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Budget period start date."},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"Budget period end date."}},"type":"object","title":"BudgetUpdateRequest","description":"Request schema for updating a budget."},"BudgetVsActualLineItem":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id","description":"Ledger account UUID."},"ledger_name":{"type":"string","title":"Ledger Name","description":"Ledger account name."},"ledger_type":{"type":"string","title":"Ledger Type","description":"Ledger type (revenue, expense, etc.)."},"budget_amount":{"type":"integer","title":"Budget Amount","description":"Budgeted amount in cents."},"actual_amount":{"type":"integer","title":"Actual Amount","description":"Actual amount in cents."},"variance_amount":{"type":"integer","title":"Variance Amount","description":"Variance (actual - budget) in cents."},"variance_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Variance Percent","description":"Variance percentage."},"variance_type":{"$ref":"#/components/schemas/VarianceTypeEnum","description":"Favorable, unfavorable, or neutral."}},"type":"object","required":["ledger_id","ledger_name","ledger_type","budget_amount","actual_amount","variance_amount","variance_type"],"title":"BudgetVsActualLineItem","description":"Single line item in budget vs actual comparison."},"BudgetVsActualResponse":{"properties":{"budget_id":{"type":"string","title":"Budget Id","description":"Budget UUID."},"budget_name":{"type":"string","title":"Budget Name","description":"Budget name."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"business_name":{"type":"string","title":"Business Name","description":"Business name."},"start_date":{"type":"string","format":"date","title":"Start Date","description":"Report period start."},"end_date":{"type":"string","format":"date","title":"End Date","description":"Report period end."},"generated_at":{"type":"string","format":"date-time","title":"Generated At","description":"When report was generated."},"revenue":{"$ref":"#/components/schemas/BudgetVsActualSection","description":"Revenue section."},"expenses":{"$ref":"#/components/schemas/BudgetVsActualSection","description":"Expenses section."},"budgeted_net_income":{"type":"integer","title":"Budgeted Net Income","description":"Budgeted net income in cents."},"actual_net_income":{"type":"integer","title":"Actual Net Income","description":"Actual net income in cents."},"net_income_variance":{"type":"integer","title":"Net Income Variance","description":"Net income variance in cents."},"net_income_variance_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net Income Variance Percent","description":"Net income variance %."},"net_income_variance_type":{"$ref":"#/components/schemas/VarianceTypeEnum","description":"Favorable or unfavorable."}},"type":"object","required":["budget_id","budget_name","business_id","business_name","start_date","end_date","generated_at","revenue","expenses","budgeted_net_income","actual_net_income","net_income_variance","net_income_variance_type"],"title":"BudgetVsActualResponse","description":"Complete budget vs actual comparison report."},"BudgetVsActualSection":{"properties":{"section_name":{"type":"string","title":"Section Name","description":"Section name (e.g., 'Revenue', 'Expenses')."},"items":{"items":{"$ref":"#/components/schemas/BudgetVsActualLineItem"},"type":"array","title":"Items","description":"Line items in this section"},"total_budget":{"type":"integer","title":"Total Budget","description":"Total budgeted for section."},"total_actual":{"type":"integer","title":"Total Actual","description":"Total actual for section."},"total_variance":{"type":"integer","title":"Total Variance","description":"Total variance for section."},"total_variance_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Variance Percent","description":"Total variance percentage."}},"type":"object","required":["section_name","total_budget","total_actual","total_variance"],"title":"BudgetVsActualSection","description":"Section in budget vs actual (revenue or expenses)."},"BulkAllRequest":{"properties":{"scope":{"$ref":"#/components/schemas/NotificationScopeEnum","default":"me"},"scope_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope Id","description":"Required when scope is 'business' or 'firm'"},"topic":{"anyOf":[{"items":{"$ref":"#/components/schemas/NotificationTopicEnum"},"type":"array"},{"type":"null"}],"title":"Topic","description":"Restrict to one or more topics"},"severity":{"anyOf":[{"items":{"$ref":"#/components/schemas/NotificationSeverityEnum"},"type":"array"},{"type":"null"}],"title":"Severity","description":"Restrict to one or more severities"},"live_business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Live Business Id","description":"When scope='me', also dismiss live alerts for this business id (dismiss-all only; ignored by mark-all-seen)."}},"type":"object","title":"BulkAllRequest","description":"Operate on *all* of the caller's matching notifications.\n\nServer-authoritative bulk action.  Unlike :class:`BulkIdsRequest`\n(which is capped at 200 explicit ids — i.e. the page the client has\nloaded), this applies to every notification the caller can see that\nmatches the optional scope/topic/severity filters.  Used by\n\"Mark all seen\" and \"Dismiss all\" so they stay correct regardless\nof pagination."},"BulkApproveMatchesResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"approved_count":{"type":"integer","title":"Approved Count"},"skipped_count":{"type":"integer","title":"Skipped Count"},"approved":{"items":{"anyOf":[{"$ref":"#/components/schemas/CommittedMatch"},{"additionalProperties":true,"type":"object"}]},"type":"array","title":"Approved","default":[]},"skipped":{"items":{"anyOf":[{"$ref":"#/components/schemas/BulkSkippedMatch"},{"additionalProperties":true,"type":"object"}]},"type":"array","title":"Skipped","default":[]}},"additionalProperties":true,"type":"object","required":["approved_count","skipped_count"],"title":"BulkApproveMatchesResponse","description":"``SuccessEnvelope[BulkApproveMatchesResponse]`` inner payload."},"BulkApproveRequest":{"properties":{"min_confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Min Confidence","description":"Minimum AI confidence threshold for approval (0.0-1.0)","default":0.9},"statement_txn_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Statement Txn Ids","description":"Specific statement transaction IDs to approve (overrides min_confidence)"}},"type":"object","title":"BulkApproveRequest","description":"Request to bulk approve matches."},"BulkApproveSuggestionsRequest":{"properties":{"min_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min Confidence","description":"Only approve suggestions at or above this confidence","default":0.85}},"type":"object","title":"BulkApproveSuggestionsRequest","description":"Request schema for bulk approving bill payment suggestions."},"BulkApproveSuggestionsResponse":{"properties":{"accepted":{"type":"integer","title":"Accepted","description":"Successfully accepted","default":0},"failed":{"type":"integer","title":"Failed","description":"Failed to accept","default":0},"total":{"type":"integer","title":"Total","description":"Total suggestions processed","default":0}},"type":"object","title":"BulkApproveSuggestionsResponse","description":"Response schema for bulk approval results."},"BulkDismissAllRequest":{"properties":{"reason":{"type":"string","title":"Reason","description":"One of: expected, resolved, false_positive, other"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional user-provided notes"}},"type":"object","required":["reason"],"title":"BulkDismissAllRequest"},"BulkDismissAllResponse":{"properties":{"dismissed_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dismissed Count"}},"additionalProperties":true,"type":"object","title":"BulkDismissAllResponse","description":"Response for ``bulk_dismiss_all``."},"BulkDismissByPeriodRequest":{"properties":{"start_date":{"type":"string","format":"date","title":"Start Date","description":"Inclusive lower bound for anomaly date window (YYYY-MM-DD)."},"end_date":{"type":"string","format":"date","title":"End Date","description":"Inclusive upper bound for anomaly date window (YYYY-MM-DD)."},"reason":{"type":"string","title":"Reason","description":"One of: expected, resolved, false_positive, other"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional user-provided notes"}},"type":"object","required":["start_date","end_date","reason"],"title":"BulkDismissByPeriodRequest"},"BulkDismissByPeriodResponse":{"properties":{"dismissed_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dismissed Count"}},"additionalProperties":true,"type":"object","title":"BulkDismissByPeriodResponse","description":"Response for ``bulk_dismiss_by_period``."},"BulkDismissRequest":{"properties":{"anomaly_type":{"type":"string","title":"Anomaly Type","description":"Dismiss all active anomalies of this type"},"reason":{"type":"string","title":"Reason","description":"One of: expected, resolved, false_positive, other"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional user-provided notes"}},"type":"object","required":["anomaly_type","reason"],"title":"BulkDismissRequest"},"BulkDismissTypeResponse":{"properties":{"dismissed_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dismissed Count"}},"additionalProperties":true,"type":"object","title":"BulkDismissTypeResponse","description":"Response for ``bulk_dismiss_type``."},"BulkEntityTagAttachResponse":{"properties":{"entity_tags":{"items":{"$ref":"#/components/schemas/EntityTagResponse"},"type":"array","title":"Entity Tags","description":"All tags on the entity after attach"},"attached_count":{"type":"integer","title":"Attached Count","description":"Number of new attachments created"},"total_count":{"type":"integer","title":"Total Count","description":"Total tags on the entity after attach"}},"type":"object","required":["attached_count","total_count"],"title":"BulkEntityTagAttachResponse","description":"Response for bulk attaching tags to an entity."},"BulkEntityTagCreate":{"properties":{"tag_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Tag Ids","description":"List of tag UUIDs to attach"},"model_type":{"type":"string","title":"Model Type","description":"Type of entity (transaction, invoice, bill, etc.)"},"model_id":{"type":"string","title":"Model Id","description":"UUID of the entity to tag"}},"type":"object","required":["tag_ids","model_type","model_id"],"title":"BulkEntityTagCreate","description":"Schema for bulk attaching tags to entities."},"BulkEntityTagDetachResponse":{"properties":{"entity_tags":{"items":{"$ref":"#/components/schemas/EntityTagResponse"},"type":"array","title":"Entity Tags","description":"Remaining tags on the entity after detach"},"removed_count":{"type":"integer","title":"Removed Count","description":"Number of tags removed"},"remaining_count":{"type":"integer","title":"Remaining Count","description":"Number of tags still on the entity after detach"}},"type":"object","required":["removed_count","remaining_count"],"title":"BulkEntityTagDetachResponse","description":"Response for bulk detaching tags from an entity."},"BulkEntityTagRemove":{"properties":{"tag_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Tag Ids","description":"List of tag UUIDs to remove"},"model_type":{"type":"string","title":"Model Type","description":"Type of entity (transaction, invoice, bill, etc.)"},"model_id":{"type":"string","title":"Model Id","description":"UUID of the entity"}},"type":"object","required":["tag_ids","model_type","model_id"],"title":"BulkEntityTagRemove","description":"Schema for bulk removing tags from entities."},"BulkEntityTagsRequest":{"properties":{"model_type":{"type":"string","title":"Model Type","description":"Type of entity (transaction, invoice, bill, etc.)"},"model_ids":{"items":{"type":"string"},"type":"array","maxItems":200,"minItems":1,"title":"Model Ids","description":"Entity UUIDs to fetch tags for (typically the visible page)."}},"type":"object","required":["model_type","model_ids"],"title":"BulkEntityTagsRequest","description":"Schema for fetching tags for many entities of the same type at once."},"BulkEntityTagsResponse":{"properties":{"items":{"additionalProperties":{"items":{"$ref":"#/components/schemas/EntityTagResponse"},"type":"array"},"type":"object","title":"Items","description":"Mapping of entity UUID -> tags attached to it. Entities with no tags are omitted."}},"type":"object","title":"BulkEntityTagsResponse","description":"Schema for the batch entity-tag lookup, keyed by entity id."},"BulkIdsRequest":{"properties":{"notification_ids":{"items":{"type":"string"},"type":"array","maxItems":200,"minItems":1,"title":"Notification Ids"}},"type":"object","required":["notification_ids"],"title":"BulkIdsRequest","description":"Operate on a batch of notifications by id."},"BulkJePreviewEntry":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"entry_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entry Date"},"line_entries":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Line Entries","default":[]},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","default":[]}},"additionalProperties":true,"type":"object","title":"BulkJePreviewEntry"},"BulkJournalEntryUploadRequest":{"properties":{"s3_key":{"type":"string","minLength":1,"title":"S3 Key","description":"S3 key of the uploaded CSV/Excel file (from POST /upload/direct)"}},"type":"object","required":["s3_key"],"title":"BulkJournalEntryUploadRequest","description":"Request schema for bulk journal entry upload (preview and post)."},"BulkLockPeriodsRequest":{"properties":{"period_ids":{"items":{"type":"string"},"type":"array","maxItems":120,"minItems":1,"title":"Period Ids","description":"Period UUIDs to lock"},"lock_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lock Reason","description":"Reason recorded on each period. Defaults to 'Historical migration - bulk locked' when omitted."}},"type":"object","required":["period_ids"],"title":"BulkLockPeriodsRequest","description":"Bulk-close-and-lock a list of accounting periods.\n\nIntended for historical-data migration where the user already\nreviewed the months offline and just wants the periods locked."},"BulkLockPeriodsResult":{"properties":{"locked_count":{"type":"integer","minimum":0.0,"title":"Locked Count","description":"Periods that ended up locked"},"skipped_count":{"type":"integer","minimum":0.0,"title":"Skipped Count","description":"Periods skipped (already locked / not found)"},"locked_ids":{"items":{"type":"string"},"type":"array","title":"Locked Ids"},"skipped":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Skipped","description":"Per-period skip info: {period_id, reason}"}},"type":"object","required":["locked_count","skipped_count"],"title":"BulkLockPeriodsResult","description":"Outcome of a bulk lock operation."},"BulkOpResponse":{"properties":{"updated":{"type":"integer","minimum":0.0,"title":"Updated"}},"type":"object","required":["updated"],"title":"BulkOpResponse"},"BulkRejectMatchesResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"rejected_count":{"type":"integer","title":"Rejected Count"},"rejected":{"items":{"type":"string"},"type":"array","title":"Rejected","default":[]}},"additionalProperties":true,"type":"object","required":["rejected_count"],"title":"BulkRejectMatchesResponse","description":"``SuccessEnvelope[BulkRejectMatchesResponse]`` inner payload."},"BulkRejectRequest":{"properties":{"statement_txn_ids":{"items":{"type":"string"},"type":"array","title":"Statement Txn Ids","description":"Statement transaction IDs to reject"}},"type":"object","required":["statement_txn_ids"],"title":"BulkRejectRequest","description":"Request to bulk reject matches."},"BulkSetAssignmentsRequest":{"properties":{"business_ids":{"items":{"type":"string"},"type":"array","title":"Business Ids","description":"Business IDs to assign. Replaces existing assignments."}},"type":"object","required":["business_ids"],"title":"BulkSetAssignmentsRequest","description":"Replace all business assignments for a member."},"BulkSkippedMatch":{"properties":{"statement_txn_id":{"type":"string","title":"Statement Txn Id"},"reason":{"type":"string","title":"Reason"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"}},"additionalProperties":true,"type":"object","required":["statement_txn_id","reason"],"title":"BulkSkippedMatch"},"BulkSuggestedMatchesRequest":{"properties":{"transaction_ids":{"items":{"type":"string"},"type":"array","maxItems":200,"minItems":1,"title":"Transaction Ids","description":"Transaction UUIDs to score (typically the visible page)."}},"type":"object","required":["transaction_ids"],"title":"BulkSuggestedMatchesRequest","description":"Request body for batch suggested-match lookup (Transactions list)."},"BulkSuggestedMatchesResponse":{"properties":{"items":{"additionalProperties":{"items":{"$ref":"#/components/schemas/SuggestedMatch"},"type":"array"},"type":"object","title":"Items","description":"Mapping of transaction UUID → ranked suggested matches. Transactions with no qualifying match are omitted."}},"type":"object","title":"BulkSuggestedMatchesResponse","description":"Suggested matches for a batch of transactions, keyed by transaction ID."},"BulkTransactionCreateRequest":{"properties":{"transactions":{"items":{"$ref":"#/components/schemas/TransactionCreateRequest"},"type":"array","title":"Transactions","description":"Array of transactions to create."}},"type":"object","required":["transactions"],"title":"BulkTransactionCreateRequest","description":"Request schema for bulk transaction creation.\n\nCreate multiple transactions in a single request.\nUseful for importing historical data or batch processing.","example":{"transactions":[{"amount":-25000,"datetime":"2024-01-15","description":"Office supplies - Staples","source_account_id":"019ab37c-c309-7698-a8d9-14e0409977d8"},{"amount":-15000,"datetime":"2024-01-15","description":"Software subscription - Adobe","source_account_id":"019ab37c-c309-7698-a8d9-14e0409977d8"}]}},"BulkTransactionResponse":{"properties":{"success_count":{"type":"integer","title":"Success Count","description":"Number of transactions created successfully."},"error_count":{"type":"integer","title":"Error Count","description":"Number of transactions that failed."},"created_transactions":{"items":{"$ref":"#/components/schemas/TransactionResponse"},"type":"array","title":"Created Transactions","description":"Successfully created transactions."},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","description":"Error messages for failed transactions."}},"type":"object","required":["success_count","error_count","created_transactions","errors"],"title":"BulkTransactionResponse","description":"Response schema for bulk transaction operations.\n\nReports success/failure counts and details for each transaction.","example":{"created_transactions":[{"amount":-25000,"id":"019ab37c-txn1-7000-8000-000000000001"},{"amount":-15000,"id":"019ab37c-txn2-7000-8000-000000000002"}],"error_count":0,"errors":[],"success_count":2}},"BulkTransactionUploadPreviewRequest":{"properties":{"s3_key":{"type":"string","minLength":1,"title":"S3 Key","description":"S3 key of the CSV file containing transactions"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Optional: Only preview transactions on or after this date (YYYY-MM-DD)."},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"Optional: Only preview transactions on or before this date (YYYY-MM-DD)."},"check_duplicates":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Check Duplicates","description":"If true, checks for duplicate transactions against existing database records.","default":false},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"Optional: Ledger ID to check duplicates against. If not provided, checks all ledgers for the business."},"financial_account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Account Type","description":"Financial account type selected for a new ledger. Used by preview to show the same signed amount DayZero will store after import."},"column_mapping":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Column Mapping","description":"User-supplied mapping from DayZero field names to CSV column names. Keys: 'date', 'amount', 'description', and optional 'category' (aliases: ledger, ledger_name, account, account_name, category_name). Values: the CSV header to use. When provided, auto-detection is skipped."}},"type":"object","required":["s3_key"],"title":"BulkTransactionUploadPreviewRequest","description":"Request schema for previewing/validating CSV before upload.\n\nValidates the file structure, parses transactions, applies date filtering,\nand optionally checks for duplicates. Does NOT upload any transactions."},"BulkTransactionUploadPreviewResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the file was successfully parsed"},"total_rows":{"type":"integer","title":"Total Rows","description":"Total number of rows in the file (including headers)"},"valid_transactions":{"type":"integer","title":"Valid Transactions","description":"Number of valid transactions found"},"invalid_rows":{"type":"integer","title":"Invalid Rows","description":"Number of rows that failed validation"},"filtered_by_date":{"type":"integer","title":"Filtered By Date","description":"Number of transactions filtered out by date range"},"duplicates_found":{"type":"integer","title":"Duplicates Found","description":"Number of duplicate transactions found (if check_duplicates was true)"},"transactions_to_upload":{"type":"integer","title":"Transactions To Upload","description":"Number of transactions that would be uploaded"},"sample_transactions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":10,"title":"Sample Transactions","description":"Sample of first 10 valid transactions (for preview)"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","description":"List of validation errors encountered"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"List of warnings (e.g., skipped rows)"},"duplicate_transactions":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Duplicate Transactions","description":"List of duplicate transactions found (if check_duplicates was true)"}},"type":"object","required":["success","total_rows","valid_transactions","invalid_rows","filtered_by_date","duplicates_found","transactions_to_upload","sample_transactions"],"title":"BulkTransactionUploadPreviewResponse","description":"Response schema for CSV preview/validation.\n\nContains validation results, statistics, sample transactions, and any errors\nor warnings encountered during parsing. Also includes duplicate detection\nresults if check_duplicates was enabled.","example":{"duplicates_found":5,"errors":[],"filtered_by_date":2,"invalid_rows":3,"sample_transactions":[{"amount":-125.5,"date":"2024-01-15","description":"Office Supplies - Staples"}],"success":true,"total_rows":150,"transactions_to_upload":138,"valid_transactions":145,"warnings":["Row 5: Invalid date format","Row 12: Missing amount"]}},"BulkTransactionUploadRequest":{"properties":{"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"Optional: UUID of existing ledger to use. If provided, ledger creation is skipped and ledger_name/ledger fields are ignored."},"ledger_name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Ledger Name","description":"Display name for the new ledger (required if ledger_id not provided, e.g., 'My Old Credit Card XXXX')"},"source_account_name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Source Account Name","description":"Optional: Display name for the source account. Defaults to ledger name if not provided."},"business_personal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Personal","description":"Whether the source account is a business or personal account. 'business' (default) for company transactions, 'personal' for owner draws/contributions.","default":"business"},"invert_transaction_amounts":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Invert Transaction Amounts","description":"If true, transaction amounts are inverted during import. Useful when CSV has opposite sign convention.","default":false},"s3_key":{"type":"string","minLength":1,"title":"S3 Key","description":"S3 key of the CSV file containing transactions"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Optional: Only upload transactions on or after this date (YYYY-MM-DD). Filters transactions before upload."},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"Optional: Only upload transactions on or before this date (YYYY-MM-DD). Filters transactions before upload."},"check_duplicates":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Check Duplicates","description":"If true, checks for duplicate transactions before uploading. Duplicates are skipped.","default":true},"duplicate_match_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Duplicate Match Fields","description":"Fields to use for duplicate detection: 'amount', 'date', 'description'. Defaults to all three.","default":["amount","date","description"]},"skip_categorization":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Skip Categorization","description":"If true, skip post-upload bank rules and AI categorization. Journal entries still post during import — to the mapped category column when provided, otherwise to Uncategorized Expense/Income. Only honored on the local accounting engine.","default":false},"generate_bank_rules":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Generate Bank Rules","description":"If true (default), learn bank rules from the categorized transactions so future transactions auto-categorize. Ignored when skip_categorization is true.","default":true},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Currency for this account (USD, CAD, AUD, EUR, or GBP). Defaults to business default.","default":"USD"},"editable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Editable","description":"If true, journal entries can be manually posted to this account.","default":true},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"Account type: asset, liability, equity, revenue, expense. Required in Custom Mode."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description of the account's purpose."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Account status: 'active' or 'inactive'. Inactive accounts hidden from dropdowns.","default":"active"},"debit_credit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Debit Credit","description":"Normal balance: 'debit' (assets/expenses) or 'credit' (liabilities/equity/revenue). Required in Custom Mode."},"sort_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort Code","description":"Sort code for chart ordering (e.g., '1000' for assets, '4000' for revenue). Required in Custom Mode."},"sub_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Type","description":"Sub-classification (current_assets, operating_expenses, etc.). Required in Custom Mode."},"report_cash_flow":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Report Cash Flow","description":"Include in cash flow statement. Required in Custom Mode."},"financial_account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Account Type","description":"Templated Mode: bank_account, credit_card, payments, payroll, loan, prepaid_card, accounts_receivable, accounts_payable."},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id","description":"UUID of parent ledger for sub-accounts (e.g., 'Operating Expenses' → 'Office Supplies')."},"column_mapping":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Column Mapping","description":"User-supplied mapping from DayZero field names to CSV column names. Keys: 'date', 'amount', 'description', and optional 'category' (aliases: ledger, ledger_name, account, account_name, category_name). Values: the CSV header to use. When provided, auto-detection is skipped."}},"type":"object","required":["s3_key"],"title":"BulkTransactionUploadRequest","description":"Request schema for bulk transaction upload.\n\nUpload historical transactions from a CSV file to a new source account.\nThe workflow creates a ledger (or uses existing), source account, posts transactions to Teal,\nand imports the resulting journal entries.\n\n**Two modes:**\n\n1. **Use Existing Ledger** (if ledger_id is provided):\n   - Provide `ledger_id` of an existing ledger\n   - Ledger creation is skipped\n   - `source_account_name` is optional (defaults to ledger name)\n\n2. **Create New Ledger** (if ledger_id is not provided):\n   - Provide `ledger_name` and ledger fields\n   - Supports two creation modes:\n     - **Templated Mode**: Provide `financial_account_type` (recommended)\n     - **Custom Mode**: Provide all required fields (type, debit_credit, sort_code, sub_type, report_cash_flow)\n\n**Additional Features:**\n- Date range filtering: Use `start_date` and `end_date` to filter transactions before upload\n- Duplicate detection: Use `check_duplicates` (default: true) to automatically skip duplicate transactions\n- Custom duplicate matching: Use `duplicate_match_fields` to customize which fields are used for duplicate detection","examples":[{"financial_account_type":"credit_card","ledger_name":"My Old Credit Card XXXX","s3_key":"uploads/business123/transactions.csv"},{"ledger_id":"019abc12-3456-7890-abcd-ef1234567890","s3_key":"uploads/business123/transactions.csv","source_account_name":"Historical Import Source"},{"debit_credit":"debit","editable":true,"ledger_name":"Historical Bank Account","report_cash_flow":true,"s3_key":"uploads/business123/transactions.csv","sort_code":"1010","sub_type":"current_assets","type":"asset"}]},"BulkTransactionUploadResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id","description":"Temporal workflow ID for tracking progress"},"business_id":{"type":"string","title":"Business Id","description":"Business ID the upload is for"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"UUID of the existing ledger when uploading to one; null for new-ledger uploads"},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name","description":"Name of the ledger (the new ledger's name, or the existing ledger's name when resolved server-side)"},"status":{"type":"string","title":"Status","description":"Workflow status (typically 'started' initially)"},"executor":{"type":"string","title":"Executor","description":"Execution backend (typically 'temporal')"}},"type":"object","required":["workflow_id","business_id","status","executor"],"title":"BulkTransactionUploadResponse","description":"Response schema for bulk transaction upload workflow.\n\nReturns workflow information since the upload runs asynchronously via Temporal.\nThe workflow is durable - if interrupted, it will resume from where it left off.","example":{"business_id":"019abc12-3456-7890-abcd-ef1234567890","executor":"temporal","ledger_name":"My Old Credit Card XXXX","status":"started","workflow_id":"bulk-upload-019abc12-1234567890"}},"BulkUploadHeadersRequest":{"properties":{"s3_key":{"type":"string","minLength":1,"title":"S3 Key","description":"S3 key of the CSV/Excel file to read headers from"}},"type":"object","required":["s3_key"],"title":"BulkUploadHeadersRequest","description":"Request schema for fetching column headers from an uploaded CSV/Excel file."},"BulkUploadHeadersResponse":{"properties":{"headers":{"items":{"type":"string"},"type":"array","title":"Headers","description":"Column headers found in the file"},"sample_rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sample Rows","description":"First few rows of raw data (up to 5) for the user to see values"},"suggested_mapping":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object"},{"type":"null"}],"title":"Suggested Mapping","description":"Auto-detected mapping suggestion: {dayzero_field: csv_column_or_null}"}},"type":"object","required":["headers"],"title":"BulkUploadHeadersResponse","description":"Response with detected column headers and sample rows for user mapping."},"BusinessCreateRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Business display name."},"default_currency":{"type":"string","title":"Default Currency","description":"Default currency for the business (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"tax_year_end_month":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Tax Year End Month","description":"Month when the tax/fiscal year ends (1-12). Default 12 = calendar year.","default":12},"mailbox":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mailbox","description":"Unique email prefix for bill forwarding. Auto-generated from the business name when omitted."},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"UUID of the user who will own this business. Optional for admin-created businesses."},"create_teal_instance":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Create Teal Instance","description":"If true, creates a new Teal accounting instance. Default false since DayZero local engine is now the default.","default":false},"teal_instance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Instance","description":"Existing Teal instance ID to use (if not creating new)."},"coa_template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coa Template Id","description":"Pre-built chart of accounts template ID. Mutually exclusive with custom_coa_template."},"custom_coa_template":{"anyOf":[{"$ref":"#/components/schemas/CustomCoaTemplate"},{"type":"null"}],"description":"Custom chart of accounts definition. Mutually exclusive with coa_template_id."},"entries_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entries Start","description":"Date from which to start importing transactions (YYYY-MM-DD)."},"firm_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Id","description":"Advisory firm UUID to link this business to."},"stripe_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Account Id","description":"Stripe Connect account ID."},"stripe_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Subscription Id","description":"Stripe subscription ID for billing."},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id","description":"Stripe customer ID (e.g., cus_xxx)."},"subscription_items":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Subscription Items","description":"Stripe subscription items/products linked to this business."},"accounting_engine_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accounting Engine Type","description":"Accounting engine: 'local' (DayZero, default), 'teal', or null (inherit from firm)."}},"additionalProperties":false,"type":"object","required":["name"],"title":"BusinessCreateRequest","description":"Request schema for creating a new business.\n\nCreates a business entity with an accounting system (Teal instance)\nand associates it with a user as the owner.\n\n**Chart of Accounts Options:**\n- Use `coa_template_id` for pre-built templates\n- Use `custom_coa_template` for custom chart of accounts\n- These options are mutually exclusive","example":{"coa_template_id":"standard_accrual","create_teal_instance":true,"entries_start":"2024-01-01","mailbox":"acme","name":"Acme Corporation","user_id":"019ab37c-user-7000-8000-000000000001"}},"BusinessCursorListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BusinessResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"BusinessCursorListResponse","description":"Schema for list of businesses response (cursor-based pagination)."},"BusinessDeleteRequest":{"properties":{"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id"},"confirm_name":{"type":"string","minLength":1,"title":"Confirm Name","description":"Exact business name as a typed confirmation. Must match the persisted business name (case-insensitive, trimmed). Required."},"preserve_teal_instance":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Preserve Teal Instance"},"preserve_dz_users":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Preserve Dz Users"}},"type":"object","required":["confirm_name"],"title":"BusinessDeleteRequest","description":"Request body for irreversible business deletion.\n\n``confirm_name`` MUST echo the business's name (case-insensitive, trimmed).\nThe backend rejects any delete whose ``confirm_name`` doesn't match, which\nprevents single-click muscle-memory mistakes from wiping a business and\n~80 tables of dependent data."},"BusinessFirmAssociationCreateRequest":{"properties":{"business_id":{"type":"string","title":"Business Id"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["business_id"],"title":"BusinessFirmAssociationCreateRequest"},"BusinessFirmAssociationResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"advisory_firm_id":{"type":"string","title":"Advisory Firm Id"},"is_active":{"type":"boolean","title":"Is Active"},"start_date":{"type":"string","format":"date-time","title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["id","business_id","advisory_firm_id","is_active","start_date","end_date","created_at","updated_at"],"title":"BusinessFirmAssociationResponse"},"BusinessResponse":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Business UUID."},"firm_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Id","description":"Advisory firm UUID this business belongs to."},"mailbox":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mailbox","description":"Email prefix for bill forwarding."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Business name."},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url","description":"URL to business logo/avatar image."},"default_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Currency","description":"Default currency for the business (USD, CAD, AUD, EUR, or GBP)."},"tax_year_end_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tax Year End Month","description":"Month when the tax/fiscal year ends (1-12). 12 = calendar year."},"tax_year_display":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Year Display","description":"Human-readable tax year description (e.g., 'Calendar Year (Jan-Dec)')."},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Creation timestamp."},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp."},"teal_instance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Instance Id","description":"Teal instance ID (API format)."},"teal_instance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Instance","description":"Teal database ID."},"entries_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Entries Start","description":"Start date for transaction imports."},"stripe_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Account Id","description":"Connected Stripe account ID."},"stripe_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Subscription Id","description":"Stripe subscription ID."},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id","description":"Stripe customer ID."},"subscription_items":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Subscription Items","description":"Stripe subscription items/products linked to this business."},"shopify_shop_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shopify Shop Domain","description":"Connected Shopify domain."},"shopify_access_token_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shopify Access Token Id","description":"Shopify token UUID."},"ramp_connection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ramp Connection Id","description":"Ramp connection UUID."},"square_connection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Square Connection Id","description":"Square connection UUID."},"finch_connection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finch Connection Id","description":"Finch payroll connection UUID."},"hubspot_connection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hubspot Connection Id","description":"HubSpot connection UUID."},"plaid_connections":{"anyOf":[{"items":{"$ref":"#/components/schemas/PlaidConnectionSchema"},"type":"array"},{"type":"null"}],"title":"Plaid Connections","description":"Connected bank accounts via Plaid."},"slack_connected":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Slack Connected","description":"Whether a Slack webhook URL is configured."},"sync":{"anyOf":[{"$ref":"#/components/schemas/SyncStatus"},{"type":"null"}],"description":"Teal sync status."},"inventory_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Mode","description":"Inventory module flavor: 'cpg' or 'finished_goods'."}},"additionalProperties":true,"type":"object","title":"BusinessResponse","description":"Response schema for a business.\n\nContains all business details including connected integrations\nand sync status with the accounting system.","example":{"created_at":"2024-01-10T10:30:00Z","entries_start":"2024-01-01T00:00:00Z","firm_id":"019ab37c-firm-7000-8000-000000000001","id":"019ab37c-bus1-7000-8000-000000000001","mailbox":"acme","name":"Acme Corporation","plaid_connections":[],"shopify_shop_domain":"acme-store.myshopify.com","stripe_account_id":"acct_abc123","sync":{"last_synced":"2024-01-15T14:00:00Z","status":"completed"},"teal_instance_id":"teal_inst_abc123","updated_at":"2024-01-15T14:00:00Z"}},"BusinessUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Business display name."},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url","description":"URL to business logo/avatar image."},"default_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Currency","description":"Default currency for the business (USD, CAD, AUD, EUR, or GBP)."},"tax_year_end_month":{"anyOf":[{"type":"integer","maximum":12.0,"minimum":1.0},{"type":"null"}],"title":"Tax Year End Month","description":"Month when the tax/fiscal year ends (1-12)."},"accounting_basis":{"anyOf":[{"type":"string","enum":["cash","accrual"]},{"type":"null"}],"title":"Accounting Basis","description":"Accounting basis: 'cash' or 'accrual'. Changes sync to Teal."},"mailbox":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mailbox","description":"Email prefix for bill forwarding."},"inventory_mode":{"anyOf":[{"type":"string","enum":["cpg","finished_goods"]},{"type":"null"}],"title":"Inventory Mode","description":"Inventory module flavor: 'cpg' exposes the Supply Chain map, production recipes, and landed COGS; 'finished_goods' hides the CPG-only surfaces."}},"additionalProperties":false,"type":"object","title":"BusinessUpdateRequest","description":"Public API schema for updating a business.\n\nOnly fields that a business admin should be able to change via the API\nare listed here.  Integration and billing fields (stripe_*, billing_status,\nplan_tier, active_addons, etc.) are managed by webhooks / internal services\nand are intentionally excluded."},"BusinessUserAddRequest":{"properties":{"id":{"type":"string","title":"Id","description":"UUID of the user to add."},"role":{"anyOf":[{"$ref":"#/components/schemas/Role"},{"type":"null"}],"description":"Role: owner, admin, member, or viewer","default":"member"}},"type":"object","required":["id"],"title":"BusinessUserAddRequest","description":"Request schema for adding a user to a business.\n\nThe user must already exist in the system.\nSee ROLE_ABILITIES_DOC in app.models.user_businesses for detailed role descriptions.\nValid roles: owner, admin, member, viewer.","example":{"id":"019ab37c-user-7000-8000-000000000001","role":"member"}},"BusinessUserRoleUpdateRequest":{"properties":{"role":{"$ref":"#/components/schemas/Role","description":"Role: owner, admin, member, or viewer"}},"type":"object","required":["role"],"title":"BusinessUserRoleUpdateRequest","description":"Request schema for updating a user's role in a business.","example":{"role":"accountant"}},"CancelCountResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"count_number":{"type":"string","title":"Count Number"},"location_id":{"type":"string","title":"Location Id"},"status":{"type":"string","title":"Status"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"posted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Posted At"},"counted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counted By User Id"},"posted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted By User Id"},"variance_line_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Variance Line Count"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"lines":{"items":{"$ref":"#/components/schemas/CycleCountLineResponse"},"type":"array","title":"Lines","default":[]}},"additionalProperties":true,"type":"object","required":["id","business_id","count_number","location_id","status"],"title":"CancelCountResponse","description":"Response for ``cancel_count``."},"CapitalizationSuggestionItem":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"Transaction ID"},"description":{"type":"string","title":"Description","description":"Transaction description"},"amount":{"type":"integer","title":"Amount","description":"Amount in cents"},"reason":{"type":"string","title":"Reason","description":"Why this should be capitalized"},"suggested_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Category","description":"Suggested asset category"},"suggested_useful_life":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Suggested Useful Life","description":"Suggested useful life in months"}},"type":"object","required":["transaction_id","description","amount","reason"],"title":"CapitalizationSuggestionItem"},"CashFlowClassEnum":{"type":"string","enum":["cash","ar","inventory","prepaid","other_current_asset","ppe","intangible","other_lt_asset","intercompany_asset","internal_transfer","ap","cc_payable","accrued","other_current_liability","lt_debt","intercompany_liability","equity_contribution","equity_distribution","retained_earnings","revenue","cogs","opex","non_cash_expense","interest_expense","tax_expense"],"title":"CashFlowClassEnum","description":"Indirect-method cash flow classification for ledgers.\n\nEach chart-of-account row carries one of these in addition to its\nbroader ``type``. The indirect cash flow statement is built by\ngrouping period-over-period balance deltas by this column.\nMirrors ``app.models.ledgers.CashFlowClassEnum`` for API surface."},"CashFlowLineItem":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id","description":"Stable identifier for this row"},"ledger_name":{"type":"string","title":"Ledger Name","description":"Human label shown to the reader"},"teal_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Ledger Id","description":"Teal ledger ID if this row corresponds to a single externally linked account; null for synthetic indirect-method rows."},"change":{"type":"integer","title":"Change","description":"Signed amount for this row in cents"},"cfs_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cfs Class","description":"Source ``cfs_class`` aggregation key for this row (e.g. 'ar', 'ppe'); null for opener / subtotal rows."}},"type":"object","required":["ledger_id","ledger_name","change"],"title":"CashFlowLineItem","description":"A single line on the Statement of Cash Flows.\n\nEach line has a stable string identifier (``ledger_id``) so the\nfrontend can key React components and treat synthetic rows\nconsistently with real-ledger rows. For indirect-method rows the\nid has the shape ``\"indirect:<key>\"`` (e.g. ``\"indirect:net_income\"``,\n``\"indirect:ar\"``, ``\"indirect:da\"``); for ledger-level rows it's\nthe ledger UUID. ``ledger_name`` is the human-readable label."},"CashFlowPeriodicPeriod":{"properties":{"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"}},"additionalProperties":true,"type":"object","required":["start_date","end_date"],"title":"CashFlowPeriodicPeriod","description":"Date range for one periodic cash-flow statement."},"CashFlowSection":{"properties":{"name":{"type":"string","title":"Name","description":"Section name"},"line_items":{"items":{"$ref":"#/components/schemas/CashFlowLineItem"},"type":"array","title":"Line Items","description":"Line items in this section"},"total":{"type":"integer","title":"Total","description":"Net cash flow for this section (cents)","default":0}},"type":"object","required":["name"],"title":"CashFlowSection","description":"Operating / Investing / Financing section of the statement."},"CashFlowSectionEnum":{"type":"string","enum":["operating","investing","financing","excluded"],"title":"CashFlowSectionEnum","description":"Cash flow statement section classification for ledgers."},"CashFlowStatement":{"properties":{"business_id":{"type":"string","title":"Business Id","description":"Business ID"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name","description":"Business name"},"start_date":{"type":"string","format":"date","title":"Start Date","description":"Report start date"},"end_date":{"type":"string","format":"date","title":"End Date","description":"Report end date"},"generated_at":{"type":"string","format":"date-time","title":"Generated At","description":"When the report was generated"},"method":{"type":"string","const":"indirect","title":"Method","description":"Construction method. The indirect method is canonical.","default":"indirect"},"net_income":{"type":"integer","title":"Net Income","description":"Net Income (accrual) for the period in cents. Also appears as the first line item of ``operating_activities``."},"operating_activities":{"$ref":"#/components/schemas/CashFlowSection","description":"Section A — operating activities"},"investing_activities":{"$ref":"#/components/schemas/CashFlowSection","description":"Section B — investing activities"},"financing_activities":{"$ref":"#/components/schemas/CashFlowSection","description":"Section C — financing activities"},"net_cash_from_operating":{"type":"integer","title":"Net Cash From Operating","description":"Subtotal of Section A (cents)"},"net_cash_from_investing":{"type":"integer","title":"Net Cash From Investing","description":"Subtotal of Section B (cents)"},"net_cash_from_financing":{"type":"integer","title":"Net Cash From Financing","description":"Subtotal of Section C (cents)"},"net_change_in_cash":{"type":"integer","title":"Net Change In Cash","description":"Sum of Sections A+B+C (cents)"},"beginning_cash":{"type":"integer","title":"Beginning Cash","description":"Σ beginning natural balance for cfs_class='cash' (cents)"},"ending_cash":{"type":"integer","title":"Ending Cash","description":"Beginning cash + Net change in cash (cents)"},"supplemental_disclosures":{"$ref":"#/components/schemas/SupplementalDisclosures","description":"ASC 230 supplemental disclosures"},"validation_results":{"items":{"$ref":"#/components/schemas/CashFlowValidationResult"},"type":"array","title":"Validation Results","description":"Outcome of §5 validation rules"},"validation_passed":{"type":"boolean","title":"Validation Passed","description":"True iff every §5 validation rule passed","default":true},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"Non-fatal accuracy warnings. Validation failures are duplicated here so legacy callers that ignore ``validation_results`` still see the diagnostic."}},"type":"object","required":["business_id","start_date","end_date","net_income","operating_activities","investing_activities","financing_activities","net_cash_from_operating","net_cash_from_investing","net_cash_from_financing","net_change_in_cash","beginning_cash","ending_cash"],"title":"CashFlowStatement","description":"Indirect-method Statement of Cash Flows for one period.\n\nSection A (Operating) walks Net Income through non-cash add-backs\nand working-capital changes to Net Cash from Operating Activities.\nSections B (Investing) and C (Financing) carry the corresponding\nbalance deltas on long-term assets, debt, and equity. Section D\n(Reconciliation) is exposed as ``net_change_in_cash`` /\n``beginning_cash`` / ``ending_cash``.\n\nThe §5 validation results are attached so callers can render a\nPASS/FAIL banner without re-deriving the checks."},"CashFlowSuggestionItem":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id"},"name":{"type":"string","title":"Name"},"suggested_cfs_class":{"$ref":"#/components/schemas/CashFlowClassEnum"},"suggested_cash_flow_section":{"$ref":"#/components/schemas/CashFlowSectionEnum"},"current_cfs_class":{"anyOf":[{"$ref":"#/components/schemas/CashFlowClassEnum"},{"type":"null"}]},"current_cash_flow_section":{"anyOf":[{"$ref":"#/components/schemas/CashFlowSectionEnum"},{"type":"null"}]}},"type":"object","required":["ledger_id","name","suggested_cfs_class","suggested_cash_flow_section"],"title":"CashFlowSuggestionItem","description":"A single cash flow classification suggestion."},"CashFlowValidationResult":{"properties":{"rule":{"type":"string","title":"Rule","description":"Stable rule identifier"},"passed":{"type":"boolean","title":"Passed","description":"Whether the rule was satisfied"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Human-readable detail when the rule failed"}},"type":"object","required":["rule","passed"],"title":"CashFlowValidationResult","description":"Outcome of one §5 validation rule applied to a generated statement.\n\nA rule passes when its condition holds within the spec's tolerance\n(typically $1 / 100 cents). Failed rules carry a human-readable\nmessage that explains the gap and any remediation. The full list of\nrules is reported on every statement -- a \"PASS\" report shows them\nall green, a \"FAIL\" shows the failing ones with detail."},"CashForecastOneTimeItem":{"properties":{"label":{"type":"string","maxLength":200,"minLength":1,"title":"Label"},"amount_cents":{"type":"integer","title":"Amount Cents","description":"Positive = cash in, negative = cash out. Integer cents."},"applies_on":{"type":"string","format":"date","title":"Applies On","description":"Date the cash event lands. The week index is derived from this date relative to the forecast's first Sunday."},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"},"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"created_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By User Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["label","amount_cents","applies_on","id","business_id","created_at","updated_at"],"title":"CashForecastOneTimeItem"},"CashForecastOneTimeItemBase":{"properties":{"label":{"type":"string","maxLength":200,"minLength":1,"title":"Label"},"amount_cents":{"type":"integer","title":"Amount Cents","description":"Positive = cash in, negative = cash out. Integer cents."},"applies_on":{"type":"string","format":"date","title":"Applies On","description":"Date the cash event lands. The week index is derived from this date relative to the forecast's first Sunday."},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","required":["label","amount_cents","applies_on"],"title":"CashForecastOneTimeItemBase","description":"Shared fields for one-time payment items."},"CashForecastOneTimeItemCreate":{"properties":{"label":{"type":"string","maxLength":200,"minLength":1,"title":"Label"},"amount_cents":{"type":"integer","title":"Amount Cents","description":"Positive = cash in, negative = cash out. Integer cents."},"applies_on":{"type":"string","format":"date","title":"Applies On","description":"Date the cash event lands. The week index is derived from this date relative to the forecast's first Sunday."},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","required":["label","amount_cents","applies_on"],"title":"CashForecastOneTimeItemCreate"},"CashForecastOneTimeItemList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CashForecastOneTimeItem"},"type":"array","title":"Items"}},"type":"object","title":"CashForecastOneTimeItemList"},"CashForecastOneTimeItemUpdate":{"properties":{"label":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Label"},"amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount Cents"},"applies_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Applies On"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","title":"CashForecastOneTimeItemUpdate","description":"Partial-update payload for an existing one-time item."},"CashForecastOverride":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Id"},"week_number":{"type":"integer","title":"Week Number"},"column":{"type":"string","enum":["ar_in","ap_out","inventory","debt","budget_rev","budget_exp","one_time"],"title":"Column"},"override_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Override Amount Cents"},"source":{"type":"string","enum":["user","ai"],"title":"Source","default":"user"},"ai_scenario_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Scenario Label"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","week_number","column","created_at","updated_at"],"title":"CashForecastOverride","description":"Stored override row."},"CashForecastOverrideInput":{"properties":{"week_number":{"type":"integer","maximum":104.0,"minimum":0.0,"title":"Week Number"},"column":{"type":"string","enum":["ar_in","ap_out","inventory","debt","budget_rev","budget_exp","one_time"],"title":"Column"},"amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount Cents"},"source":{"type":"string","enum":["user","ai"],"title":"Source","default":"user"},"ai_scenario_label":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Ai Scenario Label"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"}},"type":"object","required":["week_number","column"],"title":"CashForecastOverrideInput","description":"One cell-level override applied to a forecast week.\n\n``week_number = 0`` targets the Overdue row, ``1..weeks`` targets a\nweekly cell. ``column`` matches the forecast column names\n(``ar_in``, ``ap_out``, ``inventory``, ``debt``, ``budget_rev``,\n``budget_exp``, ``one_time``). ``amount_cents`` is treated as the\nliteral value to use; ``None`` means \"force this cell to zero\"."},"CashForecastOverrideList":{"properties":{"version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Id"},"items":{"items":{"$ref":"#/components/schemas/CashForecastOverride"},"type":"array","title":"Items"}},"type":"object","title":"CashForecastOverrideList"},"CashForecastOverridesUpsert":{"properties":{"version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Id"},"overrides":{"items":{"$ref":"#/components/schemas/CashForecastOverrideInput"},"type":"array","title":"Overrides"}},"type":"object","title":"CashForecastOverridesUpsert","description":"Bulk upsert for the user's working override set.\n\nThe service replaces all overrides for the matching\n``(business_id, version_id)`` scope with the rows provided here, so\nthe frontend can save the entire override map in one round-trip."},"CashForecastSettingsUpdateRequest":{"properties":{"excluded_budget_ledger_ids":{"items":{"type":"string"},"type":"array","title":"Excluded Budget Ledger Ids","description":"List of ledger IDs to exclude from budget projections"}},"type":"object","title":"CashForecastSettingsUpdateRequest","description":"Request payload for updating cash forecast configuration."},"CashForecastVersionApplyResponse":{"properties":{"version_id":{"type":"string","title":"Version Id"},"budget_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Budget Id"},"excluded_budget_ledger_ids":{"items":{"type":"string"},"type":"array","title":"Excluded Budget Ledger Ids"},"applied_override_count":{"type":"integer","title":"Applied Override Count"}},"type":"object","required":["version_id","applied_override_count"],"title":"CashForecastVersionApplyResponse","description":"Response from applying a saved version to the live view.\n\nThe ``budget_id`` is returned explicitly so the frontend can sync\nits local \"selected budget\" state (it is per-request via query\nparameter, not stored on the business)."},"CashForecastVersionConfig":{"properties":{"budget_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Budget Id"},"excluded_budget_ledger_ids":{"items":{"type":"string"},"type":"array","title":"Excluded Budget Ledger Ids"},"weeks":{"type":"integer","title":"Weeks","default":13},"one_time_items_snapshot":{"items":{"$ref":"#/components/schemas/CashForecastOneTimeItemBase"},"type":"array","title":"One Time Items Snapshot","description":"Snapshot of the one-time items as they existed when the version was saved. Replays against live data don't re-load from the live ``cash_forecast_one_time_items`` table."}},"type":"object","title":"CashForecastVersionConfig","description":"Captured configuration when a version is saved.\n\nThe runtime can replay these inputs against live data to recompute\nthe forecast, or use the embedded ``snapshot_output`` for a stable\nhistorical view if requested."},"CashForecastVersionCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"config":{"$ref":"#/components/schemas/CashForecastVersionConfig"}},"type":"object","required":["name"],"title":"CashForecastVersionCreate","description":"Request payload for creating a saved forecast version."},"CashForecastVersionDetail":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By User Id"},"snapshot_as_of":{"type":"string","format":"date-time","title":"Snapshot As Of"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"config":{"$ref":"#/components/schemas/CashForecastVersionConfig"},"snapshot_output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Snapshot Output","description":"Full ``CashForecast`` JSON captured at save time. Provides a stable historical view that doesn't shift as live data changes."}},"type":"object","required":["id","business_id","name","snapshot_as_of","created_at","updated_at"],"title":"CashForecastVersionDetail","description":"Full detail for a saved forecast version, including snapshot."},"CashForecastVersionList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CashForecastVersionSummary"},"type":"array","title":"Items"}},"type":"object","title":"CashForecastVersionList"},"CashForecastVersionSummary":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By User Id"},"snapshot_as_of":{"type":"string","format":"date-time","title":"Snapshot As Of"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","name","snapshot_as_of","created_at","updated_at"],"title":"CashForecastVersionSummary","description":"List-view summary of a saved forecast version."},"CashForecastVersionUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"}},"type":"object","title":"CashForecastVersionUpdate","description":"Partial-update for a saved forecast version (name/description only)."},"CashForecastWeek":{"properties":{"week":{"type":"integer","title":"Week","description":"1-indexed week within the horizon"},"start_date":{"type":"string","format":"date","title":"Start Date","description":"Inclusive start date"},"end_date":{"type":"string","format":"date","title":"End Date","description":"Inclusive end date"},"cash_in_cents":{"type":"integer","title":"Cash In Cents","description":"Projected inflows from open invoices due in this week","default":0},"ap_out_cents":{"type":"integer","title":"Ap Out Cents","description":"Projected outflows from open bills due in this week","default":0},"po_out_cents":{"type":"integer","title":"Po Out Cents","description":"Projected outflows from POs with expected delivery in this week","default":0},"projected_po_out_cents":{"type":"integer","title":"Projected Po Out Cents","description":"Projected outflows from replenishment POs the business has not placed yet but the forecast engine expects it will need to, based on per-SKU demand forecasts and safety stock. Zero unless projected replenishment is explicitly enabled (Demand Planner).","default":0},"debt_out_cents":{"type":"integer","title":"Debt Out Cents","description":"Projected outflows from scheduled debt payments in this week","default":0},"budget_revenue_cents":{"type":"integer","title":"Budget Revenue Cents","description":"Weekly budgeted revenue projection (prorated from monthly budget lines)","default":0},"budget_expense_cents":{"type":"integer","title":"Budget Expense Cents","description":"Weekly budgeted expense projection (prorated from monthly budget lines)","default":0},"budget_breakdown":{"$ref":"#/components/schemas/BudgetCalculationWeekBreakdown","description":"Detailed ledger-by-ledger breakdown of budgeted amounts"},"one_time_cents":{"type":"integer","title":"One Time Cents","description":"Net one-time payment delta for this week from user-defined one-time items (positive = inflow, negative = outflow).","default":0},"ending_cash_cents":{"type":"integer","title":"Ending Cash Cents","description":"Projected ending cash balance after this week. = prior ending + cash_in + budget_rev + one_time - (ap + po + debt + budget_exp)","default":0},"ar_in_overridden":{"type":"boolean","title":"Ar In Overridden","default":false},"ap_out_overridden":{"type":"boolean","title":"Ap Out Overridden","default":false},"po_out_overridden":{"type":"boolean","title":"Po Out Overridden","default":false},"projected_po_out_overridden":{"type":"boolean","title":"Projected Po Out Overridden","default":false},"debt_out_overridden":{"type":"boolean","title":"Debt Out Overridden","default":false},"budget_revenue_overridden":{"type":"boolean","title":"Budget Revenue Overridden","default":false},"budget_expense_overridden":{"type":"boolean","title":"Budget Expense Overridden","default":false},"one_time_overridden":{"type":"boolean","title":"One Time Overridden","default":false}},"type":"object","required":["week","start_date","end_date"],"title":"CashForecastWeek","description":"One week in a cash forecast horizon."},"CashOutflowCategory":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id"},"ledger_name":{"type":"string","title":"Ledger Name"},"sub_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Type"},"ledger_type":{"type":"string","title":"Ledger Type"},"amount_cents":{"type":"integer","title":"Amount Cents"},"entry_count":{"type":"integer","title":"Entry Count"}},"additionalProperties":true,"type":"object","required":["ledger_id","ledger_name","ledger_type","amount_cents","entry_count"],"title":"CashOutflowCategory","description":"Ledger category ranked by cash outflow."},"CashOutflowVendor":{"properties":{"counterparty_name":{"type":"string","title":"Counterparty Name"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"amount_cents":{"type":"integer","title":"Amount Cents"},"entry_count":{"type":"integer","title":"Entry Count"}},"additionalProperties":true,"type":"object","required":["counterparty_name","amount_cents","entry_count"],"title":"CashOutflowVendor","description":"Counterparty ranked by cash outflow."},"CashPositionSlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"cash_position","title":"Slide Type","default":"cash_position"},"data":{"$ref":"#/components/schemas/CashPositionSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"CashPositionSlide"},"CashPositionSlideData":{"properties":{"current_cash_cents":{"type":"integer","title":"Current Cash Cents"},"series":{"items":{"$ref":"#/components/schemas/CashSeriesPoint"},"type":"array","maxItems":400,"title":"Series"},"burn_rate_cents_per_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Burn Rate Cents Per Month"},"runway_months":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Runway Months"}},"additionalProperties":false,"type":"object","required":["current_cash_cents"],"title":"CashPositionSlideData"},"CashReceiptDismissRequest":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the transaction to dismiss."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Reason: not_deposit, duplicate, or other."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional free-text notes."}},"type":"object","required":["transaction_id"],"title":"CashReceiptDismissRequest","description":"Request body to dismiss a transaction from cash receipts."},"CashReceiptDismissResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"transaction_id":{"type":"string","title":"Transaction Id"},"dismissal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dismissal Id"}},"type":"object","required":["success","transaction_id"],"title":"CashReceiptDismissResponse","description":"Response after dismissing / restoring a cash receipt."},"CashReceiptsResponse":{"properties":{"start_date":{"type":"string","title":"Start Date","description":"Report start date (YYYY-MM-DD)."},"end_date":{"type":"string","title":"End Date","description":"Report end date (YYYY-MM-DD)."},"weeks":{"items":{"$ref":"#/components/schemas/CashReceiptsWeekSummary"},"type":"array","title":"Weeks","description":"Weekly breakdown of cash received."},"unapplied_transactions":{"items":{"$ref":"#/components/schemas/UnappliedTransaction"},"type":"array","title":"Unapplied Transactions","description":"Deposit transactions with remaining unapplied balance."},"summary":{"$ref":"#/components/schemas/CashReceiptsSummary","description":"Period totals."}},"type":"object","required":["start_date","end_date","weeks","unapplied_transactions","summary"],"title":"CashReceiptsResponse","description":"Full cash receipts reconciliation report."},"CashReceiptsSummary":{"properties":{"total_received":{"type":"integer","title":"Total Received","description":"Total deposits in cents."},"total_applied":{"type":"integer","title":"Total Applied","description":"Total applied to invoices/bills in cents."},"total_unapplied":{"type":"integer","title":"Total Unapplied","description":"Total unapplied in cents."},"transaction_count":{"type":"integer","title":"Transaction Count","description":"Total deposit transactions."}},"type":"object","required":["total_received","total_applied","total_unapplied","transaction_count"],"title":"CashReceiptsSummary","description":"Period-level totals for cash receipts."},"CashReceiptsWeekSummary":{"properties":{"week_start":{"type":"string","title":"Week Start","description":"Start of the ISO week (YYYY-MM-DD)."},"week_end":{"type":"string","title":"Week End","description":"End of the ISO week (YYYY-MM-DD)."},"total_received":{"type":"integer","title":"Total Received","description":"Total deposits received in cents."},"total_applied":{"type":"integer","title":"Total Applied","description":"Amount applied to invoices/bills in cents."},"unapplied":{"type":"integer","title":"Unapplied","description":"Unapplied remainder in cents."},"transaction_count":{"type":"integer","title":"Transaction Count","description":"Number of deposit transactions."}},"type":"object","required":["week_start","week_end","total_received","total_applied","unapplied","transaction_count"],"title":"CashReceiptsWeekSummary","description":"Weekly summary of cash received and how much was applied to invoices."},"CashSeriesPoint":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"cash_cents":{"type":"integer","title":"Cash Cents"}},"additionalProperties":false,"type":"object","required":["date","cash_cents"],"title":"CashSeriesPoint"},"CatalogItemCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Item name."},"item_type":{"type":"string","title":"Item Type","description":"One of: service, non_inventory, inventory, bundle.","default":"service"},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Sku","description":"Optional SKU/code."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Default sales description for line items."},"unit_price":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Unit Price","description":"Default sales price in cents (e.g. 15000 = $150.00)."},"purchase_cost":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Purchase Cost","description":"Default purchase cost in cents."},"is_sold":{"type":"boolean","title":"Is Sold","description":"Item is available on sales documents.","default":true},"is_purchased":{"type":"boolean","title":"Is Purchased","description":"Item is available on purchase documents.","default":false},"taxable":{"type":"boolean","title":"Taxable","description":"Item is taxable by default.","default":false},"income_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Income Ledger Id","description":"Revenue ledger account used when this item is sold."},"expense_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expense Ledger Id","description":"Expense ledger account used when this item is purchased."}},"type":"object","required":["name"],"title":"CatalogItemCreateRequest","description":"Request schema for creating a catalog item."},"CatalogItemResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Catalog item UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"name":{"type":"string","title":"Name"},"item_type":{"type":"string","title":"Item Type"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"unit_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Price"},"purchase_cost":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Purchase Cost"},"is_sold":{"type":"boolean","title":"Is Sold"},"is_purchased":{"type":"boolean","title":"Is Purchased"},"taxable":{"type":"boolean","title":"Taxable"},"income_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Income Ledger Id"},"expense_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expense Ledger Id"},"income_ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Income Ledger Name"},"expense_ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expense Ledger Name"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","name","item_type","is_sold","is_purchased","taxable","is_active","created_at","updated_at"],"title":"CatalogItemResponse","description":"Response schema for a catalog item."},"CatalogItemUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"item_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Type"},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Sku"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"unit_price":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Unit Price"},"purchase_cost":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Purchase Cost"},"is_sold":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Sold"},"is_purchased":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Purchased"},"taxable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Taxable"},"income_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Income Ledger Id"},"expense_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expense Ledger Id"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"CatalogItemUpdateRequest","description":"Request schema for updating a catalog item (all fields optional)."},"CatalogItemsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CatalogItemResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"CatalogItemsListResponse","description":"Paginated list of catalog items."},"CategorizationResponse":{"properties":{"category":{"type":"string","title":"Category","description":"Suggested category."},"subcategory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subcategory","description":"Suggested subcategory."},"confidence":{"type":"number","title":"Confidence","description":"Confidence score (0.0-1.0)."}},"type":"object","required":["category","confidence"],"title":"CategorizationResponse","description":"Response for AI-powered categorization."},"CategorizeAllResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"business_id":{"type":"string","title":"Business Id"}},"additionalProperties":true,"type":"object","required":["workflow_id","business_id"],"title":"CategorizeAllResponse","description":"Envelope data for ``categorize_all``."},"CategorySuggestionItem":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"ID of the transaction"},"suggested_ledger_id":{"type":"string","title":"Suggested Ledger Id","description":"Suggested ledger/account ID"},"suggested_ledger_name":{"type":"string","title":"Suggested Ledger Name","description":"Suggested ledger/account name"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"Confidence score 0-1"},"reason":{"type":"string","title":"Reason","description":"Brief reason for this suggestion"}},"type":"object","required":["transaction_id","suggested_ledger_id","suggested_ledger_name","confidence","reason"],"title":"CategorySuggestionItem"},"CfoPortalAskRequest":{"properties":{"question":{"type":"string","maxLength":2000,"minLength":1,"title":"Question"},"context_section":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context Section","description":"Slug of the CFO portal section the user is currently viewing (e.g. 'weekly-pulse', 'ap-aging'). Used to pick the data slice that grounds the answer."}},"type":"object","required":["question"],"title":"CfoPortalAskRequest","description":"Request payload for the CFO portal AI ask endpoint."},"CfoPortalAskResponse":{"properties":{"answer":{"type":"string","title":"Answer"},"sources":{"items":{"type":"string"},"type":"array","title":"Sources"}},"type":"object","required":["answer"],"title":"CfoPortalAskResponse","description":"Response payload for the CFO portal AI ask endpoint."},"CfoPortalBoardMemoExportRequest":{"properties":{"title":{"type":"string","maxLength":200,"title":"Title","default":"AI Board Memo"},"memo_markdown":{"type":"string","maxLength":100000,"minLength":1,"title":"Memo Markdown"},"generated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Generated At"},"format":{"type":"string","title":"Format","description":"Export format: pdf or html","default":"pdf"}},"type":"object","required":["memo_markdown"],"title":"CfoPortalBoardMemoExportRequest","description":"Request payload for exporting the generated board memo."},"CfoPortalBoardMemoResponse":{"properties":{"title":{"type":"string","title":"Title"},"memo_markdown":{"type":"string","title":"Memo Markdown"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"status":{"type":"string","title":"Status","description":"available when AI succeeded, fallback when template text was used","default":"available"},"sources":{"items":{"type":"string"},"type":"array","title":"Sources"}},"type":"object","required":["title","memo_markdown","generated_at"],"title":"CfoPortalBoardMemoResponse","description":"Response payload for the board-deck AI memo endpoint."},"CfoPortalSectionResponse":{"properties":{"business_id":{"type":"string","title":"Business Id"},"section":{"type":"string","title":"Section"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"sources":{"items":{"$ref":"#/components/schemas/CfoPortalSource"},"type":"array","title":"Sources"},"data":{"additionalProperties":true,"type":"object","title":"Data"}},"type":"object","required":["business_id","section","generated_at"],"title":"CfoPortalSectionResponse","description":"Typed envelope for a CFO portal section payload."},"CfoPortalSource":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"status":{"type":"string","title":"Status","description":"available, empty, partial, or unavailable","default":"available"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["key","label"],"title":"CfoPortalSource","description":"Metadata for a CFO portal section's backing source."},"ChangeFirmTierResponse":{"properties":{"status":{"type":"string","title":"Status"},"firm_plan_tier":{"type":"string","title":"Firm Plan Tier"},"previous_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Tier"},"active_clients":{"type":"integer","title":"Active Clients"}},"additionalProperties":true,"type":"object","required":["status","firm_plan_tier","active_clients"],"title":"ChangeFirmTierResponse","description":"Response for ``change_firm_tier``."},"ChangePlanResponse":{"properties":{"status":{"type":"string","title":"Status"},"subscription_id":{"type":"string","title":"Subscription Id"}},"additionalProperties":true,"type":"object","required":["status","subscription_id"],"title":"ChangePlanResponse","description":"Response for ``change_plan``."},"CheckoutRequest":{"properties":{"price_id":{"type":"string","title":"Price Id","description":"Stripe Price ID for the plan."},"success_url":{"type":"string","title":"Success Url","description":"URL to redirect after successful payment."},"cancel_url":{"type":"string","title":"Cancel Url","description":"URL to redirect if checkout is canceled."}},"type":"object","required":["price_id","success_url","cancel_url"],"title":"CheckoutRequest"},"ClarificationCountResponse":{"properties":{"open_count":{"type":"integer","title":"Open Count"}},"type":"object","required":["open_count"],"title":"ClarificationCountResponse","description":"Open clarification count for sidebar badges."},"ClarificationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ClarificationResponse"},"type":"array","title":"Items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"has_next":{"type":"boolean","title":"Has Next","default":false},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items"],"title":"ClarificationListResponse","description":"Paginated list of clarifications."},"ClarificationResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"transaction_id":{"type":"string","title":"Transaction Id"},"advisory_firm_id":{"type":"string","title":"Advisory Firm Id"},"question":{"type":"string","title":"Question"},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options"},"status":{"type":"string","title":"Status"},"answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer"},"asked_by_user_id":{"type":"string","title":"Asked By User Id"},"asked_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asked By Name"},"answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Answered At"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"transaction_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Description"},"transaction_counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Counterparty"},"transaction_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transaction Amount","description":"Transaction amount in cents."},"transaction_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Transaction Date"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"}},"type":"object","required":["id","business_id","transaction_id","advisory_firm_id","question","status","asked_by_user_id","created_at","updated_at"],"title":"ClarificationResponse","description":"A single transaction clarification, enriched with transaction context."},"ClearAttentionDismissalsResponse":{"properties":{"cleared":{"type":"boolean","title":"Cleared"}},"additionalProperties":true,"type":"object","required":["cleared"],"title":"ClearAttentionDismissalsResponse","description":"Envelope ``data`` for ``clear_dismissals``."},"ClientBusinessAccessListItem":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"business_name":{"type":"string","title":"Business Name"},"granted_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Granted By"},"created_at":{"type":"string","title":"Created At"}},"additionalProperties":true,"type":"object","required":["id","business_id","business_name","created_at"],"title":"ClientBusinessAccessListItem"},"ClientBusinessAccessRequest":{"properties":{"business_id":{"type":"string","title":"Business Id","description":"Business ID to grant access to."}},"type":"object","required":["business_id"],"title":"ClientBusinessAccessRequest","description":"Request schema for granting a client access to a business.","example":{"business_id":"019ab37c-xxxx-xxxx-xxxx-000000000001"}},"ClientBusinessAccessResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"business_id":{"type":"string","title":"Business Id"},"firm_id":{"type":"string","title":"Firm Id"},"granted_by":{"type":"string","title":"Granted By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","user_id","business_id","firm_id","granted_by","created_at"],"title":"ClientBusinessAccessResponse","description":"Single client business access grant."},"CloseChecklistAckResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Ack row UUID"},"business_id":{"type":"string","title":"Business Id","description":"Business UUID"},"period_start":{"type":"string","format":"date","title":"Period Start","description":"Period start the ack is keyed to"},"step_id":{"type":"string","title":"Step Id","description":"Checklist step ID (e.g. trial_balance_review)"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional free-form note"},"acked_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Acked By","description":"User who acknowledged"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the ack was first recorded"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When the ack was last updated"}},"type":"object","required":["id","business_id","period_start","step_id","created_at","updated_at"],"title":"CloseChecklistAckResponse","description":"A persisted acknowledgement that a manual close step is done."},"CloseChecklistAcksListResponse":{"properties":{"period_id":{"type":"string","title":"Period Id","description":"Period UUID the acks belong to"},"period_start":{"type":"string","format":"date","title":"Period Start","description":"Period start date"},"items":{"items":{"$ref":"#/components/schemas/CloseChecklistAckResponse"},"type":"array","title":"Items"}},"type":"object","required":["period_id","period_start"],"title":"CloseChecklistAcksListResponse","description":"List of acknowledgements for a single period."},"ClosePeriodRequest":{"properties":{"period_end":{"type":"string","format":"date","title":"Period End","description":"End date of the period to close"},"lock_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lock Reason","description":"Reason for closing the period"},"force":{"type":"boolean","title":"Force","description":"Bypass soft client-side blockers (unresolved checklist items) and force the close. Backend still rejects already-closed periods. Required for historical migration when the period was reviewed offline.","default":false}},"type":"object","required":["period_end"],"title":"ClosePeriodRequest","description":"Request schema for closing an accounting period.","example":{"lock_reason":"Month-end close completed","period_end":"2026-01-31"}},"CloseReadinessItem":{"properties":{"check":{"type":"string","title":"Check","description":"Name of the readiness check"},"status":{"type":"string","title":"Status","description":"pass, warning, or fail"},"detail":{"type":"string","title":"Detail","description":"Explanation"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count","description":"Number of items flagged"}},"type":"object","required":["check","status","detail"],"title":"CloseReadinessItem"},"CloseReadinessResponse":{"properties":{"score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Score","description":"Overall readiness score 0-100"},"items":{"items":{"$ref":"#/components/schemas/CloseReadinessItem"},"type":"array","title":"Items"},"summary":{"$ref":"#/components/schemas/CloseReadinessSummary","description":"Period-scoped transaction counts to power dashboards without extra fetches"}},"type":"object","required":["score"],"title":"CloseReadinessResponse"},"CloseReadinessSummary":{"properties":{"transaction_count":{"type":"integer","minimum":0.0,"title":"Transaction Count","description":"Total non-deleted transactions in the period","default":0},"unreviewed_count":{"type":"integer","minimum":0.0,"title":"Unreviewed Count","description":"Transactions in the period that are still unreviewed","default":0},"uncategorized_count":{"type":"integer","minimum":0.0,"title":"Uncategorized Count","description":"Transactions in the period that are still uncategorized","default":0}},"type":"object","title":"CloseReadinessSummary","description":"Period-scoped totals computed alongside the readiness checks."},"CloseScoreBlocker":{"properties":{"category":{"type":"string","title":"Category"},"severity":{"type":"string","title":"Severity"},"label":{"type":"string","title":"Label"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"}},"additionalProperties":true,"type":"object","required":["category","severity","label"],"title":"CloseScoreBlocker","description":"Item blocking the period close score from reaching 100."},"CloseScoreHistoryEntry":{"properties":{"snapshot_date":{"type":"string","title":"Snapshot Date"},"score":{"type":"number","title":"Score"},"color":{"type":"string","title":"Color"}},"additionalProperties":true,"type":"object","required":["snapshot_date","score","color"],"title":"CloseScoreHistoryEntry","description":"Daily close-score snapshot for trend charts."},"CoaGenerateRequest":{"properties":{"business_description":{"type":"string","maxLength":2000,"minLength":10,"title":"Business Description","description":"Description of the business including industry, size, and accounting needs. E.g. 'Small e-commerce business selling handmade jewelry, accrual basis, US-based'"},"accounting_basis":{"anyOf":[{"type":"string","enum":["cash","accrual"]},{"type":"null"}],"title":"Accounting Basis","description":"Preferred accounting basis. If omitted, the AI will choose based on business description."},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Primary currency (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"include_inventory":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Inventory","description":"Whether to include inventory-related accounts (COGS, inventory assets, etc.).","default":false}},"type":"object","required":["business_description"],"title":"CoaGenerateRequest","description":"Request schema for AI-powered COA template generation.\n\nProvide a business description and the AI will generate a complete\nchart of accounts template that conforms to Teal API requirements."},"CoaGenerateResponse":{"properties":{"template":{"$ref":"#/components/schemas/CustomCoaTemplate","description":"Generated COA template ready for use in business creation"},"accounting_basis":{"type":"string","title":"Accounting Basis","description":"The accounting basis used for this template (cash or accrual)"},"summary":{"type":"string","title":"Summary","description":"Brief AI explanation of the generated template and why accounts were chosen"},"ledger_count":{"type":"integer","title":"Ledger Count","description":"Number of ledgers in the generated template","default":0}},"type":"object","required":["template","accounting_basis","summary"],"title":"CoaGenerateResponse","description":"Response from the AI-powered COA template generation endpoint."},"CoaValidationError":{"properties":{"ledger_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ledger Index","description":"0-based index of the ledger with the error (null for template-level errors)"},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name","description":"Name of the ledger (if available)"},"field":{"type":"string","title":"Field","description":"Field that failed validation"},"message":{"type":"string","title":"Message","description":"Human-readable error description"}},"type":"object","required":["field","message"],"title":"CoaValidationError","description":"A single validation error within a COA template."},"CollectionOverdueInvoice":{"properties":{"id":{"type":"string","title":"Id"},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"customer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Email"},"status":{"type":"string","title":"Status"},"total":{"type":"integer","title":"Total","description":"Invoice total in cents."},"total_paid":{"type":"integer","title":"Total Paid","description":"Total paid in cents.","default":0},"balance_due":{"type":"integer","title":"Balance Due","description":"Remaining balance in cents."},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date"},"days_past_due":{"type":"integer","title":"Days Past Due","description":"Days past the due date."},"suggested_reminder_type":{"type":"string","title":"Suggested Reminder Type","description":"Recommended tone: 'friendly', 'firm', or 'final'."},"reminder_count":{"type":"integer","title":"Reminder Count","description":"Collection reminders already recorded for this invoice.","default":0},"last_reminder_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Reminder At","description":"ISO timestamp of the most recent collection reminder."}},"type":"object","required":["id","status","total","balance_due","days_past_due","suggested_reminder_type"],"title":"CollectionOverdueInvoice","description":"An overdue invoice surfaced on the Collections tab."},"CollectionReminderHistoryItem":{"properties":{"id":{"type":"string","title":"Id"},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id"},"reminder_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reminder Type"},"days_overdue":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Overdue"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"recipient_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Email"},"recipient_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Name"},"processing_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing Status"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id"],"title":"CollectionReminderHistoryItem","description":"A collection reminder email stored in the emails table."},"CollectionWorkflowRun":{"properties":{"id":{"type":"string","title":"Id"},"workflow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id"},"status":{"type":"string","title":"Status"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"total_overdue_invoices":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Overdue Invoices"},"total_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Amount Cents"},"friendly_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Friendly Count"},"firm_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Firm Count"},"final_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Final Count"},"emails_sent":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Emails Sent"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},"type":"object","required":["id","status"],"title":"CollectionWorkflowRun","description":"A recorded AR collection workflow run from the tasks table."},"ColumnMapping":{"properties":{"column_index":{"type":"integer","title":"Column Index","description":"0-based column index in the sheet."},"column_header":{"type":"string","title":"Column Header","description":"Header text from the source column.","default":""},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"AI confidence score.","default":0.0}},"type":"object","required":["column_index"],"title":"ColumnMapping","description":"AI-detected mapping of a source column to a standard inventory field."},"CommentResponse":{"properties":{"comment":{"type":"string","maxLength":10000,"minLength":1,"title":"Comment","description":"The comment text content"},"comment_id":{"type":"string","title":"Comment Id","description":"Unique identifier for the comment"},"thread_id":{"type":"string","title":"Thread Id","description":"UUID of the thread this comment belongs to"},"user_id":{"type":"string","title":"User Id","description":"UUID of the user who created the comment"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name","description":"Display name of the comment author"},"object_type":{"type":"string","title":"Object Type","description":"Type of object this comment is attached to"},"object_id":{"type":"string","title":"Object Id","description":"UUID of the object this comment is attached to"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when the comment was created"}},"type":"object","required":["comment","comment_id","thread_id","user_id","object_type","object_id","created_at"],"title":"CommentResponse","description":"Schema for comment response."},"CommittedMatch":{"properties":{"statement_txn_id":{"type":"string","title":"Statement Txn Id"},"ledger_txn_ids":{"items":{"type":"string"},"type":"array","title":"Ledger Txn Ids"},"approved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By"},"approved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved At"},"was_ai_suggested":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Was Ai Suggested"},"ai_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ai Confidence"},"ai_reasoning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Reasoning"},"bulk_approved":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Bulk Approved"}},"additionalProperties":true,"type":"object","required":["statement_txn_id","ledger_txn_ids"],"title":"CommittedMatch","description":"User-approved match."},"CompareBillAgainstContractResponse":{"properties":{"bill_id":{"type":"string","title":"Bill Id"},"contract_match":{"type":"string","title":"Contract Match"},"vendor_contract_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Contract Id"}},"additionalProperties":true,"type":"object","required":["bill_id","contract_match"],"title":"CompareBillAgainstContractResponse","description":"Response for ``compare_bill_against_contract``."},"CompleteOnboardingRequest":{"properties":{"stripe_session_id":{"type":"string","title":"Stripe Session Id","description":"Stripe Checkout session ID"}},"type":"object","required":["stripe_session_id"],"title":"CompleteOnboardingRequest","description":"Complete onboarding after Stripe Checkout.\n\nThe Stripe session ID is used to retrieve the onboarding payload\nstored in session metadata."},"CompleteRequest":{"properties":{"skip_balance_check":{"type":"boolean","title":"Skip Balance Check","description":"Skip balance validation (use with caution)","default":false}},"type":"object","title":"CompleteRequest","description":"Request to complete reconciliation."},"ConsolidatedAssetBreakdown":{"properties":{"current_assets":{"additionalProperties":{"type":"integer"},"type":"object","title":"Current Assets"},"fixed_assets":{"additionalProperties":{"type":"integer"},"type":"object","title":"Fixed Assets"}},"additionalProperties":true,"type":"object","title":"ConsolidatedAssetBreakdown","description":"Balance sheet asset accounts grouped by current vs fixed."},"ConsolidatedLiabilityBreakdown":{"properties":{"current_liabilities":{"additionalProperties":{"type":"integer"},"type":"object","title":"Current Liabilities"},"long_term_liabilities":{"additionalProperties":{"type":"integer"},"type":"object","title":"Long Term Liabilities"}},"additionalProperties":true,"type":"object","title":"ConsolidatedLiabilityBreakdown","description":"Balance sheet liability accounts grouped by term."},"ContractInsightItem":{"properties":{"contract_id":{"type":"string","title":"Contract Id","description":"Contract ID"},"type":{"type":"string","title":"Type","description":"renewal, overspend, or terms"},"title":{"type":"string","title":"Title","description":"Short headline"},"description":{"type":"string","title":"Description","description":"Explanation"},"severity":{"type":"string","title":"Severity","description":"info, warning, or critical"}},"type":"object","required":["contract_id","type","title","description","severity"],"title":"ContractInsightItem"},"Contractor1099ReportResponse":{"properties":{"year":{"type":"integer","title":"Year"},"threshold_cents":{"type":"integer","title":"Threshold Cents","default":60000},"rows":{"items":{"$ref":"#/components/schemas/Contractor1099ReportRow"},"type":"array","title":"Rows"},"total_paid":{"type":"integer","title":"Total Paid"},"reportable_count":{"type":"integer","title":"Reportable Count"}},"type":"object","required":["year","rows","total_paid","reportable_count"],"title":"Contractor1099ReportResponse","description":"The 1099 year-end summary across all flagged contractors."},"Contractor1099ReportRow":{"properties":{"vendor_id":{"type":"string","title":"Vendor Id"},"name":{"type":"string","title":"Name"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"tax_id_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id Type"},"box":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Box"},"total_paid":{"type":"integer","title":"Total Paid"},"meets_threshold":{"type":"boolean","title":"Meets Threshold"}},"type":"object","required":["vendor_id","name","total_paid","meets_threshold"],"title":"Contractor1099ReportRow","description":"One contractor's total payments for the tax year (cents)."},"ContractorResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"name":{"type":"string","title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"is_1099_contractor":{"type":"boolean","title":"Is 1099 Contractor","default":false},"tax_id_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id Type"},"default_1099_box":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default 1099 Box"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","business_id","name"],"title":"ContractorResponse","description":"A vendor with its 1099 tracking fields."},"ContractorUpdateRequest":{"properties":{"is_1099_contractor":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is 1099 Contractor"},"tax_id":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Tax Id"},"tax_id_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id Type","description":"ein or ssn."},"default_1099_box":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Default 1099 Box","description":"e.g. \"NEC-1\"."}},"type":"object","title":"ContractorUpdateRequest","description":"Update 1099 fields on a vendor."},"ContractorsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ContractorResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ContractorsListResponse","description":"A flat list of contractors (vendors)."},"ConversationCategory":{"type":"string","enum":["general","document_request","tax_question","payment_question","other"],"title":"ConversationCategory"},"ConversationDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"advisory_firm_id":{"type":"string","title":"Advisory Firm Id"},"subject":{"type":"string","title":"Subject"},"category":{"$ref":"#/components/schemas/ConversationCategory"},"status":{"$ref":"#/components/schemas/ConversationStatus"},"created_by_user_id":{"type":"string","title":"Created By User Id"},"created_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Name"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"messages":{"items":{"$ref":"#/components/schemas/app__api__v1__schemas__client_messages__MessageResponse"},"type":"array","title":"Messages"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","advisory_firm_id","subject","category","status","created_by_user_id","created_at","updated_at"],"title":"ConversationDetailResponse","description":"Full conversation with messages."},"ConversationStatus":{"type":"string","enum":["open","waiting_on_client","resolved"],"title":"ConversationStatus"},"ConversationSummaryResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"advisory_firm_id":{"type":"string","title":"Advisory Firm Id"},"subject":{"type":"string","title":"Subject"},"category":{"$ref":"#/components/schemas/ConversationCategory"},"status":{"$ref":"#/components/schemas/ConversationStatus"},"created_by_user_id":{"type":"string","title":"Created By User Id"},"created_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Name"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"message_count":{"type":"integer","title":"Message Count","default":0},"last_message_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message Preview"},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Message At"},"unread_count":{"type":"integer","title":"Unread Count","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","advisory_firm_id","subject","category","status","created_by_user_id","created_at","updated_at"],"title":"ConversationSummaryResponse","description":"Summary shown in the conversation list."},"ConvertProductToVariantRequest":{"properties":{"target_product_id":{"type":"string","minLength":1,"title":"Target Product Id","description":"UUID of the product that will become the parent."}},"type":"object","required":["target_product_id"],"title":"ConvertProductToVariantRequest","description":"Request to convert a product into variant(s) of another product."},"ConvertProductToVariantResponse":{"properties":{"product":{"anyOf":[{"$ref":"#/components/schemas/ProductResponse"},{"type":"null"}]},"variants":{"items":{"$ref":"#/components/schemas/VariantResponse"},"type":"array","title":"Variants","default":[]},"source_archived":{"type":"boolean","title":"Source Archived","default":true}},"additionalProperties":true,"type":"object","title":"ConvertProductToVariantResponse","description":"Product conversion: variants moved under target product; source archived."},"CostBreakdown":{"properties":{"materials_by_category":{"additionalProperties":{"type":"integer"},"type":"object","title":"Materials By Category","description":"Cost per category in cents."},"processing_steps_by_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"Processing Steps By Type","description":"Cost per step_type in cents."},"material_line_items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Material Line Items"},"step_line_items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Step Line Items"},"total_cost":{"type":"integer","title":"Total Cost","default":0},"cost_per_unit":{"type":"integer","title":"Cost Per Unit","default":0},"sales_potential":{"type":"integer","title":"Sales Potential","default":0},"gross_profit":{"type":"integer","title":"Gross Profit","default":0},"gross_margin_pct":{"type":"number","title":"Gross Margin Pct","default":0.0},"total_weight":{"type":"number","title":"Total Weight","default":0.0},"total_weight_unit":{"type":"string","title":"Total Weight Unit","default":""}},"type":"object","title":"CostBreakdown","description":"Structured cost breakdown returned by the calculation engine."},"CostClassification":{"type":"string","enum":["var","fix"],"title":"CostClassification","description":"Whether a cost line scales with revenue or is a flat run rate."},"CostHistoryResponse":{"properties":{"window_months":{"type":"integer","title":"Window Months"},"variants":{"items":{"$ref":"#/components/schemas/VariantCostHistory"},"type":"array","title":"Variants"}},"type":"object","required":["window_months","variants"],"title":"CostHistoryResponse"},"CostSnapshotPoint":{"properties":{"snapshot_month":{"type":"string","format":"date","title":"Snapshot Month"},"material_per_unit":{"type":"integer","title":"Material Per Unit"},"packaging_per_unit":{"type":"integer","title":"Packaging Per Unit","default":0},"processing_per_unit":{"type":"integer","title":"Processing Per Unit"},"freight_per_unit":{"type":"integer","title":"Freight Per Unit"},"duties_per_unit":{"type":"integer","title":"Duties Per Unit","default":0},"handling_per_unit":{"type":"integer","title":"Handling Per Unit","default":0},"total_per_unit":{"type":"integer","title":"Total Per Unit"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},"type":"object","required":["snapshot_month","material_per_unit","processing_per_unit","freight_per_unit","total_per_unit"],"title":"CostSnapshotPoint"},"CounterpartyDefaultCreate":{"properties":{"registry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registry Id","description":"Linked counterparty registry entry. Preferred — survives name normalisation. When provided, ``counterparty_name`` is treated as a display label only."},"counterparty_name":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Counterparty Name","description":"Raw counterparty string used when the counterparty is not linked to the registry. Required when ``registry_id`` is absent."},"default_ledger_id":{"type":"string","title":"Default Ledger Id","description":"Ledger to categorize matched transactions to."},"memo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Memo","description":"Optional memo to stamp on matches."},"mark_personal":{"type":"boolean","title":"Mark Personal","description":"Mark matched transactions as personal expenses.","default":false}},"type":"object","required":["default_ledger_id"],"title":"CounterpartyDefaultCreate","description":"Payload to create a counterparty default."},"CounterpartyDefaultListResponse":{"properties":{"defaults":{"items":{"$ref":"#/components/schemas/CounterpartyDefaultResponse"},"type":"array","title":"Defaults"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["defaults","total"],"title":"CounterpartyDefaultListResponse","description":"Wrapped collection response."},"CounterpartyDefaultResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"registry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registry Id"},"counterparty_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty Name"},"default_ledger_id":{"type":"string","title":"Default Ledger Id"},"default_ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Ledger Name"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"},"mark_personal":{"type":"boolean","title":"Mark Personal"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","registry_id","counterparty_name","default_ledger_id","memo","mark_personal","created_at","updated_at"],"title":"CounterpartyDefaultResponse","description":"Public shape of a counterparty default."},"CounterpartyDefaultUpdate":{"properties":{"default_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Ledger Id"},"memo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Memo"},"mark_personal":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Mark Personal"}},"type":"object","title":"CounterpartyDefaultUpdate","description":"Patch payload — every field is optional."},"CounterpartyStatus":{"type":"string","enum":["active","inactive","blocked"],"title":"CounterpartyStatus","description":"Status values for customers and vendors."},"CounterpartySuggestionGroup":{"properties":{"counterparty":{"type":"string","title":"Counterparty","description":"Counterparty name"},"suggested_ledger_id":{"type":"string","title":"Suggested Ledger Id","description":"Suggested ledger/account ID"},"suggested_ledger_name":{"type":"string","title":"Suggested Ledger Name","description":"Suggested ledger/account name"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"Avg confidence score"},"reason":{"type":"string","title":"Reason","description":"Strategy or pattern that matched"},"transaction_ids":{"items":{"type":"string"},"type":"array","title":"Transaction Ids","description":"IDs of transactions in this group (from analyzed batch)"},"transaction_count":{"type":"integer","title":"Transaction Count","description":"Total transactions for this counterparty (may exceed analyzed batch)"},"sample_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sample Description","description":"Example transaction description for context"}},"type":"object","required":["counterparty","suggested_ledger_id","suggested_ledger_name","confidence","reason","transaction_count"],"title":"CounterpartySuggestionGroup","description":"A group of transactions sharing the same counterparty and suggested category."},"CoverSlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"cover","title":"Slide Type","default":"cover"},"data":{"$ref":"#/components/schemas/CoverSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"CoverSlide"},"CoverSlideData":{"properties":{"business_name":{"type":"string","title":"Business Name"},"period_label":{"type":"string","title":"Period Label"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"prepared_for":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prepared For"},"prepared_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prepared By"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tagline"}},"additionalProperties":false,"type":"object","required":["business_name","period_label","generated_at"],"title":"CoverSlideData"},"CoverageReportRow":{"properties":{"source_type":{"type":"string","title":"Source Type"},"dayzero_target":{"type":"string","title":"Dayzero Target"},"imported":{"type":"integer","title":"Imported"}},"additionalProperties":true,"type":"object","required":["source_type","dayzero_target","imported"],"title":"CoverageReportRow"},"CreateBatchInvoicesResponse":{"properties":{"total":{"type":"integer","title":"Total"},"succeeded":{"type":"integer","title":"Succeeded"},"failed":{"type":"integer","title":"Failed"},"invoice_ids":{"items":{"type":"string"},"type":"array","title":"Invoice Ids"},"errors":{"items":{"$ref":"#/components/schemas/BatchInvoiceError"},"type":"array","title":"Errors"}},"additionalProperties":true,"type":"object","required":["total","succeeded","failed"],"title":"CreateBatchInvoicesResponse","description":"Response for ``create_batch_invoices``."},"CreateCheckoutSessionResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"},"session_id":{"type":"string","title":"Session Id"}},"additionalProperties":true,"type":"object","required":["checkout_url","session_id"],"title":"CreateCheckoutSessionResponse","description":"Response for ``create_checkout_session``."},"CreateClarificationRequest":{"properties":{"question":{"type":"string","maxLength":2000,"minLength":1,"title":"Question","description":"The question to ask the client about this transaction."},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options","description":"Optional suggested answers rendered as one-tap replies."}},"type":"object","required":["question"],"title":"CreateClarificationRequest","description":"Firm asks the client a question about a transaction.","example":{"options":["Business meal","Personal — exclude"],"question":"Was this a business meal or personal? If business, who attended?"}},"CreateConversationRequest":{"properties":{"subject":{"type":"string","maxLength":500,"minLength":1,"title":"Subject","description":"Conversation subject"},"category":{"$ref":"#/components/schemas/ConversationCategory","description":"Conversation category","default":"general"},"message":{"type":"string","maxLength":10000,"minLength":1,"title":"Message","description":"Initial message body"}},"type":"object","required":["subject","message"],"title":"CreateConversationRequest","description":"Create a new conversation (client-initiated).","example":{"category":"tax_question","message":"Hi, I wanted to check on the status of our Q4 estimated tax payment.","subject":"Question about Q4 tax filing"}},"CreateDocumentRequest":{"properties":{"title":{"type":"string","maxLength":255,"minLength":1,"title":"Title","description":"What document is being requested."},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Optional extra instructions."},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date","description":"Optional due date."}},"type":"object","required":["title"],"title":"CreateDocumentRequest","description":"Firm requests a document from the client.","example":{"description":"PDF export from your bank for the full month.","title":"January 2026 bank statement"}},"CreateDraftReordersRequest":{"properties":{"vendor_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Vendor Ids","description":"If provided, only create drafts for these vendor UUIDs. Otherwise all suggestion groups are drafted."}},"type":"object","title":"CreateDraftReordersRequest","description":"Optionally restrict draft creation to a subset of vendors."},"CreateDraftReordersResponse":{"properties":{"drafts":{"items":{"$ref":"#/components/schemas/DraftReorderResult"},"type":"array","title":"Drafts"},"drafted_count":{"type":"integer","title":"Drafted Count","default":0},"skipped_unassigned":{"type":"integer","title":"Skipped Unassigned","default":0}},"type":"object","title":"CreateDraftReordersResponse"},"CreateMessageRequest":{"properties":{"body":{"type":"string","maxLength":10000,"minLength":1,"title":"Body","description":"Message body"}},"type":"object","required":["body"],"title":"CreateMessageRequest","description":"Add a reply to an existing conversation.","example":{"body":"Thanks for the update, that makes sense."}},"CreateNotesBulkResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/NoteResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"additionalProperties":true,"type":"object","required":["items","total"],"title":"CreateNotesBulkResponse","description":"Response for ``create_notes_bulk``."},"CreatePeriodSignOffResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"role":{"type":"string","title":"Role"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"signed_off_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signed Off At"},"score_at_signoff":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score At Signoff"}},"additionalProperties":true,"type":"object","required":["id","user_id","role"],"title":"CreatePeriodSignOffResponse","description":"Response for ``create_period_sign_off``."},"CreatePortalSessionResponse":{"properties":{"portal_url":{"type":"string","title":"Portal Url"}},"additionalProperties":true,"type":"object","required":["portal_url"],"title":"CreatePortalSessionResponse","description":"Response for ``create_portal_session``."},"CreateReconciliationWithUploadResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id"},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name"},"status":{"type":"string","title":"Status"},"status_display":{"type":"string","title":"Status Display"},"statement_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement Filename"},"statement_start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement Start Date"},"statement_end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement End Date"},"opening_balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Opening Balance"},"closing_balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Closing Balance"},"locked":{"type":"boolean","title":"Locked"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"input_txns":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationInputTxns"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Txns"},"ai_match_results":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationAIMatchResults"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Ai Match Results"},"user_committed_matches":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationCommittedMatches"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Committed Matches"},"match_counts":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationMatchCounts"},{"type":"null"}]},"workflow_started":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Workflow Started"}},"additionalProperties":true,"type":"object","required":["id","business_id","status","status_display","locked"],"title":"CreateReconciliationWithUploadResponse","description":"Reconciliation created via direct file upload."},"CreateShareRequest":{"properties":{"expires_in_hours":{"anyOf":[{"type":"integer","maximum":8760.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Hours"},"slug":{"anyOf":[{"type":"string","maxLength":80,"pattern":"^[a-z0-9-]+$"},{"type":"null"}],"title":"Slug"}},"additionalProperties":false,"type":"object","title":"CreateShareRequest","description":"Body for ``POST /ai-reporting/decks/{deck_id}/share``."},"CreateStaffAssignmentRequest":{"properties":{"business_id":{"type":"string","title":"Business Id","description":"Business to assign."},"engagement_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engagement Type","description":"Type of engagement: tax_preparation, audit, bookkeeping, advisory, etc."},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date","description":"Engagement start date (YYYY-MM-DD)."},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date","description":"Engagement end date (YYYY-MM-DD)."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Notes about the assignment."}},"type":"object","required":["business_id"],"title":"CreateStaffAssignmentRequest","description":"Request to assign a member to a business."},"CreateTeamRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Team name (unique within the firm)."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Team description."}},"type":"object","required":["name"],"title":"CreateTeamRequest","description":"Request to create a firm team."},"CreditMemoApplicationCreate":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id","description":"Invoice to apply credit to"},"amount_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount Cents","description":"Amount to apply in cents"}},"type":"object","required":["invoice_id","amount_cents"],"title":"CreditMemoApplicationCreate","description":"Request schema for applying a credit memo to an invoice.","example":{"amount_cents":2500,"invoice_id":"019ab37c-inv2-7000-8000-000000000002"}},"CreditMemoApplicationResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Application record ID"},"credit_memo_id":{"type":"string","title":"Credit Memo Id","description":"Source credit memo ID"},"invoice_id":{"type":"string","title":"Invoice Id","description":"Invoice the credit was applied to"},"amount_applied":{"type":"integer","title":"Amount Applied","description":"Amount applied in cents"},"amount_applied_dollars":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount Applied Dollars","description":"Amount applied in dollars"},"applied_at":{"type":"string","format":"date-time","title":"Applied At","description":"When the credit was applied"},"applied_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applied By User Id","description":"User who applied the credit"}},"type":"object","required":["id","credit_memo_id","invoice_id","amount_applied","amount_applied_dollars","applied_at"],"title":"CreditMemoApplicationResponse","description":"Response schema for a credit memo application."},"CreditMemoCreate":{"properties":{"customer_id":{"type":"string","title":"Customer Id","description":"Customer receiving the credit"},"amount_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount Cents","description":"Credit amount in cents"},"reason":{"$ref":"#/components/schemas/CreditMemoReasonEnum","description":"Reason for the credit memo","default":"other"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the credit"},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id","description":"Original invoice being credited (optional)"},"issue_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issue Date","description":"Issue date (defaults to today)"},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/CreditMemoLineItem"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Optional line items for credit detail"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes","description":"Internal notes (not visible to customer)"}},"type":"object","required":["customer_id","amount_cents"],"title":"CreditMemoCreate","description":"Request schema for creating a credit memo.","example":{"amount_cents":5000,"customer_id":"019ab37c-cust-7000-8000-000000000001","description":"Overcharged on invoice #INV-001","invoice_id":"019ab37c-inv1-7000-8000-000000000001","reason":"pricing_error"}},"CreditMemoLineItem":{"properties":{"description":{"type":"string","title":"Description","description":"Line item description"},"quantity":{"type":"integer","minimum":1.0,"title":"Quantity","description":"Quantity","default":1},"unit_price_cents":{"type":"integer","title":"Unit Price Cents","description":"Unit price in cents"},"amount_cents":{"type":"integer","title":"Amount Cents","description":"Total amount in cents (qty * unit_price)"},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Optional variant UUID. When set, issuing the memo restocks `quantity` units of this variant."}},"type":"object","required":["description","unit_price_cents","amount_cents"],"title":"CreditMemoLineItem","description":"Line item for credit memo details."},"CreditMemoReasonEnum":{"type":"string","enum":["returned_goods","damaged_goods","service_issue","pricing_error","billing_adjustment","goodwill","duplicate_charge","other"],"title":"CreditMemoReasonEnum","description":"Standard reasons for issuing a credit memo."},"CreditMemoResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Credit memo ID"},"business_id":{"type":"string","title":"Business Id","description":"Business that issued the credit"},"customer_id":{"type":"string","title":"Customer Id","description":"Customer receiving the credit"},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id","description":"Original invoice being credited"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number","description":"Auto-generated credit memo number (e.g. CM-001)"},"status":{"type":"string","title":"Status","description":"Status: draft, issued, partially_applied, fully_applied, void"},"currency":{"type":"string","title":"Currency","description":"ISO currency code (e.g. USD)"},"amount":{"type":"integer","title":"Amount","description":"Total credit amount in cents"},"amount_in_dollars":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount In Dollars","description":"Total credit amount in dollars"},"amount_applied":{"type":"integer","title":"Amount Applied","description":"Amount applied in cents"},"amount_applied_in_dollars":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount Applied In Dollars","description":"Amount applied in dollars"},"amount_remaining":{"type":"integer","title":"Amount Remaining","description":"Remaining amount in cents"},"amount_remaining_in_dollars":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount Remaining In Dollars","description":"Remaining amount in dollars"},"issue_date":{"type":"string","format":"date","title":"Issue Date","description":"Date the credit memo was issued"},"applied_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Applied Date","description":"When credits were last applied"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Record creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"},"reason":{"type":"string","title":"Reason","description":"Reason code (e.g. pricing_error, refund, other)"},"reason_display":{"type":"string","title":"Reason Display","description":"Human-readable reason label"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the credit"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes","description":"Internal notes (not visible to customer)"},"line_items":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Line Items","description":"Detailed line items breakdown"},"voided_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Voided At","description":"When the credit memo was voided"},"voided_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voided Reason","description":"Reason for voiding"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name","description":"Customer display name"},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number","description":"Original invoice number"},"applications":{"anyOf":[{"items":{"$ref":"#/components/schemas/CreditMemoApplicationResponse"},"type":"array"},{"type":"null"}],"title":"Applications","description":"Applications to invoices"},"can_be_applied":{"type":"boolean","title":"Can Be Applied","description":"Whether credits can be applied to invoices"},"can_be_voided":{"type":"boolean","title":"Can Be Voided","description":"Whether the credit memo can be voided"},"can_be_deleted":{"type":"boolean","title":"Can Be Deleted","description":"Whether the credit memo can be deleted (drafts only)"},"has_applications":{"type":"boolean","title":"Has Applications","description":"Whether any credits have been applied"}},"type":"object","required":["id","business_id","customer_id","status","currency","amount","amount_in_dollars","amount_applied","amount_applied_in_dollars","amount_remaining","amount_remaining_in_dollars","issue_date","created_at","updated_at","reason","reason_display","can_be_applied","can_be_voided","can_be_deleted","has_applications"],"title":"CreditMemoResponse","description":"Response schema for a credit memo.","example":{"amount":5000,"amount_applied":0,"amount_applied_in_dollars":0.0,"amount_in_dollars":50.0,"amount_remaining":5000,"amount_remaining_in_dollars":50.0,"business_id":"019ab37c-bus1-7000-8000-000000000001","can_be_applied":true,"can_be_deleted":false,"can_be_voided":true,"currency":"USD","customer_id":"019ab37c-cust-7000-8000-000000000001","description":"Overcharged on invoice #INV-001","has_applications":false,"id":"019ab37c-cm01-7000-8000-000000000001","issue_date":"2026-01-07","number":"CM-001","reason":"pricing_error","reason_display":"Pricing Error","status":"issued"}},"CreditMemoStatusEnum":{"type":"string","enum":["draft","issued","applied","partially_applied","void"],"title":"CreditMemoStatusEnum","description":"Credit memo status values."},"CreditMemoSuggestionItem":{"properties":{"customer_id":{"type":"string","title":"Customer Id","description":"Customer ID"},"customer_name":{"type":"string","title":"Customer Name","description":"Customer name"},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id","description":"Related invoice ID"},"reason":{"type":"string","title":"Reason","description":"Reason for credit memo"},"suggested_amount":{"type":"integer","title":"Suggested Amount","description":"Suggested amount in cents"},"pattern":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pattern","description":"Pattern detected"}},"type":"object","required":["customer_id","customer_name","reason","suggested_amount"],"title":"CreditMemoSuggestionItem"},"CreditMemoUpdate":{"properties":{"amount_cents":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Amount Cents","description":"Credit amount in cents"},"reason":{"anyOf":[{"$ref":"#/components/schemas/CreditMemoReasonEnum"},{"type":"null"}],"description":"Reason for the credit memo"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the credit"},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id","description":"Original invoice being credited"},"issue_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issue Date","description":"Issue date"},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/CreditMemoLineItem"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Line items for credit detail"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes","description":"Internal notes"}},"type":"object","title":"CreditMemoUpdate","description":"Request schema for updating a credit memo (draft only)."},"CreditMemoVoid":{"properties":{"reason":{"type":"string","minLength":1,"title":"Reason","description":"Reason for voiding"}},"type":"object","required":["reason"],"title":"CreditMemoVoid","description":"Request schema for voiding a credit memo.","example":{"reason":"Issued in error - customer already refunded"}},"CreditMemosListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CreditMemoResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"CreditMemosListResponse","description":"Paginated list of credit memos."},"CursorPaginatedResponse_DeckListItem_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DeckListItem"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"CursorPaginatedResponse[DeckListItem]"},"CustomBucketCreateRequest":{"properties":{"key":{"type":"string","maxLength":40,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Key","description":"Unique slug for the bucket (lowercase, underscores allowed)"},"label":{"type":"string","maxLength":100,"minLength":1,"title":"Label","description":"Display name for the bucket"},"color":{"type":"string","maxLength":20,"title":"Color","description":"Color theme: green, orange, indigo, accent, gray","default":"gray"},"classification":{"type":"string","maxLength":40,"title":"Classification","description":"Bucket classification: operating_revenue, cogs, operating_expense, other_income, other_expense","default":"operating_expense"},"sort_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Sort Order","default":100}},"type":"object","required":["key","label"],"title":"CustomBucketCreateRequest","description":"Request payload for creating a new custom managerial bucket."},"CustomBucketResponse":{"properties":{"id":{"type":"string","title":"Id"},"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"color":{"type":"string","title":"Color"},"classification":{"type":"string","title":"Classification"},"sort_order":{"type":"integer","title":"Sort Order"},"is_active":{"type":"boolean","title":"Is Active"},"is_default":{"type":"boolean","title":"Is Default","description":"True for built-in default buckets","default":false},"can_delete":{"type":"boolean","title":"Can Delete","description":"Whether the bucket can be deleted from Recipe Book. Some built-in buckets are locked.","default":true}},"type":"object","required":["id","key","label","color","classification","sort_order","is_active"],"title":"CustomBucketResponse","description":"A managerial bucket (built-in or custom).\n\nBuilt-in buckets have stable ``key`` values; optional ``label`` /\n``color`` edits come from per-business display overrides."},"CustomBucketUpdateRequest":{"properties":{"label":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Label","description":"Display name for the bucket"},"color":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Color","description":"Color theme: green, orange, indigo, accent, gray"},"classification":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Classification","description":"Bucket classification: operating_revenue, cogs, operating_expense, other_income, other_expense"},"sort_order":{"anyOf":[{"type":"integer","maximum":999.0,"minimum":0.0},{"type":"null"}],"title":"Sort Order"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"CustomBucketUpdateRequest","description":"Request payload for updating a custom managerial bucket."},"CustomBucketsListResponse":{"properties":{"buckets":{"items":{"$ref":"#/components/schemas/CustomBucketResponse"},"type":"array","title":"Buckets"}},"type":"object","required":["buckets"],"title":"CustomBucketsListResponse","description":"Response containing all buckets (default + custom) for a business."},"CustomCoaLedger":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Ledger name"},"type":{"type":"string","title":"Type","description":"Ledger type: asset, liability, equity, revenue, expense"},"sub_type":{"type":"string","title":"Sub Type","description":"Ledger sub-type: current_assets, non-current_assets, transfers_between_accounts, uncategorized_assets, current_liabilities, non-current_liabilities, equity, operating_revenues, other_income, cost_of_goods_sold, operating_expenses, other_expenses"},"sort_code":{"type":"string","maxLength":20,"title":"Sort Code","description":"Numeric sort code for ordering (digits only, max 20 chars)"},"debit_credit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Debit Credit","description":"Debit/credit behavior: debit, credit. Optional - Teal auto-determines based on ledger type."},"report_cash_flow":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Report Cash Flow","description":"Include in cash flow reports. Optional."},"editable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Editable","description":"Whether line entries can be manually added or removed","default":true},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Ledger description"},"financial_account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Account Type","description":"Financial account type for Templated Mode. Options: bank_account, credit_card, payments, payroll, loan, prepaid_card, accounts_receivable, accounts_payable"}},"type":"object","required":["name","type","sub_type","sort_code"],"title":"CustomCoaLedger","description":"Schema for a ledger definition in a custom COA template.\n\nPer the Teal API (https://docs.teal.dev/api-reference/instances/create-an-instance),\nonly name, type, sub_type, and sort_code are required. Teal automatically determines\ndebit_credit based on the ledger type."},"CustomCoaTemplate":{"properties":{"ledgers":{"items":{"$ref":"#/components/schemas/CustomCoaLedger"},"type":"array","minItems":1,"title":"Ledgers","description":"List of ledger definitions for the custom COA"}},"type":"object","required":["ledgers"],"title":"CustomCoaTemplate","description":"Schema for a custom COA template that defines all ledgers."},"CustomSlideData":{"properties":{"markdown":{"type":"string","maxLength":8000,"title":"Markdown"}},"additionalProperties":false,"type":"object","required":["markdown"],"title":"CustomSlideData"},"CustomSlideSpec":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"custom","title":"Slide Type","default":"custom"},"data":{"$ref":"#/components/schemas/CustomSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"CustomSlideSpec"},"CustomerAutoCategorizeResponse":{"properties":{"submitted":{"type":"integer","title":"Submitted","description":"Number of uncategorized customers submitted for AI categorization."},"status":{"type":"string","title":"Status","description":"`processing` if work was scheduled, `noop` if there was nothing to do.","default":"processing"}},"type":"object","required":["submitted"],"title":"CustomerAutoCategorizeResponse","description":"Response for the bulk auto-categorize endpoint.\n\nThe request returns immediately after scheduling; the AI categorization\nruns as a background task and writes results to the database. Clients\nshould refresh the customers list to observe progress."},"CustomerBulkRowError":{"properties":{"row":{"type":"integer","title":"Row","description":"1-based row number from the CSV."},"error":{"type":"string","title":"Error","description":"Description of the validation error."}},"type":"object","required":["row","error"],"title":"CustomerBulkRowError","description":"Error detail for a single row in a bulk upload."},"CustomerBulkUploadResponse":{"properties":{"created":{"type":"integer","title":"Created","description":"Number of customers successfully created.","default":0},"skipped":{"type":"integer","title":"Skipped","description":"Number of rows skipped (duplicates).","default":0},"errors":{"items":{"$ref":"#/components/schemas/CustomerBulkRowError"},"type":"array","title":"Errors","description":"Per-row validation errors."}},"type":"object","title":"CustomerBulkUploadResponse","description":"Response for bulk customer CSV upload."},"CustomerConcentrationRow":{"properties":{"customer_name":{"type":"string","title":"Customer Name"},"revenue_cents":{"type":"integer","title":"Revenue Cents"},"pct_of_revenue":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Pct Of Revenue"}},"additionalProperties":false,"type":"object","required":["customer_name","revenue_cents","pct_of_revenue"],"title":"CustomerConcentrationRow"},"CustomerConcentrationSlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"customer_concentration","title":"Slide Type","default":"customer_concentration"},"data":{"$ref":"#/components/schemas/CustomerConcentrationSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"CustomerConcentrationSlide"},"CustomerConcentrationSlideData":{"properties":{"total_revenue_cents":{"type":"integer","title":"Total Revenue Cents"},"top_customers":{"items":{"$ref":"#/components/schemas/CustomerConcentrationRow"},"type":"array","maxItems":12,"title":"Top Customers"},"concentration_index":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Concentration Index"}},"additionalProperties":false,"type":"object","required":["total_revenue_cents"],"title":"CustomerConcentrationSlideData"},"CustomerContactResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Contact UUID."},"customer_id":{"type":"string","title":"Customer Id","description":"Customer UUID."},"name":{"type":"string","title":"Name","description":"Contact name."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Contact email."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Contact phone."},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role","description":"Contact role (e.g., 'Billing', 'Technical')."},"is_primary":{"type":"boolean","title":"Is Primary","description":"Whether this is the primary contact.","default":false},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Notes about this contact."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."}},"type":"object","required":["id","customer_id","name","created_at","updated_at"],"title":"CustomerContactResponse","description":"Response schema for a customer contact."},"CustomerCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"title":"Name","description":"Customer name (person or company)."},"email":{"type":"string","format":"email","title":"Email","description":"Customer email for invoices and communications."},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Address","description":"Customer billing/shipping address."},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone","description":"Customer phone number."},"tax_id":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Tax Id","description":"Tax identification number (EIN, VAT, etc.)."},"website":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Website","description":"Customer website URL."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Internal notes about this customer."},"credit_limit_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Credit Limit Cents","description":"Credit limit in cents (e.g., 100000 = $1,000.00)."},"default_payment_term_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Payment Term Id","description":"Default payment term ID for new invoices."},"status":{"$ref":"#/components/schemas/CounterpartyStatus","description":"Customer status (active, inactive, blocked).","default":"active"},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category","description":"Business category (e.g., 'Retail', 'Wholesale')."},"invoice_footer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Footer","description":"Custom invoice footer/payment instructions for this customer. Overrides business default."}},"type":"object","required":["name","email"],"title":"CustomerCreateRequest","description":"Request schema for creating a new customer.\n\nCustomers are the people or companies you sell to and invoice.\nSupports credit limits, default payment terms, tax IDs, and categorization.","example":{"address":"123 Main Street, Suite 100, San Francisco, CA 94102","category":"Wholesale","credit_limit_cents":1000000,"email":"billing@acme.com","name":"Acme Corporation","notes":"Preferred customer, always pays on time","phone":"(555) 123-4567","status":"active","tax_id":"12-3456789","website":"https://acme.com"}},"CustomerCreditSummary":{"properties":{"customer_id":{"type":"string","title":"Customer Id","description":"Customer ID"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name","description":"Customer display name"},"total_credits_available":{"type":"integer","title":"Total Credits Available","description":"Total available credits in cents"},"total_credits_available_dollars":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total Credits Available Dollars","description":"Total available credits in dollars"},"credit_memos_count":{"type":"integer","title":"Credit Memos Count","description":"Number of credit memos with available balance"},"credit_memos":{"items":{"$ref":"#/components/schemas/CreditMemoResponse"},"type":"array","title":"Credit Memos","description":"Credit memos with available balance"}},"type":"object","required":["customer_id","total_credits_available","total_credits_available_dollars","credit_memos_count"],"title":"CustomerCreditSummary","description":"Summary of available credits for a customer."},"CustomerListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CustomerResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"CustomerListResponse","description":"Paginated list of customers with cursor-based navigation."},"CustomerPendingChargesSummary":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"total_charges":{"type":"integer","title":"Total Charges","description":"Total pending charges in cents","default":0},"total_credits":{"type":"integer","title":"Total Credits","description":"Total pending credits in cents","default":0},"net_amount":{"type":"integer","title":"Net Amount","description":"Net amount (charges - credits) in cents","default":0},"count":{"type":"integer","title":"Count","description":"Number of pending items","default":0},"items":{"items":{"$ref":"#/components/schemas/DelayedChargeResponse"},"type":"array","title":"Items"}},"type":"object","required":["customer_id"],"title":"CustomerPendingChargesSummary","description":"Summary of pending charges for a customer."},"CustomerResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Customer UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"name":{"type":"string","title":"Name","description":"Customer name."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Customer email."},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"Customer address."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Customer phone number."},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id","description":"Tax identification number."},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website","description":"Customer website URL."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Internal notes."},"credit_limit_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credit Limit Cents","description":"Credit limit in cents."},"default_payment_term_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Payment Term Id","description":"Default payment term ID."},"status":{"type":"string","title":"Status","description":"Customer status.","default":"active"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Business category."},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Whether customer is soft deleted.","default":false},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"Timestamp when customer was deleted."},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id","description":"Linked Stripe customer ID."},"invoice_footer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Footer","description":"Custom invoice footer/payment instructions for this customer."},"contacts":{"anyOf":[{"items":{"$ref":"#/components/schemas/CustomerContactResponse"},"type":"array"},{"type":"null"}],"title":"Contacts","description":"Customer contacts."}},"additionalProperties":true,"type":"object","required":["id","business_id","created_at","updated_at","name"],"title":"CustomerResponse","description":"Response schema for a customer.\n\nContains customer details and any linked external IDs.","example":{"address":"123 Main Street, Suite 100, San Francisco, CA 94102","business_id":"019ab37c-bus1-7000-8000-000000000001","category":"Wholesale","created_at":"2024-01-10T10:30:00Z","credit_limit_cents":1000000,"email":"billing@acme.com","id":"019ab37c-cust-7000-8000-000000000001","name":"Acme Corporation","phone":"(555) 123-4567","status":"active","stripe_customer_id":"cus_Abc123XYZ","tax_id":"12-3456789","updated_at":"2024-01-15T14:00:00Z","website":"https://acme.com"}},"CustomerStatementResponse":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"customer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Email"},"customer_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Address"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"},"as_of_date":{"type":"string","format":"date","title":"As Of Date"},"opening_balance":{"type":"integer","title":"Opening Balance"},"lines":{"items":{"$ref":"#/components/schemas/StatementLine"},"type":"array","title":"Lines"},"total_charges":{"type":"integer","title":"Total Charges"},"total_payments":{"type":"integer","title":"Total Payments"},"closing_balance":{"type":"integer","title":"Closing Balance"},"aging":{"$ref":"#/components/schemas/StatementAging"}},"type":"object","required":["customer_id","start_date","end_date","as_of_date","opening_balance","lines","total_charges","total_payments","closing_balance","aging"],"title":"CustomerStatementResponse","description":"A fully assembled customer statement."},"CustomerSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["id"],"title":"CustomerSummary","description":"Summary of customer for response."},"CustomerUpdateRequest":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Customer UUID (set from URL path)."},"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name","description":"Updated customer name."},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email","description":"Updated email address."},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Address","description":"Updated address."},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone","description":"Updated phone number."},"tax_id":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Tax Id","description":"Updated tax ID."},"website":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Website","description":"Updated website URL."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Updated internal notes."},"credit_limit_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Credit Limit Cents","description":"Updated credit limit in cents."},"default_payment_term_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Payment Term Id","description":"Updated default payment term ID."},"status":{"anyOf":[{"$ref":"#/components/schemas/CounterpartyStatus"},{"type":"null"}],"description":"Updated status."},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category","description":"Updated category."},"invoice_footer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Footer","description":"Custom invoice footer/payment instructions for this customer."}},"type":"object","title":"CustomerUpdateRequest","description":"Request schema for updating a customer.\n\nAll fields are optional - only include fields you want to change.","example":{"address":"456 New Street, Floor 5, San Francisco, CA 94103","credit_limit_cents":2000000,"name":"Acme Corporation Inc."}},"CycleCountLineResponse":{"properties":{"id":{"type":"string","title":"Id"},"count_id":{"type":"string","title":"Count Id"},"variant_id":{"type":"string","title":"Variant Id"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"barcode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Barcode"},"expected_quantity":{"type":"number","title":"Expected Quantity","default":0},"counted_quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Counted Quantity"},"variance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Variance"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"adjustment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Adjustment Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"additionalProperties":true,"type":"object","required":["id","count_id","variant_id"],"title":"CycleCountLineResponse"},"CycleCountResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"count_number":{"type":"string","title":"Count Number"},"location_id":{"type":"string","title":"Location Id"},"status":{"type":"string","title":"Status"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"posted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Posted At"},"counted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counted By User Id"},"posted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted By User Id"},"variance_line_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Variance Line Count"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"lines":{"items":{"$ref":"#/components/schemas/CycleCountLineResponse"},"type":"array","title":"Lines","default":[]}},"additionalProperties":true,"type":"object","required":["id","business_id","count_number","location_id","status"],"title":"CycleCountResponse"},"DailyBriefAnomaliesTile":{"properties":{"status":{"$ref":"#/components/schemas/JsonValue"},"count":{"type":"integer","title":"Count"},"by_severity":{"$ref":"#/components/schemas/JsonValue"},"top":{"items":{"$ref":"#/components/schemas/DailyBriefAnomalyRow"},"type":"array","title":"Top"},"last_scanned":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Scanned"}},"additionalProperties":true,"type":"object","required":["status","count","by_severity","top"],"title":"DailyBriefAnomaliesTile","description":"Frontend type ``DailyBriefAnomaliesTile``."},"DailyBriefAnomalyRow":{"properties":{"fingerprint":{"type":"string","title":"Fingerprint"},"anomaly_type":{"type":"string","title":"Anomaly Type"},"severity":{"$ref":"#/components/schemas/JsonValue"},"description":{"type":"string","title":"Description"},"recommended_action":{"anyOf":[{"$ref":"#/components/schemas/DailyBriefRecommendedAction"},{"type":"null"}]}},"additionalProperties":true,"type":"object","required":["fingerprint","anomaly_type","severity","description"],"title":"DailyBriefAnomalyRow","description":"Frontend type ``DailyBriefAnomalyRow``."},"DailyBriefApDraftRow":{"properties":{"bill_id":{"type":"string","title":"Bill Id"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"amount_cents":{"type":"integer","title":"Amount Cents"},"description":{"type":"string","title":"Description"},"due_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due On"}},"additionalProperties":true,"type":"object","required":["bill_id","amount_cents","description"],"title":"DailyBriefApDraftRow","description":"Frontend type ``DailyBriefApDraftRow``."},"DailyBriefApDraftsTile":{"properties":{"status":{"$ref":"#/components/schemas/JsonValue"},"count":{"type":"integer","title":"Count"},"total_cents":{"type":"integer","title":"Total Cents"},"top":{"items":{"$ref":"#/components/schemas/DailyBriefApDraftRow"},"type":"array","title":"Top"}},"additionalProperties":true,"type":"object","required":["status","count","total_cents","top"],"title":"DailyBriefApDraftsTile","description":"Frontend type ``DailyBriefApDraftsTile``."},"DailyBriefCategorizationTile":{"properties":{"status":{"$ref":"#/components/schemas/JsonValue"},"auto_categorized_today":{"type":"number","title":"Auto Categorized Today"},"sent_to_review_today":{"type":"number","title":"Sent To Review Today"},"top_rule":{"anyOf":[{"$ref":"#/components/schemas/DailyBriefTopRule"},{"type":"null"}]}},"additionalProperties":true,"type":"object","required":["status","auto_categorized_today","sent_to_review_today"],"title":"DailyBriefCategorizationTile","description":"Frontend type ``DailyBriefCategorizationTile``."},"DailyBriefCloseScoreTile":{"properties":{"status":{"$ref":"#/components/schemas/JsonValue"},"current":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current"},"previous":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Previous"},"delta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Delta"},"color":{"$ref":"#/components/schemas/JsonValue"},"blockers_count":{"type":"number","title":"Blockers Count"},"period_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Id"},"period_display":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Display"}},"additionalProperties":true,"type":"object","required":["status","color","blockers_count"],"title":"DailyBriefCloseScoreTile","description":"Frontend type ``DailyBriefCloseScoreTile``."},"DailyBriefRecommendedAction":{"properties":{"action":{"type":"string","title":"Action"},"label":{"type":"string","title":"Label"},"savings_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Savings Cents"},"params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Params"}},"additionalProperties":true,"type":"object","required":["action","label"],"title":"DailyBriefRecommendedAction","description":"Recommended action payload on an anomaly row."},"DailyBriefResponse":{"properties":{"as_of":{"type":"string","title":"As Of"},"business_id":{"type":"string","title":"Business Id"},"categorization":{"$ref":"#/components/schemas/DailyBriefCategorizationTile"},"ap_drafts":{"$ref":"#/components/schemas/DailyBriefApDraftsTile"},"anomalies":{"$ref":"#/components/schemas/DailyBriefAnomaliesTile"},"close_score":{"$ref":"#/components/schemas/DailyBriefCloseScoreTile"}},"additionalProperties":true,"type":"object","required":["as_of","business_id","categorization","ap_drafts","anomalies","close_score"],"title":"DailyBriefResponse","description":"Frontend type ``DailyBriefResponse``."},"DailyBriefTopRule":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"match_count":{"type":"number","title":"Match Count"}},"additionalProperties":true,"type":"object","required":["id","name","match_count"],"title":"DailyBriefTopRule","description":"Top firing bank rule nested under the categorization tile."},"DateRangeDeletedCounts":{"properties":{"transactions":{"type":"integer","title":"Transactions","description":"Transactions permanently removed.","default":0},"journal_entries":{"type":"integer","title":"Journal Entries","description":"Orphaned journal entries removed (no longer referenced).","default":0}},"type":"object","title":"DateRangeDeletedCounts","description":"Local DB deletion counts for a date-range delete."},"DebtContractApproveRequest":{"properties":{"contract":{"$ref":"#/components/schemas/ParsedDebtContract","description":"Parsed contract payload returned by the parse endpoint."},"contract_s3_key":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Contract S3 Key","description":"S3 key of the original uploaded contract; persisted on the debt instrument for later retrieval."}},"type":"object","required":["contract"],"title":"DebtContractApproveRequest","description":"Request payload for approving a parsed lending contract."},"DebtContractApproveResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"lender":{"type":"string","title":"Lender"}},"type":"object","required":["id","name","lender"],"title":"DebtContractApproveResponse","description":"Response payload after persisting an approved parsed contract."},"DebtContractParseRequest":{"properties":{"s3_key":{"type":"string","maxLength":1024,"minLength":1,"title":"S3 Key","description":"S3 key of the uploaded debt contract document."}},"type":"object","required":["s3_key"],"title":"DebtContractParseRequest","description":"Request payload for parsing a lending/debt contract file."},"DebtPaymentRequest":{"properties":{"payment_amount_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Payment Amount Cents","description":"Total payment amount in cents (split into principal + interest)."},"cash_ledger_id":{"type":"string","minLength":1,"title":"Cash Ledger Id","description":"Bank/cash ledger the money moves through — paid from (debt we owe) or received into (a note receivable)."},"payment_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Payment Date","description":"Payment date (defaults to today)."},"memo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Memo"}},"type":"object","required":["payment_amount_cents","cash_ledger_id"],"title":"DebtPaymentRequest","description":"Request payload for recording a payment against a debt instrument."},"DebtPaymentResponse":{"properties":{"journal_entry_id":{"type":"string","title":"Journal Entry Id"},"principal_cents":{"type":"integer","title":"Principal Cents"},"interest_cents":{"type":"integer","title":"Interest Cents"},"remaining_balance_cents":{"type":"integer","title":"Remaining Balance Cents"},"name":{"type":"string","title":"Name"},"direction":{"type":"string","title":"Direction"}},"type":"object","required":["journal_entry_id","principal_cents","interest_cents","remaining_balance_cents","name","direction"],"title":"DebtPaymentResponse","description":"Result of posting a loan payment."},"DeckListItem":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period End"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"slide_count":{"type":"integer","title":"Slide Count"}},"additionalProperties":false,"type":"object","required":["id","title","created_at","slide_count"],"title":"DeckListItem","description":"Skinny projection used by the list endpoint — no slide payload."},"DeckShareList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DeckShareListItem"},"type":"array","title":"Items"}},"additionalProperties":false,"type":"object","title":"DeckShareList"},"DeckShareListItem":{"properties":{"id":{"type":"string","title":"Id"},"deck_id":{"type":"string","title":"Deck Id"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"view_count":{"type":"integer","title":"View Count","default":0},"last_viewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Viewed At"}},"additionalProperties":false,"type":"object","required":["id","deck_id","created_at"],"title":"DeckShareListItem","description":"Skinny listing of existing shares for a deck — no raw token."},"DeckSpec":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"title":{"type":"string","title":"Title"},"period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period End"},"slides":{"items":{"oneOf":[{"$ref":"#/components/schemas/CoverSlide"},{"$ref":"#/components/schemas/ExecSummarySlide"},{"$ref":"#/components/schemas/PnlSummarySlide"},{"$ref":"#/components/schemas/ArAgingSlide"},{"$ref":"#/components/schemas/CashPositionSlide"},{"$ref":"#/components/schemas/InventoryCogsSlide"},{"$ref":"#/components/schemas/CustomerConcentrationSlide"},{"$ref":"#/components/schemas/AsksSlide"},{"$ref":"#/components/schemas/CustomSlideSpec"}],"discriminator":{"propertyName":"slide_type","mapping":{"ar_aging":"#/components/schemas/ArAgingSlide","asks":"#/components/schemas/AsksSlide","cash_position":"#/components/schemas/CashPositionSlide","cover":"#/components/schemas/CoverSlide","custom":"#/components/schemas/CustomSlideSpec","customer_concentration":"#/components/schemas/CustomerConcentrationSlide","exec_summary":"#/components/schemas/ExecSummarySlide","inventory_cogs":"#/components/schemas/InventoryCogsSlide","pnl_summary":"#/components/schemas/PnlSummarySlide"}}},"type":"array","maxItems":40,"title":"Slides"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"theme":{"anyOf":[{"$ref":"#/components/schemas/DeckTheme"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["id","business_id","title","created_at"],"title":"DeckSpec","description":"The full deck payload — exactly what the FE renderer consumes."},"DeckTheme":{"properties":{"accent_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accent Color"},"cover_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cover Image Url"}},"additionalProperties":false,"type":"object","title":"DeckTheme"},"DelayedChargeCreate":{"properties":{"type":{"type":"string","title":"Type","description":"Type: 'charge' or 'credit'","default":"charge"},"customer_id":{"type":"string","title":"Customer Id","description":"Customer to charge"},"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Amount in cents"},"description":{"type":"string","minLength":1,"title":"Description","description":"Description"},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/DelayedChargeLineItem"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Optional line items"},"service_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Date","description":"Date service was performed (YYYY-MM-DD)"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes","description":"Internal notes"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Currency code","default":"USD"}},"type":"object","required":["customer_id","amount","description"],"title":"DelayedChargeCreate","description":"Request schema for creating a delayed charge."},"DelayedChargeLineItem":{"properties":{"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Product variant ID or null for custom"},"description":{"type":"string","title":"Description","description":"Line item description"},"quantity":{"type":"integer","minimum":1.0,"title":"Quantity","description":"Quantity","default":1},"unit_price":{"type":"integer","title":"Unit Price","description":"Unit price in cents"},"amount":{"type":"integer","title":"Amount","description":"Total amount in cents (qty * unit_price)"}},"type":"object","required":["description","unit_price","amount"],"title":"DelayedChargeLineItem","description":"Line item for a delayed charge."},"DelayedChargeResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"customer_id":{"type":"string","title":"Customer Id"},"type":{"type":"string","title":"Type"},"status":{"type":"string","title":"Status"},"currency":{"type":"string","title":"Currency"},"amount":{"type":"integer","title":"Amount"},"amount_in_dollars":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount In Dollars"},"description":{"type":"string","title":"Description"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes"},"line_items":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Line Items"},"service_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Service Date"},"invoiced_invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoiced Invoice Id"},"invoiced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Invoiced At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"can_be_updated":{"type":"boolean","title":"Can Be Updated","default":false},"can_be_deleted":{"type":"boolean","title":"Can Be Deleted","default":false},"can_be_invoiced":{"type":"boolean","title":"Can Be Invoiced","default":false}},"type":"object","required":["id","business_id","customer_id","type","status","currency","amount","amount_in_dollars","description","created_at","updated_at"],"title":"DelayedChargeResponse","description":"Response schema for a delayed charge."},"DelayedChargeStatusEnum":{"type":"string","enum":["pending","invoiced"],"title":"DelayedChargeStatusEnum","description":"Delayed charge status values."},"DelayedChargeTypeEnum":{"type":"string","enum":["charge","credit"],"title":"DelayedChargeTypeEnum","description":"Delayed charge type."},"DelayedChargeUpdate":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"Type: 'charge' or 'credit'"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id","description":"Customer ID"},"amount":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Amount","description":"Amount in cents"},"description":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Description","description":"Description"},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/DelayedChargeLineItem"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Line items"},"service_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Date","description":"Service date (YYYY-MM-DD)"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes","description":"Internal notes"}},"type":"object","title":"DelayedChargeUpdate","description":"Request schema for updating a delayed charge (pending only)."},"DelayedChargesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DelayedChargeResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"DelayedChargesListResponse","description":"Paginated list of delayed charges."},"DemandPlanScenarioOneTime":{"properties":{"label":{"type":"string","maxLength":200,"minLength":1,"title":"Label"},"amount_cents":{"type":"integer","title":"Amount Cents"},"applies_on":{"type":"string","format":"date","title":"Applies On"}},"type":"object","required":["label","amount_cents","applies_on"],"title":"DemandPlanScenarioOneTime","description":"One inline one-time item to model in a scenario only."},"DemandPlanScenarioOverride":{"properties":{"week_number":{"type":"integer","maximum":104.0,"minimum":0.0,"title":"Week Number"},"column":{"type":"string","enum":["ar_in","ap_out","inventory","debt","budget_rev","budget_exp","one_time"],"title":"Column"},"amount_cents":{"type":"integer","title":"Amount Cents"}},"type":"object","required":["week_number","column","amount_cents"],"title":"DemandPlanScenarioOverride","description":"One cell override for an HTTP scenario evaluation request.\n\n``week_number=0`` targets the Overdue row; ``1..weeks`` targets a\nweekly cell. ``amount_cents`` is the literal value to use."},"DemandPlanScenarioRequest":{"properties":{"scenario_description":{"type":"string","maxLength":400,"minLength":1,"title":"Scenario Description"},"overrides":{"items":{"$ref":"#/components/schemas/DemandPlanScenarioOverride"},"type":"array","title":"Overrides"},"inline_one_time_items":{"items":{"$ref":"#/components/schemas/DemandPlanScenarioOneTime"},"type":"array","title":"Inline One Time Items"},"weeks":{"type":"integer","maximum":52.0,"minimum":1.0,"title":"Weeks","default":13},"budget_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Budget Id"},"excluded_budget_ledger_ids":{"items":{"type":"string"},"type":"array","title":"Excluded Budget Ledger Ids"}},"type":"object","required":["scenario_description"],"title":"DemandPlanScenarioRequest","description":"Inputs to ``POST /cfo-portal/cash-forecast/demand-plan``."},"DemandPlanScenarioResponse":{"properties":{"scenario_description":{"type":"string","title":"Scenario Description"},"weeks":{"items":{"$ref":"#/components/schemas/CashForecastWeek"},"type":"array","title":"Weeks"},"week_deltas":{"items":{"$ref":"#/components/schemas/DemandPlanWeekDelta"},"type":"array","title":"Week Deltas"},"starting_cash_cents":{"type":"integer","title":"Starting Cash Cents"},"baseline_ending_cash_cents":{"type":"integer","title":"Baseline Ending Cash Cents"},"scenario_ending_cash_cents":{"type":"integer","title":"Scenario Ending Cash Cents"},"ending_cash_delta_cents":{"type":"integer","title":"Ending Cash Delta Cents"},"baseline_lowest_cash_cents":{"type":"integer","title":"Baseline Lowest Cash Cents"},"scenario_lowest_cash_cents":{"type":"integer","title":"Scenario Lowest Cash Cents"},"lowest_cash_delta_cents":{"type":"integer","title":"Lowest Cash Delta Cents"},"baseline_lowest_cash_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Baseline Lowest Cash Week"},"scenario_lowest_cash_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scenario Lowest Cash Week"},"headline":{"type":"string","title":"Headline"},"narrative":{"type":"string","title":"Narrative"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"}},"type":"object","required":["scenario_description","weeks","week_deltas","starting_cash_cents","baseline_ending_cash_cents","scenario_ending_cash_cents","ending_cash_delta_cents","baseline_lowest_cash_cents","scenario_lowest_cash_cents","lowest_cash_delta_cents","headline","narrative"],"title":"DemandPlanScenarioResponse","description":"Structured demand-plan scenario output (cents-based).\n\nMirrors the AI tool's output shape but returns integer cents\ninstead of formatted currency strings so the frontend can render\nconsistently with the rest of the cash-forecast UI."},"DemandPlanWeekDelta":{"properties":{"week":{"type":"integer","title":"Week"},"start_date":{"type":"string","format":"date","title":"Start Date"},"baseline_ending_cash_cents":{"type":"integer","title":"Baseline Ending Cash Cents"},"scenario_ending_cash_cents":{"type":"integer","title":"Scenario Ending Cash Cents"},"delta_cents":{"type":"integer","title":"Delta Cents"}},"type":"object","required":["week","start_date","baseline_ending_cash_cents","scenario_ending_cash_cents","delta_cents"],"title":"DemandPlanWeekDelta","description":"One week of baseline-vs-scenario comparison."},"DepositCandidateItem":{"properties":{"id":{"type":"string","title":"Id"},"amount":{"type":"integer","title":"Amount"},"unallocated":{"type":"integer","title":"Unallocated"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty"},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"already_linked_invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Already Linked Invoice Id"}},"additionalProperties":true,"type":"object","required":["id","amount","unallocated"],"title":"DepositCandidateItem","description":"Income transaction eligible as a customer deposit."},"DepreciationEntryListResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/DepreciationEntryResponse"},"type":"array","title":"Entries","description":"Depreciation entries"},"count":{"type":"integer","title":"Count","description":"Total number of entries"}},"type":"object","required":["count"],"title":"DepreciationEntryListResponse","description":"Schema for listing depreciation entries."},"DepreciationEntryResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Depreciation entry ID"},"fixed_asset_id":{"type":"string","title":"Fixed Asset Id","description":"Asset this entry belongs to"},"period_date":{"type":"string","format":"date","title":"Period Date","description":"First day of the depreciation period"},"depreciation_amount":{"type":"integer","title":"Depreciation Amount","description":"Depreciation for this period, in cents"},"accumulated_depreciation":{"type":"integer","title":"Accumulated Depreciation","description":"Cumulative depreciation after this period, in cents"},"book_value":{"type":"integer","title":"Book Value","description":"Book value after this period, in cents"},"units_this_period":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Units This Period","description":"Units used this period (units-of-production only)"},"journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Id","description":"Associated journal entry ID"},"status":{"$ref":"#/components/schemas/DepreciationEntryStatus","description":"Entry status: pending, posted, reversed"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Record creation timestamp"}},"type":"object","required":["id","fixed_asset_id","period_date","depreciation_amount","accumulated_depreciation","book_value","status","created_at"],"title":"DepreciationEntryResponse","description":"Schema for depreciation entry response."},"DepreciationEntryStatus":{"type":"string","enum":["pending","posted","reversed"],"title":"DepreciationEntryStatus","description":"Status of a depreciation entry."},"DepreciationMethod":{"type":"string","enum":["straight_line","declining_balance","double_declining","units_of_production"],"title":"DepreciationMethod","description":"Depreciation calculation methods."},"DepreciationPreviewEntry":{"properties":{"asset_id":{"type":"string","title":"Asset Id","description":"Asset ID"},"asset_name":{"type":"string","title":"Asset Name","description":"Asset name"},"depreciation_amount":{"type":"integer","title":"Depreciation Amount","description":"Projected depreciation in cents"},"new_accumulated":{"type":"integer","title":"New Accumulated","description":"Projected accumulated depreciation in cents"},"new_book_value":{"type":"integer","title":"New Book Value","description":"Projected book value after depreciation in cents"}},"type":"object","required":["asset_id","asset_name","depreciation_amount","new_accumulated","new_book_value"],"title":"DepreciationPreviewEntry","description":"Preview of depreciation for one asset."},"DepreciationPreviewResponse":{"properties":{"period_date":{"type":"string","format":"date","title":"Period Date","description":"Period to preview"},"assets_count":{"type":"integer","title":"Assets Count","description":"Number of assets included"},"total_depreciation":{"type":"integer","title":"Total Depreciation","description":"Total projected depreciation in cents"},"entries":{"items":{"$ref":"#/components/schemas/DepreciationPreviewEntry"},"type":"array","title":"Entries","description":"Per-asset depreciation preview"}},"type":"object","required":["period_date","assets_count","total_depreciation","entries"],"title":"DepreciationPreviewResponse","description":"Preview of next depreciation run."},"DepreciationScheduleEntry":{"properties":{"period":{"type":"integer","title":"Period","description":"Period number (1-based)"},"period_date":{"type":"string","format":"date","title":"Period Date","description":"First day of the period"},"beginning_book_value":{"type":"integer","title":"Beginning Book Value","description":"Book value at start of period, in cents"},"depreciation_amount":{"type":"integer","title":"Depreciation Amount","description":"Depreciation for this period, in cents"},"accumulated_depreciation":{"type":"integer","title":"Accumulated Depreciation","description":"Cumulative depreciation, in cents"},"ending_book_value":{"type":"integer","title":"Ending Book Value","description":"Book value at end of period, in cents"}},"type":"object","required":["period","period_date","beginning_book_value","depreciation_amount","accumulated_depreciation","ending_book_value"],"title":"DepreciationScheduleEntry","description":"A single entry in a depreciation schedule."},"DepreciationScheduleResponse":{"properties":{"asset_id":{"type":"string","title":"Asset Id","description":"Asset ID"},"asset_name":{"type":"string","title":"Asset Name","description":"Asset name"},"original_cost":{"type":"integer","title":"Original Cost","description":"Original purchase cost in cents"},"salvage_value":{"type":"integer","title":"Salvage Value","description":"Estimated salvage value in cents"},"useful_life_months":{"type":"integer","title":"Useful Life Months","description":"Useful life in months"},"depreciation_method":{"$ref":"#/components/schemas/DepreciationMethod","description":"Depreciation method used"},"schedule":{"items":{"$ref":"#/components/schemas/DepreciationScheduleEntry"},"type":"array","title":"Schedule","description":"Period-by-period depreciation schedule"}},"type":"object","required":["asset_id","asset_name","original_cost","salvage_value","useful_life_months","depreciation_method","schedule"],"title":"DepreciationScheduleResponse","description":"Full depreciation schedule for an asset."},"DetectedEntities":{"properties":{"locations":{"items":{"$ref":"#/components/schemas/DetectedLocation"},"type":"array","title":"Locations"},"categories":{"items":{"type":"string"},"type":"array","title":"Categories"},"products":{"items":{"$ref":"#/components/schemas/DetectedProduct"},"type":"array","title":"Products"}},"type":"object","title":"DetectedEntities"},"DetectedLocation":{"properties":{"name":{"type":"string","title":"Name"},"source_sheets":{"items":{"type":"string"},"type":"array","title":"Source Sheets"},"type":{"type":"string","title":"Type","default":"warehouse"}},"type":"object","required":["name"],"title":"DetectedLocation"},"DetectedProduct":{"properties":{"name":{"type":"string","title":"Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"appears_in_sheets":{"type":"integer","title":"Appears In Sheets","default":1},"skus":{"items":{"type":"string"},"type":"array","title":"Skus"}},"type":"object","required":["name"],"title":"DetectedProduct"},"DetectedSubscriptionResponse":{"properties":{"counterparty_key":{"type":"string","title":"Counterparty Key"},"counterparty_display":{"type":"string","title":"Counterparty Display"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"registry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registry Id"},"avg_amount_cents":{"type":"integer","title":"Avg Amount Cents","description":"Average charge in cents (negative = expense)"},"last_amount_cents":{"type":"integer","title":"Last Amount Cents"},"estimated_monthly_cents":{"type":"integer","title":"Estimated Monthly Cents","description":"Estimated monthly cost in cents"},"period_total_cents":{"type":"integer","title":"Period Total Cents","description":"Total spent during the lookback period in cents","default":0},"frequency":{"type":"string","title":"Frequency","description":"weekly | biweekly | monthly | quarterly | semi-annual | annual"},"occurrence_count":{"type":"integer","title":"Occurrence Count"},"last_date":{"type":"string","title":"Last Date"},"next_expected_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Expected Date"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"},"custom_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Name"},"custom_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Custom Amount Cents"},"custom_frequency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Frequency"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"has_overrides":{"type":"boolean","title":"Has Overrides","default":false}},"type":"object","required":["counterparty_key","counterparty_display","avg_amount_cents","last_amount_cents","estimated_monthly_cents","frequency","occurrence_count","last_date","confidence"],"title":"DetectedSubscriptionResponse"},"DimensionalPnLResponse":{"properties":{"dimension_type":{"type":"string","enum":["class","location"],"title":"Dimension Type"},"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"},"rows":{"items":{"$ref":"#/components/schemas/DimensionalPnLRow"},"type":"array","title":"Rows"},"totals":{"$ref":"#/components/schemas/DimensionalPnLTotals"}},"type":"object","required":["dimension_type","start_date","end_date","rows","totals"],"title":"DimensionalPnLResponse","description":"Profit & loss broken down by class or location."},"DimensionalPnLRow":{"properties":{"dimension_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dimension Id","description":"Dimension UUID, or null for the unassigned bucket."},"dimension_name":{"type":"string","title":"Dimension Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"revenue":{"type":"integer","title":"Revenue"},"expenses":{"type":"integer","title":"Expenses"},"net_income":{"type":"integer","title":"Net Income"}},"type":"object","required":["dimension_name","revenue","expenses","net_income"],"title":"DimensionalPnLRow","description":"One dimension's revenue / expense / net for the period (cents)."},"DimensionalPnLTotals":{"properties":{"revenue":{"type":"integer","title":"Revenue"},"expenses":{"type":"integer","title":"Expenses"},"net_income":{"type":"integer","title":"Net Income"}},"type":"object","required":["revenue","expenses","net_income"],"title":"DimensionalPnLTotals","description":"Period totals across all dimensions (cents)."},"DismissAnomalyResponse":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fingerprint"},"anomaly_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anomaly Type"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"additionalProperties":true,"type":"object","title":"DismissAnomalyResponse","description":"Response for ``dismiss_anomaly``."},"DismissSubscriptionResponse":{"properties":{"status":{"type":"string","title":"Status"},"counterparty_key":{"type":"string","title":"Counterparty Key"}},"additionalProperties":true,"type":"object","required":["status","counterparty_key"],"title":"DismissSubscriptionResponse","description":"Response for ``dismiss_subscription``."},"DismissSuggestedMatchRequest":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"Bank transaction UUID the suggestion was shown for."},"type":{"type":"string","enum":["invoice","bill"],"title":"Type","description":"Whether the dismissed target is an invoice or bill."},"target_id":{"type":"string","title":"Target Id","description":"UUID of the dismissed invoice or bill."}},"type":"object","required":["transaction_id","type","target_id"],"title":"DismissSuggestedMatchRequest","description":"Dismiss a single inline invoice/bill match suggestion."},"DismissSuggestedMatchResponse":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"Bank transaction UUID."},"type":{"type":"string","enum":["invoice","bill"],"title":"Type","description":"Dismissed target document type."},"target_id":{"type":"string","title":"Target Id","description":"Dismissed invoice or bill UUID."},"dismissal_id":{"type":"string","title":"Dismissal Id","description":"UUID of the persisted dismissal row."}},"type":"object","required":["transaction_id","type","target_id","dismissal_id"],"title":"DismissSuggestedMatchResponse","description":"Acknowledgement for ``dismiss_suggested_match``."},"DisposalMethod":{"type":"string","enum":["sold","traded","scrapped","lost","donated"],"title":"DisposalMethod","description":"How an asset was disposed."},"DisposalResponse":{"properties":{"asset":{"$ref":"#/components/schemas/FixedAssetResponse","description":"Updated asset record"},"gain_loss":{"type":"integer","title":"Gain Loss","description":"Gain (positive) or loss (negative) on disposal, in cents"},"journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Id","description":"Journal entry created for the disposal"}},"type":"object","required":["asset","gain_loss"],"title":"DisposalResponse","description":"Response after disposing an asset."},"DisposeAssetRequest":{"properties":{"disposal_date":{"type":"string","format":"date","title":"Disposal Date","description":"Date of disposal"},"disposal_method":{"$ref":"#/components/schemas/DisposalMethod","description":"How the asset was disposed: sold, traded, scrapped, lost, donated"},"disposal_amount":{"type":"integer","minimum":0.0,"title":"Disposal Amount","description":"Sale/trade proceeds in cents","default":0},"disposal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disposal Notes","description":"Notes about the disposal"}},"type":"object","required":["disposal_date","disposal_method"],"title":"DisposeAssetRequest","description":"Schema for disposing of an asset."},"DocumentDownloadResponse":{"properties":{"download_url":{"type":"string","title":"Download Url"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"}},"type":"object","required":["download_url"],"title":"DocumentDownloadResponse","description":"Presigned download URL for an uploaded document."},"DocumentRequestCountResponse":{"properties":{"open_count":{"type":"integer","title":"Open Count"}},"type":"object","required":["open_count"],"title":"DocumentRequestCountResponse","description":"Open document-request count for sidebar badges."},"DocumentRequestListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DocumentRequestResponse"},"type":"array","title":"Items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"has_next":{"type":"boolean","title":"Has Next","default":false},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items"],"title":"DocumentRequestListResponse","description":"Paginated list of document requests."},"DocumentRequestResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"advisory_firm_id":{"type":"string","title":"Advisory Firm Id"},"requested_by_user_id":{"type":"string","title":"Requested By User Id"},"requested_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By Name"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"type":"string","title":"Status"},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"has_file":{"type":"boolean","title":"Has File","default":false},"fulfilled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Fulfilled At"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","advisory_firm_id","requested_by_user_id","title","status","created_at","updated_at"],"title":"DocumentRequestResponse","description":"A single document request, enriched with names."},"DownloadReconciliationPdfResponse":{"properties":{},"additionalProperties":true,"type":"object","title":"DownloadReconciliationPdfResponse","description":"PDF download streams ``application/pdf`` (not JSON)."},"DraftBill":{"properties":{"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name","description":"Vendor/company name extracted by AI. Use to match or create a vendor."},"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount","description":"Bill amount in cents extracted by AI."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of what the bill is for."},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Number","description":"Bill/invoice number from the vendor document."},"bill_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Date","description":"Date of the bill (YYYY-MM-DD) extracted by AI."},"expense_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expense Category","description":"Expense category suggested by AI (e.g., 'Office Supplies', 'Rent')."},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Matched vendor UUID (if the vendor was found in the system)."},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Currency code (USD, CAD, AUD, EUR, or GBP). Defaults to USD.","default":"USD"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"Bill type: 'recurring' or 'one_time'. Defaults to 'one_time'.","default":"one_time"},"received_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Received On","description":"Date bill was received (ISO 8601). Defaults to bill_date if available."},"due_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due On","description":"Payment due date (ISO 8601). Maps from due_date."},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key","description":"S3 key of the source document for this bill."},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"Matched expense ledger UUID (if matched from expense_category)."},"journal_entry_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Date","description":"Date for journal entry (ISO 8601). Defaults to received_on."},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence","description":"AI confidence score for this extraction (0.0-1.0)."},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Source type: 'pasted_text', 'single_file', or 'multi_file'."},"source_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Filename","description":"Original filename or S3 key of the source document."}},"type":"object","title":"DraftBill","description":"A draft bill entity extracted by AI, ready for user review before creation.\n\nAssumes 'received' status — includes all possible params for creating a bill\nin the received status. Fields are optional since AI extraction may not\npopulate every field.","example":{"amount":15000,"bill_date":"2026-02-10","bill_number":"INV-12345","confidence":0.92,"currency":"USD","description":"Office supplies - paper and toner","due_on":"2026-03-12","expense_category":"Office Supplies","received_on":"2026-02-10","source":"single_file","type":"one_time","vendor_name":"Office Depot"}},"DraftInvoice":{"properties":{"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name","description":"Customer/company name extracted by AI. Use to match or create a customer."},"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount","description":"Total invoice amount in cents extracted by AI."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Invoice description or notes."},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number","description":"Invoice number from the document."},"issue_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issue Date","description":"Invoice issue date (YYYY-MM-DD) extracted by AI."},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date","description":"Payment due date (YYYY-MM-DD) extracted by AI."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Additional notes or terms extracted by AI."},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id","description":"Matched customer UUID (if the customer was found in the system)."},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Currency code (USD, CAD, AUD, EUR, or GBP). Defaults to USD.","default":"USD"},"line_items":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Line items extracted by AI: [{description, quantity, unit_price_cents, total_cents}]."},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key","description":"S3 key of the source document for this invoice."},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence","description":"AI confidence score for this extraction (0.0-1.0)."},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Source type: 'pasted_text', 'single_file', or 'multi_file'."},"source_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Filename","description":"Original filename or S3 key of the source document."}},"type":"object","title":"DraftInvoice","description":"A draft invoice entity extracted by AI, ready for user review before creation.\n\nIncludes all fields needed for creating an invoice. Fields are optional\nsince AI extraction may not populate every field.","example":{"amount":25000,"confidence":0.88,"currency":"USD","customer_name":"Acme Corporation","description":"Consulting services - January 2026","due_date":"2026-03-03","invoice_number":"INV-001","issue_date":"2026-02-01","line_items":[{"description":"Consulting - 10 hours","quantity":10,"total_cents":25000,"unit_price_cents":2500}],"source":"single_file"}},"DraftReorderResult":{"properties":{"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"},"po_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Number"},"vendor_id":{"type":"string","title":"Vendor Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"line_count":{"type":"integer","title":"Line Count"},"estimated_total_cents":{"type":"integer","title":"Estimated Total Cents"}},"type":"object","required":["vendor_id","line_count","estimated_total_cents"],"title":"DraftReorderResult"},"DuplicateCandidateResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Customer UUID."},"name":{"type":"string","title":"Name","description":"Customer name."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Customer email."},"similarity_score":{"type":"number","title":"Similarity Score","description":"Similarity score (0.0-1.0)."},"match_type":{"type":"string","title":"Match Type","description":"Type of match (name, email, tax_id, phone)."}},"type":"object","required":["id","name","similarity_score","match_type"],"title":"DuplicateCandidateResponse","description":"A potential duplicate customer."},"DuplicateCheckResponse":{"properties":{"has_duplicates":{"type":"boolean","title":"Has Duplicates","description":"Whether duplicates were found."},"duplicates":{"items":{"$ref":"#/components/schemas/DuplicateCandidateResponse"},"type":"array","title":"Duplicates","description":"List of potential duplicates."}},"type":"object","required":["has_duplicates"],"title":"DuplicateCheckResponse","description":"Response for duplicate check operation."},"EntityContactCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"title":"Name","description":"Contact name."},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email","description":"Contact email address."},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone","description":"Contact phone number."},"role":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Role","description":"Contact role (e.g., 'Billing', 'Technical')."},"is_primary":{"type":"boolean","title":"Is Primary","description":"Set as primary contact.","default":false},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Notes about this contact."}},"type":"object","required":["name"],"title":"EntityContactCreateRequest","description":"Request schema for creating a contact.","example":{"email":"john.smith@example.com","is_primary":true,"name":"John Smith","phone":"(555) 123-4567","role":"Accounts Payable"}},"EntityContactResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Contact UUID."},"entity_type":{"type":"string","title":"Entity Type","description":"Type of parent entity."},"entity_id":{"type":"string","title":"Entity Id","description":"Parent entity UUID."},"name":{"type":"string","title":"Name","description":"Contact name."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Contact email."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Contact phone."},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role","description":"Contact role."},"is_primary":{"type":"boolean","title":"Is Primary","description":"Whether this is the primary contact.","default":false},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Notes about this contact."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."}},"type":"object","required":["id","entity_type","entity_id","name","created_at","updated_at"],"title":"EntityContactResponse","description":"Response schema for a contact.","example":{"created_at":"2024-01-10T10:30:00Z","email":"john.smith@example.com","entity_id":"019def...","entity_type":"customer","id":"019abc...","is_primary":true,"name":"John Smith","notes":"Primary billing contact","phone":"(555) 123-4567","role":"Accounts Payable","updated_at":"2024-01-15T14:00:00Z"}},"EntityContactUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name","description":"Updated contact name."},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email","description":"Updated email address."},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone","description":"Updated phone number."},"role":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Role","description":"Updated role."},"is_primary":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Primary","description":"Set as primary contact."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Updated notes."}},"type":"object","title":"EntityContactUpdateRequest","description":"Request schema for updating a contact."},"EntityTagCreate":{"properties":{"tag_id":{"type":"string","title":"Tag Id","description":"UUID of the tag to attach"},"model_type":{"type":"string","title":"Model Type","description":"Type of entity (transaction, invoice, bill, journal_entry, customer, vendor, product)"},"model_id":{"type":"string","title":"Model Id","description":"UUID of the entity to tag"}},"type":"object","required":["tag_id","model_type","model_id"],"title":"EntityTagCreate","description":"Schema for attaching a tag to an entity.","example":{"model_id":"660e8400-e29b-41d4-a716-446655440001","model_type":"transaction","tag_id":"550e8400-e29b-41d4-a716-446655440000"}},"EntityTagListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/EntityTagResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"EntityTagListResponse","description":"Cursor-paginated list of entity tags."},"EntityTagResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for the entity tag"},"tag_id":{"type":"string","title":"Tag Id","description":"UUID of the tag"},"tag_name":{"type":"string","title":"Tag Name","description":"Name of the tag"},"tag_group_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag Group Name","description":"Name of the tag group (if any)"},"model_type":{"type":"string","title":"Model Type","description":"Type of entity this tag is attached to"},"model_id":{"type":"string","title":"Model Id","description":"UUID of the entity"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when the tag was attached"}},"type":"object","required":["id","tag_id","tag_name","model_type","model_id","created_at"],"title":"EntityTagResponse","description":"Schema for entity tag response."},"EstimateCreate":{"properties":{"customer_id":{"type":"string","title":"Customer Id","description":"Customer to send estimate to"},"line_items":{"items":{"$ref":"#/components/schemas/EstimateLineItem"},"type":"array","minItems":1,"title":"Line Items","description":"Line items"},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date","description":"Proposed payment due date (YYYY-MM-DD)"},"expiration_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiration Date","description":"Estimate expiration date (YYYY-MM-DD)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Estimate description"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes","description":"Internal notes"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Currency code","default":"USD"}},"type":"object","required":["customer_id","line_items"],"title":"EstimateCreate","description":"Request schema for creating an estimate."},"EstimateLineItem":{"properties":{"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Product variant ID or null for custom"},"description":{"type":"string","title":"Description","description":"Line item description"},"quantity":{"type":"integer","minimum":1.0,"title":"Quantity","description":"Quantity","default":1},"unit_price":{"type":"integer","title":"Unit Price","description":"Unit price in cents"},"amount":{"type":"integer","title":"Amount","description":"Total amount in cents (qty * unit_price)"}},"type":"object","required":["description","unit_price","amount"],"title":"EstimateLineItem","description":"Line item for an estimate."},"EstimateResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"customer_id":{"type":"string","title":"Customer Id"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"status":{"type":"string","title":"Status"},"currency":{"type":"string","title":"Currency"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"total_in_dollars":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Total In Dollars"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes"},"line_items":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Line Items"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"expiration_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expiration Date"},"converted_invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Converted Invoice Id"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Accepted At"},"declined_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Declined At"},"converted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Converted At"},"pdf_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"can_be_sent":{"type":"boolean","title":"Can Be Sent","default":false},"can_be_accepted":{"type":"boolean","title":"Can Be Accepted","default":false},"can_be_declined":{"type":"boolean","title":"Can Be Declined","default":false},"can_be_converted":{"type":"boolean","title":"Can Be Converted","default":false},"can_be_updated":{"type":"boolean","title":"Can Be Updated","default":false},"can_be_deleted":{"type":"boolean","title":"Can Be Deleted","default":false}},"type":"object","required":["id","business_id","customer_id","status","currency","created_at","updated_at"],"title":"EstimateResponse","description":"Response schema for an estimate."},"EstimateStatusEnum":{"type":"string","enum":["draft","sent","accepted","declined","expired","converted"],"title":"EstimateStatusEnum","description":"Estimate status values."},"EstimateUpdate":{"properties":{"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id","description":"Customer ID"},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/EstimateLineItem"},"type":"array","minItems":1},{"type":"null"}],"title":"Line Items","description":"Line items"},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date","description":"Due date (YYYY-MM-DD)"},"expiration_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiration Date","description":"Expiration date (YYYY-MM-DD)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes","description":"Internal notes"}},"type":"object","title":"EstimateUpdate","description":"Request schema for updating an estimate (draft/sent only)."},"EstimatesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/EstimateResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"EstimatesListResponse","description":"Paginated list of estimates."},"ExecSummaryKpi":{"properties":{"label":{"type":"string","title":"Label"},"value":{"type":"string","title":"Value"},"delta_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delta Label"},"trend":{"anyOf":[{"type":"string","enum":["up","down","flat"]},{"type":"null"}],"title":"Trend"}},"additionalProperties":false,"type":"object","required":["label","value"],"title":"ExecSummaryKpi"},"ExecSummarySlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"exec_summary","title":"Slide Type","default":"exec_summary"},"data":{"$ref":"#/components/schemas/ExecSummarySlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"ExecSummarySlide"},"ExecSummarySlideData":{"properties":{"kpis":{"items":{"$ref":"#/components/schemas/ExecSummaryKpi"},"type":"array","maxItems":8,"title":"Kpis"},"highlights":{"items":{"type":"string"},"type":"array","maxItems":8,"title":"Highlights"}},"additionalProperties":false,"type":"object","title":"ExecSummarySlideData"},"ExpenseCandidateItem":{"properties":{"id":{"type":"string","title":"Id"},"amount":{"type":"integer","title":"Amount"},"unallocated":{"type":"integer","title":"Unallocated"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty"},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name"},"currency":{"type":"string","title":"Currency","default":"USD"}},"additionalProperties":true,"type":"object","required":["id","amount","unallocated"],"title":"ExpenseCandidateItem","description":"Outgoing transaction eligible for bill payment linking."},"ExpenseReportCreateRequest":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"currency":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}],"title":"Currency","default":"USD"},"lines":{"items":{"$ref":"#/components/schemas/ExpenseReportLineInput"},"type":"array","minItems":1,"title":"Lines"}},"type":"object","required":["lines"],"title":"ExpenseReportCreateRequest","description":"Create a draft expense report."},"ExpenseReportDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"status":{"type":"string","title":"Status"},"currency":{"type":"string","title":"Currency"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"total":{"type":"integer","title":"Total"},"employee_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee User Id"},"approved_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By User Id"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"reimbursed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reimbursed At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"line_count":{"type":"integer","title":"Line Count","default":0},"can_be_updated":{"type":"boolean","title":"Can Be Updated","default":false},"can_be_deleted":{"type":"boolean","title":"Can Be Deleted","default":false},"can_be_submitted":{"type":"boolean","title":"Can Be Submitted","default":false},"can_be_approved":{"type":"boolean","title":"Can Be Approved","default":false},"can_be_reimbursed":{"type":"boolean","title":"Can Be Reimbursed","default":false},"lines":{"items":{"$ref":"#/components/schemas/ExpenseReportLineResponse"},"type":"array","title":"Lines"}},"type":"object","required":["id","business_id","status","currency","total"],"title":"ExpenseReportDetailResponse","description":"Expense report with line items."},"ExpenseReportLineInput":{"properties":{"description":{"type":"string","maxLength":500,"minLength":1,"title":"Description"},"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Amount in cents"},"expense_date":{"type":"string","format":"date","title":"Expense Date","description":"Date expense was incurred"},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key","description":"Receipt attachment S3 key"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"Expense category ledger"}},"type":"object","required":["description","amount","expense_date"],"title":"ExpenseReportLineInput","description":"Line item payload for create/update."},"ExpenseReportLineResponse":{"properties":{"id":{"type":"string","title":"Id"},"expense_report_id":{"type":"string","title":"Expense Report Id"},"description":{"type":"string","title":"Description"},"amount":{"type":"integer","title":"Amount"},"expense_date":{"type":"string","format":"date","title":"Expense Date"},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id"},"has_receipt":{"type":"boolean","title":"Has Receipt","default":false},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","expense_report_id","description","amount","expense_date"],"title":"ExpenseReportLineResponse","description":"Expense report line in API responses."},"ExpenseReportResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"status":{"type":"string","title":"Status"},"currency":{"type":"string","title":"Currency"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"total":{"type":"integer","title":"Total"},"employee_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee User Id"},"approved_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By User Id"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"reimbursed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reimbursed At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"line_count":{"type":"integer","title":"Line Count","default":0},"can_be_updated":{"type":"boolean","title":"Can Be Updated","default":false},"can_be_deleted":{"type":"boolean","title":"Can Be Deleted","default":false},"can_be_submitted":{"type":"boolean","title":"Can Be Submitted","default":false},"can_be_approved":{"type":"boolean","title":"Can Be Approved","default":false},"can_be_reimbursed":{"type":"boolean","title":"Can Be Reimbursed","default":false}},"type":"object","required":["id","business_id","status","currency","total"],"title":"ExpenseReportResponse","description":"Expense report summary."},"ExpenseReportStatusEnum":{"type":"string","enum":["draft","submitted","approved","reimbursed"],"title":"ExpenseReportStatusEnum","description":"Expense report lifecycle status."},"ExpenseReportUpdateRequest":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"lines":{"anyOf":[{"items":{"$ref":"#/components/schemas/ExpenseReportLineInput"},"type":"array","minItems":1},{"type":"null"}],"title":"Lines","description":"Replace all lines when provided"}},"type":"object","title":"ExpenseReportUpdateRequest","description":"Update a draft expense report."},"ExpenseReportsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ExpenseReportResponse"},"type":"array","title":"Items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"ExpenseReportsListResponse","description":"Paginated list of expense reports."},"ExpiringLot":{"properties":{"id":{"type":"string","title":"Id"},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"lot_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lot Number"},"external_lot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Lot Id"},"expiration_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expiration Date"},"days_until_expiry":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Until Expiry","description":"Days from today to `expiration_date` (negative when already expired)."},"quantity_remaining":{"type":"number","title":"Quantity Remaining"},"unit_cost_cents":{"type":"integer","title":"Unit Cost Cents"}},"type":"object","required":["id","quantity_remaining","unit_cost_cents"],"title":"ExpiringLot"},"ExpiringLotsResponse":{"properties":{"within_days":{"type":"integer","title":"Within Days"},"lots":{"items":{"$ref":"#/components/schemas/ExpiringLot"},"type":"array","title":"Lots"},"total_remaining_value_cents":{"type":"integer","title":"Total Remaining Value Cents","default":0}},"type":"object","required":["within_days"],"title":"ExpiringLotsResponse"},"ExplainMatchesResponse":{"properties":{"explanations":{"items":{"$ref":"#/components/schemas/MatchExplanation"},"type":"array","title":"Explanations"}},"additionalProperties":true,"type":"object","required":["explanations"],"title":"ExplainMatchesResponse","description":"Frontend type ``ExplainMatchesResponse``."},"ExportDeckResponse":{"properties":{},"additionalProperties":true,"type":"object","title":"ExportDeckResponse","description":"``export_deck`` returns a binary ``StreamingResponse``; schema is docs-only."},"Fee":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Fee name (e.g., 'Shipping', 'Handling')."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Fee description (alternative to name)."},"amount":{"type":"integer","title":"Amount","description":"Fee amount in cents."}},"type":"object","required":["amount"],"title":"Fee","description":"Additional fee on an inventory order.\n\nUsed for shipping, handling, customs, or other charges.\nAmount is in cents.","example":{"amount":5000,"name":"Shipping"}},"FileProcessingError":{"properties":{"s3_key":{"type":"string","title":"S3 Key","description":"S3 key of the file that failed."},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Original filename (if determinable from the S3 key)."},"error":{"type":"string","title":"Error","description":"Human-readable error description."}},"type":"object","required":["s3_key","error"],"title":"FileProcessingError","description":"Error detail for a file that failed during AI extraction."},"FinancialInsight":{"properties":{"type":{"type":"string","enum":["variance","trend","ratio","alert","recommendation","anomaly"],"title":"Type"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"severity":{"type":"string","enum":["info","warning","critical"],"title":"Severity"},"section":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section"}},"additionalProperties":true,"type":"object","required":["type","title","description","severity"],"title":"FinancialInsight","description":"Single AI insight from financial statement analysis."},"FirmBusinessesCursorResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BusinessResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"FirmBusinessesCursorResponse"},"FirmClientResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Photo Url"},"businesses":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Businesses","description":"Businesses this client can access [{id, name}]"}},"type":"object","required":["id","email"],"title":"FirmClientResponse","description":"A client user within a firm, with their assigned businesses."},"FirmClientSummary":{"properties":{"business_id":{"type":"string","title":"Business Id"},"business_name":{"type":"string","title":"Business Name"},"outstanding_cents":{"type":"integer","title":"Outstanding Cents"},"overdue_cents":{"type":"integer","title":"Overdue Cents"},"bills_needing_review":{"type":"integer","title":"Bills Needing Review"},"total_bills":{"type":"integer","title":"Total Bills"},"close_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Close Score"},"close_score_color":{"anyOf":[{"type":"string","enum":["green","yellow","red","gray"]},{"type":"null"}],"title":"Close Score Color"},"close_period_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Close Period Id"},"close_blockers_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Close Blockers Count"}},"additionalProperties":true,"type":"object","required":["business_id","business_name","outstanding_cents","overdue_cents","bills_needing_review","total_bills"],"title":"FirmClientSummary","description":"Per-client AP and close-score summary for the firm cockpit."},"FirmClientsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FirmClientResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"FirmClientsListResponse","description":"Response schema for listing firm clients."},"FirmInsightItem":{"properties":{"type":{"type":"string","title":"Type","description":"attention, workload, anomaly, or stale_data"},"title":{"type":"string","title":"Title","description":"Short headline"},"description":{"type":"string","title":"Description","description":"Explanation"},"severity":{"type":"string","title":"Severity","description":"info, warning, or critical"},"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id","description":"Related business ID"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name","description":"Related business name"}},"type":"object","required":["type","title","description","severity"],"title":"FirmInsightItem"},"FirmReportTypeItem":{"properties":{"report_name":{"type":"string","title":"Report Name"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"category":{"type":"string","title":"Category"}},"additionalProperties":true,"type":"object","required":["report_name","title","description","category"],"title":"FirmReportTypeItem"},"FirmSummaryTotals":{"properties":{"total_outstanding_cents":{"type":"integer","title":"Total Outstanding Cents"},"total_overdue_cents":{"type":"integer","title":"Total Overdue Cents"},"bills_needing_review":{"type":"integer","title":"Bills Needing Review"},"total_bills":{"type":"integer","title":"Total Bills"}},"additionalProperties":true,"type":"object","required":["total_outstanding_cents","total_overdue_cents","bills_needing_review","total_bills"],"title":"FirmSummaryTotals","description":"Firm-wide AP totals."},"FirmTemplateCreate":{"properties":{"kind":{"type":"string","title":"Kind","description":"Template kind: 'coa', 'bank_rules', or 'review_checklist'"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"payload":{"$ref":"#/components/schemas/JsonValue","description":"Kind-specific payload (list of ledger dicts / rule dicts / checklist step dicts)."}},"type":"object","required":["kind","name","payload"],"title":"FirmTemplateCreate","description":"Request body for creating a firm template."},"FirmTemplateDeleteResponse":{"properties":{"status":{"type":"string","title":"Status"},"template_id":{"type":"string","title":"Template Id"}},"additionalProperties":true,"type":"object","required":["status","template_id"],"title":"FirmTemplateDeleteResponse","description":"Acknowledgement for ``delete_firm_template``."},"FirmTemplateDeployRequest":{"properties":{"business_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Business Ids","description":"Business IDs to deploy the template to."}},"type":"object","required":["business_ids"],"title":"FirmTemplateDeployRequest","description":"Request body for deploying a template to one or more clients."},"FirmTemplateDeployResponse":{"properties":{"template_id":{"type":"string","title":"Template Id"},"kind":{"type":"string","title":"Kind"},"applied":{"items":{"$ref":"#/components/schemas/FirmTemplateDeployResultRow"},"type":"array","title":"Applied"},"failed":{"items":{"$ref":"#/components/schemas/FirmTemplateDeployResultRow"},"type":"array","title":"Failed"},"skipped":{"items":{"$ref":"#/components/schemas/FirmTemplateDeployResultRow"},"type":"array","title":"Skipped"},"applied_count":{"type":"integer","title":"Applied Count","default":0},"failed_count":{"type":"integer","title":"Failed Count","default":0},"skipped_count":{"type":"integer","title":"Skipped Count","default":0}},"type":"object","required":["template_id","kind"],"title":"FirmTemplateDeployResponse","description":"Aggregate deploy response."},"FirmTemplateDeployResultRow":{"properties":{"business_id":{"type":"string","title":"Business Id"},"summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Summary"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["business_id"],"title":"FirmTemplateDeployResultRow","description":"Per-business outcome of a deploy."},"FirmTemplateDeploymentListResponse":{"properties":{"deployments":{"items":{"$ref":"#/components/schemas/FirmTemplateDeploymentResponse"},"type":"array","title":"Deployments"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["count"],"title":"FirmTemplateDeploymentListResponse","description":"Wrapper for the deployment history endpoint."},"FirmTemplateDeploymentResponse":{"properties":{"id":{"type":"string","title":"Id"},"template_id":{"type":"string","title":"Template Id"},"business_id":{"type":"string","title":"Business Id"},"status":{"type":"string","title":"Status"},"summary":{"additionalProperties":true,"type":"object","title":"Summary"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"applied_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Applied At"},"applied_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applied By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","template_id","business_id","status","summary","created_at","updated_at"],"title":"FirmTemplateDeploymentResponse","description":"Historical deployment row."},"FirmTemplateListResponse":{"properties":{"templates":{"items":{"$ref":"#/components/schemas/FirmTemplateResponse"},"type":"array","title":"Templates"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["count"],"title":"FirmTemplateListResponse","description":"Wrapper for listing firm templates."},"FirmTemplateResponse":{"properties":{"id":{"type":"string","title":"Id"},"advisory_firm_id":{"type":"string","title":"Advisory Firm Id"},"kind":{"type":"string","title":"Kind"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"payload":{"$ref":"#/components/schemas/JsonValue"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","advisory_firm_id","kind","name","payload","created_at","updated_at"],"title":"FirmTemplateResponse","description":"Firm template view model."},"FirmTemplateUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"payload":{"anyOf":[{"$ref":"#/components/schemas/JsonValue"},{"type":"null"}]}},"type":"object","title":"FirmTemplateUpdate","description":"Request body for updating a firm template."},"FirmTierChangeRequest":{"properties":{"firm_plan_tier":{"type":"string","title":"Firm Plan Tier","description":"Target firm tier: 'firm_starter', 'firm_professional', or 'firm_enterprise'."}},"type":"object","required":["firm_plan_tier"],"title":"FirmTierChangeRequest"},"FirmTierOption":{"properties":{"value":{"type":"string","title":"Value"},"client_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Limit"}},"additionalProperties":true,"type":"object","required":["value"],"title":"FirmTierOption"},"FirmUserApiAccessRequest":{"properties":{"api_access_enabled":{"type":"boolean","title":"Api Access Enabled","description":"Whether the user may use the DayZero API."}},"type":"object","required":["api_access_enabled"],"title":"FirmUserApiAccessRequest","description":"Request to enable/disable API access for a firm staff member."},"FirmUserApiAccessResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"api_access_enabled":{"type":"boolean","title":"Api Access Enabled"}},"type":"object","required":["user_id","api_access_enabled"],"title":"FirmUserApiAccessResponse","description":"Result of updating a firm staff member's API access."},"FirmUserResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Photo Url"},"onboarded":{"type":"boolean","title":"Onboarded","default":false},"role":{"type":"string","enum":["owner","admin","member","client"],"title":"Role","description":"User's role in the firm. `owner`: Full access + billing + user management. `admin`: Full access + user management (no billing). `member`: Access to assigned businesses only."},"api_access_enabled":{"type":"boolean","title":"Api Access Enabled","description":"Whether this user may use the DayZero API. Enabled by default; firm owners/admins can turn it off for specific staff.","default":true},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","user_id","email","role","created_at","updated_at"],"title":"FirmUserResponse","description":"Response schema for a user in an advisory firm, including their role."},"FirmUsersListResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/FirmUserResponse"},"type":"array","title":"Users"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["users","total"],"title":"FirmUsersListResponse","description":"Response schema for listing users in an advisory firm."},"FixedAssetCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Asset name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Asset description"},"asset_number":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Asset Number","description":"User-defined asset tracking number"},"serial_number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Serial Number","description":"Manufacturer serial number"},"purchase_date":{"type":"string","format":"date","title":"Purchase Date","description":"Date the asset was purchased"},"original_cost":{"type":"integer","minimum":0.0,"title":"Original Cost","description":"Purchase cost in cents"},"salvage_value":{"type":"integer","minimum":0.0,"title":"Salvage Value","description":"Estimated salvage value in cents","default":0},"useful_life_months":{"type":"integer","maximum":600.0,"minimum":1.0,"title":"Useful Life Months","description":"Expected useful life in months","default":60},"depreciation_method":{"$ref":"#/components/schemas/DepreciationMethod","description":"Depreciation calculation method","default":"straight_line"},"location":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Location","description":"Physical location of the asset"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Additional notes"},"category_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Id","description":"Asset category ID"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Vendor the asset was purchased from"},"in_service_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"In Service Date","description":"Date the asset was placed in service (starts depreciation)"},"total_expected_units":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Total Expected Units","description":"Total expected units for units-of-production depreciation"}},"type":"object","required":["name","purchase_date","original_cost"],"title":"FixedAssetCreate","description":"Schema for creating a fixed asset."},"FixedAssetListResponse":{"properties":{"assets":{"items":{"$ref":"#/components/schemas/FixedAssetResponse"},"type":"array","title":"Assets","description":"Fixed assets"},"count":{"type":"integer","title":"Count","description":"Total number of assets"}},"type":"object","required":["count"],"title":"FixedAssetListResponse","description":"Schema for listing fixed assets."},"FixedAssetResponse":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Asset name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Asset description"},"asset_number":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Asset Number","description":"User-defined asset tracking number"},"serial_number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Serial Number","description":"Manufacturer serial number"},"purchase_date":{"type":"string","format":"date","title":"Purchase Date","description":"Date the asset was purchased"},"original_cost":{"type":"integer","minimum":0.0,"title":"Original Cost","description":"Purchase cost in cents"},"salvage_value":{"type":"integer","minimum":0.0,"title":"Salvage Value","description":"Estimated salvage value in cents","default":0},"useful_life_months":{"type":"integer","maximum":600.0,"minimum":1.0,"title":"Useful Life Months","description":"Expected useful life in months","default":60},"depreciation_method":{"$ref":"#/components/schemas/DepreciationMethod","description":"Depreciation calculation method","default":"straight_line"},"location":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Location","description":"Physical location of the asset"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Additional notes"},"id":{"type":"string","title":"Id","description":"Asset ID"},"category_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Id","description":"Asset category ID"},"category_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name","description":"Asset category name"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Vendor ID"},"in_service_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"In Service Date","description":"Date placed in service"},"total_expected_units":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Expected Units","description":"Total expected units (units-of-production method)"},"units_used_to_date":{"type":"integer","title":"Units Used To Date","description":"Cumulative units used to date","default":0},"status":{"$ref":"#/components/schemas/AssetStatus","description":"Asset lifecycle status: draft, active, fully_depreciated, disposed"},"disposal_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Disposal Date","description":"Date the asset was disposed"},"disposal_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Disposal Amount","description":"Sale/trade proceeds in cents"},"disposal_method":{"anyOf":[{"$ref":"#/components/schemas/DisposalMethod"},{"type":"null"}],"description":"How the asset was disposed"},"depreciable_amount":{"type":"integer","title":"Depreciable Amount","description":"Cost minus salvage value, in cents"},"accumulated_depreciation":{"type":"integer","title":"Accumulated Depreciation","description":"Total depreciation taken to date, in cents"},"book_value":{"type":"integer","title":"Book Value","description":"Current book value (cost - accumulated depreciation), in cents"},"monthly_depreciation_amount":{"type":"integer","title":"Monthly Depreciation Amount","description":"Monthly depreciation amount, in cents"},"remaining_life_months":{"type":"integer","title":"Remaining Life Months","description":"Remaining useful life in months"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Record creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["name","purchase_date","original_cost","id","status","depreciable_amount","accumulated_depreciation","book_value","monthly_depreciation_amount","remaining_life_months","created_at","updated_at"],"title":"FixedAssetResponse","description":"Schema for fixed asset response."},"FixedAssetUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"asset_number":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Asset Number"},"serial_number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Serial Number"},"category_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Id"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"salvage_value":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Salvage Value"},"useful_life_months":{"anyOf":[{"type":"integer","maximum":600.0,"minimum":1.0},{"type":"null"}],"title":"Useful Life Months"},"depreciation_method":{"anyOf":[{"$ref":"#/components/schemas/DepreciationMethod"},{"type":"null"}]},"total_expected_units":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Total Expected Units"},"location":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Location"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"FixedAssetUpdate","description":"Schema for updating a fixed asset."},"FixedDriverValue":{"properties":{"base":{"type":"integer","title":"Base","description":"Base $/month in cents","default":0},"esc":{"type":"number","title":"Esc","description":"Annual escalation rate, e.g. 0.03 = 3%","default":0.0}},"type":"object","title":"FixedDriverValue"},"ForecastConfigCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"title":"Name","description":"Forecast configuration name."},"method":{"$ref":"#/components/schemas/ForecastMethodEnum","description":"Forecasting method to use.","default":"linear_trend"},"lookback_months":{"type":"integer","maximum":60.0,"minimum":3.0,"title":"Lookback Months","description":"Historical months to analyze.","default":12},"forecast_months":{"type":"integer","maximum":36.0,"minimum":1.0,"title":"Forecast Months","description":"Months to forecast into future.","default":12},"growth_rate_percent":{"type":"integer","maximum":100.0,"minimum":-50.0,"title":"Growth Rate Percent","description":"Annual growth rate adjustment (%).","default":0},"use_seasonality":{"type":"boolean","title":"Use Seasonality","description":"Apply seasonal adjustments.","default":false},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Configuration notes."}},"type":"object","required":["name"],"title":"ForecastConfigCreateRequest","description":"Request to create a forecast configuration."},"ForecastConfigResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Config UUID."},"name":{"type":"string","title":"Name","description":"Config name."},"method":{"$ref":"#/components/schemas/ForecastMethodEnum","description":"Forecasting method."},"lookback_months":{"type":"integer","title":"Lookback Months","description":"Historical months analyzed."},"forecast_months":{"type":"integer","title":"Forecast Months","description":"Months forecasted."},"growth_rate_percent":{"type":"integer","title":"Growth Rate Percent","description":"Growth rate adjustment."},"use_seasonality":{"type":"boolean","title":"Use Seasonality","description":"Seasonality enabled."},"is_active":{"type":"boolean","title":"Is Active","description":"Whether config is active."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Notes."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."}},"type":"object","required":["id","name","method","lookback_months","forecast_months","growth_rate_percent","use_seasonality","is_active","business_id","created_at","updated_at"],"title":"ForecastConfigResponse","description":"Response for forecast configuration."},"ForecastLineItem":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id","description":"Ledger UUID."},"ledger_name":{"type":"string","title":"Ledger Name","description":"Ledger name."},"ledger_type":{"type":"string","title":"Ledger Type","description":"Ledger type."},"historical_average":{"type":"integer","title":"Historical Average","description":"Average historical monthly amount."},"historical_trend":{"type":"number","title":"Historical Trend","description":"Monthly trend (slope)."},"periods":{"items":{"$ref":"#/components/schemas/ForecastPeriod"},"type":"array","title":"Periods","description":"Forecasted periods."}},"type":"object","required":["ledger_id","ledger_name","ledger_type","historical_average","historical_trend"],"title":"ForecastLineItem","description":"Forecast for a single ledger account."},"ForecastMethodEnum":{"type":"string","enum":["linear_trend","moving_average","seasonal","year_over_year"],"title":"ForecastMethodEnum","description":"Methods for generating forecasts."},"ForecastPeriod":{"properties":{"period_date":{"type":"string","format":"date","title":"Period Date","description":"First day of the forecasted month."},"forecasted_amount":{"type":"integer","title":"Forecasted Amount","description":"Forecasted amount in cents."},"confidence_low":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Confidence Low","description":"Lower confidence bound."},"confidence_high":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Confidence High","description":"Upper confidence bound."},"is_historical":{"type":"boolean","title":"Is Historical","description":"True if this is actual historical data.","default":false}},"type":"object","required":["period_date","forecasted_amount"],"title":"ForecastPeriod","description":"Single forecast period (month)."},"ForecastResponse":{"properties":{"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"business_name":{"type":"string","title":"Business Name","description":"Business name."},"forecast_start":{"type":"string","format":"date","title":"Forecast Start","description":"Forecast period start."},"forecast_end":{"type":"string","format":"date","title":"Forecast End","description":"Forecast period end."},"method":{"$ref":"#/components/schemas/ForecastMethodEnum","description":"Method used."},"generated_at":{"type":"string","format":"date-time","title":"Generated At","description":"Generation timestamp."},"revenue_items":{"items":{"$ref":"#/components/schemas/ForecastLineItem"},"type":"array","title":"Revenue Items","description":"Revenue account forecasts."},"total_forecasted_revenue":{"type":"integer","title":"Total Forecasted Revenue","description":"Total forecasted revenue."},"expense_items":{"items":{"$ref":"#/components/schemas/ForecastLineItem"},"type":"array","title":"Expense Items","description":"Expense account forecasts."},"total_forecasted_expenses":{"type":"integer","title":"Total Forecasted Expenses","description":"Total forecasted expenses."},"forecasted_net_income":{"type":"integer","title":"Forecasted Net Income","description":"Forecasted net income."},"cash_flow_forecast":{"items":{"$ref":"#/components/schemas/ForecastPeriod"},"type":"array","title":"Cash Flow Forecast","description":"Monthly cash flow projections."},"projected_ending_cash":{"type":"integer","title":"Projected Ending Cash","description":"Projected cash at forecast end."}},"type":"object","required":["business_id","business_name","forecast_start","forecast_end","method","generated_at","total_forecasted_revenue","total_forecasted_expenses","forecasted_net_income","projected_ending_cash"],"title":"ForecastResponse","description":"Complete financial forecast."},"FrequencyEnum":{"type":"string","enum":["daily","weekly","biweekly","monthly","quarterly","annually"],"title":"FrequencyEnum","description":"Recurrence frequency options."},"FxCurrencyExposure":{"properties":{"currency":{"type":"string","title":"Currency"},"receivable_foreign":{"type":"integer","title":"Receivable Foreign","description":"Open AR balance in the foreign currency (cents).","default":0},"payable_foreign":{"type":"integer","title":"Payable Foreign","description":"Open AP balance in the foreign currency (cents).","default":0},"booked_rate":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Booked Rate"},"current_rate":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Current Rate"},"receivable_gain_loss":{"type":"integer","title":"Receivable Gain Loss","description":"AR revaluation gain(+)/loss(-) in base cents.","default":0},"payable_gain_loss":{"type":"integer","title":"Payable Gain Loss","description":"AP revaluation gain(+)/loss(-) in base cents.","default":0},"net_gain_loss":{"type":"integer","title":"Net Gain Loss","description":"Net gain(+)/loss(-) in base cents.","default":0}},"type":"object","required":["currency"],"title":"FxCurrencyExposure","description":"Per-currency open AR/AP exposure and computed gain/loss (cents)."},"FxRateResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"base_currency":{"type":"string","title":"Base Currency"},"quote_currency":{"type":"string","title":"Quote Currency"},"rate":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Rate"},"as_of_date":{"type":"string","format":"date","title":"As Of Date"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","base_currency","quote_currency","rate","as_of_date","created_at","updated_at"],"title":"FxRateResponse","description":"An FX rate row."},"FxRateUpsertRequest":{"properties":{"base_currency":{"type":"string","maxLength":3,"minLength":3,"title":"Base Currency"},"quote_currency":{"type":"string","maxLength":3,"minLength":3,"title":"Quote Currency"},"rate":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Rate","description":"base = quote * rate."},"as_of_date":{"type":"string","format":"date","title":"As Of Date"},"source":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Source"}},"type":"object","required":["base_currency","quote_currency","rate","as_of_date"],"title":"FxRateUpsertRequest","description":"Create or update an FX rate for a (base, quote) pair on a date."},"FxRatesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FxRateResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"FxRatesListResponse","description":"A flat list of FX rates."},"FxRevaluationRequest":{"properties":{"as_of_date":{"type":"string","format":"date","title":"As Of Date"},"post":{"type":"boolean","title":"Post","description":"Post the adjusting JE (false = preview only).","default":true}},"type":"object","required":["as_of_date"],"title":"FxRevaluationRequest","description":"Trigger a revaluation as of a date; optionally post the JE."},"FxRevaluationResponse":{"properties":{"as_of_date":{"type":"string","format":"date","title":"As Of Date"},"base_currency":{"type":"string","title":"Base Currency"},"exposures":{"items":{"$ref":"#/components/schemas/FxCurrencyExposure"},"type":"array","title":"Exposures"},"total_gain_loss":{"type":"integer","title":"Total Gain Loss","description":"Net unrealized FX gain(+)/loss(-) in base cents.","default":0},"journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Id","description":"Posted adjusting JE id (null for a preview)."},"posted":{"type":"boolean","title":"Posted","default":false}},"type":"object","required":["as_of_date","base_currency","exposures"],"title":"FxRevaluationResponse","description":"Result/preview of an FX revaluation as of a date."},"GenerateDeckRequest":{"properties":{"prompt":{"type":"string","maxLength":400,"minLength":1,"title":"Prompt"},"period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period End"},"slide_types":{"anyOf":[{"items":{"type":"string","enum":["cover","exec_summary","pnl_summary","ar_aging","cash_position","inventory_cogs","customer_concentration","asks","custom"]},"type":"array"},{"type":"null"}],"title":"Slide Types","description":"Optional subset of slide types to include. When omitted the service picks a sensible default for board / investor decks."},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Title"}},"additionalProperties":false,"type":"object","required":["prompt"],"title":"GenerateDeckRequest","description":"Body for ``POST /ai-reporting/decks`` — kick off a fresh deck."},"GenerateDeckResponse":{"properties":{"deck":{"$ref":"#/components/schemas/DeckSpec"}},"additionalProperties":false,"type":"object","required":["deck"],"title":"GenerateDeckResponse","description":"Returned from generation and refresh endpoints. Wraps the full deck."},"GenerateFirmReportResponse":{"properties":{"report":{"additionalProperties":true,"type":"object","title":"Report"}},"additionalProperties":true,"type":"object","required":["report"],"title":"GenerateFirmReportResponse","description":"Envelope data for ``generate_firm_report``."},"GenerateForecastRequest":{"properties":{"method":{"$ref":"#/components/schemas/ForecastMethodEnum","description":"Forecasting method.","default":"linear_trend"},"lookback_months":{"type":"integer","maximum":60.0,"minimum":3.0,"title":"Lookback Months","description":"Historical months to analyze.","default":12},"forecast_months":{"type":"integer","maximum":36.0,"minimum":1.0,"title":"Forecast Months","description":"Months to forecast.","default":12},"growth_rate_percent":{"type":"integer","maximum":100.0,"minimum":-50.0,"title":"Growth Rate Percent","description":"Growth rate adjustment.","default":0},"use_seasonality":{"type":"boolean","title":"Use Seasonality","description":"Apply seasonal adjustments.","default":false},"include_cash_flow":{"type":"boolean","title":"Include Cash Flow","description":"Include cash flow projections.","default":true}},"type":"object","title":"GenerateForecastRequest","description":"Request to generate a financial forecast.","example":{"forecast_months":12,"growth_rate_percent":5,"include_cash_flow":true,"lookback_months":12,"method":"linear_trend","use_seasonality":true}},"GenerateOrderPdfResponse":{"properties":{"url":{"type":"string","title":"Url"}},"additionalProperties":true,"type":"object","required":["url"],"title":"GenerateOrderPdfResponse","description":"Response for ``generate_order_pdf``."},"GeneratedDocumentItem":{"properties":{"id":{"type":"string","title":"Id"},"document_type":{"$ref":"#/components/schemas/RecurrenceTypeEnum-Output"},"status":{"type":"string","title":"Status"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount"},"amount_in_dollars":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount In Dollars"},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"}},"type":"object","required":["id","document_type","status","created_at"],"title":"GeneratedDocumentItem","description":"A document generated from a recurring template.","example":{"amount":350000,"amount_in_dollars":3500.0,"created_at":"2026-02-01T01:00:00Z","description":"Monthly office rent","document_type":"bill","due_date":"2026-02-16","id":"bill-uuid","status":"forecasted","vendor_name":"Property Management LLC"}},"GenericListResponse":{"properties":{"data":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Data","description":"List of items"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count","description":"Total count of items"}},"type":"object","required":["data"],"title":"GenericListResponse","description":"Generic response for list operations."},"GetAiUsageDetailsResponse":{"properties":{"summary":{"$ref":"#/components/schemas/AIUsageDetailsSummary"},"top_users":{"items":{"$ref":"#/components/schemas/AIUsageTopUser"},"type":"array","title":"Top Users"},"by_model":{"anyOf":[{"items":{"$ref":"#/components/schemas/AIUsageByModel"},"type":"array"},{"type":"null"}],"title":"By Model"},"daily":{"items":{"$ref":"#/components/schemas/AIUsageDaily"},"type":"array","title":"Daily"}},"additionalProperties":true,"type":"object","required":["summary","top_users","daily"],"title":"GetAiUsageDetailsResponse","description":"Response for ``get_ai_usage_details``."},"GetAiUsageResponse":{"properties":{"requests_used":{"type":"integer","title":"Requests Used"},"monthly_limit":{"type":"integer","title":"Monthly Limit"},"remaining":{"type":"integer","title":"Remaining"},"is_unlimited":{"type":"boolean","title":"Is Unlimited"},"plan_tier":{"type":"string","title":"Plan Tier"},"has_ai_pro":{"type":"boolean","title":"Has Ai Pro"},"is_trial":{"type":"boolean","title":"Is Trial"},"overage_enabled":{"type":"boolean","title":"Overage Enabled"},"overage_requests":{"type":"integer","title":"Overage Requests"},"overage_rates_cents":{"$ref":"#/components/schemas/AIOverageRatesCents"},"overage_breakdown":{"$ref":"#/components/schemas/AIOverageBreakdown"},"estimated_overage_cost_cents":{"type":"integer","title":"Estimated Overage Cost Cents"},"projected_month_end_overage_cents":{"type":"integer","title":"Projected Month End Overage Cents"},"ai_paused_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Paused At"},"ai_paused_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Paused By"},"upgrade_suggestion":{"anyOf":[{"$ref":"#/components/schemas/AIUpgradeSuggestion"},{"type":"null"}]},"disabled_features_when_paused":{"items":{"type":"string"},"type":"array","title":"Disabled Features When Paused"}},"additionalProperties":true,"type":"object","required":["requests_used","monthly_limit","remaining","is_unlimited","plan_tier","has_ai_pro","is_trial","overage_enabled","overage_requests","overage_rates_cents","overage_breakdown","estimated_overage_cost_cents","projected_month_end_overage_cents","disabled_features_when_paused"],"title":"GetAiUsageResponse","description":"Response for ``get_ai_usage`` (also returned by pause/resume)."},"GetAnomalyDetailResponse":{"properties":{"anomaly_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anomaly Type"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"transaction_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Transaction Ids"},"entity_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Entity Ids"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fingerprint"},"recommended_action":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Recommended Action"},"evidence":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Evidence"},"dismissed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Dismissed"},"dismissal":{"anyOf":[{"$ref":"#/components/schemas/AnomalyDismissalState"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"GetAnomalyDetailResponse","description":"Response for ``get_anomaly_detail``."},"GetAttachmentDownloadUrlResponse":{"properties":{"download_url":{"type":"string","title":"Download Url"}},"additionalProperties":true,"type":"object","required":["download_url"],"title":"GetAttachmentDownloadUrlResponse","description":"Response for ``get_attachment_download_url``."},"GetAttachmentUploadUrlResponse":{"properties":{"upload_url":{"type":"string","title":"Upload Url"},"s3_key":{"type":"string","title":"S3 Key"}},"additionalProperties":true,"type":"object","required":["upload_url","s3_key"],"title":"GetAttachmentUploadUrlResponse","description":"Response for ``get_attachment_upload_url``."},"GetBalanceSheetResponse":{"items":{"$ref":"#/components/schemas/BalanceSheetSectionBlock"},"type":"array","title":"GetBalanceSheetResponse","description":"Sectioned balance sheet (list of section blocks)."},"GetBalanceValidationResponse":{"properties":{"balanced":{"type":"boolean","title":"Balanced"},"opening_balance":{"type":"integer","title":"Opening Balance"},"closing_balance":{"type":"integer","title":"Closing Balance"},"net_transactions":{"type":"integer","title":"Net Transactions"},"expected_closing":{"type":"integer","title":"Expected Closing"},"difference":{"type":"integer","title":"Difference"}},"additionalProperties":true,"type":"object","required":["balanced","opening_balance","closing_balance","net_transactions","expected_closing","difference"],"title":"GetBalanceValidationResponse","description":"Balance validation (amounts in cents)."},"GetBillingCatalogResponse":{"properties":{},"additionalProperties":true,"type":"object","title":"GetBillingCatalogResponse","description":"Stripe slug → price details (handler returns the catalog dict directly).\n\nKeys are catalog slugs; values match :class:`BillingCatalogEntry`."},"GetBillingStatusResponse":{"properties":{"billing_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Status"},"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"firm_plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Plan Tier"},"trial_ends_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trial Ends At"},"trial_days_remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Trial Days Remaining"},"is_billing_active":{"type":"boolean","title":"Is Billing Active"},"has_stripe_subscription":{"type":"boolean","title":"Has Stripe Subscription"},"active_addons":{"items":{"type":"string"},"type":"array","title":"Active Addons"},"grandfathered_addons":{"items":{"type":"string"},"type":"array","title":"Grandfathered Addons"},"subscription_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Period End"},"monthly_total":{"type":"integer","title":"Monthly Total"},"annual_total":{"type":"integer","title":"Annual Total","default":0},"billing_interval":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Interval"},"base_plan_price":{"type":"integer","title":"Base Plan Price","default":0},"is_demo":{"type":"boolean","title":"Is Demo","default":false}},"additionalProperties":true,"type":"object","required":["is_billing_active","has_stripe_subscription","active_addons","grandfathered_addons","monthly_total"],"title":"GetBillingStatusResponse","description":"Response for ``get_billing_status``."},"GetBooksStandupResponse":{"properties":{"as_of":{"type":"string","title":"As Of"},"business_id":{"type":"string","title":"Business Id"},"greeting":{"type":"string","title":"Greeting"},"headline":{"type":"string","title":"Headline"},"summary_md":{"type":"string","title":"Summary Md"},"highlights":{"items":{"$ref":"#/components/schemas/StandupHighlight"},"type":"array","title":"Highlights"},"action_cards":{"items":{"$ref":"#/components/schemas/StandupActionCard"},"type":"array","title":"Action Cards"},"brief":{"$ref":"#/components/schemas/DailyBriefResponse"}},"additionalProperties":true,"type":"object","required":["as_of","business_id","greeting","headline","summary_md","highlights","action_cards","brief"],"title":"GetBooksStandupResponse","description":"Response for ``get_books_standup``."},"GetCashFlowOutflowBreakdownResponse":{"properties":{"categories":{"items":{"$ref":"#/components/schemas/CashOutflowCategory"},"type":"array","title":"Categories"},"vendors":{"items":{"$ref":"#/components/schemas/CashOutflowVendor"},"type":"array","title":"Vendors"},"total_outflow_cents":{"type":"integer","title":"Total Outflow Cents"},"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"}},"additionalProperties":true,"type":"object","required":["categories","vendors","total_outflow_cents","start_date","end_date"],"title":"GetCashFlowOutflowBreakdownResponse","description":"Response for ``get_cash_flow_outflow_breakdown``."},"GetCashFlowStatementResponse":{"properties":{"business_id":{"type":"string","title":"Business Id","description":"Business ID"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name","description":"Business name"},"start_date":{"type":"string","format":"date","title":"Start Date","description":"Report start date"},"end_date":{"type":"string","format":"date","title":"End Date","description":"Report end date"},"generated_at":{"type":"string","format":"date-time","title":"Generated At","description":"When the report was generated"},"method":{"type":"string","const":"indirect","title":"Method","description":"Construction method. The indirect method is canonical.","default":"indirect"},"net_income":{"type":"integer","title":"Net Income","description":"Net Income (accrual) for the period in cents. Also appears as the first line item of ``operating_activities``."},"operating_activities":{"$ref":"#/components/schemas/CashFlowSection","description":"Section A — operating activities"},"investing_activities":{"$ref":"#/components/schemas/CashFlowSection","description":"Section B — investing activities"},"financing_activities":{"$ref":"#/components/schemas/CashFlowSection","description":"Section C — financing activities"},"net_cash_from_operating":{"type":"integer","title":"Net Cash From Operating","description":"Subtotal of Section A (cents)"},"net_cash_from_investing":{"type":"integer","title":"Net Cash From Investing","description":"Subtotal of Section B (cents)"},"net_cash_from_financing":{"type":"integer","title":"Net Cash From Financing","description":"Subtotal of Section C (cents)"},"net_change_in_cash":{"type":"integer","title":"Net Change In Cash","description":"Sum of Sections A+B+C (cents)"},"beginning_cash":{"type":"integer","title":"Beginning Cash","description":"Σ beginning natural balance for cfs_class='cash' (cents)"},"ending_cash":{"type":"integer","title":"Ending Cash","description":"Beginning cash + Net change in cash (cents)"},"supplemental_disclosures":{"$ref":"#/components/schemas/SupplementalDisclosures","description":"ASC 230 supplemental disclosures"},"validation_results":{"items":{"$ref":"#/components/schemas/CashFlowValidationResult"},"type":"array","title":"Validation Results","description":"Outcome of §5 validation rules"},"validation_passed":{"type":"boolean","title":"Validation Passed","description":"True iff every §5 validation rule passed","default":true},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"Non-fatal accuracy warnings. Validation failures are duplicated here so legacy callers that ignore ``validation_results`` still see the diagnostic."}},"additionalProperties":true,"type":"object","required":["business_id","start_date","end_date","net_income","operating_activities","investing_activities","financing_activities","net_cash_from_operating","net_cash_from_investing","net_cash_from_financing","net_change_in_cash","beginning_cash","ending_cash"],"title":"GetCashFlowStatementResponse","description":"Response for ``get_cash_flow_statement`` (indirect method, cents)."},"GetCashFlowStatementsPeriodicResponse":{"properties":{"grouping":{"type":"string","enum":["monthly","quarterly"],"title":"Grouping"},"periods":{"items":{"$ref":"#/components/schemas/CashFlowPeriodicPeriod"},"type":"array","title":"Periods"},"statements":{"items":{"$ref":"#/components/schemas/CashFlowStatement"},"type":"array","title":"Statements"}},"additionalProperties":true,"type":"object","required":["grouping","periods","statements"],"title":"GetCashFlowStatementsPeriodicResponse","description":"Response for ``get_cash_flow_statements_periodic``."},"GetCloseScoreResponse":{"properties":{"id":{"type":"string","title":"Id"},"period_id":{"type":"string","title":"Period Id"},"score":{"type":"number","title":"Score"},"color":{"type":"string","title":"Color"},"components":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Components"},"blockers":{"items":{"$ref":"#/components/schemas/CloseScoreBlocker"},"type":"array","title":"Blockers"},"last_computed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Computed At"}},"additionalProperties":true,"type":"object","required":["id","period_id","score","color","components","blockers"],"title":"GetCloseScoreResponse","description":"Response for ``get_close_score`` / ``recompute_close_score``."},"GetConsolidatedBalanceSheetResponse":{"properties":{"as_of_date":{"type":"string","title":"As Of Date"},"assets_cents":{"type":"integer","title":"Assets Cents"},"liabilities_cents":{"type":"integer","title":"Liabilities Cents"},"equity_cents":{"type":"integer","title":"Equity Cents"},"asset_breakdown":{"$ref":"#/components/schemas/ConsolidatedAssetBreakdown"},"liability_breakdown":{"$ref":"#/components/schemas/ConsolidatedLiabilityBreakdown"},"equity_breakdown":{"additionalProperties":{"type":"integer"},"type":"object","title":"Equity Breakdown"},"is_balanced":{"type":"boolean","title":"Is Balanced","default":true},"business_count":{"type":"integer","title":"Business Count"},"businesses_with_teal":{"type":"integer","title":"Businesses With Teal","default":0},"businesses_with_local":{"type":"integer","title":"Businesses With Local","default":0}},"additionalProperties":true,"type":"object","required":["as_of_date","assets_cents","liabilities_cents","equity_cents","business_count"],"title":"GetConsolidatedBalanceSheetResponse","description":"Uneliminated balance sheet roll-up across firm client businesses."},"GetConsolidatedPnlResponse":{"properties":{"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"revenue_cents":{"type":"integer","title":"Revenue Cents"},"expenses_cents":{"type":"integer","title":"Expenses Cents"},"net_income_cents":{"type":"integer","title":"Net Income Cents"},"revenue_breakdown":{"additionalProperties":{"type":"integer"},"type":"object","title":"Revenue Breakdown"},"expense_breakdown":{"additionalProperties":{"type":"integer"},"type":"object","title":"Expense Breakdown"},"cogs_breakdown":{"additionalProperties":{"type":"integer"},"type":"object","title":"Cogs Breakdown"},"other_income_breakdown":{"additionalProperties":{"type":"integer"},"type":"object","title":"Other Income Breakdown"},"other_expense_breakdown":{"additionalProperties":{"type":"integer"},"type":"object","title":"Other Expense Breakdown"},"business_count":{"type":"integer","title":"Business Count"},"businesses_with_teal":{"type":"integer","title":"Businesses With Teal","default":0},"businesses_with_local":{"type":"integer","title":"Businesses With Local","default":0},"source":{"type":"string","enum":["gl","categorized_transactions","transaction_estimate"],"title":"Source","default":"gl"},"transaction_count":{"type":"integer","title":"Transaction Count","default":0},"categorized_count":{"type":"integer","title":"Categorized Count","default":0},"uncategorized_count":{"type":"integer","title":"Uncategorized Count","default":0}},"additionalProperties":true,"type":"object","required":["start_date","end_date","revenue_cents","expenses_cents","net_income_cents","business_count"],"title":"GetConsolidatedPnlResponse","description":"Uneliminated P&L roll-up across firm client businesses."},"GetCountResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"count_number":{"type":"string","title":"Count Number"},"location_id":{"type":"string","title":"Location Id"},"status":{"type":"string","title":"Status"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"posted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Posted At"},"counted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counted By User Id"},"posted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted By User Id"},"variance_line_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Variance Line Count"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"lines":{"items":{"$ref":"#/components/schemas/CycleCountLineResponse"},"type":"array","title":"Lines","default":[]}},"additionalProperties":true,"type":"object","required":["id","business_id","count_number","location_id","status"],"title":"GetCountResponse","description":"Response for ``get_count``."},"GetCoverageReportResponse":{"properties":{"integration":{"type":"string","title":"Integration"},"object_types":{"type":"integer","title":"Object Types"},"rows":{"items":{"$ref":"#/components/schemas/CoverageReportRow"},"type":"array","title":"Rows"}},"additionalProperties":true,"type":"object","required":["integration","object_types","rows"],"title":"GetCoverageReportResponse","description":"Response for ``get_coverage_report``."},"GetDailyBriefResponse":{"properties":{"as_of":{"type":"string","title":"As Of"},"business_id":{"type":"string","title":"Business Id"},"categorization":{"$ref":"#/components/schemas/DailyBriefCategorizationTile"},"ap_drafts":{"$ref":"#/components/schemas/DailyBriefApDraftsTile"},"anomalies":{"$ref":"#/components/schemas/DailyBriefAnomaliesTile"},"close_score":{"$ref":"#/components/schemas/DailyBriefCloseScoreTile"}},"additionalProperties":true,"type":"object","required":["as_of","business_id","categorization","ap_drafts","anomalies","close_score"],"title":"GetDailyBriefResponse","description":"Response for ``get_daily_brief``."},"GetFirmAIInsightsResponse":{"properties":{"insights":{"items":{"$ref":"#/components/schemas/FirmInsightItem"},"type":"array","title":"Insights"}},"type":"object","title":"GetFirmAIInsightsResponse"},"GetFirmApSummaryResponse":{"properties":{"totals":{"$ref":"#/components/schemas/FirmSummaryTotals"},"clients":{"items":{"$ref":"#/components/schemas/FirmClientSummary"},"type":"array","title":"Clients"}},"additionalProperties":true,"type":"object","required":["totals","clients"],"title":"GetFirmApSummaryResponse","description":"Response for ``get_firm_ap_summary``."},"GetFirmClientUsageResponse":{"properties":{"is_advisory_firm":{"type":"boolean","title":"Is Advisory Firm"},"firm_plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Plan Tier"},"active_clients":{"type":"integer","title":"Active Clients"},"client_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Limit"},"seats_remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seats Remaining"},"can_add_client":{"type":"boolean","title":"Can Add Client"},"tiers":{"items":{"$ref":"#/components/schemas/FirmTierOption"},"type":"array","title":"Tiers"},"firm_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Id"}},"additionalProperties":true,"type":"object","required":["is_advisory_firm","active_clients","can_add_client","tiers"],"title":"GetFirmClientUsageResponse","description":"Response for ``get_firm_client_usage``."},"GetFirmLogoResponse":{"properties":{"download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Url"},"firm_id":{"type":"string","title":"Firm Id"}},"additionalProperties":true,"type":"object","required":["firm_id"],"title":"GetFirmLogoResponse","description":"Response for ``get_firm_logo``."},"GetGrandfatheredSummaryResponse":{"properties":{"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"is_grandfathered":{"type":"boolean","title":"Is Grandfathered"},"current_access":{"$ref":"#/components/schemas/GrandfatheredCurrentAccess"},"available_plans":{"items":{"$ref":"#/components/schemas/GrandfatheredAvailablePlan"},"type":"array","title":"Available Plans"}},"additionalProperties":true,"type":"object","required":["is_grandfathered","current_access","available_plans"],"title":"GetGrandfatheredSummaryResponse","description":"Response for ``get_grandfathered_summary``."},"GetIncomeStatementFlatResponse":{"properties":{},"additionalProperties":true,"type":"object","title":"GetIncomeStatementFlatResponse","description":"Response for ``get_income_statement_flat``."},"GetIncomeStatementResponse":{"items":{"$ref":"#/components/schemas/IncomeStatementSectionBlock"},"type":"array","title":"GetIncomeStatementResponse","description":"Sectioned income statement (list of section blocks)."},"GetInvoiceHistoryResponse":{"properties":{"invoices":{"items":{"$ref":"#/components/schemas/BillingInvoiceItem"},"type":"array","title":"Invoices"}},"additionalProperties":true,"type":"object","required":["invoices"],"title":"GetInvoiceHistoryResponse","description":"Response for ``get_invoice_history``."},"GetInvoicePdfUrlResponse":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id"},"stripe_invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Invoice Id"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"pdf_url":{"type":"string","title":"Pdf Url"},"hosted_invoice_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hosted Invoice Url"}},"additionalProperties":true,"type":"object","required":["invoice_id","pdf_url"],"title":"GetInvoicePdfUrlResponse","description":"Response for ``get_invoice_pdf_url``."},"GetLedgerStatementResponse":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id"},"ledger_name":{"type":"string","title":"Ledger Name"},"ledger_type":{"anyOf":[{"type":"string","enum":["asset","liability","equity","revenue","expense"]},{"type":"null"}],"title":"Ledger Type"},"is_debit_normal":{"type":"boolean","title":"Is Debit Normal"},"beginning_balance":{"type":"integer","title":"Beginning Balance"},"ending_balance":{"type":"integer","title":"Ending Balance"},"total_debits":{"type":"integer","title":"Total Debits"},"total_credits":{"type":"integer","title":"Total Credits"},"net_activity":{"type":"integer","title":"Net Activity"},"transactions":{"items":{"$ref":"#/components/schemas/LedgerStatementTransaction"},"type":"array","title":"Transactions"}},"additionalProperties":true,"type":"object","required":["ledger_id","ledger_name","is_debit_normal","beginning_balance","ending_balance","total_debits","total_credits","net_activity","transactions"],"title":"GetLedgerStatementResponse","description":"Response for ``get_ledger_statement``."},"GetLedgerVendorBreakdownResponse":{"properties":{"vendors":{"items":{"$ref":"#/components/schemas/LedgerVendorBreakdownEntry"},"type":"array","title":"Vendors"},"total_amount":{"type":"integer","title":"Total Amount"}},"additionalProperties":true,"type":"object","required":["vendors","total_amount"],"title":"GetLedgerVendorBreakdownResponse","description":"Response for ``get_ledger_vendor_breakdown``."},"GetLedgerVendorPeriodMatrixResponse":{"properties":{"vendors":{"items":{"$ref":"#/components/schemas/LedgerVendorPeriodRow"},"type":"array","title":"Vendors"},"periods":{"items":{"type":"string"},"type":"array","title":"Periods"}},"additionalProperties":true,"type":"object","required":["vendors","periods"],"title":"GetLedgerVendorPeriodMatrixResponse","description":"Response for ``get_ledger_vendor_period_matrix``."},"GetLedgerVendorTransactionsResponse":{"properties":{"transactions":{"items":{"$ref":"#/components/schemas/LedgerVendorTransactionEntry"},"type":"array","title":"Transactions"},"total_amount":{"type":"integer","title":"Total Amount"}},"additionalProperties":true,"type":"object","required":["transactions","total_amount"],"title":"GetLedgerVendorTransactionsResponse","description":"Response for ``get_ledger_vendor_transactions``."},"GetLocationInventoryResponse":{"properties":{"location":{"$ref":"#/components/schemas/LocationResponse"},"items":{"items":{"$ref":"#/components/schemas/VariantInventoryAcrossLocations"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor"},"has_next":{"type":"boolean","title":"Has Next","default":false},"has_prev":{"type":"boolean","title":"Has Prev","default":false}},"additionalProperties":true,"type":"object","required":["location","items"],"title":"GetLocationInventoryResponse","description":"Response for ``get_location_inventory``."},"GetMigrationReportResponse":{"properties":{"as_of_date":{"type":"string","title":"As Of Date"},"rows":{"items":{"$ref":"#/components/schemas/MigrationReportRow"},"type":"array","title":"Rows"},"totals":{"$ref":"#/components/schemas/app__api__v1__schemas__quickbooks__responses__MigrationReportTotals"}},"additionalProperties":true,"type":"object","required":["as_of_date","rows","totals"],"title":"GetMigrationReportResponse","description":"Response for ``get_migration_report`` — trial-balance QA."},"GetOrderPdfsResponse":{"type":"string","title":"GetOrderPdfsResponse","description":"Response for ``get_order_pdfs`` (handler returns a signed URL string)."},"GetPaymentRecommendationsResponse":{"properties":{"summary":{"$ref":"#/components/schemas/PaymentRecommendationsSummary"},"recommendations":{"$ref":"#/components/schemas/PaymentRecommendationsGrouped"}},"additionalProperties":true,"type":"object","required":["summary","recommendations"],"title":"GetPaymentRecommendationsResponse","description":"Response for ``get_payment_recommendations``."},"GetPricingConfigResponse":{"properties":{"annual_discount_pct":{"type":"number","title":"Annual Discount Pct"},"annual_discount_label":{"type":"string","title":"Annual Discount Label"}},"additionalProperties":true,"type":"object","required":["annual_discount_pct","annual_discount_label"],"title":"GetPricingConfigResponse","description":"Response for ``get_pricing_config``."},"GetProfileResponse":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id"},"accounting_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accounting Basis"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"key_personnel":{"items":{"type":"string"},"type":"array","title":"Key Personnel","default":[]},"convention_overrides":{"additionalProperties":{"type":"string"},"type":"object","title":"Convention Overrides","default":{}},"tax_remittance_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Remittance Ledger Id"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"additionalProperties":true,"type":"object","title":"GetProfileResponse","description":"Response for ``get_profile`` (empty ``{}`` when no profile exists)."},"GetReconciliationResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id"},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name"},"status":{"type":"string","title":"Status"},"status_display":{"type":"string","title":"Status Display"},"statement_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement Filename"},"statement_start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement Start Date"},"statement_end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement End Date"},"opening_balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Opening Balance"},"closing_balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Closing Balance"},"locked":{"type":"boolean","title":"Locked"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"input_txns":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationInputTxns"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Txns"},"ai_match_results":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationAIMatchResults"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Ai Match Results"},"user_committed_matches":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationCommittedMatches"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Committed Matches"},"match_counts":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationMatchCounts"},{"type":"null"}]},"workflow_started":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Workflow Started"}},"additionalProperties":true,"type":"object","required":["id","business_id","status","status_display","locked"],"title":"GetReconciliationResponse","description":"Full reconciliation with transaction and match detail."},"GetScoreHistoryResponse":{"properties":{"period_id":{"type":"string","title":"Period Id"},"history":{"items":{"$ref":"#/components/schemas/CloseScoreHistoryEntry"},"type":"array","title":"History"}},"additionalProperties":true,"type":"object","required":["period_id","history"],"title":"GetScoreHistoryResponse","description":"Response for ``get_score_history``."},"GetSettingsResponse":{"properties":{"monthly_limit_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Limit Cents"}},"additionalProperties":true,"type":"object","title":"GetSettingsResponse","description":"Response for ``get_settings``."},"GetTransactionAllocationsResponse":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id"},"amount":{"type":"integer","title":"Amount"},"allocated":{"type":"integer","title":"Allocated"},"unallocated":{"type":"integer","title":"Unallocated"}},"additionalProperties":true,"type":"object","required":["transaction_id","amount","allocated","unallocated"],"title":"GetTransactionAllocationsResponse","description":"Response for ``get_transaction_allocations`` — amounts in cents."},"GetTransferSummaryResponse":{"properties":{"by_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Status"},"in_transit":{"$ref":"#/components/schemas/TransferInTransitSummary"}},"additionalProperties":true,"type":"object","required":["by_status","in_transit"],"title":"GetTransferSummaryResponse","description":"Response for ``get_transfer_summary``."},"GetUserRoleInBusinessResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"business_id":{"type":"string","title":"Business Id"},"role":{"type":"string","title":"Role"}},"additionalProperties":true,"type":"object","required":["user_id","business_id","role"],"title":"GetUserRoleInBusinessResponse","description":"Envelope data for ``get_user_role_in_business``."},"GrandfatheredAvailablePlan":{"properties":{"plan_tier":{"type":"string","title":"Plan Tier"},"catalog_slug":{"type":"string","title":"Catalog Slug"},"price_amount":{"type":"integer","title":"Price Amount"},"interval":{"type":"string","title":"Interval"}},"additionalProperties":true,"type":"object","required":["plan_tier","catalog_slug","price_amount","interval"],"title":"GrandfatheredAvailablePlan"},"GrandfatheredCurrentAccess":{"properties":{"all_addons_included":{"type":"boolean","title":"All Addons Included"},"addons":{"items":{"type":"string"},"type":"array","title":"Addons"},"ai_monthly_limit":{"type":"integer","title":"Ai Monthly Limit"},"has_ai_pro":{"type":"boolean","title":"Has Ai Pro"},"billing_status":{"type":"string","title":"Billing Status"},"no_payment_required":{"type":"boolean","title":"No Payment Required"}},"additionalProperties":true,"type":"object","required":["all_addons_included","addons","ai_monthly_limit","has_ai_pro","billing_status","no_payment_required"],"title":"GrandfatheredCurrentAccess"},"GrandfatheredMigrateRequest":{"properties":{"target_plan":{"type":"string","title":"Target Plan","description":"Target plan tier: 'self_directed' or 'managed'."},"success_url":{"type":"string","title":"Success Url","description":"URL to redirect after successful payment."},"cancel_url":{"type":"string","title":"Cancel Url","description":"URL to redirect if checkout is canceled."},"billing_interval":{"type":"string","enum":["month","year"],"title":"Billing Interval","description":"Billing cadence: 'month' or discounted annual 'year'.","default":"month"}},"type":"object","required":["target_plan","success_url","cancel_url"],"title":"GrandfatheredMigrateRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IncomeStatementRow":{"properties":{"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id"},"ledger_name":{"type":"string","title":"Ledger Name"},"total":{"type":"integer","title":"Total"}},"additionalProperties":true,"type":"object","required":["ledger_name","total"],"title":"IncomeStatementRow","description":"Ledger row within an income-statement section; period keys are dynamic."},"IncomeStatementSectionBlock":{"properties":{"section":{"type":"string","title":"Section"},"rows":{"items":{"$ref":"#/components/schemas/IncomeStatementRow"},"type":"array","title":"Rows"},"total_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Amount"}},"additionalProperties":true,"type":"object","required":["section","rows"],"title":"IncomeStatementSectionBlock","description":"Revenue / expense section with period-valued rows."},"IndirectReconciliationItem":{"properties":{"label":{"type":"string","title":"Label","description":"Description of the adjustment"},"amount":{"type":"integer","title":"Amount","description":"Adjustment amount (cents)"}},"type":"object","required":["label","amount"],"title":"IndirectReconciliationItem","description":"Legacy memo line preserved for backwards-compat with callers that\nconsumed the ASC 230 indirect reconciliation as a separate list.\n\nUnder the indirect method this content lives on\n``operating_activities.line_items`` directly; the supplemental memo\nre-emits the same data so existing UI/AI consumers keep working."},"IntentRequest":{"properties":{"query":{"type":"string","maxLength":500,"minLength":1,"title":"Query"}},"type":"object","required":["query"],"title":"IntentRequest"},"IntentResponse":{"properties":{"action":{"type":"string","title":"Action","description":"navigate | search | ai_task_started | unknown"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"URL for navigation"},"search_query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Query","description":"Query for search"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id","description":"Task ID for AI mutations"},"confidence":{"type":"number","title":"Confidence","description":"Classification confidence","default":1.0}},"type":"object","required":["action"],"title":"IntentResponse"},"InventoryActivityItem":{"properties":{"id":{"type":"string","title":"Id"},"event_type":{"type":"string","title":"Event Type"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"related_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Related Type"},"related_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Related Id"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","event_type","title","created_at"],"title":"InventoryActivityItem"},"InventoryActivityResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/InventoryActivityItem"},"type":"array","title":"Items"}},"type":"object","title":"InventoryActivityResponse"},"InventoryAdjustmentRequest":{"properties":{"variant_id":{"type":"string","title":"Variant Id","description":"Product variant UUID to adjust."},"quantity_change":{"type":"integer","title":"Quantity Change","description":"Quantity change: positive to add, negative to subtract. Cannot be zero."},"reason":{"type":"string","minLength":1,"title":"Reason","description":"Adjustment reason. Prefer one of the canonical values: shrinkage | damage | expired | count_variance | theft | transfer | return | receipt_correction | found | other. Free-text values are accepted for backward compatibility."},"reason_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason Code","description":"Optional canonical reason code (overrides `reason` for reporting). See InventoryAdjustmentReason for valid values."},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id","description":"Location UUID where adjustment applies. Uses default location if not specified."}},"type":"object","required":["variant_id","quantity_change","reason"],"title":"InventoryAdjustmentRequest","description":"Request schema for manual inventory adjustments.\n\nUse this to correct inventory counts outside of normal\norder/shipment flows (e.g., damaged goods, shrinkage, audit corrections).","example":{"location_id":"019ab37c-loc1-7000-8000-000000000001","quantity_change":-5,"reason":"Damaged in warehouse - water damage","variant_id":"019ab37c-var1-7000-8000-000000000001"}},"InventoryAdjustmentResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Adjustment UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"variant_id":{"type":"string","title":"Variant Id","description":"Adjusted variant UUID."},"delta":{"type":"integer","title":"Delta","description":"Quantity change applied."},"correction_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correction Reason","description":"Adjustment reason."},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id","description":"Location where adjustment was applied."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When adjustment was made."}},"type":"object","required":["id","business_id","variant_id","delta","created_at"],"title":"InventoryAdjustmentResponse","description":"Response schema for an inventory adjustment.","example":{"business_id":"019ab37c-bus1-7000-8000-000000000001","correction_reason":"Damaged in warehouse - water damage","created_at":"2024-01-15T14:00:00Z","delta":-5,"id":"019ab37c-adj1-7000-8000-000000000001","location_id":"019ab37c-loc1-7000-8000-000000000001","variant_id":"019ab37c-var1-7000-8000-000000000001"}},"InventoryCogsSlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"inventory_cogs","title":"Slide Type","default":"inventory_cogs"},"data":{"$ref":"#/components/schemas/InventoryCogsSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"InventoryCogsSlide"},"InventoryCogsSlideData":{"properties":{"inventory_value_cents":{"type":"integer","title":"Inventory Value Cents"},"inventory_days_on_hand":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Inventory Days On Hand"},"cogs_last_period_cents":{"type":"integer","title":"Cogs Last Period Cents"},"top_skus":{"items":{"$ref":"#/components/schemas/InventoryTopSku"},"type":"array","maxItems":12,"title":"Top Skus"}},"additionalProperties":false,"type":"object","required":["inventory_value_cents","cogs_last_period_cents"],"title":"InventoryCogsSlideData"},"InventoryOrderCreate":{"properties":{"vendor_id":{"type":"string","title":"Vendor Id","description":"Vendor UUID."},"status":{"type":"string","title":"Status","description":"Order status (draft, submitted, confirmed, received, cancelled)."},"name":{"type":"string","title":"Name","description":"Order name/title."},"po_number":{"type":"string","title":"Po Number","description":"Purchase order number."},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/LineItem"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Products being ordered."},"fees":{"anyOf":[{"items":{"$ref":"#/components/schemas/Fee"},"type":"array"},{"type":"null"}],"title":"Fees","description":"Additional fees (shipping, handling, etc.)."},"payments":{"anyOf":[{"items":{"$ref":"#/components/schemas/Payment-Input"},"type":"array"},{"type":"null"}],"title":"Payments","description":"Payments made on this order."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Order notes."},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total order amount in cents (calculated if not provided)."},"balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Balance","description":"Remaining balance in cents (total minus payments)."},"shipping_cost":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Shipping Cost","description":"Freight/shipping cost in cents."},"ship_from_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ship From Location Id","description":"Source location; defaults to vendor.default_location_id."},"ship_to_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ship To Location Id","description":"Destination location."},"production_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Production Run Id","description":"Linked production run (for copacker orders)."},"expected_delivery_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Delivery Date","description":"Expected delivery date (ISO 8601)."},"payment_term_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Term Id","description":"Payment term ID for net terms (defaults to vendor's)."},"expected_paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Paid On","description":"Expected payment date (ISO 8601). Auto-calculated from delivery + net terms if not provided."}},"type":"object","required":["vendor_id","status","name","po_number"],"title":"InventoryOrderCreate","description":"Request schema for creating an inventory (purchase) order.\n\nInventory orders track purchases from vendors, including\nline items, fees, and payment status.\n\n**Order Statuses:**\n- `draft`: Order being prepared\n- `submitted`: Sent to vendor\n- `confirmed`: Vendor confirmed\n- `partially_received`: Some items received\n- `received`: All items received\n- `cancelled`: Order cancelled","example":{"description":"Monthly restock order","fees":[{"amount":5000,"name":"Shipping"}],"line_items":[{"quantity":100,"unit_price":1200,"variant_id":"019ab37c-var1-7000-8000-000000000001"}],"name":"January Inventory Restock","po_number":"PO-2024-001","status":"draft","vendor_id":"019ab37c-vend-7000-8000-000000000001"}},"InventoryOrderUpdate":{"properties":{"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Updated vendor UUID."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Updated status."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Updated name."},"po_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Number","description":"Updated PO number."},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/LineItem"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Replace line items."},"fees":{"anyOf":[{"items":{"$ref":"#/components/schemas/Fee"},"type":"array"},{"type":"null"}],"title":"Fees","description":"Replace fees."},"payments":{"anyOf":[{"items":{"$ref":"#/components/schemas/Payment-Input"},"type":"array"},{"type":"null"}],"title":"Payments","description":"Replace payments."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Updated notes."},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Updated total in cents."},"balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Balance","description":"Updated balance in cents."},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version","description":"Version for optimistic locking (prevents concurrent updates)."},"shipping_cost":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Shipping Cost","description":"Freight/shipping cost in cents."},"ship_from_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ship From Location Id","description":"Source location."},"ship_to_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ship To Location Id","description":"Destination location."},"production_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Production Run Id","description":"Linked production run."},"expected_delivery_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Delivery Date","description":"Updated expected delivery date."},"payment_term_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Term Id","description":"Updated payment term ID."},"expected_paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Paid On","description":"Updated expected payment date."}},"type":"object","title":"InventoryOrderUpdate","description":"Request schema for updating an inventory order.\n\nAll fields are optional - only include fields to change.","example":{"description":"Order submitted to vendor on 2024-01-15","status":"submitted"}},"InventorySummary":{"properties":{"on_hand":{"type":"number","minimum":0.0,"title":"On Hand","description":"Total physical inventory quantity in your possession.","default":0},"available":{"type":"number","minimum":0.0,"title":"Available","description":"Quantity available for allocation.","default":0},"in_transit":{"type":"number","minimum":0.0,"title":"In Transit","description":"Quantity currently being shipped to your location.","default":0},"ordered":{"type":"number","minimum":0.0,"title":"Ordered","description":"Quantity ordered from suppliers but not yet shipped.","default":0}},"type":"object","title":"InventorySummary","description":"Summary of inventory quantities for a product variant.\n\nTracks different inventory states to support proper stock management\nand prevent overselling.","example":{"available":100,"in_transit":25,"on_hand":100,"ordered":50}},"InventoryTopSku":{"properties":{"sku":{"type":"string","title":"Sku"},"name":{"type":"string","title":"Name"},"qty_on_hand":{"type":"integer","title":"Qty On Hand"},"value_cents":{"type":"integer","title":"Value Cents"}},"additionalProperties":false,"type":"object","required":["sku","name","qty_on_hand","value_cents"],"title":"InventoryTopSku"},"InvitationItemResponse":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","description":"'client' or 'staff'."},"email":{"type":"string","title":"Email"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"reason":{"anyOf":[{"type":"string","enum":["clerk_confirmed","new_user","needs_clerk_signup","clerk_unavailable","resent"]},{"type":"null"}],"title":"Reason","description":"Derived at list time for pending invitations — explains why the invite hasn't been accepted yet (new_user / needs_clerk_signup / clerk_unavailable). None for terminal states (accepted / cancelled / expired)."},"firm_id":{"type":"string","title":"Firm Id"},"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id","description":"Business ID (client invitations only)."},"invited_by":{"type":"string","title":"Invited By"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"last_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sent At"},"email_opened_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Email Opened At","description":"Best-effort: first hit on the tracking pixel embedded in the email."},"email_delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Email Delivered At","description":"When SES reported the email as delivered to the recipient's inbox."},"email_bounced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Email Bounced At","description":"When SES reported the email as bounced. Indicates the mailbox is invalid or unreachable."},"email_bounce_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Bounce Reason","description":"Short SES-supplied reason for the bounce, when available."},"email_complaint_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Email Complaint At","description":"When the recipient marked the message as spam."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"business_ids":{"items":{"type":"string"},"type":"array","title":"Business Ids","description":"Businesses queued to be assigned to the invitee on accept (staff member invitations only)."},"assign_all_firm_businesses":{"type":"boolean","title":"Assign All Firm Businesses","description":"If true, the invitee will be assigned to every active firm business on accept (staff member invitations only).","default":false},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id","description":"Team the invitee will join on accept (staff member invitations only)."}},"type":"object","required":["id","type","email","role","status","firm_id","invited_by","created_at"],"title":"InvitationItemResponse","description":"A single invitation in a list response."},"InvitationListResponse":{"properties":{"invitations":{"items":{"$ref":"#/components/schemas/InvitationItemResponse"},"type":"array","title":"Invitations"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["invitations","total"],"title":"InvitationListResponse","description":"Response schema for listing firm invitations."},"InvitationPreviewResponse":{"properties":{"status":{"type":"string","enum":["pending","expired","accepted","cancelled","not_found"],"title":"Status"},"invitation_type":{"anyOf":[{"type":"string","enum":["client","staff"]},{"type":"null"}],"title":"Invitation Type"},"firm_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Name"},"firm_logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Logo Url"},"invitee_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitee Email"},"invitee_first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitee First Name"},"invitee_last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitee Last Name"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"}},"type":"object","required":["status"],"title":"InvitationPreviewResponse"},"InviteClientRequest":{"properties":{"email":{"type":"string","title":"Email","description":"Email address of the client to invite."},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"Optional first name to personalize the invitation."},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Optional last name to personalize the invitation."},"message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Message","description":"Optional personal message from the inviter included in the email."}},"type":"object","required":["email"],"title":"InviteClientRequest","description":"Request schema for inviting a client user to a business.","example":{"email":"client@example.com"}},"InviteClientResponse":{"properties":{"status":{"type":"string","title":"Status","description":"'added' if user existed and was added, 'invited' if a new invitation email was sent, 'resent' if a pending invitation already existed and was resent with refreshed details."},"reason":{"anyOf":[{"type":"string","enum":["clerk_confirmed","new_user","needs_clerk_signup","clerk_unavailable","resent"]},{"type":"null"}],"title":"Reason","description":"Why this branch was chosen. Lets the UI render the right confirmation message without parsing 'message'."},"message":{"type":"string","title":"Message"},"email_sent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email Sent","description":"Whether the notification email was sent successfully."}},"type":"object","required":["status","message"],"title":"InviteClientResponse","description":"Response schema for a client invitation."},"InviteStaffRequest":{"properties":{"email":{"type":"string","title":"Email","description":"Email address of the person to invite."},"role":{"type":"string","enum":["admin","member"],"title":"Role","description":"Role to assign: 'admin' or 'member'. Owner cannot be invited.","default":"member"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"Optional first name to personalize the invitation."},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Optional last name to personalize the invitation."},"message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Message","description":"Optional personal message from the inviter included in the email."},"business_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Business Ids","description":"For 'member' role: explicit list of businesses the invitee should be assigned to on acceptance. Ignored for 'admin' (admins see every firm business)."},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id","description":"For 'member' role: team to add the invitee to on acceptance. Mutually exclusive with 'business_ids' and 'assign_all_firm_businesses'."},"assign_all_firm_businesses":{"type":"boolean","title":"Assign All Firm Businesses","description":"For 'member' role: if true, grant the invitee direct assignment to every currently active firm business on acceptance.","default":false}},"type":"object","required":["email"],"title":"InviteStaffRequest","description":"Request schema for inviting a staff user to a firm.","example":{"business_ids":["b1111111-1111-1111-1111-111111111111"],"email":"staff@example.com","role":"member"}},"InviteStaffResponse":{"properties":{"status":{"type":"string","title":"Status","description":"'added' if user existed and was added, 'invited' if a new invitation email was sent, 'resent' if the admin re-invited an email with an existing pending invite (refreshed details + rotated token)."},"reason":{"anyOf":[{"type":"string","enum":["clerk_confirmed","new_user","needs_clerk_signup","clerk_unavailable","resent"]},{"type":"null"}],"title":"Reason","description":"Why this branch was chosen. Lets the UI render the right confirmation message without parsing 'message'."},"message":{"type":"string","title":"Message"},"email_sent":{"type":"boolean","title":"Email Sent","description":"Whether the notification email was sent successfully.","default":true}},"type":"object","required":["status","message"],"title":"InviteStaffResponse","description":"Response schema for a staff invitation."},"InvoiceAICreatePayloadRequest":{"properties":{"pasted_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pasted Text","description":"Raw text content to extract an invoice from. Limit 1 invoice per text input. Mutually exclusive with pasted_text_s3_key."},"pasted_text_s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pasted Text S3 Key","description":"S3 key of pasted text content. Limit 1 invoice per text input. Mutually exclusive with pasted_text."},"single_invoice_s3_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Single Invoice S3 Keys","description":"S3 keys of individual invoice documents (PDFs, images, Excel). Each file is processed independently."},"multi_invoice_s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Multi Invoice S3 Key","description":"S3 key of a CSV file containing multiple invoices."}},"type":"object","title":"InvoiceAICreatePayloadRequest","description":"Request schema for AI-powered invoice extraction from uploaded documents.\n\nProvide one or more source inputs. The AI will analyze each source and\nextract draft invoice entities from the content.\n\nSource types:\n- pasted_text: Raw text content to extract an invoice from (limit 1 invoice)\n- pasted_text_s3_key: S3 key of pasted text content (limit 1 invoice)\n- single_invoice_s3_keys: S3 keys of individual invoice documents (PDFs, images, Excel)\n- multi_invoice_s3_key: S3 key of a CSV or Excel file containing multiple invoices","example":{"single_invoice_s3_keys":["business-id/uuid-invoice1.pdf","business-id/uuid-invoice2.png"]}},"InvoiceAICreatePayloadResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DraftInvoice"},"type":"array","title":"Items","description":"List of draft invoice entities extracted by AI."},"errors":{"items":{"$ref":"#/components/schemas/InvoiceFileProcessingError"},"type":"array","title":"Errors","description":"List of per-file errors for files that could not be processed."}},"type":"object","required":["items"],"title":"InvoiceAICreatePayloadResponse","description":"Response schema for AI-powered invoice extraction.\n\nReturns a list of draft invoice entities extracted from the uploaded documents.\nFiles that fail are reported in the ``errors`` list rather than causing\nthe entire request to fail.","example":{"errors":[],"items":[{"amount":25000,"confidence":0.88,"currency":"USD","customer_name":"Acme Corporation","description":"Consulting services","due_date":"2026-03-03","invoice_number":"INV-001","source":"single_file"}]}},"InvoiceAgingResponse":{"properties":{"as_of_date":{"type":"string","title":"As Of Date","description":"Report date in YYYY-MM-DD format."},"customers":{"items":{"$ref":"#/components/schemas/AgingCustomerSummary"},"type":"array","title":"Customers","description":"Per-customer aging summary rows."},"invoices":{"items":{"$ref":"#/components/schemas/AgingInvoiceItem"},"type":"array","title":"Invoices","description":"Individual invoices with aging bucket for drill-down."},"totals":{"$ref":"#/components/schemas/AgingCustomerSummary","description":"Grand totals across all customers."}},"type":"object","required":["as_of_date","customers","invoices","totals"],"title":"InvoiceAgingResponse","description":"AR Aging Summary with per-customer buckets and invoice-level detail."},"InvoiceBulkRequest":{"properties":{"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key","description":"S3 key of the uploaded CSV file containing invoice data."},"finalize":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Finalize","description":"If true, immediately finalize all created invoices.","default":false}},"additionalProperties":true,"type":"object","title":"InvoiceBulkRequest","description":"Request schema for bulk invoice creation via CSV upload.\n\nUpload a CSV file to S3 first, then provide the s3_key here.\n\nCSV columns expected:\n- due_date: Payment due date in YYYY-MM-DD format (marks start of new invoice)\n- customer_email: Email of the customer (must exist in the system)\n- description: Optional invoice-level description/notes\n- variant_sku: SKU of the variant to add (leave blank for custom line items)\n- quantity: Quantity for the line item\n- custom_line_item_description: Description for custom line items (when variant_sku is blank)\n- custom_line_item_amount: Amount in dollars for custom line items\n- invoice_note: Optional invoice description/notes\n\nNote: Multiple line items for the same invoice are grouped by consecutive rows\nwith the same due_date + customer_email combination.","example":{"finalize":false,"s3_key":"uploads/invoices/batch-2024-01.csv"}},"InvoiceCollectionsResponse":{"properties":{"as_of_date":{"type":"string","title":"As Of Date","description":"Report date in YYYY-MM-DD format."},"workflow_id":{"type":"string","title":"Workflow Id","description":"Deterministic Temporal workflow ID for AR collection runs."},"total_overdue_count":{"type":"integer","title":"Total Overdue Count"},"total_overdue_amount_cents":{"type":"integer","title":"Total Overdue Amount Cents"},"overdue_invoices":{"items":{"$ref":"#/components/schemas/CollectionOverdueInvoice"},"type":"array","title":"Overdue Invoices","description":"Open or partially-paid invoices past their due date."},"latest_workflow":{"anyOf":[{"$ref":"#/components/schemas/CollectionWorkflowRun"},{"type":"null"}],"description":"Most recent AR collection workflow run, if any."},"workflow_history":{"items":{"$ref":"#/components/schemas/CollectionWorkflowRun"},"type":"array","title":"Workflow History","description":"Recent AR collection workflow runs newest first."},"reminder_history":{"items":{"$ref":"#/components/schemas/CollectionReminderHistoryItem"},"type":"array","title":"Reminder History","description":"Collection reminder emails recorded in the system."}},"type":"object","required":["as_of_date","workflow_id","total_overdue_count","total_overdue_amount_cents"],"title":"InvoiceCollectionsResponse","description":"Collections dashboard: overdue invoices plus workflow and reminder history."},"InvoiceCreateRequest":{"properties":{"customer_id":{"type":"string","title":"Customer Id","description":"UUID of the customer to invoice."},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Currency for the invoice (USD, CAD, AUD, EUR, or GBP). Defaults to business default.","default":"USD"},"line_items":{"items":{"$ref":"#/components/schemas/LineItemRequest"},"type":"array","minItems":1,"title":"Line Items","description":"Line items (at least one required). Can be variant-linked or custom."},"due_date":{"type":"string","title":"Due Date","description":"Payment due date in YYYY-MM-DD format."},"issue_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issue Date","description":"Optional 'Date of issue' to display on the invoice in YYYY-MM-DD format. Use this to backdate an invoice. When set, it replaces the system-generated issue date on the invoice PDF and receipt."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional invoice description or notes."},"fulfillment_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fulfillment Location Id","description":"Default warehouse UUID for inventory deductions when the invoice is delivered. Per-line `location_id` overrides this."},"recurring":{"anyOf":[{"$ref":"#/components/schemas/InvoiceRecurringConfig"},{"type":"null"}],"description":"If provided, creates a recurring template for this invoice."}},"additionalProperties":true,"type":"object","required":["customer_id","line_items","due_date"],"title":"InvoiceCreateRequest","description":"Request schema for creating a new invoice.\n\nAn invoice represents a bill sent to a customer for goods or services.\nIt contains one or more line items and tracks payment status through\nits lifecycle: draft → pending → paid (or void).","example":{"customer_id":"019ab37c-cust-7000-8000-000000000001","description":"January services","due_date":"2024-02-15","line_items":[{"quantity":3,"variant_id":"019ab37c-var1-7000-8000-000000000001"},{"amount":2500,"description":"Rush delivery fee","variant_id":"custom"}]}},"InvoiceFileProcessingError":{"properties":{"s3_key":{"type":"string","title":"S3 Key","description":"S3 key of the file that failed."},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Original filename (if determinable from the S3 key)."},"error":{"type":"string","title":"Error","description":"Human-readable error description."}},"type":"object","required":["s3_key","error"],"title":"InvoiceFileProcessingError","description":"Error detail for a file that failed during AI extraction."},"InvoiceListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/InvoiceResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"InvoiceListResponse","description":"Paginated list of invoices with cursor-based pagination."},"InvoiceMetricsResponse":{"properties":{"total_outstanding":{"type":"integer","title":"Total Outstanding","description":"Sum of the total for all invoices in 'open' status (in cents)."},"total_overdue":{"type":"integer","title":"Total Overdue","description":"Sum of the total for all open invoices where the current date exceeds the due date (in cents)."}},"type":"object","required":["total_outstanding","total_overdue"],"title":"InvoiceMetricsResponse","description":"Response schema for invoice aggregate metrics."},"InvoicePaymentLinkResponse":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id","description":"UUID of the invoice."},"status":{"type":"string","title":"Status","description":"Current invoice status."},"hosted_invoice_url":{"type":"string","title":"Hosted Invoice Url","description":"Stripe-hosted page where the invoice can be paid online."},"already_paid":{"type":"boolean","title":"Already Paid","description":"True if the invoice is already fully paid.","default":false},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total amount in cents."},"balance_due":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Balance Due","description":"Remaining balance in cents."}},"type":"object","required":["invoice_id","status","hosted_invoice_url"],"title":"InvoicePaymentLinkResponse","description":"Stripe hosted payment link for an invoice (client collection)."},"InvoicePaymentRequest":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the bank transaction representing the payment."},"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Payment amount in cents allocated to this invoice.  Must be > 0 and <= the remaining unallocated amount on the transaction.  Overpayments (exceeding the invoice balance) are permitted."},"paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid On","description":"Override payment date (ISO 8601).  Defaults to the transaction datetime if omitted."}},"type":"object","required":["transaction_id","amount"],"title":"InvoicePaymentRequest","description":"Request schema for linking a bank transaction as payment against an invoice.\n\nSupports split payments: a single transaction can pay multiple invoices\nby creating separate payment records with different allocated amounts.\n\nExample — a $200 bank deposit paying two invoices::\n\n    POST /invoices/{inv_1}/payments  {\"transaction_id\": \"txn_abc\", \"amount\": 12000}\n    POST /invoices/{inv_2}/payments  {\"transaction_id\": \"txn_abc\", \"amount\": 8000}","example":{"amount":12000,"transaction_id":"019ab37c-txn1-7000-8000-000000000001"}},"InvoicePaymentSuggestionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Suggestion UUID."},"invoice_id":{"type":"string","title":"Invoice Id","description":"UUID of the matched invoice."},"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the matched transaction."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"amount":{"type":"integer","title":"Amount","description":"Suggested allocation in cents."},"confidence":{"type":"number","title":"Confidence","description":"Composite match confidence (0.0–1.0)."},"signals":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Signals","description":"Breakdown of individual signal scores (amount_match, date_proximity, memo_match, counterparty_match)."},"match_group_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Group Id","description":"Groups multi-invoice suggestions sharing the same transaction."},"status":{"type":"string","title":"Status","description":"Suggestion status: pending, accepted, rejected, expired."},"reviewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reviewed At","description":"When the suggestion was accepted or rejected."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Record creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."}},"type":"object","required":["id","invoice_id","transaction_id","business_id","amount","confidence","status","created_at","updated_at"],"title":"InvoicePaymentSuggestionResponse","description":"Response schema for an auto-detected payment match suggestion.\n\nRepresents a candidate match between a bank transaction and an invoice,\nproduced by the matching engine (Phase 2).","example":{"amount":12000,"business_id":"019ab37c-bus1-7000-8000-000000000001","confidence":0.87,"created_at":"2026-02-13T12:00:00Z","id":"019ab37c-sug1-7000-8000-000000000001","invoice_id":"019ab37c-inv1-7000-8000-000000000001","signals":{"amount_match":0.4,"counterparty_match":0.04,"date_proximity":0.18,"memo_match":0.25},"status":"pending","transaction_id":"019ab37c-txn1-7000-8000-000000000001","updated_at":"2026-02-13T12:00:00Z"}},"InvoicePaymentTransactionSummary":{"properties":{"id":{"type":"string","title":"Id","description":"Transaction UUID."},"amount":{"type":"integer","title":"Amount","description":"Transaction amount in cents. Positive = deposit, negative = withdrawal."},"currency":{"type":"string","title":"Currency","description":"Currency code (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"datetime":{"type":"string","format":"date","title":"Datetime","description":"The date the transaction occurred."},"counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty","description":"Clean counterparty/merchant name."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Transaction memo/description."},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"Bank account (ledger) UUID."}},"type":"object","required":["id","amount","datetime"],"title":"InvoicePaymentTransactionSummary","description":"Lightweight transaction summary embedded in invoice payment responses.\n\nContains the key fields needed to display the linked bank transaction\nwithout pulling the full TransactionResponse (journal entries, threads, etc.)."},"InvoicePaymentUpdateRequest":{"properties":{"amount":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Amount","description":"New payment amount in cents.  Must be > 0 and <= the remaining unallocated amount on the transaction (excluding the current payment's allocation)."},"paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid On","description":"Override payment date (ISO 8601)."}},"type":"object","title":"InvoicePaymentUpdateRequest","description":"Request schema for updating an existing invoice payment record.\n\nOnly the provided fields are updated; omitted fields remain unchanged.\nChanging the amount triggers a recalculation of the invoice's total_paid\nand status.","example":{"amount":8000,"paid_on":"2026-03-15T00:00:00Z"}},"InvoiceRecurringConfig":{"properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly","quarterly","annually"],"title":"Frequency","description":"How often to generate invoices."},"start_date":{"type":"string","format":"date","title":"Start Date","description":"When to start generating invoices (first occurrence)."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Name for the recurring template. Defaults to invoice description."},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"Stop generating after this date (null = indefinite). If both end_date and max_occurrences are set, whichever is reached first stops generation."},"day_of_month":{"anyOf":[{"type":"integer","maximum":31.0,"minimum":1.0},{"type":"null"}],"title":"Day Of Month","description":"Day of month (1-31). Only applies to monthly/quarterly/annually frequencies; ignored for daily/weekly/biweekly. If the day doesn't exist in a month (e.g., 31 in February), generates on the last day instead. If omitted, uses the day from start_date."},"day_of_week":{"anyOf":[{"type":"integer","maximum":6.0,"minimum":0.0},{"type":"null"}],"title":"Day Of Week","description":"Day of week (0=Monday, 6=Sunday). Only applies to weekly/biweekly frequencies; ignored for other frequencies. If omitted, uses the weekday from start_date."},"days_until_due":{"type":"integer","maximum":365.0,"minimum":0.0,"title":"Days Until Due","description":"Days from generation until due date.","default":30},"max_occurrences":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Occurrences","description":"Stop after generating this many invoices (null = unlimited). If both end_date and max_occurrences are set, whichever is reached first stops generation."}},"type":"object","required":["frequency","start_date"],"title":"InvoiceRecurringConfig","description":"Recurring configuration that can be embedded in invoice create/update requests.","example":{"day_of_month":1,"days_until_due":30,"frequency":"monthly","start_date":"2026-02-01"}},"InvoiceResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Invoice UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"status":{"type":"string","title":"Status","description":"Status: draft, open, partially_paid, manual_paid, stripe_paid, void."},"currency":{"type":"string","title":"Currency","description":"Currency for the invoice (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"stripe_invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Invoice Id","description":"Stripe invoice ID if synced."},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total amount in cents."},"total_paid":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Paid","description":"Running total of payments received in cents."},"balance_due":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Balance Due","description":"Remaining balance in cents (total - total_paid)."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Invoice description/notes."},"customer_id":{"type":"string","title":"Customer Id","description":"Customer UUID."},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name","description":"Customer name (resolved)."},"customer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Email","description":"Customer email (resolved)."},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date","description":"Due date (YYYY-MM-DD)."},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/LineItemResponse"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Invoice line items."},"fulfillment_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fulfillment Location Id","description":"Default warehouse used for inventory deductions."},"pdf_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Url","description":"URL to download invoice PDF."},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number","description":"Invoice number (assigned on finalize)."},"delivered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Delivered","description":"Whether invoice was delivered."},"delivered_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered On","description":"Delivery timestamp."},"hosted_invoice_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hosted Invoice Url","description":"URL for customer payment portal."},"paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid On","description":"Payment timestamp."},"journal_entries":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Journal Entries","description":"Associated accounting journal entries.","default":[]},"payments":{"anyOf":[{"items":{"$ref":"#/components/schemas/app__api__v1__schemas__invoices__invoice__InvoicePaymentResponse"},"type":"array"},{"type":"null"}],"title":"Payments","description":"Payment records linking bank transactions to this invoice.","default":[]},"recurring_template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recurring Template Id","description":"ID of recurring template if invoice was generated from one, or if one was created."},"stripe_settlement":{"anyOf":[{"$ref":"#/components/schemas/StripeSettlementInfo"},{"type":"null"}],"description":"Stripe payout and bank deposit linkage for stripe_paid invoices."}},"additionalProperties":true,"type":"object","required":["id","business_id","created_at","updated_at","status","customer_id"],"title":"InvoiceResponse","description":"Response schema for an invoice.\n\nContains all invoice details including customer info, line items,\npayment status, and associated accounting entries.","example":{"business_id":"019ab37c-bus1-7000-8000-000000000001","created_at":"2024-01-15T10:30:00Z","customer_email":"billing@acme.com","customer_id":"019ab37c-cust-7000-8000-000000000001","customer_name":"Acme Corporation","delivered":true,"delivered_on":"2024-01-16T09:00:00Z","description":"January services","due_date":"2024-02-15","id":"019ab37c-inv1-7000-8000-000000000001","line_items":[{"amount":75000,"description":"Widget Pro","quantity":3,"unit_price":25000,"variant_id":"019ab37c-var1-7000-8000-000000000001","variant_name":"Widget Pro - Large"},{"amount":2500,"description":"Rush delivery fee","quantity":1,"variant_id":"custom"}],"number":"INV-2024-0001","status":"pending","total":77500,"updated_at":"2024-01-15T10:30:00Z"}},"InvoiceSendEmailRequest":{"properties":{"custom_message":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Custom Message","description":"Optional personalized message to include in the email body."},"cc_sender":{"type":"boolean","title":"Cc Sender","description":"If true, CC the sending user on the email.","default":false},"attach_pdf":{"type":"boolean","title":"Attach Pdf","description":"If true, attach the invoice PDF to the email. Requires Stripe integration.","default":true}},"type":"object","title":"InvoiceSendEmailRequest","description":"Request schema for sending an invoice via email.","example":{"attach_pdf":true,"cc_sender":true,"custom_message":"Please let me know if you have any questions about this invoice."}},"InvoiceSendEmailResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the email was sent successfully."},"invoice_id":{"type":"string","title":"Invoice Id","description":"UUID of the invoice sent."},"invoice_number":{"type":"string","title":"Invoice Number","description":"Invoice number (e.g., INV-001)."},"customer_email":{"type":"string","title":"Customer Email","description":"Email address the invoice was sent to."},"cc_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cc Email","description":"Email address that was CC'd (if cc_sender was true)."},"message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Id","description":"SES message ID for tracking."},"pdf_attached":{"type":"boolean","title":"Pdf Attached","description":"Whether the PDF was attached to the email.","default":false}},"type":"object","required":["success","invoice_id","invoice_number","customer_email"],"title":"InvoiceSendEmailResponse","description":"Response schema for sending an invoice via email.","example":{"cc_email":"user@company.com","customer_email":"customer@example.com","invoice_id":"019abc12-3456-7890-abcd-ef1234567890","invoice_number":"INV-0042","message_id":"0100018f-1234-5678-9abc-def012345678","pdf_attached":true,"success":true}},"InvoiceSettingsResponse":{"properties":{"invoice_footer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Footer","description":"Default footer text for invoices (payment instructions, bank details)."},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url","description":"Business logo URL used for invoice branding."},"stripe_branding_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Stripe Branding Synced At","description":"When the logo was last synced to Stripe account branding."}},"type":"object","title":"InvoiceSettingsResponse","description":"Response schema for invoice branding settings."},"InvoiceSettingsUpdateRequest":{"properties":{"invoice_footer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Footer","description":"Default footer text for invoices (payment instructions, bank details)."}},"type":"object","title":"InvoiceSettingsUpdateRequest","description":"Request schema for updating invoice branding settings.\n\nUpdate the default footer text shown on invoice PDFs.\nThis appears at the bottom of Stripe-generated invoices."},"InvoiceUpdateRequest":{"properties":{"id":{"type":"string","title":"Id","description":"UUID of the invoice to update."},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id","description":"Change the customer."},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/LineItemRequest"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Replace line items (draft invoices only)."},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date","description":"New due date (YYYY-MM-DD)."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Update description/notes."},"fulfillment_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fulfillment Location Id","description":"Update the default warehouse for inventory deductions. Ignored once the invoice has been delivered."},"recurring":{"anyOf":[{"$ref":"#/components/schemas/InvoiceRecurringConfig"},{"type":"null"}],"description":"If provided, creates a recurring template from this invoice."}},"additionalProperties":true,"type":"object","required":["id"],"title":"InvoiceUpdateRequest","description":"Request schema for updating an invoice.\n\nOnly draft invoices can have line items modified.\nFinalized invoices can only have metadata updated.","example":{"description":"Updated: January services - corrected","due_date":"2024-02-28","id":"019ab37c-inv1-7000-8000-000000000001"}},"JournalEntryCreateRequest":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Human-readable description of the journal entry. Should describe the transaction being recorded."},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Currency for the journal entry (USD, CAD, AUD, EUR, or GBP). Defaults to business default.","default":"USD"},"date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date","description":"The date when this transaction occurred. Use ISO 8601 date format (YYYY-MM-DD)."},"line_entries":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Line Entries","description":"Array of line entries (minimum 2). Total debits must equal total credits. Each entry requires: amount (integer in cents), debit_credit ('debit' or 'credit'), ledger_id (UUID of target ledger account), description (what this line represents)."},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id","description":"Optional UUID of an invoice to link this journal entry to. Useful for tracking revenue recognition."},"inventory_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Order Id","description":"Optional UUID of an inventory order (PO) to link this journal entry to. Useful for the PO audit trail."}},"type":"object","title":"JournalEntryCreateRequest","description":"Request schema for creating a new journal entry.\n\nJournal entries represent double-entry accounting records. Each entry must\nhave balanced line entries where total debits equal total credits.\n\nLine entries are the individual debit/credit items that make up the journal\nentry. Each line entry affects a specific ledger account (e.g., Cash,\nAccounts Receivable, Revenue).\n\nCommon use cases:\n- Recording sales: Debit Accounts Receivable, Credit Revenue\n- Recording payments received: Debit Cash, Credit Accounts Receivable\n- Recording expenses: Debit Expense account, Credit Cash/Accounts Payable","example":{"date":"2024-01-15","description":"Record sale to customer - Invoice #1234","invoice_id":"019ab37c-e5b3-7c49-96e1-7c3b4d9f0e2b","line_entries":[{"amount":150000,"debit_credit":"debit","description":"Accounts Receivable - Customer ABC","ledger_id":"019ab37c-c309-7698-a8d9-14e0409977d8"},{"amount":150000,"debit_credit":"credit","description":"Sales Revenue","ledger_id":"019ab37c-d4a2-7b38-85f0-6b2a3c8e9f1a"}]}},"JournalEntryCreationMethodEnum":{"type":"string","enum":["ai","manual"],"title":"JournalEntryCreationMethodEnum","description":"How a journal entry was created — user-facing field."},"JournalEntryLineItem":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id","description":"UUID of the expense ledger account."},"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Amount in cents for this line (must be > 0)."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description for this line item."}},"type":"object","required":["ledger_id","amount"],"title":"JournalEntryLineItem","description":"A single line item for a split journal entry on bill creation."},"JournalEntryLinkRequest":{"properties":{"journal_entry_id":{"type":"string","title":"Journal Entry Id","description":"UUID of the journal entry to attach."}},"type":"object","required":["journal_entry_id"],"title":"JournalEntryLinkRequest","description":"Link an existing journal entry to a bill or invoice."},"JournalEntryListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JournalEntryResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"JournalEntryListResponse","description":"Paginated response containing a list of journal entries.\n\nUses cursor-based pagination for efficient traversal of large datasets.\nThe cursor is an opaque string that should be passed to subsequent requests\nto fetch the next page of results."},"JournalEntryResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for this journal entry (UUID7)."},"entry_number":{"type":"string","title":"Entry Number","description":"Sequential display number for this journal entry (prefix + sequence)."},"description":{"type":"string","title":"Description","description":"Human-readable description of the transaction."},"currency":{"type":"string","title":"Currency","description":"Currency for the journal entry (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"entry_date":{"type":"string","format":"date","title":"Entry Date","description":"The date this transaction occurred."},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id","description":"UUID of linked invoice, if this entry relates to an invoice."},"inventory_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Order Id","description":"UUID of linked inventory order (PO), if this entry relates to a PO."},"reversed_by_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reversed By Id","description":"UUID of the offsetting reversal journal entry, when this entry has been reversed. Set by reverse_journal_entry for idempotency."},"file_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"File Ids","description":"S3 keys of attached supporting documents (PDF, PNG, JPG)."},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Backend origin: manual, invoice, bill, credit_memo, transaction, stripe, shopify, plaid, ramp, square, system, teal"},"creation_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Creation Method","description":"User-facing creation method: ai (system-generated) or manual (user-typed)"},"business_id":{"type":"string","title":"Business Id","description":"UUID of the business this entry belongs to."},"line_entries":{"anyOf":[{"items":{"$ref":"#/components/schemas/LineEntryResponse"},"type":"array"},{"type":"null"}],"title":"Line Entries","description":"The debit and credit line entries that make up this journal entry. Will be empty list if not expanded."},"thread":{"anyOf":[{"$ref":"#/components/schemas/JournalEntryThreadResponse"},{"type":"null"}],"description":"Comment thread information if this journal entry has comments. Contains thread_id, comments array, and comment_count."},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When this journal entry was created."},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"When this journal entry was last modified."}},"additionalProperties":true,"type":"object","required":["id","entry_number","description","entry_date","business_id"],"title":"JournalEntryResponse","description":"Response schema for a journal entry.\n\nA journal entry is a complete double-entry accounting record consisting of\ntwo or more line entries that must balance (total debits = total credits).","example":{"business_id":"019ab37c-0002-7000-8000-000000000002","created_at":"2024-01-15T10:30:00Z","description":"Record sale to customer - Invoice #1234","entry_date":"2024-01-15","id":"019ab37c-0001-7000-8000-000000000001","invoice_id":"019ab37c-e5b3-7c49-96e1-7c3b4d9f0e2b","line_entries":[{"amount":150000,"business_id":"019ab37c-0002-7000-8000-000000000002","created_at":"2024-01-15T10:30:00Z","debit_credit":"debit","description":"Accounts Receivable - Customer ABC","entry_date":"2024-01-15","id":"019ab37c-a1b2-7c3d-e4f5-6a7b8c9d0e1f","journal_entry_id":"019ab37c-0001-7000-8000-000000000001","ledger_id":"019ab37c-c309-7698-a8d9-14e0409977d8","updated_at":"2024-01-15T10:30:00Z"},{"amount":150000,"business_id":"019ab37c-0002-7000-8000-000000000002","created_at":"2024-01-15T10:30:00Z","debit_credit":"credit","description":"Sales Revenue","entry_date":"2024-01-15","id":"019ab37c-b2c3-7d4e-f5a6-7b8c9d0e1f2a","journal_entry_id":"019ab37c-0001-7000-8000-000000000001","ledger_id":"019ab37c-d4a2-7b38-85f0-6b2a3c8e9f1a","updated_at":"2024-01-15T10:30:00Z"}],"updated_at":"2024-01-15T10:30:00Z"}},"JournalEntryReverseRequest":{"properties":{"reversal_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Reversal Date","description":"Reversal date (YYYY-MM-DD). Defaults to today."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Optional reason for the reversal (included in the reversing entry description)."}},"type":"object","title":"JournalEntryReverseRequest","description":"Request schema for reversing a journal entry."},"JournalEntryReverseResponse":{"properties":{"original_entry_id":{"type":"string","title":"Original Entry Id","description":"UUID of the journal entry that was reversed."},"reversal_entry_id":{"type":"string","title":"Reversal Entry Id","description":"UUID of the newly created reversing journal entry."},"original_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Description","description":"Description of the original journal entry."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Reason provided for the reversal."},"reversal_date":{"type":"string","format":"date","title":"Reversal Date","description":"Date applied to the reversing journal entry."}},"type":"object","required":["original_entry_id","reversal_entry_id","reversal_date"],"title":"JournalEntryReverseResponse","description":"Response schema for a journal entry reversal."},"JournalEntryThreadResponse":{"properties":{"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id","description":"UUID of the associated comment thread."},"comments":{"items":{"$ref":"#/components/schemas/CommentResponse"},"type":"array","title":"Comments","description":"List of comments in the thread."},"comment_count":{"type":"integer","title":"Comment Count","description":"Total number of comments.","default":0}},"type":"object","title":"JournalEntryThreadResponse","description":"Nested thread information for journal entries.\n\nContains comment thread data when a journal entry has associated comments/discussion."},"JournalEntryUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Updated description for the journal entry."},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date","description":"Updated date in ISO 8601 format (e.g., '2024-01-15')."},"line_entry_changes":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Line Entry Changes","description":"Object containing arrays of line entry changes. Supports 'create' (new entries), 'update' (modify existing by ID), and 'delete' (remove by ID) operations."}},"additionalProperties":true,"type":"object","title":"JournalEntryUpdateRequest","description":"Request schema for updating an existing journal entry.\n\nYou can update the description, datetime, and/or modify line entries.\nLine entry modifications use a change-based approach with create, update,\nand delete operations.\n\nNote: When updating line entries, ensure the journal entry remains balanced\n(total debits = total credits) after all changes are applied.","example":{"date":"2024-01-16","description":"Updated: Record sale to customer - Invoice #1234 (corrected)","line_entry_changes":{"create":[{"amount":5000,"debit_credit":"debit","description":"Shipping charges","ledger_id":"019ab37c-f6c4-7d5a-a7f2-8d4c5e0f1g3c"},{"amount":5000,"debit_credit":"credit","description":"Shipping revenue","ledger_id":"019ab37c-d4a2-7b38-85f0-6b2a3c8e9f1a"}],"delete":["019ab37c-b2c3-7d4e-f5a6-7b8c9d0e1f2a"],"update":[{"description":"Updated line entry description","id":"019ab37c-a1b2-7c3d-e4f5-6a7b8c9d0e1f"}]}}},"JsonValue":{},"LastBusinessResponse":{"properties":{"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id","description":"Last-selected business UUID."},"firm_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Id","description":"Last-selected firm UUID."}},"type":"object","title":"LastBusinessResponse","description":"Response schema for the user's last-selected business."},"LastBusinessUpdate":{"properties":{"business_id":{"type":"string","title":"Business Id","description":"Business UUID to persist as last-selected."},"firm_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Id","description":"Firm UUID to persist alongside."}},"type":"object","required":["business_id"],"title":"LastBusinessUpdate","description":"Request schema for updating the user's last-selected business."},"LedgerBulkUpdateRequest":{"properties":{"updates":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Updates"}},"type":"object","required":["updates"],"title":"LedgerBulkUpdateRequest"},"LedgerBulkUpdateResponse":{"properties":{"updated":{"type":"integer","title":"Updated"}},"type":"object","required":["updated"],"title":"LedgerBulkUpdateResponse"},"LedgerCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Ledger name (e.g., 'Operating Cash', 'Sales Revenue')."},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Currency for this account (USD, CAD, AUD, EUR, or GBP). Defaults to business default.","default":"USD"},"editable":{"type":"boolean","title":"Editable","description":"Whether journal entries can be manually posted to this account.","default":true},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"Account type: asset, liability, equity, revenue, expense. Required in Custom Mode."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description of the account's purpose."},"account_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Number","description":"Optional account number/code for chart-of-accounts numbering."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Account status: 'active' or 'inactive'. Inactive accounts hidden from dropdowns.","default":"active"},"debit_credit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Debit Credit","description":"Normal balance: 'debit' (assets/expenses) or 'credit' (liabilities/equity/revenue). Required in Custom Mode."},"sort_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sort Code","description":"Sort code for chart ordering (e.g. 1000 for assets, 4000 for revenue). Required in Custom Mode."},"sub_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Type","description":"Sub-classification (current_assets, operating_expenses, etc.). Required in Custom Mode."},"report_cash_flow":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Report Cash Flow","description":"Include in cash flow statement. Required in Custom Mode."},"financial_account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Account Type","description":"Templated Mode: bank_account, credit_card, payments, payroll, loan, prepaid_card, accounts_receivable, accounts_payable."},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id","description":"UUID of parent ledger for sub-accounts (e.g., 'Operating Expenses' → 'Office Supplies')."},"cfs_class":{"anyOf":[{"$ref":"#/components/schemas/CashFlowClassEnum"},{"type":"null"}],"description":"Indirect-method cash flow classification. Determines which row of the Statement of Cash Flows this account populates. If omitted, the system derives it from `type`/`sub_type`/`financial_account_type` on first save; un-derivable rows must be set explicitly to pass cash-flow validation."}},"type":"object","required":["name"],"title":"LedgerCreateRequest","description":"Request schema for creating a new ledger (chart of accounts entry).\n\nLedgers are the accounts in your chart of accounts (e.g., Cash, Accounts\nReceivable, Revenue). Supports two creation modes:\n\n**Templated Mode** (recommended for standard accounts):\n- Provide `name` and `financial_account_type`\n- Teal auto-configures accounting properties\n\n**Custom Mode** (for specialized accounts):\n- Provide all fields manually for full control\n- Required: name, type, debit_credit, sort_code, sub_type, report_cash_flow","examples":[{"editable":true,"financial_account_type":"bank_account","name":"Chase Business Checking"},{"debit_credit":"debit","editable":true,"name":"Advertising Expense","report_cash_flow":true,"sort_code":"6100","sub_type":"operating_expenses","type":"expense"}]},"LedgerListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/LedgerResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"LedgerListResponse","description":"Paginated list of ledgers (chart of accounts) with cursor-based navigation."},"LedgerMergeRequest":{"properties":{"source_ledger_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Source Ledger Ids","description":"One or more ledger UUIDs to merge FROM (will be archived after merge)."},"target_ledger_id":{"type":"string","title":"Target Ledger Id","description":"The ledger UUID to merge INTO (receives all reassigned data)."},"new_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Name","description":"Optional new name for the target ledger after merge."}},"type":"object","required":["source_ledger_ids","target_ledger_id"],"title":"LedgerMergeRequest","description":"Request schema for merging one or more source ledgers into a target ledger.\n\nAll line entries, transactions, budgets, reconciliations, and other\nreferences pointing at the source ledgers are reassigned to the target.\nSource ledgers are then archived (set to inactive)."},"LedgerMergeResponse":{"properties":{"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id","description":"Temporal workflow / task ID for async Teal merges. Poll GET /tasks/{task_id} for status."},"message":{"type":"string","title":"Message","description":"Human-readable status message."},"merged_ledger":{"anyOf":[{"$ref":"#/components/schemas/LedgerResponse"},{"type":"null"}],"description":"The updated target ledger (present for synchronous local-engine merges)."}},"type":"object","required":["message"],"title":"LedgerMergeResponse","description":"Response schema for a ledger merge operation.\n\nFor local-engine businesses the merge completes synchronously and\n``items`` contains the updated target ledger.\n\nFor Teal-engine businesses the merge runs asynchronously via a\nTemporal workflow; ``task_id`` can be polled for progress."},"LedgerResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Ledger UUID."},"teal_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Ledger Id","description":"Linked Teal accounting system ID."},"name":{"type":"string","title":"Name","description":"Account name."},"currency":{"type":"string","title":"Currency","description":"Currency for this account (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"type":{"type":"string","title":"Type","description":"Account type: asset, liability, equity, revenue, expense."},"balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Balance","description":"Current balance in cents (may be negative)."},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id","description":"Parent ledger UUID for sub-accounts."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Account description."},"account_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Number","description":"Optional account number/code for chart-of-accounts numbering."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Status: 'active' or 'inactive'."},"debit_credit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Debit Credit","description":"Normal balance: 'debit' or 'credit'."},"sort_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort Code","description":"Sort code for chart ordering."},"sub_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Type","description":"Sub-classification for reporting."},"report_cash_flow":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Report Cash Flow","description":"Whether included in cash flow statement."},"cash_flow_section":{"anyOf":[{"$ref":"#/components/schemas/CashFlowSectionEnum"},{"type":"null"}],"description":"Cash flow statement section: 'operating', 'investing', 'financing', or 'excluded'."},"cfs_class":{"anyOf":[{"$ref":"#/components/schemas/CashFlowClassEnum"},{"type":"null"}],"description":"Indirect-method cash flow classification used to populate the Statement of Cash Flows."},"editable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Editable","description":"Whether journal entries can be manually posted to this account."},"financial_account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Account Type","description":"Template type if created in Templated Mode."},"is_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Required","description":"True for system-required accounts that cannot be deleted."},"system_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Key","description":"Immutable key for system/base ledgers (e.g. 'accounts_receivable'). Null for user-created ledgers."},"teal_account_link_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Account Link Id","description":"UUID of the TealAccountLink if this ledger is connected to a bank/Plaid source account. Null for unlinked ledgers."},"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id","description":"Business UUID."},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Creation timestamp."},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp."}},"additionalProperties":true,"type":"object","required":["id","name","type"],"title":"LedgerResponse","description":"Response schema for a ledger (chart of accounts entry).\n\nA ledger represents an account in the chart of accounts. Each ledger\nhas a type (asset, liability, etc.), current balance, and configuration\nfor how it affects financial reports.","example":{"account_number":"1010","balance":1523450,"business_id":"019ab37c-bus1-7000-8000-000000000001","created_at":"2024-01-10T10:30:00Z","debit_credit":"debit","description":"Primary operating account","editable":true,"financial_account_type":"bank_account","id":"019ab37c-led1-7000-8000-000000000001","is_required":false,"name":"Chase Business Checking","report_cash_flow":true,"sort_code":"1010","status":"active","sub_type":"current_assets","teal_ledger_id":"led_abc123","type":"asset","updated_at":"2024-01-15T14:00:00Z"}},"LedgerStatementTransaction":{"properties":{"date":{"type":"string","title":"Date"},"description":{"type":"string","title":"Description"},"debit":{"type":"integer","title":"Debit"},"credit":{"type":"integer","title":"Credit"},"amount":{"type":"integer","title":"Amount"},"debit_credit":{"type":"string","title":"Debit Credit"},"line_entry_id":{"type":"string","title":"Line Entry Id"},"journal_entry_id":{"type":"string","title":"Journal Entry Id"},"reference":{"type":"string","title":"Reference"},"transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Id"},"transaction_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Source"},"journal_entry_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Source"},"can_be_deleted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Can Be Deleted"},"deletes_as_soft_hide":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Deletes As Soft Hide"},"delete_via":{"anyOf":[{"type":"string","enum":["transaction","journal_entry"]},{"type":"null"}],"title":"Delete Via"}},"additionalProperties":true,"type":"object","required":["date","description","debit","credit","amount","debit_credit","line_entry_id","journal_entry_id","reference"],"title":"LedgerStatementTransaction","description":"Transaction line on a ledger statement."},"LedgerTxn":{"properties":{"id":{"type":"string","title":"Id"},"date":{"type":"string","title":"Date"},"description":{"type":"string","title":"Description"},"amount":{"type":"integer","title":"Amount"}},"additionalProperties":true,"type":"object","required":["id","date","description","amount"],"title":"LedgerTxn","description":"Ledger transaction row."},"LedgerUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name","description":"Ledger name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Ledger description"},"account_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Number","description":"Optional account number/code for chart-of-accounts numbering."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Ledger status (active, inactive)"},"debit_credit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Debit Credit","description":"Debit/credit behavior (debit, credit)"},"sort_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sort Code","description":"Sort code for chart ordering (e.g. 1000 for assets, 4000 for revenue)."},"sub_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Type","description":"Ledger sub-type"},"report_cash_flow":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Report Cash Flow","description":"Include in cash flow reports"},"cash_flow_section":{"anyOf":[{"$ref":"#/components/schemas/CashFlowSectionEnum"},{"type":"null"}],"description":"Cash flow statement section: 'operating' (working capital changes), 'investing' (fixed assets, investments), 'financing' (loans, equity), or 'excluded' (not shown in cash flow statement)."},"cfs_class":{"anyOf":[{"$ref":"#/components/schemas/CashFlowClassEnum"},{"type":"null"}],"description":"Indirect-method cash flow classification (e.g. 'ar', 'ppe', 'lt_debt'). See `CashFlowClassEnum` for full list."},"editable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Editable","description":"Whether journal entries can be manually posted to this account."},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id","description":"Parent ledger ID for creating child/sub-ledgers"},"financial_account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Account Type","description":"Financial account type: bank_account, credit_card, payments, payroll, loan, prepaid_card, accounts_receivable, accounts_payable. Set to designate this ledger as a financial account."}},"type":"object","title":"LedgerUpdateRequest","description":"Request schema for updating a ledger."},"LedgerVendorBreakdownEntry":{"properties":{"counterparty_name":{"type":"string","title":"Counterparty Name"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"total_amount":{"type":"integer","title":"Total Amount"},"entry_count":{"type":"integer","title":"Entry Count"},"percentage":{"type":"number","title":"Percentage"}},"additionalProperties":true,"type":"object","required":["counterparty_name","total_amount","entry_count","percentage"],"title":"LedgerVendorBreakdownEntry","description":"Vendor/counterparty slice of a ledger total."},"LedgerVendorPeriodRow":{"properties":{"counterparty_name":{"type":"string","title":"Counterparty Name"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"total":{"type":"integer","title":"Total"},"entry_count":{"type":"integer","title":"Entry Count"},"pct_of_total":{"type":"number","title":"Pct Of Total"}},"additionalProperties":true,"type":"object","required":["counterparty_name","total","entry_count","pct_of_total"],"title":"LedgerVendorPeriodRow","description":"Vendor row with per-period amounts; period keys are dynamic."},"LedgerVendorTransactionEntry":{"properties":{"id":{"type":"string","title":"Id"},"transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Id"},"date":{"type":"string","title":"Date"},"description":{"type":"string","title":"Description"},"journal_entry_id":{"type":"string","title":"Journal Entry Id"},"amount":{"type":"integer","title":"Amount"},"debit_credit":{"type":"string","title":"Debit Credit"},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number"}},"additionalProperties":true,"type":"object","required":["id","date","description","journal_entry_id","amount","debit_credit"],"title":"LedgerVendorTransactionEntry","description":"Single line entry for a vendor drill-down."},"LineEntryResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for this line entry (UUID7)."},"amount":{"type":"integer","title":"Amount","description":"Amount in cents (e.g., 15000 = $150.00). Always positive; direction determined by debit_credit."},"currency":{"type":"string","title":"Currency","description":"Currency for the line entry (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"debit_credit":{"type":"string","title":"Debit Credit","description":"Whether this is a 'debit' or 'credit' entry. Debits increase asset/expense accounts; credits increase liability/equity/revenue accounts."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of what this specific line entry represents."},"entry_date":{"type":"string","format":"date","title":"Entry Date","description":"Date of the line entry (typically matches parent journal entry)."},"ledger_id":{"type":"string","title":"Ledger Id","description":"UUID of the ledger account this entry affects (e.g., Cash, Accounts Receivable)."},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name","description":"Human-readable name of the ledger account (e.g., 'Cash', 'Accounts Receivable')."},"class_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Class Id","description":"Optional Class dimension tag for this line."},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id","description":"Optional Location dimension tag for this line."},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Optional Project (job-costing) tag for this line."},"journal_entry_id":{"type":"string","title":"Journal Entry Id","description":"UUID of the parent journal entry this line belongs to."},"business_id":{"type":"string","title":"Business Id","description":"UUID of the business this entry belongs to."},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When this line entry was created."},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"When this line entry was last modified."}},"type":"object","required":["id","amount","debit_credit","entry_date","ledger_id","journal_entry_id","business_id"],"title":"LineEntryResponse","description":"Response schema for a line entry within a journal entry.\n\nEach line entry represents one side of the double-entry accounting record,\neither a debit or credit to a specific ledger account.","example":{"amount":150000,"business_id":"019ab37c-0002-7000-8000-000000000002","created_at":"2024-01-15T10:30:00Z","debit_credit":"debit","description":"Accounts Receivable - Customer ABC","entry_date":"2024-01-15","id":"019ab37c-a1b2-7c3d-e4f5-6a7b8c9d0e1f","journal_entry_id":"019ab37c-0001-7000-8000-000000000001","ledger_id":"019ab37c-c309-7698-a8d9-14e0409977d8","updated_at":"2024-01-15T10:30:00Z"}},"LineItem":{"properties":{"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount","description":"Line item total in cents (e.g., 2550 for $25.50)."},"product_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Id","description":"Product UUID (optional if variant_id provided)."},"quantity":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Quantity","description":"Number of units."},"unit_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Price","description":"Price per unit in cents."},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Product variant UUID."},"variant_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Variant Name","description":"Display name for a custom line item when no variant_id is set."},"inventory_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Order Id","description":"Parent order UUID (set automatically)."},"lot_number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Lot Number","description":"Vendor/supplier lot or batch number. Captured per-line on shipment receive; flows into `inventory_cost_lots.lot_number` for traceability."},"external_lot_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"External Lot Id","description":"Optional upstream identifier (e.g. ASN line id)."},"expiration_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiration Date","description":"Best-by / expiration date (YYYY-MM-DD). When set and the owning product has `tracks_expiration=true`, drives FEFO consumption and the expiring-lots report."}},"type":"object","title":"LineItem","description":"Line item for inventory orders and shipments.\n\nRepresents a single product variant being ordered or shipped.\nAmounts are in cents (e.g., 2550 = $25.50).","example":{"amount":120000,"quantity":100,"unit_price":1200,"variant_id":"019ab37c-var1-7000-8000-000000000001"}},"LineItemRequest":{"properties":{"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"UUID of product variant. Omit or use 'custom' for manual line items."},"quantity":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Quantity","description":"Quantity ordered. Defaults to 1 for custom items."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Line item description (required for custom items)."},"unit_price":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Unit Price","description":"Price per unit in cents. Required for custom items. For variant-linked items this is an OPTIONAL override - if omitted, the current catalog price is used; if provided, the catalog price is ignored for this invoice. The override is snapshotted onto the invoice line item."},"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount","description":"Total amount in cents. Deprecated for custom items - use unit_price instead. For backward compatibility, if unit_price is not set, amount is treated as unit_price."},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id","description":"Optional warehouse UUID to deduct this line from. Overrides the invoice's `fulfillment_location_id` and the business default. Ignored for custom (non-variant) lines."}},"additionalProperties":true,"type":"object","title":"LineItemRequest","description":"Line item for invoice requests.\n\nLine items can be linked to product variants or be custom items.\nFor variant-linked items, quantity is required and ``unit_price`` is\noptional - omit to use the catalog price, or provide a value to\noverride it for this invoice. For custom items, ``unit_price`` and\n``description`` are required (amount is auto-calculated).","examples":[{"quantity":2,"variant_id":"019ab37c-var1-7000-8000-000000000001"},{"quantity":2,"unit_price":9999,"variant_id":"019ab37c-var1-7000-8000-000000000001"},{"description":"Consulting services","quantity":5,"unit_price":15000,"variant_id":"custom"}]},"LineItemResponse":{"properties":{"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Product variant UUID or 'custom'."},"quantity":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Quantity","description":"Quantity ordered."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Line item description."},"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount","description":"Total line amount in cents."},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name","description":"Product variant name (resolved)."},"unit_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Price","description":"Price per unit in cents."},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id","description":"Warehouse UUID this line was deducted from (if set)."}},"additionalProperties":true,"type":"object","title":"LineItemResponse","description":"Line item in an invoice response.\n\nContains the resolved product/variant information along with pricing."},"ListAnomaliesResponse":{"properties":{"anomalies":{"anyOf":[{"items":{"$ref":"#/components/schemas/AnomalyFindingItem"},"type":"array"},{"type":"null"}],"title":"Anomalies"},"summary":{"anyOf":[{"$ref":"#/components/schemas/AnomalySummary"},{"type":"null"}]},"lookback_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Lookback Days"},"last_scanned":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Scanned"}},"additionalProperties":true,"type":"object","title":"ListAnomaliesResponse","description":"Response for ``list_anomalies``."},"ListBillPaymentsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BillPaymentResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"additionalProperties":true,"type":"object","required":["items","has_next","has_prev"],"title":"ListBillPaymentsResponse","description":"Response for ``list_bill_payments``."},"ListClientBusinessAccessResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ClientBusinessAccessListItem"},"type":"array","title":"Items"}},"additionalProperties":true,"type":"object","required":["items"],"title":"ListClientBusinessAccessResponse","description":"Response for ``list_client_business_access``."},"ListCloseBlockersResponse":{"properties":{"period_id":{"type":"string","title":"Period Id"},"score":{"type":"number","title":"Score"},"color":{"type":"string","title":"Color"},"blockers":{"items":{"$ref":"#/components/schemas/CloseScoreBlocker"},"type":"array","title":"Blockers"}},"additionalProperties":true,"type":"object","required":["period_id","score","color","blockers"],"title":"ListCloseBlockersResponse","description":"Response for ``list_close_blockers``."},"ListCountsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CycleCountResponse"},"type":"array","title":"Items"}},"additionalProperties":true,"type":"object","required":["items"],"title":"ListCountsResponse","description":"Response for ``list_counts``."},"ListDepositCandidatesResponse":{"items":{"$ref":"#/components/schemas/DepositCandidateItem"},"type":"array","title":"ListDepositCandidatesResponse","description":"Response for ``list_deposit_candidates`` — bare array."},"ListExpenseCandidatesResponse":{"items":{"$ref":"#/components/schemas/ExpenseCandidateItem"},"type":"array","title":"ListExpenseCandidatesResponse","description":"Response for ``list_expense_candidates`` — bare JSON array."},"ListFirmReportTypesResponse":{"properties":{"reports":{"items":{"$ref":"#/components/schemas/FirmReportTypeItem"},"type":"array","title":"Reports"},"by_category":{"additionalProperties":{"items":{"$ref":"#/components/schemas/FirmReportTypeItem"},"type":"array"},"type":"object","title":"By Category"}},"additionalProperties":true,"type":"object","required":["reports","by_category"],"title":"ListFirmReportTypesResponse","description":"SuccessEnvelope data for ``list_firm_report_types``."},"ListInvoicePaymentsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/app__api__v1__schemas__invoice__InvoicePaymentResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"ListInvoicePaymentsResponse","description":"Response for ``list_invoice_payments``."},"ListInvoiceSuggestionsResponse":{"items":{"$ref":"#/components/schemas/InvoicePaymentSuggestionResponse"},"type":"array","title":"ListInvoiceSuggestionsResponse","description":"Response for ``list_invoice_suggestions`` — bare array."},"ListPeriodSignOffsResponse":{"properties":{"period_id":{"type":"string","title":"Period Id"},"sign_offs":{"items":{"$ref":"#/components/schemas/PeriodSignOffItem"},"type":"array","title":"Sign Offs"}},"additionalProperties":true,"type":"object","required":["period_id","sign_offs"],"title":"ListPeriodSignOffsResponse","description":"Response for ``list_period_sign_offs``."},"ListReconciliationsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Reconciliation"},"type":"array","title":"Items","default":[]},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"},"has_next":{"type":"boolean","title":"Has Next","default":false},"has_prev":{"type":"boolean","title":"Has Prev","default":false}},"additionalProperties":true,"type":"object","title":"ListReconciliationsResponse","description":"Paginated reconciliation list."},"ListScenariosResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ScenarioResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"additionalProperties":true,"type":"object","required":["items","has_next","has_prev"],"title":"ListScenariosResponse","description":"Response for ``list_scenarios``."},"ListSubscriptionsResponse":{"properties":{"subscriptions":{"items":{"$ref":"#/components/schemas/DetectedSubscriptionResponse"},"type":"array","title":"Subscriptions"},"total_monthly_cents":{"type":"integer","title":"Total Monthly Cents"},"period_total_cents":{"type":"integer","title":"Period Total Cents","description":"Sum of all detected recurring spend over the lookback period","default":0},"monthly_limit_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Limit Cents"},"over_limit":{"type":"boolean","title":"Over Limit","default":false},"subscription_count":{"type":"integer","title":"Subscription Count"},"lookback_days":{"type":"integer","title":"Lookback Days","default":180}},"additionalProperties":true,"type":"object","required":["subscriptions","total_monthly_cents","subscription_count"],"title":"ListSubscriptionsResponse","description":"List detected recurring transactions."},"ListSuggestionsResponse":{"items":{"$ref":"#/components/schemas/InvoicePaymentSuggestionResponse"},"type":"array","title":"ListSuggestionsResponse","description":"Response for ``list_suggestions`` — bare array."},"LocationCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Location name"},"code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Code","description":"Short code like 'WH1', 'STORE-NYC'"},"location_type":{"$ref":"#/components/schemas/LocationTypeEnum","description":"Type of location","default":"warehouse"},"address_line1":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Address Line1"},"address_line2":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Address Line2"},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"State"},"postal_code":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Postal Code"},"country":{"type":"string","maxLength":2,"title":"Country","default":"US"},"is_default":{"type":"boolean","title":"Is Default","description":"Default location for new inventory","default":false},"is_active":{"type":"boolean","title":"Is Active","description":"Whether location accepts new inventory","default":true},"contact_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Contact Name"},"contact_email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Contact Phone"},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Notes"}},"type":"object","required":["name"],"title":"LocationCreate","description":"Schema for creating a new location.","example":{"address_line1":"123 Industrial Blvd","city":"Los Angeles","code":"WH1","country":"US","is_active":true,"is_default":true,"location_type":"warehouse","name":"Main Warehouse","postal_code":"90001","state":"CA"}},"LocationDecision":{"properties":{"detected_name":{"type":"string","title":"Detected Name"},"action":{"type":"string","enum":["create","match","skip"],"title":"Action","default":"create"},"existing_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Existing Location Id"},"location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Name"},"location_type":{"type":"string","title":"Location Type","default":"warehouse"}},"type":"object","required":["detected_name"],"title":"LocationDecision","description":"User decision for a detected location."},"LocationInventorySummary":{"properties":{"location_id":{"type":"string","title":"Location Id"},"location_name":{"type":"string","title":"Location Name"},"location_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Code"},"total_variants":{"type":"integer","title":"Total Variants","default":0},"total_on_hand":{"type":"integer","title":"Total On Hand","default":0},"total_available":{"type":"integer","title":"Total Available","default":0},"needs_reorder_count":{"type":"integer","title":"Needs Reorder Count","default":0},"inbound_quantity":{"type":"integer","title":"Inbound Quantity","default":0},"outbound_quantity":{"type":"integer","title":"Outbound Quantity","default":0},"ready_to_ship_quantity":{"type":"integer","title":"Ready To Ship Quantity","default":0}},"type":"object","required":["location_id","location_name"],"title":"LocationInventorySummary","description":"Inventory summary for a location."},"LocationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/LocationResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"LocationListResponse","description":"Paginated list of locations."},"LocationResponse":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Location name"},"code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Code","description":"Short code like 'WH1', 'STORE-NYC'"},"location_type":{"$ref":"#/components/schemas/LocationTypeEnum","description":"Type of location","default":"warehouse"},"address_line1":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Address Line1"},"address_line2":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Address Line2"},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"State"},"postal_code":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Postal Code"},"country":{"type":"string","maxLength":2,"title":"Country","default":"US"},"is_default":{"type":"boolean","title":"Is Default","description":"Default location for new inventory","default":false},"is_active":{"type":"boolean","title":"Is Active","description":"Whether location accepts new inventory","default":true},"contact_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Contact Name"},"contact_email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Contact Phone"},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Notes"},"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"archived":{"type":"boolean","title":"Archived"},"full_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Address"},"display_name":{"type":"string","title":"Display Name"},"can_receive_inventory":{"type":"boolean","title":"Can Receive Inventory"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"shopify_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shopify Location Id"}},"type":"object","required":["name","id","business_id","archived","display_name","can_receive_inventory","created_at","updated_at"],"title":"LocationResponse","description":"Schema for location response."},"LocationSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"location_type":{"$ref":"#/components/schemas/LocationTypeEnum"},"is_default":{"type":"boolean","title":"Is Default"}},"type":"object","required":["id","name","location_type","is_default"],"title":"LocationSummary","description":"Minimal location info for embedding in other responses."},"LocationTypeEnum":{"type":"string","enum":["warehouse","store","virtual","drop_ship","office","supplier","manufacturer","packaging","copacker","other"],"title":"LocationTypeEnum","description":"Types of inventory locations."},"LocationUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Code"},"location_type":{"anyOf":[{"$ref":"#/components/schemas/LocationTypeEnum"},{"type":"null"}]},"address_line1":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Address Line1"},"address_line2":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Address Line2"},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"State"},"postal_code":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Postal Code"},"country":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Country"},"is_default":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Default"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"archived":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Archived"},"contact_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Contact Name"},"contact_email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Contact Phone"},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Notes"}},"type":"object","title":"LocationUpdate","description":"Schema for updating a location."},"MailboxUniquenessResponse":{"properties":{"unique":{"type":"boolean","title":"Unique","description":"Whether the mailbox is unique"}},"type":"object","required":["unique"],"title":"MailboxUniquenessResponse","description":"Response schema for mailbox uniqueness check."},"ManagerialBuilderItem":{"properties":{"key":{"type":"string","pattern":"^(cm1|cm2|cash_outflow_debt|cash_outflow_inventory)$","title":"Key","description":"Builder key: cm1, cm2, cash_outflow_debt, cash_outflow_inventory"},"label":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Label","description":"Display label for this builder line."},"ledger_ids":{"items":{"type":"string"},"type":"array","title":"Ledger Ids","description":"Chart-of-accounts ledger IDs included in this builder."}},"type":"object","required":["key"],"title":"ManagerialBuilderItem","description":"Configuration for one custom managerial builder line."},"ManagerialBuildersUpdateRequest":{"properties":{"builders":{"items":{"$ref":"#/components/schemas/ManagerialBuilderItem"},"type":"array","title":"Builders"}},"type":"object","title":"ManagerialBuildersUpdateRequest","description":"Bulk update payload for custom managerial builder lines."},"ManagerialMappingItem":{"properties":{"ledger_id":{"type":"string","minLength":1,"title":"Ledger Id"},"bucket":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Bucket"}},"type":"object","required":["ledger_id"],"title":"ManagerialMappingItem","description":"Single GL ledger -> managerial bucket assignment.\n\nA ``bucket`` of ``None`` (or omitting the field on PUT) clears any\nexisting mapping for the ledger.  Otherwise it must be one of the\nallowed bucket keys validated in the service layer\n(``app.models.managerial_account_mappings.MANAGERIAL_BUCKETS``)."},"ManagerialMappingUpsertRequest":{"properties":{"mappings":{"items":{"$ref":"#/components/schemas/ManagerialMappingItem"},"type":"array","title":"Mappings"}},"type":"object","title":"ManagerialMappingUpsertRequest","description":"Bulk upsert payload for the Recipe Book bucket-mapping editor.\n\nSending an empty list is valid and is a no-op; sending a row with\n``bucket: null`` clears that ledger's mapping.  Ledgers not\nreferenced in the payload are left untouched, which lets the\nfrontend save one row at a time without re-sending the whole CoA."},"MarginByVariantResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/MarginRow"},"type":"array","title":"Rows"},"lookback_days":{"type":"integer","title":"Lookback Days","default":30},"totals":{"$ref":"#/components/schemas/MarginTotals"}},"type":"object","title":"MarginByVariantResponse"},"MarginLayerBreakdown":{"properties":{"material":{"type":"integer","title":"Material","default":0},"packaging":{"type":"integer","title":"Packaging","default":0},"processing":{"type":"integer","title":"Processing","default":0},"freight":{"type":"integer","title":"Freight","default":0},"duties":{"type":"integer","title":"Duties","default":0},"handling":{"type":"integer","title":"Handling","default":0}},"type":"object","title":"MarginLayerBreakdown","description":"Six-layer landed-cost breakdown (cents per unit)."},"MarginRow":{"properties":{"variant_id":{"type":"string","title":"Variant Id"},"product_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Id"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"price_cents":{"type":"integer","title":"Price Cents"},"landed_cost_cents":{"type":"integer","title":"Landed Cost Cents"},"margin_cents":{"type":"integer","title":"Margin Cents"},"margin_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Margin Pct"},"layers":{"$ref":"#/components/schemas/MarginLayerBreakdown"},"units_sold":{"type":"integer","title":"Units Sold","default":0},"revenue_cents":{"type":"integer","title":"Revenue Cents","default":0},"cogs_cents":{"type":"integer","title":"Cogs Cents","default":0},"daily_velocity":{"type":"number","title":"Daily Velocity","default":0.0},"snapshot_month":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snapshot Month"},"snapshot_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snapshot Source"}},"type":"object","required":["variant_id","price_cents","landed_cost_cents","margin_cents","layers"],"title":"MarginRow","description":"Per-SKU margin row for the margin-by-SKU report."},"MarginTotals":{"properties":{"revenue_cents":{"type":"integer","title":"Revenue Cents","default":0},"cogs_cents":{"type":"integer","title":"Cogs Cents","default":0},"gross_margin_cents":{"type":"integer","title":"Gross Margin Cents","default":0},"units_sold":{"type":"integer","title":"Units Sold","default":0}},"type":"object","title":"MarginTotals"},"MarkAllAttentionReadResponse":{"properties":{"count":{"type":"integer","title":"Count"}},"additionalProperties":true,"type":"object","required":["count"],"title":"MarkAllAttentionReadResponse","description":"Envelope ``data`` for ``mark_all_read``."},"MarkAttentionItemReadResponse":{"properties":{"item":{"additionalProperties":true,"type":"object","title":"Item"}},"additionalProperties":true,"type":"object","required":["item"],"title":"MarkAttentionItemReadResponse","description":"Envelope ``data`` for ``mark_item_read``."},"MatchApprovalRequest":{"properties":{"statement_txn_id":{"type":"string","title":"Statement Txn Id","description":"Statement transaction ID"},"ledger_txn_ids":{"items":{"type":"string"},"type":"array","title":"Ledger Txn Ids","description":"Ledger transaction IDs to match"}},"type":"object","required":["statement_txn_id","ledger_txn_ids"],"title":"MatchApprovalRequest","description":"Request to approve a transaction match."},"MatchExplanation":{"properties":{"match_id":{"type":"string","title":"Match Id"},"reasons":{"items":{"type":"string"},"type":"array","title":"Reasons"},"confidence":{"type":"number","title":"Confidence"}},"additionalProperties":true,"type":"object","required":["match_id","reasons","confidence"],"title":"MatchExplanation","description":"Frontend type ``MatchExplanation``."},"MatchRejectionRequest":{"properties":{"statement_txn_id":{"type":"string","title":"Statement Txn Id","description":"Statement transaction ID to unmatch"}},"type":"object","required":["statement_txn_id"],"title":"MatchRejectionRequest","description":"Request to reject a transaction match."},"MatchTriggerRequest":{"properties":{"min_confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Min Confidence","description":"Minimum confidence threshold.  Defaults to 0.50 (the 'suggest' threshold)."},"auto_match":{"type":"boolean","title":"Auto Match","description":"If true, automatically accept high-confidence matches (>= 0.85)","default":false},"invoice_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Invoice Ids","description":"Limit matching to specific invoices (by UUID).  If omitted, scans all open / partially_paid invoices."}},"type":"object","title":"MatchTriggerRequest","description":"Request schema for triggering the invoice payment matching engine.\n\nWhen called with no parameters, scans all unallocated income\ntransactions against all open invoices for the business.\n\nWhen ``auto_match`` is ``false`` (the default), every match is stored\nas a pending suggestion for manual review.  When ``true``, high-confidence\nmatches (>= 0.85) are linked automatically as ``InvoicePayment`` records.","example":{"auto_match":false,"min_confidence":0.5}},"MatchTriggerResponse":{"properties":{"suggestions_created":{"type":"integer","title":"Suggestions Created","description":"Number of new suggestions persisted."},"auto_linked":{"type":"integer","title":"Auto Linked","description":"Number of high-confidence matches auto-linked."},"total_candidates":{"type":"integer","title":"Total Candidates","description":"Total candidates evaluated by the engine."}},"type":"object","required":["suggestions_created","auto_linked","total_candidates"],"title":"MatchTriggerResponse","description":"Response from triggering the matching engine."},"MfaStatusResponse":{"properties":{"is_firm_admin":{"type":"boolean","title":"Is Firm Admin","description":"True when the user is owner or admin of an advisory firm."},"mfa_required":{"type":"boolean","title":"Mfa Required","description":"True when MFA enforcement applies to this user (firm policy)."},"mfa_satisfied":{"type":"boolean","title":"Mfa Satisfied","description":"True when the current Clerk session has verified MFA (fva[1] != -1)."},"auth_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Provider","description":"Auth provider for this request: clerk, oauth, or dev."}},"type":"object","required":["is_firm_admin","mfa_required","mfa_satisfied"],"title":"MfaStatusResponse","description":"Clerk MFA enforcement status for the authenticated user."},"MigrateFromGrandfatheredResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"},"session_id":{"type":"string","title":"Session Id"}},"additionalProperties":true,"type":"object","required":["checkout_url","session_id"],"title":"MigrateFromGrandfatheredResponse","description":"Response for ``migrate_from_grandfathered``."},"MigrationReportRow":{"properties":{"qbo_account_id":{"type":"string","title":"Qbo Account Id"},"linked":{"type":"boolean","title":"Linked"},"qbo_cents":{"type":"integer","title":"Qbo Cents"},"local_cents":{"type":"integer","title":"Local Cents"},"delta_cents":{"type":"integer","title":"Delta Cents"},"severity":{"type":"string","title":"Severity"}},"additionalProperties":true,"type":"object","required":["qbo_account_id","linked","qbo_cents","local_cents","delta_cents","severity"],"title":"MigrationReportRow"},"MonthEndPackageCreateRequest":{"properties":{"accounting_period_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accounting Period Id","description":"Optional accounting period UUID. If omitted, ``period_start`` and ``period_end`` are used directly."},"period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Start","description":"Required if ``accounting_period_id`` is not provided."},"period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period End","description":"Required if ``accounting_period_id`` is not provided."},"report_format":{"$ref":"#/components/schemas/MonthEndPackageFormatEnum","description":"Per-report format inside the zip (``pdf`` or ``xlsx``).","default":"pdf"},"selected_reports":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Selected Reports","description":"Report keys to include in the package. Supported values: pl, balance_sheet, cash_flow, ar_aging, ap_aging, budget_vs_actual, bank_reconciliation."}},"type":"object","required":["selected_reports"],"title":"MonthEndPackageCreateRequest","description":"Request schema for queuing a new month-end package build.","example":{"accounting_period_id":"01952c2e-7e7f-7c8e-9f00-000000000001","report_format":"pdf","selected_reports":["pl","balance_sheet","cash_flow","ar_aging","ap_aging"]}},"MonthEndPackageDownloadResponse":{"properties":{"package_id":{"type":"string","title":"Package Id","description":"Month-end package UUID"},"filename":{"type":"string","title":"Filename","description":"Suggested attachment filename"},"download_url":{"type":"string","title":"Download Url","description":"Presigned S3 URL"},"expires_at":{"type":"string","format":"date-time","title":"Expires At","description":"When the URL expires"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes","description":"Final zip size in bytes"}},"type":"object","required":["package_id","filename","download_url","expires_at"],"title":"MonthEndPackageDownloadResponse","description":"Short-lived presigned download URL for a ready package."},"MonthEndPackageFormatEnum":{"type":"string","enum":["pdf","xlsx"],"title":"MonthEndPackageFormatEnum","description":"Per-report file format inside the zip."},"MonthEndPackageQueuedResponse":{"properties":{"package":{"$ref":"#/components/schemas/MonthEndPackageResponse","description":"The freshly created package record"},"workflow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id","description":"Temporal workflow id (also on ``package``)"}},"type":"object","required":["package"],"title":"MonthEndPackageQueuedResponse","description":"Returned immediately after enqueuing a package build."},"MonthEndPackageResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Month-end package UUID"},"business_id":{"type":"string","title":"Business Id","description":"Owning business UUID"},"accounting_period_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accounting Period Id","description":"Linked accounting period UUID, if any"},"period_start":{"type":"string","format":"date-time","title":"Period Start","description":"Start of the covered period"},"period_end":{"type":"string","format":"date-time","title":"Period End","description":"End of the covered period"},"status":{"$ref":"#/components/schemas/MonthEndPackageStatusEnum","description":"Build status: queued, in_progress, ready, or failed"},"report_format":{"$ref":"#/components/schemas/MonthEndPackageFormatEnum","description":"Per-report format inside the zip"},"selected_reports":{"items":{"type":"string"},"type":"array","title":"Selected Reports","description":"Report keys included in the package"},"workflow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id","description":"Temporal workflow id driving the build"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes","description":"Final zip size in bytes (set when ready)"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Suggested attachment filename for the zip download"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Failure reason when ``status == 'failed'``"},"requested_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By User Id","description":"User who requested the package"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At","description":"When the build started"},"ready_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ready At","description":"When the package became downloadable"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["id","business_id","period_start","period_end","status","report_format","created_at","updated_at"],"title":"MonthEndPackageResponse","description":"Response schema for a single month-end package record."},"MonthEndPackageStatusEnum":{"type":"string","enum":["queued","in_progress","ready","failed"],"title":"MonthEndPackageStatusEnum","description":"Lifecycle of a month-end package build job."},"MonthEndPackagesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MonthEndPackageResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"MonthEndPackagesListResponse","description":"Paginated list of month-end packages."},"NLSearchResponse":{"properties":{"interpreted_query":{"type":"string","title":"Interpreted Query","description":"How the AI interpreted the query"},"results":{"items":{"$ref":"#/components/schemas/NLSearchResultItem"},"type":"array","title":"Results"},"total":{"type":"integer","title":"Total","description":"Total results","default":0}},"type":"object","required":["interpreted_query"],"title":"NLSearchResponse"},"NLSearchResultItem":{"properties":{"entity_type":{"type":"string","title":"Entity Type","description":"Type of entity"},"entity_id":{"type":"string","title":"Entity Id","description":"Entity ID"},"title":{"type":"string","title":"Title","description":"Display title"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle","description":"Additional context"},"score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Score","description":"Relevance score"}},"type":"object","required":["entity_type","entity_id","title","score"],"title":"NLSearchResultItem"},"NavCatalogItem":{"properties":{"id":{"type":"string","title":"Id","description":"Stable hideable id, e.g. 'workspace:inventory'"},"label":{"type":"string","title":"Label","description":"Human label","default":""},"description":{"type":"string","title":"Description","description":"What lives here","default":""},"feature_tags":{"items":{"type":"string"},"type":"array","title":"Feature Tags","description":"Capability tags that help the model match"}},"type":"object","required":["id"],"title":"NavCatalogItem","description":"A hideable nav item the client offers the model to reason about."},"NavPreferencesProfile":{"properties":{"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary","description":"Short business profile, e.g. 'Service business, no inventory'"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"How the config was set: 'manual' or 'ai'"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"ISO 8601 timestamp of the last change"}},"type":"object","title":"NavPreferencesProfile","description":"Optional context describing how the hidden set was chosen."},"NavPreferencesResponse":{"properties":{"hidden":{"items":{"type":"string"},"type":"array","title":"Hidden","description":"Hidden nav item ids (e.g. 'workspace:inventory', 'books-section:Planning')"},"profile":{"anyOf":[{"$ref":"#/components/schemas/NavPreferencesProfile"},{"type":"null"}],"description":"Optional profile describing the chosen config"},"version":{"type":"integer","title":"Version","description":"Schema version of the stored blob","default":1}},"type":"object","title":"NavPreferencesResponse","description":"Per-business sidebar customization."},"NavPreferencesUpdateRequest":{"properties":{"hidden":{"items":{"type":"string"},"type":"array","title":"Hidden","description":"Full list of hidden nav item ids. Send [] to show everything."},"profile":{"anyOf":[{"$ref":"#/components/schemas/NavPreferencesProfile"},{"type":"null"}],"description":"Optional profile describing the chosen config"}},"type":"object","title":"NavPreferencesUpdateRequest","description":"Replace the business's hidden nav set (full replace, not merge)."},"NavSuggestHidden":{"properties":{"id":{"type":"string","title":"Id"},"reason":{"type":"string","title":"Reason","default":""}},"type":"object","required":["id"],"title":"NavSuggestHidden","description":"One suggested item to hide, with a short rationale."},"NavSuggestRequest":{"properties":{"description":{"type":"string","maxLength":2000,"minLength":1,"title":"Description","description":"Free-text business description"},"items":{"items":{"$ref":"#/components/schemas/NavCatalogItem"},"type":"array","title":"Items","description":"The hideable nav catalog (frontend-sourced)"},"signals":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Signals","description":"Optional account-derived hints, e.g. {'has_inventory': 'true'}"}},"type":"object","required":["description"],"title":"NavSuggestRequest","description":"Describe the business and the items the model may choose to hide."},"NavSuggestResponse":{"properties":{"hide":{"items":{"$ref":"#/components/schemas/NavSuggestHidden"},"type":"array","title":"Hide"},"profile_summary":{"type":"string","title":"Profile Summary","default":""}},"type":"object","title":"NavSuggestResponse","description":"AI proposal — the client renders this as a reviewable, editable diff."},"NonCashActivity":{"properties":{"description":{"type":"string","title":"Description","description":"Description of the activity"},"amount":{"type":"integer","title":"Amount","description":"Amount of the activity (cents)"},"category":{"type":"string","pattern":"^(investing|financing)$","title":"Category","description":"'investing' or 'financing'"}},"type":"object","required":["description","amount","category"],"title":"NonCashActivity","description":"A non-cash investing or financing activity (ASC 230 disclosure)."},"NoteAttachmentCreateRequest":{"properties":{"file_name":{"type":"string","maxLength":255,"title":"File Name"},"file_size":{"type":"integer","maximum":26214400.0,"exclusiveMinimum":0.0,"title":"File Size"},"mime_type":{"type":"string","maxLength":100,"title":"Mime Type"},"s3_key":{"type":"string","maxLength":500,"title":"S3 Key"}},"type":"object","required":["file_name","file_size","mime_type","s3_key"],"title":"NoteAttachmentCreateRequest","description":"Register a new attachment after upload."},"NoteAttachmentUploadUrlRequest":{"properties":{"file_name":{"type":"string","maxLength":255,"title":"File Name"},"mime_type":{"type":"string","maxLength":100,"title":"Mime Type"},"file_size":{"type":"integer","maximum":26214400.0,"exclusiveMinimum":0.0,"title":"File Size"}},"type":"object","required":["file_name","mime_type","file_size"],"title":"NoteAttachmentUploadUrlRequest","description":"Request a presigned URL to upload an attachment.\n\nEnforces the same extension/MIME/size rules as\n:class:`NoteAttachmentCreateRequest` so that we never hand out an\nupload URL for a file we'd reject on registration."},"NoteBulkCreateRequest":{"properties":{"notes":{"items":{"$ref":"#/components/schemas/NoteCreateRequest"},"type":"array","maxItems":200,"title":"Notes"}},"type":"object","required":["notes"],"title":"NoteBulkCreateRequest","description":"Bulk-create notes (used for localStorage migration)."},"NoteCreateRequest":{"properties":{"title":{"type":"string","maxLength":500,"title":"Title","default":"Untitled Note"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"}},"type":"object","title":"NoteCreateRequest","description":"Create a new note.","example":{"body":"Review Q2 financials.","title":"Follow-up items"}},"NoteListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/NoteResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total","default":0}},"type":"object","title":"NoteListResponse","description":"List of notes for a business."},"NoteResponse":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"pinned":{"type":"boolean","title":"Pinned","default":false},"author_id":{"type":"string","title":"Author Id"},"author_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Name"},"author_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Email"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"attachments":{"items":{"$ref":"#/components/schemas/AttachmentResponse"},"type":"array","title":"Attachments"}},"type":"object","required":["id","title","author_id","created_at","updated_at"],"title":"NoteResponse","description":"Single note returned from the API."},"NoteRewriteResponse":{"properties":{"rewritten_body":{"type":"string","title":"Rewritten Body"}},"type":"object","required":["rewritten_body"],"title":"NoteRewriteResponse","description":"Preview of AI-rewritten note body."},"NoteUpdateRequest":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Title"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"pinned":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pinned"}},"type":"object","title":"NoteUpdateRequest","description":"Partial update for an existing note."},"NotificationCountResponse":{"properties":{"count":{"type":"integer","minimum":0.0,"title":"Count"}},"type":"object","required":["count"],"title":"NotificationCountResponse"},"NotificationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/NotificationResponse"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_next":{"type":"boolean","title":"Has Next","default":false}},"type":"object","required":["items"],"title":"NotificationListResponse"},"NotificationResponse":{"properties":{"id":{"type":"string","title":"Id"},"recipient_kind":{"$ref":"#/components/schemas/RecipientKindEnum"},"recipient_id":{"type":"string","title":"Recipient Id"},"scope_business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope Business Id"},"scope_firm_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope Firm Id"},"source":{"$ref":"#/components/schemas/NotificationSourceEnum"},"topic":{"$ref":"#/components/schemas/NotificationTopicEnum"},"severity":{"$ref":"#/components/schemas/NotificationSeverityEnum"},"status":{"$ref":"#/components/schemas/NotificationStatusEnum"},"snoozed_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Snoozed Until"},"pinned":{"type":"boolean","title":"Pinned","default":false},"title":{"type":"string","title":"Title"},"body":{"type":"string","title":"Body","default":""},"action_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Label"},"action_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Url"},"has_action":{"type":"boolean","title":"Has Action","default":false},"attachments":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Attachments"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"channels":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Channels"},"is_virtual":{"type":"boolean","title":"Is Virtual","default":false},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"status_changed_at":{"type":"string","format":"date-time","title":"Status Changed At"}},"type":"object","required":["id","recipient_kind","recipient_id","source","topic","severity","status","title","created_at","updated_at","status_changed_at"],"title":"NotificationResponse","description":"Single notification row."},"NotificationScopeEnum":{"type":"string","enum":["me","business","firm"],"title":"NotificationScopeEnum","description":"Read scope for the list endpoint."},"NotificationSeverityEnum":{"type":"string","enum":["info","warning","urgent"],"title":"NotificationSeverityEnum"},"NotificationSourceEnum":{"type":"string","enum":["alert","task","system","digest","announcement","message"],"title":"NotificationSourceEnum"},"NotificationStatusEnum":{"type":"string","enum":["new","seen","snoozed","resolved","dismissed"],"title":"NotificationStatusEnum"},"NotificationTopicCountsResponse":{"properties":{"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"}},"type":"object","required":["counts"],"title":"NotificationTopicCountsResponse"},"NotificationTopicEnum":{"type":"string","enum":["billing","ap_approval","anomaly","plaid","xero","plaid_sync","xero_sync","quickbooks","quickbooks_sync","subscription","month_end","ledger","notes","email_ingest","reconciliation","manual"],"title":"NotificationTopicEnum"},"NotifyBusinessResponse":{"properties":{"notified":{"type":"integer","title":"Notified"}},"additionalProperties":true,"type":"object","required":["notified"],"title":"NotifyBusinessResponse","description":"Response for ``notify_business``."},"OAuthTokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token","description":"The access token (JWT)"},"token_type":{"type":"string","title":"Token Type","description":"Token type (always 'Bearer')","default":"Bearer"},"expires_in":{"type":"integer","title":"Expires In","description":"Access token lifetime in seconds"},"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token","description":"Refresh token for obtaining new access tokens"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope","description":"Granted scope (may differ from requested)"}},"type":"object","required":["access_token","expires_in"],"title":"OAuthTokenResponse","description":"Token Response.\n\nReturned after successful token or refresh request."},"OnboardingProfileResponse":{"properties":{"account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Type"},"profile":{"additionalProperties":true,"type":"object","title":"Profile"},"conversation":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Conversation"},"recommendations":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Recommendations"},"has_profile":{"type":"boolean","title":"Has Profile","default":false}},"type":"object","title":"OnboardingProfileResponse","description":"Persisted onboarding state used by the wizard for resume.\n\nReturned by ``GET /onboarding/profile`` so the SPA can rehydrate the\nchat thread and learned profile after a refresh or new browser session.\nThe endpoint always returns 200; brand-new users get an empty body\nwith ``has_profile=False`` so the SPA can branch without an HTTP\nstatus check."},"OnboardingResponse":{"properties":{"firm_id":{"type":"string","title":"Firm Id"},"business_id":{"type":"string","title":"Business Id"},"user_id":{"type":"string","title":"User Id"},"message":{"type":"string","title":"Message","default":"Onboarding completed successfully."}},"type":"object","required":["firm_id","business_id","user_id"],"title":"OnboardingResponse","description":"Response after onboarding completes via Stripe-first flow."},"OnboardingUploadUrlRequest":{"properties":{"filename":{"type":"string","maxLength":255,"minLength":1,"title":"Filename"},"content_type":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Content Type"}},"type":"object","required":["filename"],"title":"OnboardingUploadUrlRequest","description":"Request for a pre-signed upload URL during onboarding."},"OnboardingUploadUrlResponse":{"properties":{"upload_url":{"type":"string","title":"Upload Url"},"s3_key":{"type":"string","title":"S3 Key"}},"type":"object","required":["upload_url","s3_key"],"title":"OnboardingUploadUrlResponse","description":"Pre-signed URL response for onboarding logo upload."},"OpposingLineEntryLedgerInfo":{"properties":{"id":{"type":"string","title":"Id","description":"Ledger UUID."},"name":{"type":"string","title":"Name","description":"Ledger name (e.g., 'Office Supplies', 'Sales Revenue')."},"type":{"type":"string","title":"Type","description":"Ledger type: asset, liability, equity, revenue, expense."},"financial_account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Account Type","description":"If this ledger is a connected bank/credit-card/prepaid account, the account subtype (e.g. 'bank_account', 'credit_card'). Null for regular category ledgers. Non-null means this opposing entry represents an inter-account movement, not a spend category."},"system_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Key","description":"Immutable system identifier for built-in ledgers (e.g. 'transfers_between_accounts', 'accounts_receivable'). Null for user-created ledgers."}},"type":"object","required":["id","name","type"],"title":"OpposingLineEntryLedgerInfo","description":"Embedded ledger information for opposing line entries."},"OpposingLineEntryResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Line entry UUID."},"amount":{"type":"integer","title":"Amount","description":"Amount in cents (always positive; direction via debit_credit)."},"debit_credit":{"type":"string","title":"Debit Credit","description":"Whether this is a 'debit' or 'credit' entry."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of this line entry."},"ledger":{"$ref":"#/components/schemas/OpposingLineEntryLedgerInfo","description":"The ledger (account) this entry affects."}},"type":"object","required":["id","amount","debit_credit","ledger"],"title":"OpposingLineEntryResponse","description":"Response schema for opposing line entries with ledger details.\n\nOpposing line entries are the counter-entries in a double-entry transaction.\nFor a bank transaction, these represent the category/account the transaction\nwas posted to (e.g., an expense or revenue account).","example":{"amount":15000,"debit_credit":"debit","description":"Office supplies purchase","id":"019ab37c-a1b2-7c3d-e4f5-6a7b8c9d0e1f","ledger":{"id":"019ab37c-led1-7000-8000-000000000001","name":"Office Supplies","type":"expense"}}},"OrderListItemResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Order UUID."},"vendor_id":{"type":"string","title":"Vendor Id","description":"Vendor UUID."},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name","description":"Vendor name."},"vendor_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Email","description":"Vendor email."},"status":{"type":"string","title":"Status","description":"Order status."},"name":{"type":"string","title":"Name","description":"Order name."},"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id","description":"Business UUID."},"po_number":{"type":"string","title":"Po Number","description":"PO number."},"line_items":{"items":{},"type":"array","title":"Line Items","description":"Line items."},"fees":{"items":{"$ref":"#/components/schemas/Fee"},"type":"array","title":"Fees","description":"Fees."},"payments":{"items":{"$ref":"#/components/schemas/Payment-Output"},"type":"array","title":"Payments","description":"Payments."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Notes."},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total in cents."},"balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Balance","description":"Balance in cents."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Created timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Updated timestamp."},"version":{"type":"integer","title":"Version","default":1},"bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Id","description":"UUID of the Bill linked to this PO, if any."},"bill_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Status","description":"Status of the linked bill (forecasted, received, paid, ...)."},"bill_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Bill Amount","description":"Linked bill amount in cents."},"bill_received_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Bill Received On","description":"Timestamp the linked bill was marked received from the vendor."},"bill_paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Bill Paid On","description":"Timestamp the linked bill was marked fully paid."}},"additionalProperties":true,"type":"object","required":["id","vendor_id","status","name","po_number","line_items","fees","payments","created_at","updated_at"],"title":"OrderListItemResponse","description":"Abbreviated order data for list views."},"OrderListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OrderListItemResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"OrderListResponse","description":"Paginated list of inventory orders."},"OrderPaymentRequest":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the bank transaction representing the payment."},"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Payment amount in cents. Must be > 0."},"paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid On","description":"Override payment date (ISO 8601). Defaults to the transaction datetime if omitted."}},"type":"object","required":["transaction_id","amount"],"title":"OrderPaymentRequest","description":"Request schema for recording a payment against a purchase order.\n\nLinks a bank transaction to a PO to track partial or full payment."},"OrderPaymentResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Payment UUID."},"inventory_order_id":{"type":"string","title":"Inventory Order Id","description":"Parent order UUID."},"amount":{"type":"integer","title":"Amount","description":"Payment amount in cents."},"paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid On","description":"Payment date."},"transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Id","description":"Linked bank transaction UUID."},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method","description":"Payment method."}},"type":"object","required":["id","inventory_order_id","amount"],"title":"OrderPaymentResponse","description":"Response schema for a recorded order payment."},"OrderResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Order UUID."},"vendor_id":{"type":"string","title":"Vendor Id","description":"Vendor UUID."},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name","description":"Vendor name (resolved)."},"vendor_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Email","description":"Vendor email (resolved)."},"status":{"type":"string","title":"Status","description":"Order status."},"name":{"type":"string","title":"Name","description":"Order name."},"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id","description":"Business UUID."},"po_number":{"type":"string","title":"Po Number","description":"Purchase order number."},"line_items":{"items":{},"type":"array","title":"Line Items","description":"Order line items."},"fees":{"items":{"$ref":"#/components/schemas/Fee"},"type":"array","title":"Fees","description":"Additional fees."},"payments":{"items":{"$ref":"#/components/schemas/Payment-Output"},"type":"array","title":"Payments","description":"Payment records."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Order notes."},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total amount in cents."},"balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Balance","description":"Remaining balance in cents."},"shipments":{"items":{},"type":"array","title":"Shipments","description":"Associated shipments."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"version":{"type":"integer","title":"Version","description":"Version for optimistic locking.","default":1},"shipping_cost":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Shipping Cost","description":"Freight/shipping cost in cents."},"ship_from_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ship From Location Id","description":"Source location UUID."},"ship_to_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ship To Location Id","description":"Destination location UUID."},"ship_from_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ship From Location Name","description":"Resolved source location name."},"ship_to_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ship To Location Name","description":"Resolved destination location name."},"production_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Production Run Id","description":"Linked production run UUID."},"transfer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Id","description":"Linked inventory transfer UUID."},"expected_delivery_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Delivery Date","description":"Expected delivery date."},"payment_term_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Term Id","description":"Payment term UUID for net terms."},"payment_term_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Term Name","description":"Resolved payment term name (e.g., 'Net 30')."},"payment_term_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Payment Term Days","description":"Days until due from the payment term."},"expected_paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Paid On","description":"Expected payment date."},"bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Id","description":"UUID of the Bill linked to this PO, if any."},"bill_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Status","description":"Status of the linked bill: forecasted, received, partially_paid, paid, draft, or canceled."},"bill_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Bill Amount","description":"Linked bill amount in cents."},"bill_received_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Bill Received On","description":"Timestamp the linked bill was marked received from the vendor."},"bill_paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Bill Paid On","description":"Timestamp the linked bill was marked fully paid."}},"additionalProperties":true,"type":"object","required":["id","vendor_id","status","name","po_number","line_items","fees","payments","created_at","updated_at"],"title":"OrderResponse","description":"Response schema for an inventory order.\n\nIncludes all order details, line items, fees, payments,\nand related shipments.","example":{"balance":125000,"bill_amount":125000,"bill_id":"019ab37c-bill-7000-8000-000000000001","bill_status":"forecasted","created_at":"2024-01-10T10:30:00Z","expected_delivery_date":"2024-01-25","expected_paid_on":"2024-02-24","fees":[{"amount":5000,"name":"Shipping"}],"id":"019ab37c-ord1-7000-8000-000000000001","line_items":[],"name":"January Inventory Restock","payment_term_days":30,"payment_term_id":"019ab37c-term-7000-8000-000000000001","payment_term_name":"Net 30","payments":[],"po_number":"PO-2024-001","shipments":[],"status":"submitted","total":125000,"updated_at":"2024-01-15T14:00:00Z","vendor_email":"orders@acmesupplies.com","vendor_id":"019ab37c-vend-7000-8000-000000000001","vendor_name":"Acme Supplies","version":1}},"OtherDepositLine":{"properties":{"from_ledger_id":{"type":"string","title":"From Ledger Id","description":"Account credited for this line (e.g. interest income)."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Line amount in cents."}},"type":"object","required":["from_ledger_id","amount"],"title":"OtherDepositLine","description":"An ad-hoc deposit line not sourced from undeposited funds."},"POAnalyzeResponse":{"properties":{"file_id":{"type":"string","title":"File Id"},"sheets":{"items":{"$ref":"#/components/schemas/SheetAnalysis"},"type":"array","title":"Sheets"},"metadata":{"$ref":"#/components/schemas/POMetadata"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"}},"type":"object","required":["file_id"],"title":"POAnalyzeResponse","description":"Response from POST /inventory/po-import/analyze."},"POAnalyzeStatusResponse":{"properties":{"status":{"type":"string","enum":["pending","completed","failed"],"title":"Status","default":"pending"},"result":{"anyOf":[{"$ref":"#/components/schemas/POAnalyzeResponse"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"POAnalyzeStatusResponse"},"POAnalyzeTaskResponse":{"properties":{"task_id":{"type":"string","title":"Task Id"}},"type":"object","required":["task_id"],"title":"POAnalyzeTaskResponse"},"POApplyRequest":{"properties":{"file_id":{"type":"string","title":"File Id"},"vendor_id":{"type":"string","title":"Vendor Id"},"po_number":{"type":"string","title":"Po Number"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"line_decisions":{"items":{"$ref":"#/components/schemas/POLineDecision"},"type":"array","title":"Line Decisions"},"selected_sheets":{"items":{"type":"string"},"type":"array","title":"Selected Sheets"},"sheet_mappings":{"items":{"$ref":"#/components/schemas/POSheetMappingConfirmation"},"type":"array","title":"Sheet Mappings"}},"type":"object","required":["file_id","vendor_id","po_number","name","selected_sheets","sheet_mappings"],"title":"POApplyRequest"},"POApplyResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"},"po_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Number"},"lines_created":{"type":"integer","title":"Lines Created","default":0},"lines_skipped":{"type":"integer","title":"Lines Skipped","default":0},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","title":"POApplyResponse"},"POForecastDetail":{"properties":{"po_id":{"type":"string","title":"Po Id"},"po_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Number"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"status":{"type":"string","title":"Status"},"total_cents":{"type":"integer","title":"Total Cents","default":0},"balance_cents":{"type":"integer","title":"Balance Cents","default":0},"expected_paid_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expected Paid On"},"is_linked_to_bill":{"type":"boolean","title":"Is Linked To Bill","default":false},"linked_bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked Bill Id"},"linked_bill_due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Linked Bill Due Date"},"linked_bill_remaining_balance_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Linked Bill Remaining Balance Cents"},"forecast_column":{"type":"string","enum":["inventory","ap_out"],"title":"Forecast Column"}},"type":"object","required":["po_id","status","forecast_column"],"title":"POForecastDetail","description":"One PO surfaced on the Cash Flow PO Settings panel.\n\nEach row tells the operator (a) which column this PO's cash flows\nthrough (``inventory`` when unlinked, ``ap_out`` when an explicit\n``Bill`` is attached via ``source_inventory_order_id``) and (b) the\namount and date used in that column."},"POForecastSettingsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/POForecastDetail"},"type":"array","title":"Items"},"total_inventory_outflow_cents":{"type":"integer","title":"Total Inventory Outflow Cents","default":0},"total_ap_outflow_cents":{"type":"integer","title":"Total Ap Outflow Cents","default":0}},"type":"object","title":"POForecastSettingsResponse","description":"Response envelope for the PO settings panel."},"POLineDecision":{"properties":{"row_number":{"type":"integer","title":"Row Number"},"action":{"type":"string","enum":["include","skip"],"title":"Action","default":"include"},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Override variant UUID for unmatched/ambiguous lines."}},"type":"object","required":["row_number"],"title":"POLineDecision"},"POMetadata":{"properties":{"suggested_po_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Po Name"},"suggested_vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Vendor Name"},"suggested_po_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Po Number"}},"type":"object","title":"POMetadata","description":"AI-detected purchase order metadata."},"POPreviewLineItem":{"properties":{"row_number":{"type":"integer","title":"Row Number"},"sku":{"type":"string","title":"Sku"},"item_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Name"},"quantity":{"type":"integer","title":"Quantity"},"unit_price_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Price Cents"},"match_status":{"type":"string","enum":["matched","unmatched","ambiguous"],"title":"Match Status","default":"unmatched"},"matched_variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched Variant Id"},"matched_variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched Variant Name"},"matched_sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched Sku"},"match_confidence":{"type":"number","title":"Match Confidence","default":0.0},"candidates":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Candidates"}},"type":"object","required":["row_number","sku","quantity"],"title":"POPreviewLineItem"},"POPreviewRequest":{"properties":{"file_id":{"type":"string","title":"File Id"},"selected_sheets":{"items":{"type":"string"},"type":"array","title":"Selected Sheets"},"sheet_mappings":{"items":{"$ref":"#/components/schemas/POSheetMappingConfirmation"},"type":"array","title":"Sheet Mappings"}},"type":"object","required":["file_id","selected_sheets","sheet_mappings"],"title":"POPreviewRequest"},"POPreviewResponse":{"properties":{"file_id":{"type":"string","title":"File Id"},"line_items":{"items":{"$ref":"#/components/schemas/POPreviewLineItem"},"type":"array","title":"Line Items"},"summary":{"$ref":"#/components/schemas/POPreviewSummary"},"metadata":{"$ref":"#/components/schemas/POMetadata"}},"type":"object","required":["file_id"],"title":"POPreviewResponse"},"POPreviewSummary":{"properties":{"total_lines":{"type":"integer","title":"Total Lines","default":0},"matched_lines":{"type":"integer","title":"Matched Lines","default":0},"unmatched_lines":{"type":"integer","title":"Unmatched Lines","default":0},"ambiguous_lines":{"type":"integer","title":"Ambiguous Lines","default":0},"total_quantity":{"type":"integer","title":"Total Quantity","default":0},"total_cents":{"type":"integer","title":"Total Cents","default":0},"skipped_rows":{"type":"integer","title":"Skipped Rows","default":0}},"type":"object","title":"POPreviewSummary"},"POSheetMappingConfirmation":{"properties":{"sheet_name":{"type":"string","title":"Sheet Name"},"mapping":{"additionalProperties":{"type":"integer"},"type":"object","title":"Mapping","description":"Map of standard field name → 0-based column index."},"data_start_row":{"type":"integer","title":"Data Start Row","default":2},"exclude_rows":{"items":{"type":"integer"},"type":"array","title":"Exclude Rows"}},"type":"object","required":["sheet_name","mapping"],"title":"POSheetMappingConfirmation"},"ParseDebtContractResponse":{"properties":{"contract":{"$ref":"#/components/schemas/ParsedDebtContract"},"payment_schedule":{"items":{"$ref":"#/components/schemas/ParsedDebtScheduleRow"},"type":"array","title":"Payment Schedule"}},"type":"object","required":["contract"],"title":"ParseDebtContractResponse","description":"Draft contract terms + projected payout table from a parsed PDF."},"ParsedDebtContract":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"lender":{"type":"string","maxLength":255,"minLength":1,"title":"Lender","description":"Counterparty name. The lender for a loan to us (borrow) or the borrower for a loan we made (lend)."},"direction":{"type":"string","title":"Direction","description":"DebtDirectionEnum value: 'borrow' (a loan to us — a liability) or 'lend' (a loan from us / note receivable — an asset whose interest is income). Defaults to 'borrow'.","default":"borrow"},"debt_type":{"type":"string","title":"Debt Type","description":"DebtTypeEnum value: term_loan, line_of_credit, mortgage, equipment_loan, sba_loan, convertible_note, revenue_based, other."},"original_principal_cents":{"type":"integer","minimum":0.0,"title":"Original Principal Cents"},"current_balance_cents":{"type":"integer","minimum":0.0,"title":"Current Balance Cents"},"interest_rate_bps":{"type":"integer","minimum":0.0,"title":"Interest Rate Bps","description":"Annual interest rate in basis points (e.g. 500 = 5.00%). Set to 0 for revenue-based financing.","default":0},"term_months":{"type":"integer","minimum":0.0,"title":"Term Months","description":"Loan term in months. For revenue-based financing this is an estimate of months to cap based on assumed revenue.","default":0},"start_date":{"type":"string","title":"Start Date","description":"Contract start date as ISO-8601 YYYY-MM-DD."},"maturity_date":{"type":"string","title":"Maturity Date","description":"Maturity/expected payoff date as ISO-8601 YYYY-MM-DD. For RBF this is an estimate based on the share rate."},"payment_frequency":{"type":"string","title":"Payment Frequency","description":"PaymentFrequencyEnum value: monthly, quarterly, semi_annual, annual, bullet, or revenue_share.","default":"monthly"},"payment_amount_cents":{"type":"integer","minimum":0.0,"title":"Payment Amount Cents","description":"Scheduled payment per period (fixed) or 0 for RBF.","default":0},"revenue_share_bps":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Revenue Share Bps","description":"Revenue-share rate in basis points; only set for ``revenue_based`` debt."},"total_repayment_cap_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Total Repayment Cap Cents","description":"Total dollar cap on cumulative repayments; only set for ``revenue_based`` debt."},"summary":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Summary","description":"One-paragraph human summary of the contract."},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"Parsing confidence in [0, 1] reported by the LLM.","default":0.0}},"type":"object","required":["name","lender","debt_type","original_principal_cents","current_balance_cents","start_date","maturity_date"],"title":"ParsedDebtContract","description":"Structured debt-contract terms extracted from a parsed contract.\n\nField names and units match ``DebtInstrument`` so the approve\nendpoint can persist this payload directly. Revenue-based fields\n(``revenue_share_bps`` and ``total_repayment_cap_cents``) are only\npopulated when ``debt_type`` is ``revenue_based``."},"ParsedDebtScheduleRow":{"properties":{"payment_date":{"type":"string","title":"Payment Date","description":"ISO-8601 YYYY-MM-DD."},"amount_cents":{"type":"integer","minimum":0.0,"title":"Amount Cents"},"principal_cents":{"type":"integer","minimum":0.0,"title":"Principal Cents"},"interest_cents":{"type":"integer","minimum":0.0,"title":"Interest Cents"},"remaining_balance_cents":{"type":"integer","minimum":0.0,"title":"Remaining Balance Cents"}},"type":"object","required":["payment_date","amount_cents","principal_cents","interest_cents","remaining_balance_cents"],"title":"ParsedDebtScheduleRow","description":"A single row of a projected payout table."},"PasteTransactionTextRequest":{"properties":{"pasted_text":{"type":"string","maxLength":5000000,"minLength":10,"title":"Pasted Text","description":"Raw CSV/TSV text pasted from a bank export or spreadsheet"}},"type":"object","required":["pasted_text"],"title":"PasteTransactionTextRequest","description":"Request schema for pasting transaction text (CSV) for upload.\n\nAccepts raw CSV/TSV text copied from a bank export or spreadsheet.\nThe text is saved as a CSV in S3 so it can feed into the existing\npreview → upload pipeline."},"PasteTransactionTextResponse":{"properties":{"s3_key":{"type":"string","title":"S3 Key","description":"S3 key of the generated CSV file"},"row_count":{"type":"integer","title":"Row Count","description":"Approximate number of data rows detected"}},"type":"object","required":["s3_key","row_count"],"title":"PasteTransactionTextResponse","description":"Response after converting pasted text to a CSV file in S3."},"PauseAiFeaturesResponse":{"properties":{"requests_used":{"type":"integer","title":"Requests Used"},"monthly_limit":{"type":"integer","title":"Monthly Limit"},"remaining":{"type":"integer","title":"Remaining"},"is_unlimited":{"type":"boolean","title":"Is Unlimited"},"plan_tier":{"type":"string","title":"Plan Tier"},"has_ai_pro":{"type":"boolean","title":"Has Ai Pro"},"is_trial":{"type":"boolean","title":"Is Trial"},"overage_enabled":{"type":"boolean","title":"Overage Enabled"},"overage_requests":{"type":"integer","title":"Overage Requests"},"overage_rates_cents":{"$ref":"#/components/schemas/AIOverageRatesCents"},"overage_breakdown":{"$ref":"#/components/schemas/AIOverageBreakdown"},"estimated_overage_cost_cents":{"type":"integer","title":"Estimated Overage Cost Cents"},"projected_month_end_overage_cents":{"type":"integer","title":"Projected Month End Overage Cents"},"ai_paused_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Paused At"},"ai_paused_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Paused By"},"upgrade_suggestion":{"anyOf":[{"$ref":"#/components/schemas/AIUpgradeSuggestion"},{"type":"null"}]},"disabled_features_when_paused":{"items":{"type":"string"},"type":"array","title":"Disabled Features When Paused"}},"additionalProperties":true,"type":"object","required":["requests_used","monthly_limit","remaining","is_unlimited","plan_tier","has_ai_pro","is_trial","overage_enabled","overage_requests","overage_rates_cents","overage_breakdown","estimated_overage_cost_cents","projected_month_end_overage_cents","disabled_features_when_paused"],"title":"PauseAiFeaturesResponse","description":"Response for ``pause_ai_features``."},"Payment-Input":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Payment UUID."},"date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date","description":"Payment date."},"paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid On","description":"Payment date (alias for paid_on)."},"amount":{"type":"integer","title":"Amount","description":"Payment amount in cents."},"inventory_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Order Id","description":"Parent order UUID."},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method","description":"Payment method (e.g., 'check', 'wire', 'credit_card')."}},"type":"object","required":["amount"],"title":"Payment","description":"Payment record for an inventory order.\n\nTracks payments made to vendors for purchase orders.\nAmount is in cents.","example":{"amount":50000,"method":"wire","paid_on":"2024-01-15T00:00:00Z"}},"Payment-Output":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Payment UUID."},"paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid On","description":"Payment date."},"date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date","description":"Payment date (alias for paid_on)."},"amount":{"type":"integer","title":"Amount","description":"Payment amount in cents."},"inventory_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Order Id","description":"Parent order UUID."},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method","description":"Payment method (e.g., 'check', 'wire', 'credit_card')."}},"type":"object","required":["amount"],"title":"Payment","description":"Payment record for an inventory order.\n\nTracks payments made to vendors for purchase orders.\nAmount is in cents.","example":{"amount":50000,"method":"wire","paid_on":"2024-01-15T00:00:00Z"}},"PaymentBehaviorItem":{"properties":{"customer_id":{"type":"string","title":"Customer Id","description":"Customer ID"},"customer_name":{"type":"string","title":"Customer Name","description":"Customer name"},"behavior":{"type":"string","title":"Behavior","description":"early, on_time, late, or delinquent"},"avg_days_to_pay":{"type":"number","title":"Avg Days To Pay","description":"Average days to pay"},"predicted_next_payment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Predicted Next Payment","description":"Predicted next payment date"},"risk_score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Risk Score","description":"Risk score 0-1"},"recommendation":{"type":"string","title":"Recommendation","description":"Recommended action"}},"type":"object","required":["customer_id","customer_name","behavior","avg_days_to_pay","risk_score","recommendation"],"title":"PaymentBehaviorItem"},"PaymentListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PaymentResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"PaymentListResponse","description":"Paginated list of payments."},"PaymentPriorityItem":{"properties":{"bill_id":{"type":"string","title":"Bill Id","description":"Bill ID"},"vendor_name":{"type":"string","title":"Vendor Name","description":"Vendor name"},"amount":{"type":"integer","title":"Amount","description":"Amount in cents"},"due_date":{"type":"string","title":"Due Date","description":"Due date"},"priority_score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Priority Score","description":"Priority score 0-1"},"reason":{"type":"string","title":"Reason","description":"Reason for priority ranking"}},"type":"object","required":["bill_id","vendor_name","amount","due_date","priority_score","reason"],"title":"PaymentPriorityItem"},"PaymentRecommendationItem":{"properties":{"bill_id":{"type":"string","title":"Bill Id"},"vendor_name":{"type":"string","title":"Vendor Name"},"amount_cents":{"type":"integer","title":"Amount Cents"},"balance_cents":{"type":"integer","title":"Balance Cents"},"due_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due On"},"priority":{"type":"string","enum":["overdue","due_this_week","due_this_month","can_defer"],"title":"Priority"},"action":{"type":"string","title":"Action"},"reasoning":{"type":"string","title":"Reasoning"},"contract_match":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contract Match"}},"additionalProperties":true,"type":"object","required":["bill_id","vendor_name","amount_cents","balance_cents","priority","action","reasoning"],"title":"PaymentRecommendationItem","description":"Single bill payment recommendation."},"PaymentRecommendationsGrouped":{"properties":{"overdue":{"items":{"$ref":"#/components/schemas/PaymentRecommendationItem"},"type":"array","title":"Overdue"},"due_this_week":{"items":{"$ref":"#/components/schemas/PaymentRecommendationItem"},"type":"array","title":"Due This Week"},"due_this_month":{"items":{"$ref":"#/components/schemas/PaymentRecommendationItem"},"type":"array","title":"Due This Month"},"can_defer":{"items":{"$ref":"#/components/schemas/PaymentRecommendationItem"},"type":"array","title":"Can Defer"}},"additionalProperties":true,"type":"object","title":"PaymentRecommendationsGrouped","description":"Recommendations grouped by priority bucket."},"PaymentRecommendationsSummary":{"properties":{"total_outstanding_cents":{"type":"integer","title":"Total Outstanding Cents"},"total_overdue_cents":{"type":"integer","title":"Total Overdue Cents"},"total_due_this_week_cents":{"type":"integer","title":"Total Due This Week Cents"},"bills_count":{"type":"integer","title":"Bills Count"}},"additionalProperties":true,"type":"object","required":["total_outstanding_cents","total_overdue_cents","total_due_this_week_cents","bills_count"],"title":"PaymentRecommendationsSummary","description":"Aggregate metrics for payment recommendations."},"PaymentResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Payment UUID."},"paid_on":{"type":"string","format":"date-time","title":"Paid On","description":"Payment date."},"amount":{"type":"number","title":"Amount","description":"Payment amount in dollars."},"inventory_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Order Id","description":"Parent order UUID."}},"type":"object","required":["id","paid_on","amount"],"title":"PaymentResponse","description":"Response schema for a payment record.","example":{"amount":500.0,"id":"019ab37c-pay1-7000-8000-000000000001","inventory_order_id":"019ab37c-ord1-7000-8000-000000000001","paid_on":"2024-01-15T00:00:00Z"}},"PaymentTermCreateRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Display name (e.g., 'Net 30')"},"days_until_due":{"type":"integer","minimum":0.0,"title":"Days Until Due","description":"Days until payment is due"},"discount_percent":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Discount Percent","description":"Early payment discount percentage"},"discount_days":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Discount Days","description":"Days to pay to receive discount"},"is_default":{"type":"boolean","title":"Is Default","description":"Set as default payment term","default":false}},"type":"object","required":["name","days_until_due"],"title":"PaymentTermCreateRequest","description":"Request schema for creating a payment term.","example":{"days_until_due":30,"discount_days":10,"discount_percent":2.0,"is_default":false,"name":"2/10 Net 30"}},"PaymentTermResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Payment term UUID"},"business_id":{"type":"string","title":"Business Id","description":"Business UUID"},"name":{"type":"string","title":"Name","description":"Display name"},"days_until_due":{"type":"integer","title":"Days Until Due","description":"Days until payment is due"},"discount_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount Percent","description":"Early payment discount percentage"},"discount_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discount Days","description":"Days to receive discount"},"is_default":{"type":"boolean","title":"Is Default","description":"Is default payment term"},"is_active":{"type":"boolean","title":"Is Active","description":"Is active"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["id","business_id","name","days_until_due","is_default","is_active","created_at","updated_at"],"title":"PaymentTermResponse","description":"Response schema for a payment term."},"PaymentTermUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Display name"},"days_until_due":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Days Until Due","description":"Days until due"},"discount_percent":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Discount Percent","description":"Discount percentage"},"discount_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discount Days","description":"Discount days"},"is_default":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Default","description":"Set as default"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Active status"}},"type":"object","title":"PaymentTermUpdateRequest","description":"Request schema for updating a payment term."},"PaymentTermsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PaymentTermResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"PaymentTermsListResponse","description":"Paginated list of payment terms."},"PendingApprovalBill":{"properties":{"id":{"type":"string","title":"Id","description":"Bill UUID (as string)."},"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount","description":"Bill amount in cents (0 when unavailable)."},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Vendor UUID, if set on the bill."},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name","description":"Resolved vendor name."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Bill description."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Bill status name."}},"type":"object","required":["id"],"title":"PendingApprovalBill","description":"Trimmed bill payload embedded in pending approval items."},"PendingApprovalItem":{"properties":{"execution_id":{"type":"string","title":"Execution Id","description":"Workflow execution UUID."},"workflow_id":{"type":"string","title":"Workflow Id","description":"AP approval workflow UUID."},"node_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Node Id","description":"Approval gate node id the run is waiting on."},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier","description":"Tier of the suspended gate ('ops', 'advisor', 'owner')."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Human-readable label of the suspended gate."},"suspended_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suspended At","description":"ISO timestamp when execution was suspended."},"bill":{"$ref":"#/components/schemas/PendingApprovalBill","description":"Bill awaiting approval."}},"type":"object","required":["execution_id","workflow_id","bill"],"title":"PendingApprovalItem","description":"One suspended AP approval execution waiting on human input."},"PendingApprovalsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PendingApprovalItem"},"type":"array","title":"Items","description":"Suspended approval rows, newest first (max 200)."}},"type":"object","title":"PendingApprovalsResponse","description":"Response for ``GET /ap-approval/pending``."},"PeriodSignOffItem":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"role":{"type":"string","title":"Role"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"signed_off_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signed Off At"},"score_at_signoff":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score At Signoff"}},"additionalProperties":true,"type":"object","required":["id","user_id","role"],"title":"PeriodSignOffItem","description":"Multi-reviewer sign-off on a period."},"PlaceInServiceRequest":{"properties":{"in_service_date":{"type":"string","format":"date","title":"In Service Date","description":"Date asset starts depreciating"}},"type":"object","required":["in_service_date"],"title":"PlaceInServiceRequest","description":"Schema for placing an asset in service."},"PlaidConnectionSchema":{"properties":{"id":{"type":"string","title":"Id","description":"Plaid Item UUID."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When connection was established."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"item_id":{"type":"string","title":"Item Id","description":"Plaid Item ID."},"institution_id":{"type":"string","title":"Institution Id","description":"Plaid institution ID (e.g., 'ins_3')."},"institution_name":{"type":"string","title":"Institution Name","description":"Bank/institution name."},"accounts":{"anyOf":[{"items":{"$ref":"#/components/schemas/AccountSchema"},"type":"array"},{"type":"null"}],"title":"Accounts","description":"Bank accounts associated with this connection.","default":[]},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"sync_status":{"type":"string","title":"Sync Status","description":"Current sync status."},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code","description":"Plaid error code if sync failed."}},"additionalProperties":true,"type":"object","required":["id","created_at","updated_at","item_id","institution_id","institution_name","business_id","sync_status"],"title":"PlaidConnectionSchema","description":"Response schema for a Plaid bank connection.\n\nRepresents a linked bank institution with its associated accounts.\nCreated when a user connects a bank via the Plaid Link flow.\n\n**Sync Status Values:**\n- `syncing`: Initial sync in progress\n- `synced`: Fully synced and up to date\n- `error`: Sync failed (check error_code)\n- `disconnected`: Connection needs re-authentication","example":{"accounts":[{"id":"019ab37c-acc1-7000-8000-000000000001","mask":"1234","name":"Chase Business Checking","subtype":"checking","type":"depository"}],"business_id":"019ab37c-bus1-7000-8000-000000000001","created_at":"2024-01-10T10:30:00Z","id":"019ab37c-plaid-7000-8000-000000000001","institution_id":"ins_3","institution_name":"Chase","item_id":"plaid_item_abc123","sync_status":"synced","updated_at":"2024-01-15T14:00:00Z"}},"PlanChangeRequest":{"properties":{"price_id":{"type":"string","title":"Price Id","description":"Stripe Price ID for the new plan."}},"type":"object","required":["price_id"],"title":"PlanChangeRequest"},"PnlMonthRow":{"properties":{"label":{"type":"string","title":"Label"},"revenue_cents":{"type":"integer","title":"Revenue Cents"},"cogs_cents":{"type":"integer","title":"Cogs Cents"},"opex_cents":{"type":"integer","title":"Opex Cents"},"net_income_cents":{"type":"integer","title":"Net Income Cents"}},"additionalProperties":false,"type":"object","required":["label","revenue_cents","cogs_cents","opex_cents","net_income_cents"],"title":"PnlMonthRow"},"PnlSummarySlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"pnl_summary","title":"Slide Type","default":"pnl_summary"},"data":{"$ref":"#/components/schemas/PnlSummarySlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"PnlSummarySlide"},"PnlSummarySlideData":{"properties":{"period_label":{"type":"string","title":"Period Label"},"months":{"items":{"$ref":"#/components/schemas/PnlMonthRow"},"type":"array","maxItems":24,"title":"Months"},"totals":{"$ref":"#/components/schemas/PnlTotals"}},"additionalProperties":false,"type":"object","required":["period_label","totals"],"title":"PnlSummarySlideData"},"PnlTotals":{"properties":{"revenue_cents":{"type":"integer","title":"Revenue Cents"},"cogs_cents":{"type":"integer","title":"Cogs Cents"},"gross_profit_cents":{"type":"integer","title":"Gross Profit Cents"},"opex_cents":{"type":"integer","title":"Opex Cents"},"net_income_cents":{"type":"integer","title":"Net Income Cents"},"gross_margin_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gross Margin Pct"},"net_margin_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net Margin Pct"}},"additionalProperties":false,"type":"object","required":["revenue_cents","cogs_cents","gross_profit_cents","opex_cents","net_income_cents"],"title":"PnlTotals"},"PortalRequest":{"properties":{"return_url":{"type":"string","title":"Return Url","description":"URL to redirect after leaving the portal."}},"type":"object","required":["return_url"],"title":"PortalRequest"},"PostBulkJeUploadResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"status":{"type":"string","title":"Status","default":"started"}},"additionalProperties":true,"type":"object","required":["workflow_id"],"title":"PostBulkJeUploadResponse","description":"Inner ``data`` for ``SuccessEnvelope[PostBulkJeUploadResponse]``."},"PostCountRequest":{"properties":{"posted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted By User Id","description":"Optional user id stamped onto the count. The audit middleware already records the request user separately."}},"type":"object","title":"PostCountRequest"},"PostCountResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"count_number":{"type":"string","title":"Count Number"},"location_id":{"type":"string","title":"Location Id"},"status":{"type":"string","title":"Status"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"posted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Posted At"},"counted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counted By User Id"},"posted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted By User Id"},"variance_line_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Variance Line Count"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"lines":{"items":{"$ref":"#/components/schemas/CycleCountLineResponse"},"type":"array","title":"Lines","default":[]}},"additionalProperties":true,"type":"object","required":["id","business_id","count_number","location_id","status"],"title":"PostCountResponse","description":"Response for ``post_count``."},"PrepareCheckoutRequest":{"properties":{"account_type":{"type":"string","pattern":"^(self-managed|dz-managed|advisory-firm)$","title":"Account Type","description":"'self-managed', 'dz-managed', or 'advisory-firm'"},"business_name":{"type":"string","maxLength":255,"minLength":1,"title":"Business Name"},"mailbox":{"type":"string","maxLength":100,"minLength":1,"title":"Mailbox"},"default_currency":{"type":"string","maxLength":3,"title":"Default Currency","description":"Default business currency. Supported out of the box: USD, CAD, AUD, EUR, GBP.","default":"USD"},"tax_year_end_month":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Tax Year End Month","default":12},"selected_addons":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50},{"type":"null"}],"title":"Selected Addons","description":"Optional list of addon slugs to include on the Stripe Checkout. Capped at 50 entries."},"trial_agreed":{"type":"boolean","const":true,"title":"Trial Agreed","description":"User has agreed to the 30-day free trial terms"},"billing_interval":{"type":"string","enum":["month","year"],"title":"Billing Interval","description":"Billing cadence for the subscription. 'year' resolves the discounted annual catalog prices; defaults to 'month'.","default":"month"},"firm_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Firm Name"},"firm_plan_tier":{"anyOf":[{"type":"string","pattern":"^(firm_starter|firm_professional|firm_enterprise)$"},{"type":"null"}],"title":"Firm Plan Tier","description":"Graduated firm plan tier (defaults to firm_starter)"},"ein":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Ein"},"logo_url":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Logo Url"},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Address"},"num_full_time_accountants":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Num Full Time Accountants"},"num_part_time_accountants":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Num Part Time Accountants"},"current_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Current Tools"},"success_path":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Success Path","description":"Optional path-only override (no host) to land on after Stripe Checkout. Defaults to /onboarding/complete."},"cancel_path":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Cancel Path","description":"Optional path-only override (no host) for cancelled checkout. Defaults to /welcome."}},"type":"object","required":["account_type","business_name","mailbox","trial_agreed"],"title":"PrepareCheckoutRequest","description":"Prepare a Stripe Checkout session for onboarding.\n\nCollects all onboarding data upfront. The business is NOT created yet --\nit will be created after the user completes Stripe Checkout."},"PrepareCheckoutResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"},"session_id":{"type":"string","title":"Session Id"}},"type":"object","required":["checkout_url","session_id"],"title":"PrepareCheckoutResponse","description":"Response with Stripe Checkout URL."},"PreviewAddonChangeResponse":{"properties":{"prorated_amount":{"type":"integer","title":"Prorated Amount"},"addon_price":{"type":"integer","title":"Addon Price"},"action":{"type":"string","enum":["add","remove"],"title":"Action"},"effective_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective Date"}},"additionalProperties":true,"type":"object","required":["prorated_amount","addon_price","action"],"title":"PreviewAddonChangeResponse","description":"Response for ``preview_addon_change``."},"PreviewBulkJeUploadResponse":{"properties":{"total_entries":{"type":"integer","title":"Total Entries"},"total_line_items":{"type":"integer","title":"Total Line Items"},"total_errors":{"type":"integer","title":"Total Errors"},"entries":{"items":{"anyOf":[{"$ref":"#/components/schemas/BulkJePreviewEntry"},{"additionalProperties":true,"type":"object"}]},"type":"array","title":"Entries"},"errors":{"items":{"anyOf":[{"additionalProperties":true,"type":"object"},{"$ref":"#/components/schemas/BulkJePreviewEntry"}]},"type":"array","title":"Errors"},"is_valid":{"type":"boolean","title":"Is Valid"}},"additionalProperties":true,"type":"object","required":["total_entries","total_line_items","total_errors","entries","errors","is_valid"],"title":"PreviewBulkJeUploadResponse","description":"Response for ``preview_bulk_je_upload``."},"PreviewInventoryLevel":{"properties":{"variant_name":{"type":"string","title":"Variant Name"},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id"},"location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Name"},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id"},"on_hand":{"type":"number","title":"On Hand","default":0},"reorder_point":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reorder Point"},"reorder_quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reorder Quantity"},"match_confidence":{"type":"number","title":"Match Confidence","default":0.0},"is_new":{"type":"boolean","title":"Is New","default":true}},"type":"object","required":["variant_name"],"title":"PreviewInventoryLevel"},"PreviewLocation":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type","default":"warehouse"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},"type":"object","required":["name"],"title":"PreviewLocation"},"PreviewProduct":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type","default":"manual"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"variants":{"items":{"$ref":"#/components/schemas/PreviewVariant"},"type":"array","title":"Variants"}},"type":"object","required":["name"],"title":"PreviewProduct"},"PreviewRequest":{"properties":{"file_id":{"type":"string","title":"File Id"},"selected_sheets":{"items":{"type":"string"},"type":"array","title":"Selected Sheets"},"sheet_mappings":{"items":{"$ref":"#/components/schemas/SheetMappingConfirmation"},"type":"array","title":"Sheet Mappings"},"location_decisions":{"items":{"$ref":"#/components/schemas/LocationDecision"},"type":"array","title":"Location Decisions"}},"type":"object","required":["file_id","selected_sheets","sheet_mappings"],"title":"PreviewRequest","description":"Request body for POST /inventory/import/preview."},"PreviewResponse":{"properties":{"file_id":{"type":"string","title":"File Id"},"to_create":{"$ref":"#/components/schemas/PreviewToCreate"},"to_update":{"$ref":"#/components/schemas/PreviewToUpdate"},"summary":{"$ref":"#/components/schemas/PreviewSummary"}},"type":"object","required":["file_id"],"title":"PreviewResponse","description":"Response from POST /inventory/import/preview."},"PreviewSummary":{"properties":{"locations_to_create":{"type":"integer","title":"Locations To Create","default":0},"products_to_create":{"type":"integer","title":"Products To Create","default":0},"variants_to_create":{"type":"integer","title":"Variants To Create","default":0},"levels_to_set":{"type":"integer","title":"Levels To Set","default":0},"existing_matched":{"type":"integer","title":"Existing Matched","default":0},"skipped_rows":{"type":"integer","title":"Skipped Rows","default":0}},"type":"object","title":"PreviewSummary"},"PreviewToCreate":{"properties":{"locations":{"items":{"$ref":"#/components/schemas/PreviewLocation"},"type":"array","title":"Locations"},"products":{"items":{"$ref":"#/components/schemas/PreviewProduct"},"type":"array","title":"Products"}},"type":"object","title":"PreviewToCreate"},"PreviewToUpdate":{"properties":{"inventory_levels":{"items":{"$ref":"#/components/schemas/PreviewInventoryLevel"},"type":"array","title":"Inventory Levels"}},"type":"object","title":"PreviewToUpdate"},"PreviewVariant":{"properties":{"name":{"type":"string","title":"Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"unit_cost_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Cost Cents"},"unit_cost_precise":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unit Cost Precise"},"uom":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uom"}},"type":"object","required":["name"],"title":"PreviewVariant"},"ProductCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Product name displayed to customers."},"type":{"type":"string","title":"Type","description":"Product source type: 'manual' (created here) or 'shopify' (synced)."},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category","description":"Product category (e.g. 'Finished Goods', 'Intermediate Goods', 'Ingredients', 'Packaging')."},"tracks_expiration":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tracks Expiration","description":"When true, cost-lot consumption uses FEFO (earliest expiration first) instead of FIFO. Defaults to false."}},"type":"object","required":["name","type"],"title":"ProductCreateRequest","description":"Request schema for creating a new product.\n\nProducts are the items you sell. Each product can have multiple variants\n(e.g., different sizes, colors) with their own pricing and inventory.\n\n**Product Types:**\n- `manual`: Products created directly in the system\n- `shopify`: Products synced from Shopify","example":{"category":"Finished Goods","name":"Premium Widget","type":"manual"}},"ProductResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Product UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"name":{"type":"string","title":"Name","description":"Product name."},"type":{"type":"string","title":"Type","description":"Product type: 'manual' or 'shopify'."},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Product category (e.g. 'Finished Goods', 'Intermediate Goods', 'Ingredients')."},"stripe_product_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Product Id","description":"Stripe product ID if synced to Stripe."},"shopify_product_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shopify Product Id","description":"Shopify product ID if synced from Shopify."},"archived":{"type":"boolean","title":"Archived","description":"Whether product is archived (hidden from lists).","default":false},"tracks_expiration":{"type":"boolean","title":"Tracks Expiration","description":"When true, FEFO consumption + expiry capture is active for this product.","default":false},"variant_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Variant Count","description":"Number of variants this product has."},"variants":{"anyOf":[{"items":{"$ref":"#/components/schemas/VariantResponse"},"type":"array"},{"type":"null"}],"title":"Variants","description":"List of product variants (when include_variants=true)."}},"additionalProperties":false,"type":"object","required":["id","business_id","created_at","updated_at","name","type"],"title":"ProductResponse","description":"Response schema for a product.\n\nProducts contain one or more variants with their own pricing and inventory.\nUse `include_variants=true` when fetching to get full variant details.","example":{"archived":false,"business_id":"019ab37c-bus1-7000-8000-000000000001","created_at":"2024-01-10T10:30:00Z","id":"019ab37c-prod-7000-8000-000000000001","name":"Premium Widget","stripe_product_id":"prod_abc123","type":"manual","updated_at":"2024-01-15T14:00:00Z","variant_count":3,"variants":[]}},"ProductUpdateRequest":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Product UUID (set from URL path)."},"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name","description":"Updated product name."},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"Updated product type: 'manual' or 'shopify'."},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category","description":"Updated product category."},"tracks_expiration":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tracks Expiration","description":"Toggle FEFO consumption + expiry capture. Existing cost lots are not touched -- only future receipts and consumption."},"archived":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Archived","description":"Set to true to archive (hide) the product."}},"type":"object","title":"ProductUpdateRequest","description":"Request schema for updating a product.\n\nAll fields are optional - only include fields you want to change.","example":{"archived":false,"name":"Premium Widget Pro"}},"ProductsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ProductResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"ProductsListResponse","description":"Paginated list of products with cursor-based navigation."},"ProjectCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Project name."},"code":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Code","description":"Optional code."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description."},"status":{"type":"string","title":"Status","description":"One of: active, completed, on_hold.","default":"active"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id","description":"Optional customer the project is for."},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Optional project start date."},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"Optional project end date."}},"type":"object","required":["name"],"title":"ProjectCreateRequest","description":"Request schema for creating a project."},"ProjectProfitabilityResponse":{"properties":{"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"},"rows":{"items":{"$ref":"#/components/schemas/ProjectProfitabilityRow"},"type":"array","title":"Rows"},"totals":{"$ref":"#/components/schemas/ProjectProfitabilityTotals"}},"type":"object","required":["start_date","end_date","rows","totals"],"title":"ProjectProfitabilityResponse","description":"Profit & loss broken down by project for a date range."},"ProjectProfitabilityRow":{"properties":{"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project UUID, or null for the unassigned bucket."},"project_name":{"type":"string","title":"Project Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"revenue":{"type":"integer","title":"Revenue"},"expenses":{"type":"integer","title":"Expenses"},"net_income":{"type":"integer","title":"Net Income"}},"type":"object","required":["project_name","revenue","expenses","net_income"],"title":"ProjectProfitabilityRow","description":"One project's revenue / expense / net for the period (cents)."},"ProjectProfitabilityTotals":{"properties":{"revenue":{"type":"integer","title":"Revenue"},"expenses":{"type":"integer","title":"Expenses"},"net_income":{"type":"integer","title":"Net Income"}},"type":"object","required":["revenue","expenses","net_income"],"title":"ProjectProfitabilityTotals","description":"Period totals across all projects (cents)."},"ProjectResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"name":{"type":"string","title":"Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"type":"string","title":"Status"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","name","status","is_active","created_at","updated_at"],"title":"ProjectResponse","description":"Response schema for a project."},"ProjectUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"code":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Code"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"ProjectUpdateRequest","description":"Request schema for updating a project (all fields optional)."},"ProjectionActualsResponse":{"properties":{"months":{"items":{"type":"string"},"type":"array","title":"Months","description":"Month labels in display order, e.g. ['Oct 2025', ...]"},"revenue":{"items":{"$ref":"#/components/schemas/ActualsLineItem"},"type":"array","title":"Revenue"},"cogs":{"items":{"$ref":"#/components/schemas/ActualsCostLineItem"},"type":"array","title":"Cogs"},"opex":{"items":{"$ref":"#/components/schemas/ActualsCostLineItem"},"type":"array","title":"Opex"},"other":{"items":{"$ref":"#/components/schemas/ActualsOtherLineItem"},"type":"array","title":"Other"}},"type":"object","required":["months","revenue","cogs","opex","other"],"title":"ProjectionActualsResponse","description":"Trailing actuals shaped for the Budget Projection page."},"ProjectionLineItem":{"properties":{"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id"},"name":{"type":"string","title":"Name"},"data":{"items":{"type":"integer"},"type":"array","title":"Data","description":"Projected amounts in cents, per month"},"total":{"type":"integer","title":"Total","description":"Sum across all months","default":0}},"type":"object","required":["name","data"],"title":"ProjectionLineItem","description":"A single account's projected monthly amounts."},"ProjectionOtherLineItem":{"properties":{"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id"},"name":{"type":"string","title":"Name"},"data":{"items":{"type":"integer"},"type":"array","title":"Data","description":"Projected amounts in cents, per month"},"total":{"type":"integer","title":"Total","description":"Sum across all months","default":0},"neg":{"type":"boolean","title":"Neg","description":"True if expense (negative in net calc)","default":false}},"type":"object","required":["name","data"],"title":"ProjectionOtherLineItem","description":"A single Other Income/Expense item projected from trailing actuals."},"ProjectionResponse":{"properties":{"scenario_id":{"type":"string","title":"Scenario Id"},"months":{"items":{"type":"string"},"type":"array","title":"Months","description":"Projected month labels"},"revenue":{"$ref":"#/components/schemas/ProjectionSection"},"cogs":{"$ref":"#/components/schemas/ProjectionSection"},"gross_profit":{"items":{"type":"integer"},"type":"array","title":"Gross Profit"},"opex":{"$ref":"#/components/schemas/ProjectionSection"},"operating_income":{"items":{"type":"integer"},"type":"array","title":"Operating Income"},"other_income":{"items":{"$ref":"#/components/schemas/ProjectionOtherLineItem"},"type":"array","title":"Other Income"},"other_expense":{"items":{"$ref":"#/components/schemas/ProjectionOtherLineItem"},"type":"array","title":"Other Expense"},"other_net":{"items":{"type":"integer"},"type":"array","title":"Other Net"},"pre_tax_income":{"items":{"type":"integer"},"type":"array","title":"Pre Tax Income"},"tax":{"items":{"type":"integer"},"type":"array","title":"Tax"},"net_income":{"items":{"type":"integer"},"type":"array","title":"Net Income"},"gross_margin_pct":{"items":{"type":"number"},"type":"array","title":"Gross Margin Pct"},"operating_margin_pct":{"items":{"type":"number"},"type":"array","title":"Operating Margin Pct"},"net_margin_pct":{"items":{"type":"number"},"type":"array","title":"Net Margin Pct"}},"type":"object","required":["scenario_id","months","revenue","cogs","gross_profit","opex","operating_income","other_net","pre_tax_income","tax","net_income","gross_margin_pct","operating_margin_pct","net_margin_pct"],"title":"ProjectionResponse","description":"Full computed N-month projection derived from a scenario's drivers."},"ProjectionSection":{"properties":{"label":{"type":"string","title":"Label"},"items":{"items":{"$ref":"#/components/schemas/ProjectionLineItem"},"type":"array","title":"Items"},"total":{"items":{"type":"integer"},"type":"array","title":"Total","description":"Section total per month in cents"},"grand_total":{"type":"integer","title":"Grand Total","default":0}},"type":"object","required":["label","items","total"],"title":"ProjectionSection","description":"A section of the projected income statement."},"ProjectsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ProjectResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ProjectsListResponse","description":"A flat list of projects."},"ProposedPurchaseOrder":{"properties":{"amount_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount Cents","description":"Total PO cost in cents."},"week_number":{"anyOf":[{"type":"integer","maximum":52.0,"minimum":1.0},{"type":"null"}],"title":"Week Number","description":"Forecast week the cash leaves (1-indexed). Default 1."},"expected_pay_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Pay Date","description":"ISO date the cash leaves (overrides week_number)."},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id"},"label":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Label"}},"type":"object","required":["amount_cents"],"title":"ProposedPurchaseOrder","description":"A purchase order being considered but not yet placed."},"PurchaseRequisitionConvertRequest":{"properties":{"target":{"$ref":"#/components/schemas/PurchaseRequisitionConvertTargetEnum","description":"purchase_order or bill"}},"type":"object","required":["target"],"title":"PurchaseRequisitionConvertRequest","description":"Convert an approved requisition to a PO or bill."},"PurchaseRequisitionConvertResponse":{"properties":{"requisition":{"$ref":"#/components/schemas/PurchaseRequisitionDetailResponse"},"target":{"type":"string","enum":["purchase_order","bill"],"title":"Target"},"inventory_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Order Id"},"bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Id"}},"type":"object","required":["requisition","target"],"title":"PurchaseRequisitionConvertResponse","description":"Result of converting a requisition."},"PurchaseRequisitionConvertTargetEnum":{"type":"string","enum":["purchase_order","bill"],"title":"PurchaseRequisitionConvertTargetEnum","description":"Target document type when converting an approved requisition."},"PurchaseRequisitionCreateRequest":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"currency":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}],"title":"Currency","default":"USD"},"lines":{"items":{"$ref":"#/components/schemas/PurchaseRequisitionLineInput"},"type":"array","minItems":1,"title":"Lines"}},"type":"object","required":["lines"],"title":"PurchaseRequisitionCreateRequest","description":"Create a draft purchase requisition."},"PurchaseRequisitionDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"status":{"$ref":"#/components/schemas/PurchaseRequisitionStatusEnum"},"currency":{"type":"string","title":"Currency"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"total":{"type":"integer","title":"Total"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"requested_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By User Id"},"approved_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By User Id"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"rejected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Rejected At"},"converted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Converted At"},"rejection_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rejection Reason"},"workflow_execution_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Execution Id"},"converted_target":{"anyOf":[{"$ref":"#/components/schemas/PurchaseRequisitionConvertTargetEnum"},{"type":"null"}]},"converted_inventory_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Converted Inventory Order Id"},"converted_bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Converted Bill Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"line_count":{"type":"integer","title":"Line Count","default":0},"can_be_updated":{"type":"boolean","title":"Can Be Updated","default":false},"can_be_deleted":{"type":"boolean","title":"Can Be Deleted","default":false},"can_be_submitted":{"type":"boolean","title":"Can Be Submitted","default":false},"can_be_approved":{"type":"boolean","title":"Can Be Approved","default":false},"can_be_rejected":{"type":"boolean","title":"Can Be Rejected","default":false},"can_be_converted":{"type":"boolean","title":"Can Be Converted","default":false},"lines":{"items":{"$ref":"#/components/schemas/PurchaseRequisitionLineResponse"},"type":"array","title":"Lines"}},"type":"object","required":["id","business_id","status","currency","total"],"title":"PurchaseRequisitionDetailResponse","description":"Purchase requisition with line items."},"PurchaseRequisitionLineInput":{"properties":{"description":{"type":"string","maxLength":500,"minLength":1,"title":"Description"},"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Amount in cents"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"GL expense account"}},"type":"object","required":["description","amount"],"title":"PurchaseRequisitionLineInput","description":"Line item payload for create/update."},"PurchaseRequisitionLineResponse":{"properties":{"id":{"type":"string","title":"Id"},"purchase_requisition_id":{"type":"string","title":"Purchase Requisition Id"},"description":{"type":"string","title":"Description"},"amount":{"type":"integer","title":"Amount"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id"},"position":{"type":"integer","title":"Position","default":0},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","purchase_requisition_id","description","amount"],"title":"PurchaseRequisitionLineResponse","description":"Purchase requisition line in API responses."},"PurchaseRequisitionRejectRequest":{"properties":{"reason":{"type":"string","maxLength":2000,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"PurchaseRequisitionRejectRequest","description":"Reject a submitted purchase requisition."},"PurchaseRequisitionResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"status":{"$ref":"#/components/schemas/PurchaseRequisitionStatusEnum"},"currency":{"type":"string","title":"Currency"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"total":{"type":"integer","title":"Total"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"requested_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By User Id"},"approved_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By User Id"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"rejected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Rejected At"},"converted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Converted At"},"rejection_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rejection Reason"},"workflow_execution_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Execution Id"},"converted_target":{"anyOf":[{"$ref":"#/components/schemas/PurchaseRequisitionConvertTargetEnum"},{"type":"null"}]},"converted_inventory_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Converted Inventory Order Id"},"converted_bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Converted Bill Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"line_count":{"type":"integer","title":"Line Count","default":0},"can_be_updated":{"type":"boolean","title":"Can Be Updated","default":false},"can_be_deleted":{"type":"boolean","title":"Can Be Deleted","default":false},"can_be_submitted":{"type":"boolean","title":"Can Be Submitted","default":false},"can_be_approved":{"type":"boolean","title":"Can Be Approved","default":false},"can_be_rejected":{"type":"boolean","title":"Can Be Rejected","default":false},"can_be_converted":{"type":"boolean","title":"Can Be Converted","default":false}},"type":"object","required":["id","business_id","status","currency","total"],"title":"PurchaseRequisitionResponse","description":"Purchase requisition summary."},"PurchaseRequisitionStatusEnum":{"type":"string","enum":["draft","submitted","approved","rejected","converted"],"title":"PurchaseRequisitionStatusEnum","description":"Purchase requisition lifecycle status."},"PurchaseRequisitionUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"lines":{"anyOf":[{"items":{"$ref":"#/components/schemas/PurchaseRequisitionLineInput"},"type":"array","minItems":1},{"type":"null"}],"title":"Lines"}},"type":"object","title":"PurchaseRequisitionUpdateRequest","description":"Update a draft purchase requisition."},"PurchaseRequisitionsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PurchaseRequisitionResponse"},"type":"array","title":"Items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"PurchaseRequisitionsListResponse","description":"Paginated purchase requisitions."},"QuickBooksDisconnectResponse":{"properties":{"disconnected":{"type":"boolean","title":"Disconnected","default":true}},"additionalProperties":true,"type":"object","title":"QuickBooksDisconnectResponse"},"RecategorizeByCounterpartyRequest":{"properties":{"counterparty":{"type":"string","minLength":1,"title":"Counterparty","description":"Counterparty name to recategorize"},"ledger_id":{"type":"string","title":"Ledger Id","description":"Target ledger/account ID"}},"type":"object","required":["counterparty","ledger_id"],"title":"RecategorizeByCounterpartyRequest"},"RecategorizeByCounterpartyResponse":{"properties":{"updated":{"type":"integer","title":"Updated"},"counterparty":{"type":"string","title":"Counterparty"}},"additionalProperties":true,"type":"object","required":["updated","counterparty"],"title":"RecategorizeByCounterpartyResponse","description":"Envelope data for ``recategorize_by_counterparty``."},"RecategorizeLineEntriesRequest":{"properties":{"line_entry_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Line Entry Ids","description":"IDs of the line entries to recategorize."},"ledger_id":{"type":"string","title":"Ledger Id","description":"Target ledger to move the line entries into."}},"type":"object","required":["line_entry_ids","ledger_id"],"title":"RecategorizeLineEntriesRequest","description":"Request to move line entries to a different ledger (recategorize)."},"RecategorizeLineEntriesResponse":{"properties":{"updated":{"type":"integer","title":"Updated"}},"additionalProperties":true,"type":"object","required":["updated"],"title":"RecategorizeLineEntriesResponse","description":"Response for ``recategorize_line_entries``."},"RecipeCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"output_unit_name":{"type":"string","maxLength":50,"title":"Output Unit Name","default":"unit"},"output_unit_weight":{"type":"number","exclusiveMinimum":0.0,"title":"Output Unit Weight","default":1.0},"output_unit_weight_unit":{"type":"string","maxLength":20,"title":"Output Unit Weight Unit","default":"oz"},"conversion_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Conversion Params"},"materials":{"items":{"$ref":"#/components/schemas/RecipeMaterialBase"},"type":"array","title":"Materials"},"output_variants":{"items":{"$ref":"#/components/schemas/RecipeOutputVariantBase"},"type":"array","title":"Output Variants"},"processing_steps":{"items":{"$ref":"#/components/schemas/RecipeProcessingStepBase"},"type":"array","title":"Processing Steps"}},"type":"object","required":["name"],"title":"RecipeCreateRequest"},"RecipeListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RecipeResponse"},"type":"array","title":"Items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"RecipeListResponse"},"RecipeMaterialBase":{"properties":{"category":{"type":"string","title":"Category","description":"Grouping label: raw_material, inclusion, packaging, or other.","default":"raw_material"},"name":{"type":"string","title":"Name","description":"Material name."},"quantity_type":{"type":"string","title":"Quantity Type","description":"pct_of_weight | fixed_per_unit | per_n_units | fixed_per_run"},"quantity_value":{"type":"number","title":"Quantity Value","description":"Numeric quantity parameter."},"quantity_unit":{"type":"string","title":"Quantity Unit","description":"Unit of the quantity value (g, oz, ml, units …).","default":"units"},"yield_factor":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Yield Factor","description":"Decimal yield 0-1.","default":1.0},"cost_per_unit":{"type":"integer","title":"Cost Per Unit","description":"Cost in cents (or whole-currency units for bulk like $/MT).","default":0},"cost_unit":{"type":"string","title":"Cost Unit","description":"Denominator: per_lb, per_kg, per_mt, per_unit, per_oz, per_gal.","default":"per_unit"},"position":{"type":"integer","title":"Position","description":"Display ordering.","default":0},"output_variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Variant Id","description":"Scope to a specific output variant (for inclusions)."},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Optional link to an inventory Variant."},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Optional link to a Vendor."}},"type":"object","required":["name","quantity_type","quantity_value"],"title":"RecipeMaterialBase"},"RecipeMaterialResponse":{"properties":{"category":{"type":"string","title":"Category","description":"Grouping label: raw_material, inclusion, packaging, or other.","default":"raw_material"},"name":{"type":"string","title":"Name","description":"Material name."},"quantity_type":{"type":"string","title":"Quantity Type","description":"pct_of_weight | fixed_per_unit | per_n_units | fixed_per_run"},"quantity_value":{"type":"number","title":"Quantity Value","description":"Numeric quantity parameter."},"quantity_unit":{"type":"string","title":"Quantity Unit","description":"Unit of the quantity value (g, oz, ml, units …).","default":"units"},"yield_factor":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Yield Factor","description":"Decimal yield 0-1.","default":1.0},"cost_per_unit":{"type":"integer","title":"Cost Per Unit","description":"Cost in cents (or whole-currency units for bulk like $/MT).","default":0},"cost_unit":{"type":"string","title":"Cost Unit","description":"Denominator: per_lb, per_kg, per_mt, per_unit, per_oz, per_gal.","default":"per_unit"},"position":{"type":"integer","title":"Position","description":"Display ordering.","default":0},"output_variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Variant Id","description":"Scope to a specific output variant (for inclusions)."},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Optional link to an inventory Variant."},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Optional link to a Vendor."},"id":{"type":"string","title":"Id"},"recipe_id":{"type":"string","title":"Recipe Id"}},"type":"object","required":["name","quantity_type","quantity_value","id","recipe_id"],"title":"RecipeMaterialResponse"},"RecipeOutputVariantBase":{"properties":{"name":{"type":"string","title":"Name","description":"Variant/SKU name."},"allocation_pct":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Allocation Pct","description":"Percentage of the run.","default":0.0},"is_remainder":{"type":"boolean","title":"Is Remainder","description":"Auto-calc as 100% minus others.","default":false},"position":{"type":"integer","title":"Position","default":0},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Optional link to inventory Variant."}},"type":"object","required":["name"],"title":"RecipeOutputVariantBase"},"RecipeOutputVariantResponse":{"properties":{"name":{"type":"string","title":"Name","description":"Variant/SKU name."},"allocation_pct":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Allocation Pct","description":"Percentage of the run.","default":0.0},"is_remainder":{"type":"boolean","title":"Is Remainder","description":"Auto-calc as 100% minus others.","default":false},"position":{"type":"integer","title":"Position","default":0},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Optional link to inventory Variant."},"id":{"type":"string","title":"Id"},"recipe_id":{"type":"string","title":"Recipe Id"}},"type":"object","required":["name","id","recipe_id"],"title":"RecipeOutputVariantResponse"},"RecipeProcessingStepBase":{"properties":{"name":{"type":"string","title":"Name","description":"Step / vendor name."},"step_type":{"type":"string","title":"Step Type","description":"Label: Conversion, Co-Packing, Assembly …","default":"Processing"},"allocation_type":{"type":"string","title":"Allocation Type","description":"pct_of_total | by_output_variant | all_units"},"allocation_pct":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Allocation Pct","description":"Percentage if pct_of_total."},"cost_per_unit":{"type":"integer","title":"Cost Per Unit","description":"Cost in cents.","default":0},"cost_unit":{"type":"string","title":"Cost Unit","description":"per_lb, per_unit, per_kg …","default":"per_unit"},"output_variant_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Output Variant Ids","description":"Output variant IDs for by_output_variant."},"position":{"type":"integer","title":"Position","default":0},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Optional link to Vendor."}},"type":"object","required":["name","allocation_type"],"title":"RecipeProcessingStepBase"},"RecipeProcessingStepResponse":{"properties":{"name":{"type":"string","title":"Name","description":"Step / vendor name."},"step_type":{"type":"string","title":"Step Type","description":"Label: Conversion, Co-Packing, Assembly …","default":"Processing"},"allocation_type":{"type":"string","title":"Allocation Type","description":"pct_of_total | by_output_variant | all_units"},"allocation_pct":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Allocation Pct","description":"Percentage if pct_of_total."},"cost_per_unit":{"type":"integer","title":"Cost Per Unit","description":"Cost in cents.","default":0},"cost_unit":{"type":"string","title":"Cost Unit","description":"per_lb, per_unit, per_kg …","default":"per_unit"},"output_variant_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Output Variant Ids","description":"Output variant IDs for by_output_variant."},"position":{"type":"integer","title":"Position","default":0},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Optional link to Vendor."},"id":{"type":"string","title":"Id"},"recipe_id":{"type":"string","title":"Recipe Id"}},"type":"object","required":["name","allocation_type","id","recipe_id"],"title":"RecipeProcessingStepResponse"},"RecipeResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"output_unit_name":{"type":"string","title":"Output Unit Name"},"output_unit_weight":{"type":"number","title":"Output Unit Weight"},"output_unit_weight_unit":{"type":"string","title":"Output Unit Weight Unit"},"conversion_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Conversion Params"},"materials":{"items":{"$ref":"#/components/schemas/RecipeMaterialResponse"},"type":"array","title":"Materials","default":[]},"output_variants":{"items":{"$ref":"#/components/schemas/RecipeOutputVariantResponse"},"type":"array","title":"Output Variants","default":[]},"processing_steps":{"items":{"$ref":"#/components/schemas/RecipeProcessingStepResponse"},"type":"array","title":"Processing Steps","default":[]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","name","output_unit_name","output_unit_weight","output_unit_weight_unit","created_at","updated_at"],"title":"RecipeResponse"},"RecipeUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"output_unit_name":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Output Unit Name"},"output_unit_weight":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Output Unit Weight"},"output_unit_weight_unit":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Output Unit Weight Unit"},"conversion_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Conversion Params"},"materials":{"anyOf":[{"items":{"$ref":"#/components/schemas/RecipeMaterialBase"},"type":"array"},{"type":"null"}],"title":"Materials"},"output_variants":{"anyOf":[{"items":{"$ref":"#/components/schemas/RecipeOutputVariantBase"},"type":"array"},{"type":"null"}],"title":"Output Variants"},"processing_steps":{"anyOf":[{"items":{"$ref":"#/components/schemas/RecipeProcessingStepBase"},"type":"array"},{"type":"null"}],"title":"Processing Steps"}},"type":"object","title":"RecipeUpdateRequest"},"RecipientKindEnum":{"type":"string","enum":["user","business","firm"],"title":"RecipientKindEnum"},"RecomputeCloseScoreResponse":{"properties":{"id":{"type":"string","title":"Id"},"period_id":{"type":"string","title":"Period Id"},"score":{"type":"number","title":"Score"},"color":{"type":"string","title":"Color"},"components":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Components"},"blockers":{"items":{"$ref":"#/components/schemas/CloseScoreBlocker"},"type":"array","title":"Blockers"},"last_computed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Computed At"}},"additionalProperties":true,"type":"object","required":["id","period_id","score","color","components","blockers"],"title":"RecomputeCloseScoreResponse","description":"Response for ``recompute_close_score`` (same shape as get)."},"RecomputeForecastResponse":{"properties":{"status":{"type":"string","title":"Status"},"forecasted_skus":{"type":"integer","title":"Forecasted Skus"},"by_method":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Method"}},"type":"object","required":["status","forecasted_skus"],"title":"RecomputeForecastResponse"},"Reconciliation":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id"},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name"},"status":{"type":"string","title":"Status"},"status_display":{"type":"string","title":"Status Display"},"statement_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement Filename"},"statement_start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement Start Date"},"statement_end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement End Date"},"opening_balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Opening Balance"},"closing_balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Closing Balance"},"locked":{"type":"boolean","title":"Locked"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"input_txns":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationInputTxns"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Txns"},"ai_match_results":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationAIMatchResults"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Ai Match Results"},"user_committed_matches":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationCommittedMatches"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Committed Matches"},"match_counts":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationMatchCounts"},{"type":"null"}]},"workflow_started":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Workflow Started"}},"additionalProperties":true,"type":"object","required":["id","business_id","status","status_display","locked"],"title":"Reconciliation","description":"Bank reconciliation summary or detail."},"ReconciliationAIMatchResults":{"properties":{"matches":{"items":{"$ref":"#/components/schemas/AIMatch"},"type":"array","title":"Matches","default":[]},"unmatched_statement":{"items":{"$ref":"#/components/schemas/StatementTxn"},"type":"array","title":"Unmatched Statement","default":[]},"unmatched_ledger":{"items":{"$ref":"#/components/schemas/LedgerTxn"},"type":"array","title":"Unmatched Ledger","default":[]}},"additionalProperties":true,"type":"object","title":"ReconciliationAIMatchResults"},"ReconciliationCommittedMatches":{"properties":{"matches":{"items":{"$ref":"#/components/schemas/CommittedMatch"},"type":"array","title":"Matches","default":[]}},"additionalProperties":true,"type":"object","title":"ReconciliationCommittedMatches"},"ReconciliationCreateRequest":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id","description":"ID of ledger to reconcile against"},"source_type":{"type":"string","title":"Source Type","description":"Reconciliation source: 'plaid' (synced transactions) or 'manual' (uploaded statement)","default":"manual"},"statement_s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement S3 Key","description":"S3 key of uploaded bank statement (required for manual source)"},"start_date":{"type":"string","format":"date-time","title":"Start Date","description":"Statement period start date"},"end_date":{"type":"string","format":"date-time","title":"End Date","description":"Statement period end date"},"statement_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement Filename","description":"Original filename"},"opening_balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Opening Balance","description":"Opening balance in cents"},"closing_balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Closing Balance","description":"Closing balance in cents"},"auto_start":{"type":"boolean","title":"Auto Start","description":"Auto-start processing workflow","default":true}},"type":"object","required":["ledger_id","start_date","end_date"],"title":"ReconciliationCreateRequest","description":"Request to create a new reconciliation."},"ReconciliationInputTxns":{"properties":{"statement_txns":{"items":{"$ref":"#/components/schemas/StatementTxn"},"type":"array","title":"Statement Txns","default":[]},"ledger_txns":{"items":{"$ref":"#/components/schemas/LedgerTxn"},"type":"array","title":"Ledger Txns","default":[]}},"additionalProperties":true,"type":"object","title":"ReconciliationInputTxns"},"ReconciliationMatchCounts":{"properties":{"committed":{"type":"integer","title":"Committed"},"ai_suggested":{"type":"integer","title":"Ai Suggested"},"unmatched_statement":{"type":"integer","title":"Unmatched Statement"},"unmatched_ledger":{"type":"integer","title":"Unmatched Ledger"}},"additionalProperties":true,"type":"object","required":["committed","ai_suggested","unmatched_statement","unmatched_ledger"],"title":"ReconciliationMatchCounts"},"RecurrenceTypeEnum-Output":{"type":"string","enum":["invoice","bill"],"title":"RecurrenceTypeEnum","description":"Type of recurring document."},"RecurringConfig":{"properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly","quarterly","annually"],"title":"Frequency","description":"How often to generate bills."},"start_date":{"type":"string","format":"date","title":"Start Date","description":"When to start generating bills (first occurrence)."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Name for the recurring template. Defaults to bill description."},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"Stop generating after this date (null = indefinite). If both end_date and max_occurrences are set, whichever is reached first stops generation."},"day_of_month":{"anyOf":[{"type":"integer","maximum":31.0,"minimum":1.0},{"type":"null"}],"title":"Day Of Month","description":"Day of month (1-31). Only applies to monthly/quarterly/annually frequencies; ignored for daily/weekly/biweekly. If the day doesn't exist in a month (e.g., 31 in February), generates on the last day instead. If omitted, uses the day from start_date."},"day_of_week":{"anyOf":[{"type":"integer","maximum":6.0,"minimum":0.0},{"type":"null"}],"title":"Day Of Week","description":"Day of week (0=Monday, 6=Sunday). Only applies to weekly/biweekly frequencies; ignored for other frequencies. If omitted, uses the weekday from start_date."},"days_until_due":{"type":"integer","maximum":365.0,"minimum":0.0,"title":"Days Until Due","description":"Days from generation until due date.","default":30},"max_occurrences":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Occurrences","description":"Stop after generating this many bills (null = unlimited). If both end_date and max_occurrences are set, whichever is reached first stops generation."}},"type":"object","required":["frequency","start_date"],"title":"RecurringConfig","description":"Recurring configuration that can be embedded in bill create/update requests.","example":{"day_of_month":1,"days_until_due":15,"frequency":"monthly","start_date":"2026-02-01"}},"RecurringStatusEnum":{"type":"string","enum":["active","paused","completed","cancelled"],"title":"RecurringStatusEnum","description":"Status of the recurring template."},"RecurringTemplateClone":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Name for the cloned template. If not provided, appends ' (Copy)' to original name."},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Start date for the cloned template. If not provided, uses today's date."},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id","description":"Override customer ID (for invoice templates)"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Override vendor ID (for bill templates)"}},"type":"object","title":"RecurringTemplateClone","description":"Schema for cloning a recurring template.","example":{"name":"Monthly Rent - Copy","start_date":"2026-03-01"}},"RecurringTemplateCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Name/description of this recurring template"},"currency":{"type":"string","title":"Currency","description":"Currency for generated documents (USD, CAD, AUD, EUR, or GBP)","default":"USD"},"frequency":{"$ref":"#/components/schemas/FrequencyEnum","description":"How often to generate"},"days_until_due":{"type":"integer","maximum":365.0,"minimum":0.0,"title":"Days Until Due","description":"Days from generation until due date","default":30},"day_of_month":{"anyOf":[{"type":"integer","maximum":31.0,"minimum":1.0},{"type":"null"}],"title":"Day Of Month","description":"Day of month (1-31). Only applies to monthly/quarterly/annually frequencies; ignored for daily/weekly/biweekly. If the day doesn't exist in a month (e.g., 31 in February), generates on the last day instead. If omitted, uses the day from start_date."},"day_of_week":{"anyOf":[{"type":"integer","maximum":6.0,"minimum":0.0},{"type":"null"}],"title":"Day Of Week","description":"Day of week (0=Monday, 6=Sunday). Only applies to weekly/biweekly frequencies; ignored for other frequencies. If omitted, uses the weekday from start_date."},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"Stop generating after this date (null = indefinite). If both end_date and max_occurrences are set, whichever is reached first stops generation."},"max_occurrences":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Occurrences","description":"Stop after generating this many documents (null = unlimited). If both end_date and max_occurrences are set, whichever is reached first stops generation."},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Notes","description":"Optional notes about this recurring template"},"recurrence_type":{"$ref":"#/components/schemas/app__api__v1__schemas__recurring__recurring__RecurrenceTypeEnum","description":"Type of document to generate"},"start_date":{"type":"string","format":"date","title":"Start Date","description":"When to start generating"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id","description":"Customer ID (required for invoice type)"},"auto_send":{"type":"boolean","title":"Auto Send","description":"Automatically send invoices to customer on generation","default":false},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Vendor ID (required for bill type)"},"template_data":{"additionalProperties":true,"type":"object","title":"Template Data","description":"Document template data (amount, description, line_items, etc.)"}},"type":"object","required":["name","frequency","recurrence_type","start_date","template_data"],"title":"RecurringTemplateCreate","description":"Schema for creating a recurring template.","example":{"day_of_month":1,"days_until_due":15,"frequency":"monthly","name":"Monthly Rent","recurrence_type":"bill","start_date":"2026-02-01","template_data":{"amount":350000,"description":"Office rent for 123 Main St"},"vendor_id":"01234567-89ab-cdef-0123-456789abcdef"}},"RecurringTemplateHistoryResponse":{"properties":{"template_id":{"type":"string","title":"Template Id"},"template_name":{"type":"string","title":"Template Name"},"document_type":{"$ref":"#/components/schemas/RecurrenceTypeEnum-Output"},"total_generated":{"type":"integer","title":"Total Generated"},"items":{"items":{"$ref":"#/components/schemas/GeneratedDocumentItem"},"type":"array","title":"Items"}},"type":"object","required":["template_id","template_name","document_type","total_generated","items"],"title":"RecurringTemplateHistoryResponse","description":"Response for template generation history.","example":{"document_type":"bill","items":[{"amount":350000,"amount_in_dollars":3500.0,"created_at":"2026-01-01T01:00:00Z","document_type":"bill","due_date":"2026-01-16","id":"bill-uuid-1","status":"paid"}],"template_id":"template-uuid","template_name":"Monthly Rent","total_generated":3}},"RecurringTemplateListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RecurringTemplateResponse"},"type":"array","title":"Items"},"total_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Count"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor"},"has_next":{"type":"boolean","title":"Has Next","default":false},"has_prev":{"type":"boolean","title":"Has Prev","default":false}},"type":"object","required":["items"],"title":"RecurringTemplateListResponse","description":"Response for listing recurring templates."},"RecurringTemplateResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"name":{"type":"string","title":"Name"},"recurrence_type":{"$ref":"#/components/schemas/RecurrenceTypeEnum-Output"},"status":{"$ref":"#/components/schemas/RecurringStatusEnum"},"frequency":{"$ref":"#/components/schemas/FrequencyEnum"},"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"next_occurrence":{"type":"string","format":"date","title":"Next Occurrence"},"last_generated":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Generated"},"day_of_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Day Of Month"},"day_of_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Day Of Week"},"max_occurrences":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Occurrences"},"occurrences_generated":{"type":"integer","title":"Occurrences Generated"},"template_data":{"additionalProperties":true,"type":"object","title":"Template Data"},"days_until_due":{"type":"integer","title":"Days Until Due"},"auto_send":{"type":"boolean","title":"Auto Send"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"customer":{"anyOf":[{"$ref":"#/components/schemas/CustomerSummary"},{"type":"null"}]},"vendor":{"anyOf":[{"$ref":"#/components/schemas/VendorSummary"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"amount_in_dollars":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount In Dollars"},"frequency_display":{"type":"string","title":"Frequency Display"},"days_until_next":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Until Next"},"is_due":{"type":"boolean","title":"Is Due"},"should_generate":{"type":"boolean","title":"Should Generate"}},"type":"object","required":["id","business_id","name","recurrence_type","status","frequency","start_date","next_occurrence","occurrences_generated","template_data","days_until_due","auto_send","created_at","updated_at","frequency_display","is_due","should_generate"],"title":"RecurringTemplateResponse","description":"Response schema for recurring template.","example":{"amount_in_dollars":3500.0,"auto_send":false,"business_id":"abcdef01-2345-6789-abcd-ef0123456789","created_at":"2026-01-07T12:00:00Z","day_of_month":1,"days_until_due":15,"days_until_next":25,"frequency":"monthly","frequency_display":"Monthly","id":"01234567-89ab-cdef-0123-456789abcdef","is_due":false,"name":"Monthly Rent","next_occurrence":"2026-02-01","occurrences_generated":0,"recurrence_type":"bill","should_generate":false,"start_date":"2026-02-01","status":"active","template_data":{"amount":350000,"description":"Office rent"},"updated_at":"2026-01-07T12:00:00Z","vendor":{"email":"billing@property.com","id":"vendor-uuid","name":"Property Management LLC"}}},"RecurringTemplateSuggestionItem":{"properties":{"pattern_description":{"type":"string","title":"Pattern Description","description":"Description of the recurring pattern"},"frequency":{"type":"string","title":"Frequency","description":"Suggested frequency (monthly, weekly, etc.)"},"avg_amount":{"type":"integer","title":"Avg Amount","description":"Average amount in cents"},"counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty","description":"Counterparty name"},"last_occurrence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Occurrence","description":"Date of last occurrence"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"Confidence score"}},"type":"object","required":["pattern_description","frequency","avg_amount","confidence"],"title":"RecurringTemplateSuggestionItem"},"RecurringTemplateUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Updated name"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Updated currency (USD, CAD, AUD, EUR, or GBP)"},"frequency":{"anyOf":[{"$ref":"#/components/schemas/FrequencyEnum"},{"type":"null"}],"description":"Updated frequency"},"days_until_due":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":0.0},{"type":"null"}],"title":"Days Until Due","description":"Updated days until due"},"day_of_month":{"anyOf":[{"type":"integer","maximum":31.0,"minimum":1.0},{"type":"null"}],"title":"Day Of Month","description":"Updated day of month (1-31). Only applies to monthly/quarterly/annually frequencies. If the day doesn't exist in a month, generates on the last day instead."},"day_of_week":{"anyOf":[{"type":"integer","maximum":6.0,"minimum":0.0},{"type":"null"}],"title":"Day Of Week","description":"Updated day of week (0=Monday, 6=Sunday). Only applies to weekly/biweekly frequencies."},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"Updated end date. Whichever of end_date or max_occurrences is reached first stops generation."},"max_occurrences":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Occurrences","description":"Updated max occurrences. Whichever of end_date or max_occurrences is reached first stops generation."},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Notes","description":"Updated notes"},"template_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Template Data","description":"Updated template data"},"auto_send":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Send","description":"Updated auto-send setting"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id","description":"Updated customer ID (only for invoice templates)"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Updated vendor ID (only for bill templates)"}},"type":"object","title":"RecurringTemplateUpdate","description":"Schema for updating a recurring template.","example":{"days_until_due":30,"name":"Monthly Rent - Updated","template_data":{"amount":375000,"description":"Office rent for 456 New St"}}},"RejectMatchResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true}},"additionalProperties":true,"type":"object","title":"RejectMatchResponse","description":"``SuccessEnvelope[RejectMatchResponse]`` inner payload."},"RejectSuggestionResponse":{"properties":{},"additionalProperties":true,"type":"object","title":"RejectSuggestionResponse","description":"Inner ``data`` for ``reject_suggestion`` (envelope has no resource body)."},"ReminderCreateRequest":{"properties":{"scheduled_at":{"type":"string","format":"date-time","title":"Scheduled At","description":"When to send the first notification (ISO 8601)"},"recurrence":{"$ref":"#/components/schemas/ReminderRecurrence","description":"How often to repeat: none, daily, weekly, monthly","default":"none"}},"type":"object","required":["scheduled_at"],"title":"ReminderCreateRequest","description":"Schedule a notification reminder for a note.","example":{"recurrence":"weekly","scheduled_at":"2026-04-10T09:00:00Z"}},"ReminderListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReminderResponse"},"type":"array","title":"Items"}},"type":"object","title":"ReminderListResponse","description":"All reminders for a note."},"ReminderRecurrence":{"type":"string","enum":["none","daily","weekly","monthly"],"title":"ReminderRecurrence","description":"How often a note reminder repeats."},"ReminderResponse":{"properties":{"id":{"type":"string","title":"Id"},"note_id":{"type":"string","title":"Note Id"},"scheduled_at":{"type":"string","format":"date-time","title":"Scheduled At"},"recurrence":{"type":"string","title":"Recurrence"},"is_active":{"type":"boolean","title":"Is Active"},"last_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sent At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","note_id","scheduled_at","recurrence","is_active","created_at"],"title":"ReminderResponse","description":"A scheduled reminder for a note."},"ReopenPeriodRequest":{"properties":{"reopen_reason":{"type":"string","title":"Reopen Reason","description":"Reason for reopening the period (required)"}},"type":"object","required":["reopen_reason"],"title":"ReopenPeriodRequest","description":"Request schema for reopening a closed accounting period.","example":{"reopen_reason":"Need to correct a journal entry from January"}},"ReorderCashImpactRequest":{"properties":{"proposed_pos":{"items":{"$ref":"#/components/schemas/ProposedPurchaseOrder"},"type":"array","title":"Proposed Pos"},"weeks":{"type":"integer","maximum":52.0,"minimum":1.0,"title":"Weeks","default":13}},"type":"object","title":"ReorderCashImpactRequest"},"ReorderCashImpactResponse":{"properties":{"proposed_total_cents":{"type":"integer","title":"Proposed Total Cents","default":0},"proposed_po_count":{"type":"integer","title":"Proposed Po Count","default":0},"weeks":{"type":"integer","title":"Weeks","default":13},"baseline_ending_cash_cents":{"type":"integer","title":"Baseline Ending Cash Cents","default":0},"scenario_ending_cash_cents":{"type":"integer","title":"Scenario Ending Cash Cents","default":0},"ending_cash_delta_cents":{"type":"integer","title":"Ending Cash Delta Cents","default":0},"baseline_lowest_cash_cents":{"type":"integer","title":"Baseline Lowest Cash Cents","default":0},"scenario_lowest_cash_cents":{"type":"integer","title":"Scenario Lowest Cash Cents","default":0},"lowest_cash_delta_cents":{"type":"integer","title":"Lowest Cash Delta Cents","default":0},"baseline_lowest_cash_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Baseline Lowest Cash Week"},"scenario_lowest_cash_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scenario Lowest Cash Week"},"week_deltas":{"items":{"$ref":"#/components/schemas/ReorderCashImpactWeekDelta"},"type":"array","title":"Week Deltas"},"headline":{"type":"string","title":"Headline","default":""}},"type":"object","title":"ReorderCashImpactResponse"},"ReorderCashImpactWeekDelta":{"properties":{"week":{"type":"integer","title":"Week"},"start_date":{"type":"string","title":"Start Date"},"baseline_ending_cash_cents":{"type":"integer","title":"Baseline Ending Cash Cents"},"scenario_ending_cash_cents":{"type":"integer","title":"Scenario Ending Cash Cents"},"delta_cents":{"type":"integer","title":"Delta Cents"}},"type":"object","required":["week","start_date","baseline_ending_cash_cents","scenario_ending_cash_cents","delta_cents"],"title":"ReorderCashImpactWeekDelta"},"ReorderSettingsResponse":{"properties":{"variant_id":{"type":"string","title":"Variant Id"},"location_id":{"type":"string","title":"Location Id"},"reorder_point":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reorder Point"},"reorder_quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reorder Quantity"},"needs_reorder":{"type":"boolean","title":"Needs Reorder","default":false}},"type":"object","required":["variant_id","location_id"],"title":"ReorderSettingsResponse","description":"Reorder settings for a variant at a specific location."},"ReorderSlidesRequest":{"properties":{"slide_ids":{"items":{"type":"string"},"type":"array","maxItems":40,"minItems":1,"title":"Slide Ids"}},"additionalProperties":false,"type":"object","required":["slide_ids"],"title":"ReorderSlidesRequest"},"ReorderSuggestionGroup":{"properties":{"vendor_id":{"type":"string","title":"Vendor Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"lead_time_days":{"type":"integer","title":"Lead Time Days","default":14},"payment_term_days":{"type":"integer","title":"Payment Term Days","default":0},"discount_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount Percent"},"discount_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discount Days"},"lines":{"items":{"$ref":"#/components/schemas/ReorderSuggestionLine"},"type":"array","title":"Lines"},"estimated_total_cents":{"type":"integer","title":"Estimated Total Cents","default":0}},"type":"object","required":["vendor_id"],"title":"ReorderSuggestionGroup"},"ReorderSuggestionLine":{"properties":{"variant_id":{"type":"string","title":"Variant Id"},"product_id":{"type":"string","title":"Product Id"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id"},"on_hand":{"type":"number","title":"On Hand"},"available":{"type":"number","title":"Available"},"reorder_point":{"type":"number","title":"Reorder Point"},"reorder_quantity":{"type":"number","title":"Reorder Quantity"},"daily_velocity":{"type":"number","title":"Daily Velocity","default":0.0},"lead_time_days":{"type":"integer","title":"Lead Time Days","default":14},"days_of_cover":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Days Of Cover"},"suggested_quantity":{"type":"integer","title":"Suggested Quantity"},"unit_cost_cents":{"type":"integer","title":"Unit Cost Cents"},"forecast_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Forecast Method"},"demand_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Demand Class"},"forecast_weekly_demand":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Forecast Weekly Demand"},"safety_stock":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Safety Stock"},"forecast_reorder_point":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Forecast Reorder Point"},"order_up_to":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Order Up To"},"forecast_accuracy_mape":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Forecast Accuracy Mape"}},"type":"object","required":["variant_id","product_id","on_hand","available","reorder_point","reorder_quantity","suggested_quantity","unit_cost_cents"],"title":"ReorderSuggestionLine"},"ReorderSuggestionsResponse":{"properties":{"suggestions":{"items":{"$ref":"#/components/schemas/ReorderSuggestionGroup"},"type":"array","title":"Suggestions"},"unassigned":{"items":{"$ref":"#/components/schemas/ReorderSuggestionLine"},"type":"array","title":"Unassigned"},"total_lines":{"type":"integer","title":"Total Lines","default":0}},"type":"object","title":"ReorderSuggestionsResponse"},"ReportCreateRequest":{"properties":{"report_name":{"type":"string","title":"Report Name","description":"Report type identifier. Must match a supported report_name from the /reports endpoint. Examples: 'master_transactions', 'trial_balance', 'general_ledger', 'profit_and_loss_comparative', 'ar_report', 'cogs_report', 'shareholder_loans'. See GET /reports for the complete list of available report types."},"period_type":{"anyOf":[{"$ref":"#/components/schemas/ReportPeriodType"},{"type":"null"}],"description":"Controls how report dates are determined. 'custom' (default): Use start_date/end_date fields directly. 'tax_year': Calculate full fiscal year dates from business's tax_year_end_month config. 'tax_quarter': Calculate quarter dates within a fiscal year. When using tax_year or tax_quarter, the resolved dates will be stored in generation_params.","default":"custom"},"tax_year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tax Year","description":"The tax/fiscal year for period calculation. Required when period_type is 'tax_year' or 'tax_quarter'. Example: 2026. The actual date range depends on the business's tax_year_end_month setting. For a business with tax year ending March 31, tax_year=2026 covers April 1, 2025 through March 31, 2026."},"tax_quarter":{"anyOf":[{"type":"integer","maximum":4.0,"minimum":1.0},{"type":"null"}],"title":"Tax Quarter","description":"The quarter within the tax year (1-4). Required when period_type is 'tax_quarter'. Q1 is the FIRST quarter of the fiscal year, which may start in the prior calendar year for non-calendar fiscal years. Example: For a March fiscal year-end, Q1 of tax_year=2026 covers April 1-June 30, 2025."},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date","description":"Report period start date in YYYY-MM-DD format (e.g., '2026-01-01'). Required when period_type='custom' for reports with input_type='date_start_end' or similar. Ignored when period_type is 'tax_year' or 'tax_quarter' (dates calculated automatically)."},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date","description":"Report period end date in YYYY-MM-DD format (e.g., '2026-12-31'). Required when period_type='custom' for date-range reports. For point-in-time reports (input_type='date_end_only'), only end_date is needed. Ignored when period_type is 'tax_year' or 'tax_quarter'."},"comparison_period_type":{"anyOf":[{"$ref":"#/components/schemas/ReportPeriodType"},{"type":"null"}],"description":"Period type for the comparison/prior period in comparative reports. Same options as period_type: 'custom', 'tax_year', or 'tax_quarter'. Used with reports like 'profit_and_loss_comparative' and 'balance_sheet_comparative' to enable variance analysis between two periods."},"comparison_tax_year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Comparison Tax Year","description":"Tax year for the comparison period. Used when comparison_period_type is 'tax_year' or 'tax_quarter'. Example: Set to 2025 to compare against the current period's 2026 for year-over-year analysis."},"comparison_tax_quarter":{"anyOf":[{"type":"integer","maximum":4.0,"minimum":1.0},{"type":"null"}],"title":"Comparison Tax Quarter","description":"Quarter (1-4) for the comparison period. Required when comparison_period_type is 'tax_quarter'. Example: comparison_tax_quarter=1 with comparison_tax_year=2025 compares Q1 2025 against the current period."},"comparison_start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comparison Start Date","description":"Start date for comparison period in YYYY-MM-DD format. Used when comparison_period_type='custom' for comparative reports. Example: '2025-01-01' to compare against prior year."},"comparison_end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comparison End Date","description":"End date for comparison period in YYYY-MM-DD format. Used when comparison_period_type='custom' for comparative reports. Example: '2025-12-31' to compare full prior year."},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"UUID of a specific ledger account to filter the report. Currently used with 'general_ledger' report to show transactions for only one account instead of all accounts. When omitted, the general_ledger report includes all accounts. Example: '019ab37c-ledg-7000-8000-000000000001'."},"instance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Id","description":"Teal integration instance ID. Optional - if not specified, uses the business's default Teal instance. Only needed for businesses with multiple Teal instances or when overriding the default. Used for reports that fetch data from Teal (P&L, Balance Sheet)."},"file_s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File S3 Key","description":"S3 object key for file-based report inputs. Required for reports with input_type='file_upload' (e.g., 'cogs_report'). The file should be uploaded first via the upload endpoint. Example: 'uploads/business-123/cogs-data-2026.csv'."},"s3_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"S3 Keys","description":"Array of S3 object keys when a report requires multiple input files. Each key should reference a previously uploaded file. Example: ['uploads/business-123/sales-q1.csv', 'uploads/business-123/sales-q2.csv']."},"tag_group_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag Group Id","description":"UUID of a specific tag group to filter the report. Used with 'pnl_by_department' to segment by tags within this group."},"tag_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tag Ids","description":"List of specific tag UUIDs to filter the report. When multiple tags are provided for 'pnl_by_department', it generates a multi-sheet report with one P&L statement per tag."},"additional_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Additional Params","description":"Report-specific parameters that vary by report type. Supported parameters: **customer_id** (UUID): Filter customer_statements or pnl_by_customer to a specific customer. **vendor_id** (UUID): Filter vendor_statements to a specific vendor. **include_zero_balances** (bool): Include zero-balance accounts in trial_balance report. **tag_group_id** (UUID): Filter pnl_by_department to tags in a specific tag group. **forecast_days** (int): Number of days to forecast in cash_flow_forecast (default: 90). **raw** (bool): For general_ledger only — return a single flat sheet with no formatting or headers (default: false). Example: {'customer_id': '019abc-uuid', 'include_zero_balances': true}."},"output_format":{"$ref":"#/components/schemas/ReportOutputFormat","description":"Output file format for the report. 'xlsx' (default): Excel format with formatting, multiple tabs, headers, and currency formatting. 'csv': Comma-separated values format as a single flat file without formatting. 'html': HTML format. CSV is useful for importing into other systems or programmatic analysis.","default":"xlsx"}},"type":"object","required":["report_name"],"title":"ReportCreateRequest","description":"Request schema for generating a financial report.\n\nThis schema supports all report types with flexible date period configuration.\nThe required fields depend on the report's `input_type` (see ReportTypeResponse).\n\n**Report Categories:**\n\nDate Range Reports (input_type='date_start_end'):\n    - `master_transactions`: Complete audit trail of all financial activity\n    - `profit_and_loss`: Standard P&L showing revenue, expenses, and net income\n    - `cash_flow_statement`: Cash flows by operating/investing/financing activities\n    - `sales_report`: Revenue analysis by customer, product, and time\n    - `tax_summary`: Sales tax collected by jurisdiction\n    - `sales_tax_by_jurisdiction`: Tax breakdown by state/jurisdiction\n    - `bank_reconciliation`: Reconciliation status for all bank accounts\n    - `report_1099`: Contractor payments for 1099 filing\n    - `journal_entry_report`: Audit trail of all journal entries\n    - `expense_by_category`: Expenses organized by category\n    - `check_register`: All payments and checks issued\n    - `retained_earnings`: Changes in equity over time\n    - `financial_ratios`: Key financial ratios dashboard\n    - `audit_trail`: Complete record of all changes\n    - `income_statement_details`: Transaction-level P&L detail\n    - `shareholder_loans`: Shareholder loan account tracking\n    - `subscription_costs`: Recurring subscription analysis\n    - `balance_sheet_monthly`: Month-by-month balance sheet over time\n    - `financial_summary_dashboard`: Executive-level financial dashboard\n    - `budget_vs_actual`: Compare actual performance against budget\n    - `payroll_summary`: Payroll expenses breakdown and trends\n    - `cogs_report`: Cost of goods sold analysis from ledger data\n\nComparative Reports (input_type='date_start_end_with_comparison'):\n    - `profit_and_loss_comparative`: P&L with period-over-period variance\n    - `balance_sheet_comparative`: Balance sheet with point-in-time comparison\n\nPoint-in-Time Reports (input_type='date_end_only'):\n    - `balance_sheet`: Standard balance sheet as of a specific date\n    - `working_capital`: Current assets vs liabilities analysis\n    - `aged_trial_balance`: Trial balance with aging buckets\n\nNo-Parameter Reports (input_type='no_params'):\n    - `ar_report`: Accounts receivable with aging\n    - `ar_aging_summary`: Standalone AR aging summary by customer\n    - `ap_report`: Accounts payable with aging\n    - `products_report`: Products, variants, and customers export\n    - `inventory_by_location`: Inventory by warehouse/location\n    - `chart_of_accounts`: Complete account listing\n\nPeriodic/Grouped Reports (input_type='date_start_end_with_grouping'):\n    - `income_statement_periodic`: Month-by-month or quarterly income statement\n    - `cash_flow_periodic`: Month-by-month or quarterly cash flow statement\n    - `deferred_revenue_waterfall`: Deferred revenue roll-forward by period\n\nLedger-Filtered Reports (input_type='date_start_end_with_ledger'):\n    - `general_ledger`: Detailed transactions by account, optionally filtered\n\nOptions Reports (input_type='date_start_end_with_options'):\n    - `trial_balance`: Account balances with optional zero-balance inclusion\n\nCustomer-Filtered Reports (input_type='date_start_end_with_customer'):\n    - `customer_statements`: Statements for specific customer\n    - `pnl_by_customer`: Profitability by customer\n\nVendor-Filtered Reports (input_type='date_start_end_with_vendor'):\n    - `vendor_statements`: Vendor bills, payments, and balances\n\nTag-Filtered Reports (input_type='date_start_end_with_tag_group'):\n    - `pnl_by_department`: P&L segmented by department/tag\n\nForecast Reports (input_type='forecast_params'):\n    - `cash_flow_forecast`: Projected cash position based on AR/AP\n\n**Period Selection:**\nUse `period_type` to control how dates are determined:\n- `custom` (default): Provide explicit start_date/end_date\n- `tax_year`: Use business's fiscal year config with tax_year param\n- `tax_quarter`: Use specific quarter with tax_year + tax_quarter params","examples":[{"summary":"Custom date range","value":{"end_date":"2026-03-31","period_type":"custom","report_name":"profit_and_loss","start_date":"2026-01-01"}},{"summary":"Full tax year report","value":{"period_type":"tax_year","report_name":"profit_and_loss","tax_year":2026}},{"summary":"Quarterly report with prior year comparison","value":{"comparison_period_type":"tax_quarter","comparison_tax_quarter":1,"comparison_tax_year":2025,"period_type":"tax_quarter","report_name":"profit_and_loss_comparative","tax_quarter":1,"tax_year":2026}}]},"ReportOutputFormat":{"type":"string","enum":["xlsx","csv","html"],"title":"ReportOutputFormat","description":"Output format for generated reports.\n\n- **xlsx**: Microsoft Excel format with formatting, multiple tabs, headers,\n  currency formatting, and freeze panes. Best for interactive use and sharing.\n\n- **csv**: Comma-separated values format. Single flat file without formatting.\n  Best for importing into other systems, data analysis, or programmatic use.\n\n- **html**: HTML format. Provides a basic web-viewable table."},"ReportPeriodType":{"type":"string","enum":["custom","tax_year","tax_quarter"],"title":"ReportPeriodType","description":"Type of period for report generation.\n\nDetermines how report date ranges are calculated:\n\n- **custom**: Use explicit start_date/end_date values provided in the request.\n  This is the default mode and gives full control over the date range.\n\n- **tax_year**: Calculate dates based on the business's tax year configuration.\n  Uses the business's `tax_year_end_month` setting to determine fiscal year\n  boundaries. For example, if tax_year_end_month=3 (March), tax_year=2026\n  would cover April 1, 2025 through March 31, 2026.\n\n- **tax_quarter**: Calculate dates for a specific quarter within a tax year.\n  Requires both `tax_year` and `tax_quarter` (1-4) parameters. Q1 is the\n  first quarter of the fiscal year, which may start in the prior calendar\n  year for non-calendar fiscal years."},"ReportResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for this generated report. Use this ID to retrieve the report details or delete it. Example: '019ab37c-rpt1-7000-8000-000000000001'."},"business_id":{"type":"string","title":"Business Id","description":"UUID of the business this report belongs to. Reports are scoped to a single business and cannot be accessed by other businesses."},"report_name":{"type":"string","title":"Report Name","description":"The report type that was generated. Matches the report_name from the original request. Example: 'profit_and_loss', 'master_transactions', 'ar_report'."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when the report was generated (ISO 8601 format). Example: '2026-01-15T14:00:00Z'."},"downloaded_at":{"type":"string","format":"date-time","title":"Downloaded At","description":"Timestamp of the most recent download of this report. Updated each time the report is accessed. Useful for tracking report usage."},"s3_bucket":{"type":"string","title":"S3 Bucket","description":"Name of the S3 bucket where the report file is stored. Format: 'dayzero-{environment}-reports'. Example: 'dayzero-prod-reports'."},"s3_key":{"type":"string","title":"S3 Key","description":"S3 object key (path) for the report file within the bucket. Format: 'reports/{business_id}/{report_type}_{dates}.xlsx'. Example: 'reports/019ab37c-bus1/master_transactions_2026-01-01_2026-12-31.xlsx'."},"generation_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Generation Params","description":"Dictionary of all parameters used to generate this report. Includes resolved dates (even when using tax_year/tax_quarter), filters, and any additional parameters. Useful for understanding report scope and audit purposes. Example: {'start_date': '2026-01-01', 'end_date': '2026-12-31', 'ledger_id': null}."},"download_url":{"type":"string","title":"Download Url","description":"Same-origin proxy URL for downloading the report file. Streams through the backend to avoid CORS and presigned-URL expiration issues. Requires Authorization and x-business-id headers."},"generated_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated By Name","description":"Display name of the user who generated this report, e.g. 'Sarah Chen'. Extracted from generation_params."}},"type":"object","required":["id","business_id","report_name","created_at","downloaded_at","s3_bucket","s3_key","download_url"],"title":"ReportResponse","description":"Response schema for a generated report.\n\nContains the report metadata and a pre-signed URL to download the Excel file.\nReports are stored in S3 and the signed URL provides temporary access (24 hours).\n\nThe generation_params field stores all the parameters used to create this report,\nwhich is useful for understanding the report's scope and for regenerating it.","example":{"business_id":"019ab37c-bus1-7000-8000-000000000001","created_at":"2024-01-15T14:00:00Z","download_url":"/api/v1/reports/download?s3_key=reports/019ab37c-bus1/profit_and_loss_2024-01.xlsx&filename=profit_and_loss_2024-01.xlsx","downloaded_at":"2024-01-15T14:00:00Z","generation_params":{"end_date":"2024-01-31","start_date":"2024-01-01"},"id":"019ab37c-rpt1-7000-8000-000000000001","report_name":"profit_and_loss","s3_bucket":"dayzero-reports","s3_key":"reports/019ab37c-bus1/profit_and_loss_2024-01.pdf"}},"ReportSuggestionItem":{"properties":{"report_type":{"type":"string","title":"Report Type","description":"Type of report"},"title":{"type":"string","title":"Title","description":"Suggested report title"},"description":{"type":"string","title":"Description","description":"Why this report is useful"},"params":{"additionalProperties":true,"type":"object","title":"Params","description":"Suggested report parameters"}},"type":"object","required":["report_type","title","description"],"title":"ReportSuggestionItem"},"ReportTaskResponse":{"properties":{"task_id":{"type":"string","title":"Task Id","description":"Unique identifier for the report generation task. Use this to poll for status via GET /reports/task/{task_id}. Also serves as the Temporal workflow ID. Format: 'report-generation-{business_id}-{report_name}-{date_params}'. Example: 'report-generation-bus123-profit_and_loss-start-2026-01-01-end-2026-12-31'."},"status":{"type":"string","title":"Status","description":"Initial status of the task. Typically 'queued' for new requests or 'in_progress' if a duplicate request was made while an identical report is already being generated. Values: 'queued', 'in_progress', 'failed'."},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Human-readable message about the task status. Provides context such as 'Report generation queued successfully with Temporal' or error details if the request failed validation."},"business_id":{"type":"string","title":"Business Id","description":"UUID of the business for which the report is being generated. Echoed from the request for confirmation."},"report_name":{"type":"string","title":"Report Name","description":"Type of report being generated. Echoed from the request for confirmation. Example: 'profit_and_loss', 'master_transactions', 'cogs_report'."}},"type":"object","required":["task_id","status","business_id","report_name"],"title":"ReportTaskResponse","description":"Response schema for async report generation task.\n\nReports are generated asynchronously via Temporal workflows. This response\nis returned immediately when a report generation request is submitted.\nUse the task_id to poll for status via GET /reports/task/{task_id}.\n\nThe task_id is also the Temporal workflow ID, which can be used for\ndebugging and monitoring in the Temporal UI.","example":{"business_id":"019ab37c-bus1-7000-8000-000000000001","message":"Report generation started","report_name":"profit_and_loss","status":"queued","task_id":"task_abc123xyz"}},"ReportTypeResponse":{"properties":{"report_name":{"type":"string","title":"Report Name","description":"Unique report identifier used in API requests. Examples: 'master_transactions', 'trial_balance', 'general_ledger', 'profit_and_loss_comparative', 'ar_report', 'cogs_report'. Use this value in the report_name field when generating reports."},"title":{"type":"string","title":"Title","description":"Human-readable display title for the report. Shown in UI and report headers. Example: 'Master Transactions Report', 'Trial Balance Report'."},"description":{"type":"string","title":"Description","description":"Detailed description of what the report contains, its purpose, and typical use cases. Helps users understand when to use this report."},"input_type":{"type":"string","title":"Input Type","description":"Specifies which request fields are required for this report. Values: 'no_params' (no additional fields needed), 'date_start_end' (requires start_date and end_date), 'date_end_only' (requires only end_date for point-in-time reports), 'date_start_end_with_ledger' (date range plus optional ledger_id filter), 'date_start_end_with_comparison' (two date ranges for variance analysis), 'date_start_end_with_customer' (date range plus optional customer filter), 'date_start_end_with_vendor' (date range plus optional vendor filter), 'date_start_end_with_tag_group' (date range plus optional tag group filter), 'date_start_end_with_options' (date range with additional options like include_zero_balances), 'date_start_end_with_grouping' (date range with period grouping like monthly or quarterly), 'forecast_params' (forecast configuration like forecast_days), 'file_upload' (requires file_s3_key or s3_keys for uploaded data)."}},"type":"object","required":["report_name","title","description","input_type"],"title":"ReportTypeResponse","description":"Schema for a supported report type.\n\nDescribes what reports can be generated and their required inputs.\nEach report type has a unique identifier, display title, description,\nand input type that determines which request fields are required.\n\nSee REPORTS_CATALOG.md for detailed documentation of each report type,\nincluding output columns, tabs, and use cases."},"ReportTypesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReportTypeResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"ReportTypesResponse","description":"Paginated list of available report types."},"ReportsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReportResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"ReportsListResponse","description":"Paginated list of generated reports."},"RescanAnomaliesResponse":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"workflow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id"},"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id"}},"additionalProperties":true,"type":"object","title":"RescanAnomaliesResponse","description":"Response for ``rescan_anomalies``."},"ResendInvitationResponse":{"properties":{"status":{"type":"string","title":"Status","default":"ok"},"message":{"type":"string","title":"Message"},"email_sent":{"type":"boolean","title":"Email Sent","default":true},"new_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"New Expires At"}},"type":"object","required":["message"],"title":"ResendInvitationResponse","description":"Response after resending an invitation."},"ResolveAnomalyResponse":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"},"merge_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Merge Summary"},"dismissal":{"anyOf":[{"$ref":"#/components/schemas/AnomalyResolutionDismissal"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"ResolveAnomalyResponse","description":"Response for ``resolve_anomaly``."},"ResolveClarificationRequest":{"properties":{},"type":"object","title":"ResolveClarificationRequest","description":"Firm closes the loop after applying the client's answer."},"ResolveRequest":{"properties":{"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional notes captured alongside the resolution."}},"type":"object","title":"ResolveRequest"},"RestoreAnomalyResponse":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"additionalProperties":true,"type":"object","title":"RestoreAnomalyResponse","description":"Response for ``restore_anomaly``."},"RestoreRequest":{"properties":{"counterparty_key":{"type":"string","title":"Counterparty Key","description":"Normalized counterparty name to restore"}},"type":"object","required":["counterparty_key"],"title":"RestoreRequest"},"RestoreSubscriptionResponse":{"properties":{"status":{"type":"string","title":"Status"},"counterparty_key":{"type":"string","title":"Counterparty Key"}},"additionalProperties":true,"type":"object","required":["status","counterparty_key"],"title":"RestoreSubscriptionResponse","description":"Response for ``restore_subscription``."},"RestoreTransactionResponse":{"properties":{},"additionalProperties":true,"type":"object","title":"RestoreTransactionResponse","description":"Envelope data for ``restore_transaction`` — success message only."},"ResumeAiFeaturesResponse":{"properties":{"requests_used":{"type":"integer","title":"Requests Used"},"monthly_limit":{"type":"integer","title":"Monthly Limit"},"remaining":{"type":"integer","title":"Remaining"},"is_unlimited":{"type":"boolean","title":"Is Unlimited"},"plan_tier":{"type":"string","title":"Plan Tier"},"has_ai_pro":{"type":"boolean","title":"Has Ai Pro"},"is_trial":{"type":"boolean","title":"Is Trial"},"overage_enabled":{"type":"boolean","title":"Overage Enabled"},"overage_requests":{"type":"integer","title":"Overage Requests"},"overage_rates_cents":{"$ref":"#/components/schemas/AIOverageRatesCents"},"overage_breakdown":{"$ref":"#/components/schemas/AIOverageBreakdown"},"estimated_overage_cost_cents":{"type":"integer","title":"Estimated Overage Cost Cents"},"projected_month_end_overage_cents":{"type":"integer","title":"Projected Month End Overage Cents"},"ai_paused_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Paused At"},"ai_paused_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Paused By"},"upgrade_suggestion":{"anyOf":[{"$ref":"#/components/schemas/AIUpgradeSuggestion"},{"type":"null"}]},"disabled_features_when_paused":{"items":{"type":"string"},"type":"array","title":"Disabled Features When Paused"}},"additionalProperties":true,"type":"object","required":["requests_used","monthly_limit","remaining","is_unlimited","plan_tier","has_ai_pro","is_trial","overage_enabled","overage_requests","overage_rates_cents","overage_breakdown","estimated_overage_cost_cents","projected_month_end_overage_cents","disabled_features_when_paused"],"title":"ResumeAiFeaturesResponse","description":"Response for ``resume_ai_features``."},"RevenueDriverValue":{"properties":{"growth":{"type":"number","title":"Growth","description":"MoM compound growth rate, e.g. 0.10 = 10%","default":0.0}},"type":"object","title":"RevenueDriverValue"},"Role":{"type":"string","enum":["owner","admin","member","viewer","accountant"],"title":"Role","description":"User roles in a business.\n\nSee ROLE_ABILITIES_DOC in app.models.user_businesses for detailed role descriptions.\nValid roles: owner, admin, member, viewer, accountant (legacy)."},"RunCalculateRequest":{"properties":{"total_units":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Total Units"},"unit_sale_price":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Unit Sale Price"}},"type":"object","title":"RunCalculateRequest","description":"For what-if calculations without persisting."},"RunCreateRequest":{"properties":{"recipe_id":{"type":"string","title":"Recipe Id","description":"Recipe to base the run on."},"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"total_units":{"type":"integer","exclusiveMinimum":0.0,"title":"Total Units","description":"Number of finished units to produce."},"unit_sale_price":{"type":"integer","minimum":0.0,"title":"Unit Sale Price","description":"Expected sale price per unit in cents.","default":0}},"type":"object","required":["recipe_id","total_units"],"title":"RunCreateRequest"},"RunDepreciationRequest":{"properties":{"period_date":{"type":"string","format":"date","title":"Period Date","description":"First day of the month to depreciate"},"asset_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Asset Ids","description":"Specific assets (default: all active)"},"create_journal_entries":{"type":"boolean","title":"Create Journal Entries","description":"Create journal entries for depreciation","default":true}},"type":"object","required":["period_date"],"title":"RunDepreciationRequest","description":"Schema for running monthly depreciation."},"RunDepreciationResponse":{"properties":{"period_date":{"type":"string","format":"date","title":"Period Date","description":"Depreciation period date"},"assets_processed":{"type":"integer","title":"Assets Processed","description":"Number of assets depreciated"},"total_depreciation":{"type":"integer","title":"Total Depreciation","description":"Total depreciation amount in cents"},"entries_created":{"type":"integer","title":"Entries Created","description":"Depreciation entries created"},"journal_entries_created":{"type":"integer","title":"Journal Entries Created","description":"Journal entries created"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","description":"Errors encountered during processing"}},"type":"object","required":["period_date","assets_processed","total_depreciation","entries_created","journal_entries_created"],"title":"RunDepreciationResponse","description":"Response after running depreciation."},"RunListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RunResponse"},"type":"array","title":"Items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"RunListResponse"},"RunResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"recipe_id":{"type":"string","title":"Recipe Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"total_units":{"type":"integer","title":"Total Units"},"unit_sale_price":{"type":"integer","title":"Unit Sale Price"},"status":{"type":"string","title":"Status"},"cost_snapshot":{"anyOf":[{"$ref":"#/components/schemas/CostBreakdown"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","recipe_id","total_units","unit_sale_price","status","created_at","updated_at"],"title":"RunResponse"},"RunUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"total_units":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Total Units"},"unit_sale_price":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Unit Sale Price"}},"type":"object","title":"RunUpdateRequest"},"SalesReceiptCreateRequest":{"properties":{"receipt_type":{"type":"string","title":"Receipt Type","description":"One of: sale, refund.","default":"sale"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id","description":"Optional customer (anonymous cash sales allowed)."},"receipt_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Receipt Date","description":"Receipt date. Defaults to today when omitted."},"deposit_to_ledger_id":{"type":"string","title":"Deposit To Ledger Id","description":"Bank/cash ledger that receives (sale) or pays out (refund)."},"income_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Income Ledger Id","description":"Revenue ledger override. Defaults to the Invoice Sales system account."},"line_items":{"items":{"$ref":"#/components/schemas/SalesReceiptLineItem"},"type":"array","minItems":1,"title":"Line Items","description":"At least one line item is required."},"tax_total":{"type":"integer","minimum":0.0,"title":"Tax Total","description":"Total sales tax in cents (posted to Sales Tax Payable).","default":0},"number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Number","description":"Optional document number; auto-generated."},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo","description":"Optional memo / note."},"currency":{"type":"string","maxLength":3,"title":"Currency","default":"USD"}},"type":"object","required":["deposit_to_ledger_id","line_items"],"title":"SalesReceiptCreateRequest","description":"Request schema for creating (and immediately posting) a sales receipt."},"SalesReceiptLineItem":{"properties":{"catalog_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Catalog Item Id","description":"Optional catalog item this line is based on."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Line description."},"quantity":{"type":"number","exclusiveMinimum":0.0,"title":"Quantity","description":"Quantity sold/refunded.","default":1},"unit_price":{"type":"integer","minimum":0.0,"title":"Unit Price","description":"Price per unit in cents (e.g. 15000 = $150.00)."},"amount":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Amount","description":"Line total in cents. Computed from quantity * unit_price when omitted."}},"type":"object","required":["unit_price"],"title":"SalesReceiptLineItem","description":"A single line on a sales/refund receipt."},"SalesReceiptResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"receipt_type":{"type":"string","title":"Receipt Type"},"status":{"type":"string","title":"Status"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"receipt_date":{"type":"string","format":"date","title":"Receipt Date"},"deposit_to_ledger_id":{"type":"string","title":"Deposit To Ledger Id"},"deposit_to_ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deposit To Ledger Name"},"income_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Income Ledger Id"},"income_ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Income Ledger Name"},"line_items":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Line Items"},"subtotal":{"type":"integer","title":"Subtotal"},"tax_total":{"type":"integer","title":"Tax Total"},"total":{"type":"integer","title":"Total"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"},"currency":{"type":"string","title":"Currency"},"journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Id"},"void_journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Void Journal Entry Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","receipt_type","status","receipt_date","deposit_to_ledger_id","subtotal","tax_total","total","currency","created_at","updated_at"],"title":"SalesReceiptResponse","description":"Response schema for a sales/refund receipt."},"SalesReceiptsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SalesReceiptResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"SalesReceiptsListResponse","description":"Paginated list of sales/refund receipts."},"ScenarioCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"title":"Name","default":"Default Projection"},"base_month":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Base Month","description":"Last month of actuals; defaults to most recent closed month"},"projection_months":{"type":"integer","maximum":60.0,"minimum":1.0,"title":"Projection Months","default":24},"revenue_drivers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/RevenueDriverValue"},"type":"object"},{"type":"null"}],"title":"Revenue Drivers"},"cost_classifications":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/CostClassification"},"type":"object"},{"type":"null"}],"title":"Cost Classifications"},"variable_drivers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/VariableDriverValue"},"type":"object"},{"type":"null"}],"title":"Variable Drivers"},"fixed_drivers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/FixedDriverValue"},"type":"object"},{"type":"null"}],"title":"Fixed Drivers"},"monthly_overrides":{"anyOf":[{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object"},{"type":"null"}],"title":"Monthly Overrides","description":"Manual monthly overrides keyed by ledger_id then month index"},"tax_rate":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Tax Rate"},"interest_income_monthly":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Interest Income Monthly"},"interest_expense_monthly":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Interest Expense Monthly"}},"type":"object","title":"ScenarioCreateRequest","description":"Create a new projection scenario. Drivers are optional — the service\nwill seed defaults from trailing actuals when omitted."},"ScenarioResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"name":{"type":"string","title":"Name"},"is_active":{"type":"boolean","title":"Is Active"},"base_month":{"type":"string","format":"date","title":"Base Month"},"projection_months":{"type":"integer","title":"Projection Months"},"revenue_drivers":{"additionalProperties":{"$ref":"#/components/schemas/RevenueDriverValue"},"type":"object","title":"Revenue Drivers"},"cost_classifications":{"additionalProperties":{"type":"string"},"type":"object","title":"Cost Classifications"},"variable_drivers":{"additionalProperties":{"$ref":"#/components/schemas/VariableDriverValue"},"type":"object","title":"Variable Drivers"},"fixed_drivers":{"additionalProperties":{"$ref":"#/components/schemas/FixedDriverValue"},"type":"object","title":"Fixed Drivers"},"monthly_overrides":{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object","title":"Monthly Overrides"},"tax_rate":{"type":"number","title":"Tax Rate"},"interest_income_monthly":{"type":"integer","title":"Interest Income Monthly"},"interest_expense_monthly":{"type":"integer","title":"Interest Expense Monthly"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","name","is_active","base_month","projection_months","tax_rate","interest_income_monthly","interest_expense_monthly","created_at","updated_at"],"title":"ScenarioResponse","description":"Full scenario including all persisted drivers."},"ScenarioUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"projection_months":{"anyOf":[{"type":"integer","maximum":60.0,"minimum":1.0},{"type":"null"}],"title":"Projection Months"},"revenue_drivers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/RevenueDriverValue"},"type":"object"},{"type":"null"}],"title":"Revenue Drivers"},"cost_classifications":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/CostClassification"},"type":"object"},{"type":"null"}],"title":"Cost Classifications"},"variable_drivers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/VariableDriverValue"},"type":"object"},{"type":"null"}],"title":"Variable Drivers"},"fixed_drivers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/FixedDriverValue"},"type":"object"},{"type":"null"}],"title":"Fixed Drivers"},"monthly_overrides":{"anyOf":[{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object"},{"type":"null"}],"title":"Monthly Overrides","description":"Manual monthly overrides keyed by ledger_id then month index"},"tax_rate":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Tax Rate"},"interest_income_monthly":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Interest Income Monthly"},"interest_expense_monthly":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Interest Expense Monthly"}},"type":"object","title":"ScenarioUpdateRequest","description":"Partial update of scenario drivers. Only provided fields are changed."},"SearchMetadata":{"properties":{"total_count":{"type":"integer","title":"Total Count","description":"Total matches across all entity types."},"search_term":{"type":"string","title":"Search Term","description":"The search term used."}},"type":"object","required":["total_count","search_term"],"title":"SearchMetadata","description":"Metadata about search results."},"SearchResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether search completed successfully.","default":true},"results":{"$ref":"#/components/schemas/SearchResults","description":"Search results by entity type."}},"type":"object","required":["results"],"title":"SearchResponse","description":"Response schema for global search.\n\nSearches across multiple entity types simultaneously\nand returns results grouped by type."},"SearchResults":{"properties":{"products":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Products","description":"Matching products.","default":[]},"variants":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Variants","description":"Matching product variants.","default":[]},"invoices":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Invoices","description":"Matching invoices.","default":[]},"bills":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Bills","description":"Matching bills.","default":[]},"inventory_orders":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Inventory Orders","description":"Matching inventory orders.","default":[]},"shipments":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Shipments","description":"Matching shipments.","default":[]},"customers":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Customers","description":"Matching customers.","default":[]},"vendors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Vendors","description":"Matching vendors.","default":[]},"journal_entries":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Journal Entries","description":"Matching journal entries.","default":[]},"transactions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Transactions","description":"Matching transactions.","default":[]},"ledgers":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Ledgers","description":"Matching ledger accounts.","default":[]},"emails":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Emails","description":"Matching emails.","default":[]},"metadata":{"$ref":"#/components/schemas/SearchMetadata","description":"Search metadata."}},"type":"object","required":["metadata"],"title":"SearchResults","description":"Search results grouped by entity type.\n\n**Searchable fields by entity:**\n- `products`: name, type\n- `variants`: name, sku, manufacturer_sku, unit_price*, unit_cost*\n- `invoices`: number, description, total*\n- `bills`: bill_number, description, amount*, expected_amount*\n- `customers`: name, email\n- `vendors`: name, email\n- `journal_entries`: description\n- `transactions`: description, amount*\n- `ledgers`: name, description\n- `emails`: subject, sender_email, description\n- `inventory_orders`: name, po_number, description, total*\n- `shipments`: tracking_number, description\n\n*Numeric fields: enter a dollar amount (e.g. ``5.00`` or ``$1,250``)\nand matching records will be included alongside text matches.","example":{"customers":[{"email":"billing@acme.com","id":"...","name":"Acme Corp"}],"invoices":[],"metadata":{"search_term":"acme","total_count":3},"products":[{"id":"...","name":"Widget Pro","type":"physical"}],"transactions":[{"amount":150000,"description":"ACME CORP PAYMENT","id":"..."}]}},"SendStatementRequest":{"properties":{"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"as_of_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of Date"},"custom_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Message","description":"Optional note included in the email body."},"cc_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cc Email","description":"Optional address to CC."}},"type":"object","title":"SendStatementRequest","description":"Request body for emailing a statement to the customer."},"SendStatementResponse":{"properties":{"status":{"type":"string","title":"Status"},"sent_to":{"type":"string","title":"Sent To"},"closing_balance":{"type":"integer","title":"Closing Balance"}},"type":"object","required":["status","sent_to","closing_balance"],"title":"SendStatementResponse","description":"Result of a statement send."},"SenderRole":{"type":"string","enum":["client","advisor"],"title":"SenderRole"},"SetApproversRequest":{"properties":{"user_ids":{"items":{"type":"string"},"type":"array","title":"User Ids","description":"List of user UUIDs to set as approvers for the tier."}},"type":"object","title":"SetApproversRequest","description":"Body for ``PUT /ap-approval/approvers/{tier}``."},"SetLimitRequest":{"properties":{"monthly_limit_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Limit Cents","description":"Monthly budget in cents, or null to remove limit"}},"type":"object","title":"SetLimitRequest"},"SetPinnedRequest":{"properties":{"pinned":{"type":"boolean","title":"Pinned"}},"type":"object","required":["pinned"],"title":"SetPinnedRequest"},"SetVariantLocationQuantitiesRequest":{"properties":{"location_quantities":{"items":{"$ref":"#/components/schemas/VariantLocationQuantityInput"},"type":"array","minItems":1,"title":"Location Quantities","description":"List of per-location absolute quantities."},"effective_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective At","description":"Timestamp for inventory records (ISO 8601). Defaults to now."}},"type":"object","required":["location_quantities"],"title":"SetVariantLocationQuantitiesRequest","description":"Set opening inventory quantities for a variant by location."},"ShareLinkResponse":{"properties":{"share_id":{"type":"string","title":"Share Id"},"deck_id":{"type":"string","title":"Deck Id"},"token":{"type":"string","title":"Token"},"url":{"type":"string","title":"Url"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"}},"additionalProperties":false,"type":"object","required":["share_id","deck_id","token","url"],"title":"ShareLinkResponse","description":"Returned exactly once at creation; raw token never re-emitted."},"SheetAnalysis":{"properties":{"sheet_name":{"type":"string","title":"Sheet Name"},"row_count":{"type":"integer","title":"Row Count","default":0},"recommended":{"type":"boolean","title":"Recommended","default":true},"mapping":{"additionalProperties":{"$ref":"#/components/schemas/ColumnMapping"},"type":"object","title":"Mapping"},"headers":{"items":{"type":"string"},"type":"array","title":"Headers","description":"All column headers parsed from this sheet (for the column picker)."},"data_start_row":{"type":"integer","title":"Data Start Row","description":"1-based row where data begins.","default":2},"exclude_rows":{"items":{"type":"integer"},"type":"array","title":"Exclude Rows"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"Warnings such as unresolved formula cells."},"sample_rows":{"items":{"items":{},"type":"array"},"type":"array","title":"Sample Rows"}},"type":"object","required":["sheet_name"],"title":"SheetAnalysis","description":"Per-sheet analysis returned by the AI."},"SheetMappingConfirmation":{"properties":{"sheet_name":{"type":"string","title":"Sheet Name"},"mapping":{"additionalProperties":{"type":"integer"},"type":"object","title":"Mapping","description":"Map of standard field name → 0-based column index."},"data_start_row":{"type":"integer","title":"Data Start Row","default":2},"exclude_rows":{"items":{"type":"integer"},"type":"array","title":"Exclude Rows"}},"type":"object","required":["sheet_name","mapping"],"title":"SheetMappingConfirmation","description":"User-confirmed column mapping for a single sheet."},"ShipmentCreateRequest":{"properties":{"fees":{"anyOf":[{"items":{"$ref":"#/components/schemas/Fee"},"type":"array"},{"type":"null"}],"title":"Fees","description":"Shipment-specific fees."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Shipment status.","default":"draft"},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/LineItem"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Items included in this shipment."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Shipment notes."},"tracking_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Number","description":"Carrier tracking number."},"expected_arrival_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Arrival Date","description":"Expected delivery date."},"shipped_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Shipped Date","description":"Date shipped."},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id","description":"Destination location ID (where the shipment is being shipped to)."}},"type":"object","title":"ShipmentCreateRequest","description":"Request schema for creating a shipment.\n\nShipments track delivery of inventory order items.\n\n**Shipment Statuses:**\n- `pending`: Being prepared\n- `shipped`: In transit\n- `received`: Received at destination\n- `canceled`: Cancelled","example":{"expected_arrival_date":"2024-01-20T00:00:00Z","line_items":[{"quantity":50,"variant_id":"019ab37c-var1-7000-8000-000000000001"}],"location_id":"019ab37c-loc1-7000-8000-000000000001","shipped_date":"2024-01-16T00:00:00Z","status":"shipped","tracking_number":"1Z999AA10123456784"}},"ShipmentListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ShipmentResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"ShipmentListResponse","description":"Paginated list of shipments."},"ShipmentResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Shipment UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"status":{"type":"string","title":"Status","description":"Shipment status."},"fees":{"items":{"$ref":"#/components/schemas/Fee"},"type":"array","title":"Fees","description":"Shipment fees."},"line_items":{"items":{},"type":"array","title":"Line Items","description":"Items in shipment."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Notes."},"tracking_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Number","description":"Tracking number."},"expected_arrival_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Arrival Date","description":"Expected delivery."},"shipped_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Shipped Date","description":"Ship date."},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id","description":"Destination location ID."},"location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Name","description":"Destination location name."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Created timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Updated timestamp."},"version":{"type":"integer","title":"Version","description":"Version for optimistic locking.","default":1}},"additionalProperties":true,"type":"object","required":["id","business_id","status","fees","line_items","created_at","updated_at"],"title":"ShipmentResponse","description":"Response schema for a shipment.","example":{"business_id":"019ab37c-bus1-7000-8000-000000000001","created_at":"2024-01-15T10:30:00Z","expected_arrival_date":"2024-01-20T00:00:00Z","fees":[],"id":"019ab37c-ship-7000-8000-000000000001","line_items":[],"shipped_date":"2024-01-16T00:00:00Z","status":"shipped","tracking_number":"1Z999AA10123456784","updated_at":"2024-01-16T09:00:00Z","version":2}},"ShipmentUpdateRequest":{"properties":{"fees":{"anyOf":[{"items":{"$ref":"#/components/schemas/Fee"},"type":"array"},{"type":"null"}],"title":"Fees","description":"Updated fees."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Updated status."},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/LineItem"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Updated items."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Updated notes."},"tracking_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Number","description":"Updated tracking."},"expected_arrival_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Arrival Date","description":"Updated arrival date."},"shipped_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Shipped Date","description":"Updated ship date."},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id","description":"Updated destination location."},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version","description":"Version for optimistic locking."}},"type":"object","title":"ShipmentUpdateRequest","description":"Request schema for updating a shipment.\n\nAll fields are optional - only include fields to change.","example":{"description":"Received in warehouse","status":"delivered"}},"SignOffRequest":{"properties":{"role":{"type":"string","maxLength":40,"minLength":1,"title":"Role","description":"Role of the reviewer signing off (preparer, reviewer, controller, partner)."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional reviewer notes captured at sign-off."}},"type":"object","required":["role"],"title":"SignOffRequest"},"SkipOccurrenceResponse":{"properties":{"template_id":{"type":"string","title":"Template Id"},"skipped_date":{"type":"string","format":"date","title":"Skipped Date"},"next_occurrence":{"type":"string","format":"date","title":"Next Occurrence"},"message":{"type":"string","title":"Message"}},"type":"object","required":["template_id","skipped_date","next_occurrence","message"],"title":"SkipOccurrenceResponse","description":"Response for skipping an occurrence.","example":{"message":"Skipped occurrence on 2026-02-01. Next occurrence: 2026-03-01","next_occurrence":"2026-03-01","skipped_date":"2026-02-01","template_id":"template-uuid"}},"SkuForecastDetailResponse":{"properties":{"variant_id":{"type":"string","title":"Variant Id"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"forecast":{"anyOf":[{"$ref":"#/components/schemas/SkuForecastItem"},{"type":"null"}]},"history":{"items":{"$ref":"#/components/schemas/WeeklyDemandPoint"},"type":"array","title":"History"}},"type":"object","required":["variant_id"],"title":"SkuForecastDetailResponse"},"SkuForecastItem":{"properties":{"variant_id":{"type":"string","title":"Variant Id"},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"method":{"type":"string","title":"Method"},"demand_class":{"type":"string","title":"Demand Class"},"horizon_weeks":{"type":"integer","title":"Horizon Weeks"},"weekly_forecast":{"items":{"type":"number"},"type":"array","title":"Weekly Forecast"},"avg_weekly_demand":{"type":"number","title":"Avg Weekly Demand","default":0.0},"sigma_weekly":{"type":"number","title":"Sigma Weekly","default":0.0},"service_level":{"type":"number","title":"Service Level","default":0.0},"lead_time_days":{"type":"integer","title":"Lead Time Days","default":14},"safety_stock":{"type":"number","title":"Safety Stock","default":0.0},"forecast_reorder_point":{"type":"number","title":"Forecast Reorder Point","default":0.0},"order_up_to":{"type":"number","title":"Order Up To","default":0.0},"accuracy_mape":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy Mape"},"accuracy_bias":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy Bias"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"}},"type":"object","required":["variant_id","method","demand_class","horizon_weeks"],"title":"SkuForecastItem"},"SkuForecastListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SkuForecastItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total","default":0}},"type":"object","title":"SkuForecastListResponse"},"SlackCategoryItem":{"properties":{"key":{"type":"string","title":"Key","description":"Stable category key"},"label":{"type":"string","title":"Label","description":"User-facing label"},"description":{"type":"string","title":"Description","description":"One-line explanation"},"group":{"type":"string","title":"Group","description":"Group key used to render the UI in sections"},"enabled":{"type":"boolean","title":"Enabled","description":"Whether the user has this category enabled"}},"type":"object","required":["key","label","description","group","enabled"],"title":"SlackCategoryItem","description":"One toggleable notification category in a Slack integration status."},"SlackDisconnectResult":{"properties":{"status":{"type":"string","title":"Status","description":"\"ok\" on success"},"message":{"type":"string","title":"Message","description":"Human-readable status message"}},"type":"object","required":["status","message"],"title":"SlackDisconnectResult","description":"Result of removing a configured Slack webhook."},"SlackGroupInfo":{"properties":{"key":{"type":"string","title":"Key","description":"Group key (matches SlackCategoryItem.group)"},"label":{"type":"string","title":"Label","description":"User-facing section label"}},"type":"object","required":["key","label"],"title":"SlackGroupInfo","description":"Render metadata for a category group."},"SlackIntegrationStatus":{"properties":{"connected":{"type":"boolean","title":"Connected","description":"Whether at least one webhook URL is configured"},"webhooks":{"items":{"$ref":"#/components/schemas/SlackWebhookItem"},"type":"array","title":"Webhooks","description":"List of configured webhooks"},"groups":{"items":{"$ref":"#/components/schemas/SlackGroupInfo"},"type":"array","title":"Groups","description":"Group definitions for UI section rendering"}},"type":"object","required":["connected"],"title":"SlackIntegrationStatus","description":"Status of a business- or firm-level Slack incoming-webhook integration."},"SlackPreferencesUpdateRequest":{"properties":{"preferences":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Preferences","description":"Map of category key to enabled flag, e.g. {'workflow_completions': false}. Unknown keys are silently ignored."}},"type":"object","required":["preferences"],"title":"SlackPreferencesUpdateRequest","description":"Toggle which notification categories deliver to Slack."},"SlackTestSendResult":{"properties":{"status":{"type":"string","title":"Status","description":"\"ok\" on success"},"message":{"type":"string","title":"Message","description":"Human-readable status message"}},"type":"object","required":["status","message"],"title":"SlackTestSendResult","description":"Result of sending a test notification to Slack."},"SlackWebhookItem":{"properties":{"id":{"type":"string","title":"Id","description":"Webhook ID"},"channel_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Name","description":"User-defined channel or webhook name"},"webhook_url_masked":{"type":"string","title":"Webhook Url Masked","description":"Masked URL for display"},"notification_preferences":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Notification Preferences","description":"Per-category enabled flags"},"notification_categories":{"items":{"$ref":"#/components/schemas/SlackCategoryItem"},"type":"array","title":"Notification Categories","description":"Categories with metadata for UI rendering"}},"type":"object","required":["id","webhook_url_masked","notification_preferences","notification_categories"],"title":"SlackWebhookItem","description":"A configured Slack webhook."},"SlackWebhookSaveRequest":{"properties":{"slack_webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Webhook Url","description":"Slack Incoming Webhook URL, or empty/null to disconnect"},"channel_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Name","description":"Optional name for the channel or webhook"},"preferences":{"anyOf":[{"additionalProperties":{"type":"boolean"},"type":"object"},{"type":"null"}],"title":"Preferences","description":"Optional per-category enabled flags for the new webhook. Omitted categories default to enabled."}},"type":"object","title":"SlackWebhookSaveRequest","description":"Save (or clear) a Slack Incoming Webhook URL.\n\nSend ``slack_webhook_url`` as an empty string or ``null`` to disconnect."},"SlideClaim":{"properties":{"text":{"type":"string","maxLength":600,"title":"Text"},"citations":{"items":{"$ref":"#/components/schemas/SlideSourceRef"},"type":"array","maxItems":6,"title":"Citations"}},"additionalProperties":false,"type":"object","required":["text"],"title":"SlideClaim","description":"A grounded paragraph/bullet rendered in the slide commentary block."},"SlideCommentary":{"properties":{"headline":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Headline"},"claims":{"items":{"$ref":"#/components/schemas/SlideClaim"},"type":"array","maxItems":8,"title":"Claims"},"recommendation":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}],"title":"Recommendation"},"trace_id":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Trace Id"}},"additionalProperties":false,"type":"object","title":"SlideCommentary","description":"AI commentary block attached to a slide."},"SlideSourceRef":{"properties":{"source":{"type":"string","title":"Source","description":"Underlying section, e.g. 'ar_aging'."},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path","description":"Optional dotted JSON path inside ``slide.data``, e.g. 'buckets.over_90.amount_cents'."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Human-readable badge label."}},"additionalProperties":false,"type":"object","required":["source"],"title":"SlideSourceRef","description":"A pointer back to the slide data that supports an AI claim.\n\nMirrors the looser :class:`app.ai.contracts.SourceRef` but constrained to\nreferences inside a single slide so the public/share viewer can render\ncitation badges without exposing internal lookup keys."},"SnoozeRequest":{"properties":{"until":{"type":"string","format":"date-time","title":"Until","description":"When to wake the notification"}},"type":"object","required":["until"],"title":"SnoozeRequest","description":"Snooze a notification until a specific timestamp."},"SpendHistoryBreakdown":{"properties":{"counterparty_key":{"type":"string","title":"Counterparty Key"},"cents":{"type":"integer","title":"Cents"}},"type":"object","required":["counterparty_key","cents"],"title":"SpendHistoryBreakdown"},"SpendHistoryMonth":{"properties":{"month":{"type":"string","title":"Month","description":"YYYY-MM"},"total_cents":{"type":"integer","title":"Total Cents"},"breakdown":{"items":{"$ref":"#/components/schemas/SpendHistoryBreakdown"},"type":"array","title":"Breakdown"}},"type":"object","required":["month","total_cents","breakdown"],"title":"SpendHistoryMonth"},"SpendHistoryResponse":{"properties":{"months":{"items":{"$ref":"#/components/schemas/SpendHistoryMonth"},"type":"array","title":"Months"},"lookback_days":{"type":"integer","title":"Lookback Days"}},"type":"object","required":["months","lookback_days"],"title":"SpendHistoryResponse"},"StaffAssignmentListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/app__api__v1__schemas__firm_team__StaffAssignmentResponse"},"type":"array","title":"Items"}},"additionalProperties":true,"type":"object","required":["items"],"title":"StaffAssignmentListResponse","description":"List of staff business assignments."},"StandupActionButton":{"properties":{"label":{"type":"string","title":"Label"},"method":{"$ref":"#/components/schemas/JsonValue"},"endpoint":{"type":"string","title":"Endpoint"},"body":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Body"}},"additionalProperties":true,"type":"object","required":["label","method","endpoint"],"title":"StandupActionButton","description":"Frontend type ``StandupActionButton``."},"StandupActionCard":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"$ref":"#/components/schemas/JsonValue"},"severity":{"anyOf":[{"$ref":"#/components/schemas/JsonValue"},{"type":"null"}]},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"primary_action":{"$ref":"#/components/schemas/StandupActionButton"},"secondary_action":{"anyOf":[{"$ref":"#/components/schemas/StandupActionButton"},{"type":"null"}]}},"additionalProperties":true,"type":"object","required":["id","kind","title","description","primary_action"],"title":"StandupActionCard","description":"Frontend type ``StandupActionCard``."},"StandupHighlight":{"properties":{"label":{"type":"string","title":"Label"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"tone":{"$ref":"#/components/schemas/JsonValue"},"delta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Delta"}},"additionalProperties":true,"type":"object","required":["label","tone"],"title":"StandupHighlight","description":"Frontend type ``StandupHighlight``."},"StartCountRequest":{"properties":{"location_id":{"type":"string","title":"Location Id","description":"Location to count."},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","required":["location_id"],"title":"StartCountRequest"},"StartCountResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"count_number":{"type":"string","title":"Count Number"},"location_id":{"type":"string","title":"Location Id"},"status":{"type":"string","title":"Status"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"posted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Posted At"},"counted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counted By User Id"},"posted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted By User Id"},"variance_line_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Variance Line Count"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"lines":{"items":{"$ref":"#/components/schemas/CycleCountLineResponse"},"type":"array","title":"Lines","default":[]}},"additionalProperties":true,"type":"object","required":["id","business_id","count_number","location_id","status"],"title":"StartCountResponse","description":"Response for ``start_count``."},"StartImportResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"business_id":{"type":"string","title":"Business Id"},"status":{"type":"string","title":"Status"},"executor":{"type":"string","title":"Executor"}},"additionalProperties":true,"type":"object","required":["workflow_id","business_id","status","executor"],"title":"StartImportResponse","description":"Response for ``start_import`` — Temporal workflow kickoff."},"StartReconciliationProcessingResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},"additionalProperties":true,"type":"object","title":"StartReconciliationProcessingResponse","description":"Start reconciliation processing."},"StatementAging":{"properties":{"current":{"type":"integer","title":"Current","default":0},"days_1_30":{"type":"integer","title":"Days 1 30","default":0},"days_31_60":{"type":"integer","title":"Days 31 60","default":0},"days_61_90":{"type":"integer","title":"Days 61 90","default":0},"days_91_plus":{"type":"integer","title":"Days 91 Plus","default":0},"total":{"type":"integer","title":"Total","default":0}},"type":"object","title":"StatementAging","description":"Outstanding balance bucketed by days past due, as of the statement date."},"StatementLine":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"type":{"type":"string","title":"Type","description":"invoice, payment, or credit."},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference","description":"Invoice or credit memo number."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"charges":{"type":"integer","title":"Charges","description":"Amount added to the balance, in cents.","default":0},"payments":{"type":"integer","title":"Payments","description":"Amount reducing the balance, in cents.","default":0},"balance":{"type":"integer","title":"Balance","description":"Running balance after this line, in cents."}},"type":"object","required":["date","type","balance"],"title":"StatementLine","description":"A single activity line on a statement."},"StatementTxn":{"properties":{"id":{"type":"string","title":"Id"},"date":{"type":"string","title":"Date"},"description":{"type":"string","title":"Description"},"amount":{"type":"integer","title":"Amount"}},"additionalProperties":true,"type":"object","required":["id","date","description","amount"],"title":"StatementTxn","description":"Bank statement transaction row."},"StripePayoutBankTransactionSummary":{"properties":{"id":{"type":"string","title":"Id","description":"Bank transaction UUID."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Transaction memo/description."},"datetime":{"type":"string","format":"date","title":"Datetime","description":"The date the deposit occurred."},"amount":{"type":"integer","title":"Amount","description":"Deposit amount in cents (positive)."}},"type":"object","required":["id","datetime","amount"],"title":"StripePayoutBankTransactionSummary","description":"Lightweight bank deposit linked to a Stripe payout."},"StripePayoutInvoiceBreakdownItem":{"properties":{"label":{"type":"string","title":"Label","description":"Customer or invoice label from Stripe."},"amount_cents":{"type":"integer","title":"Amount Cents","description":"Charge amount in cents."},"stripe_charge_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Charge Id","description":"Stripe charge ID (ch_…), when available."},"dayzero_invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dayzero Invoice Id","description":"Matched DayZero invoice UUID, when resolved."},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number","description":"Invoice number from metadata or charge description."}},"type":"object","required":["label","amount_cents"],"title":"StripePayoutInvoiceBreakdownItem","description":"One settled charge row included in a Stripe payout."},"StripePayoutSummary":{"properties":{"stripe_payout_id":{"type":"string","title":"Stripe Payout Id","description":"Stripe payout ID (e.g. po_…)."},"status":{"type":"string","title":"Status","description":"Stripe payout status (e.g. paid, pending)."},"amount_cents":{"type":"integer","title":"Amount Cents","description":"Net payout amount deposited in cents."},"gross_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gross Amount Cents","description":"Gross charge total in cents before Stripe fees, when computed."},"fee_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fee Amount Cents","description":"Total Stripe fees in cents from balance transactions, when computed."},"stripe_dashboard_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Dashboard Url","description":"Stripe Dashboard URL for this payout, when account context is known."},"payment_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Summary","description":"Human-readable customer/invoice breakdown from balance transactions."},"invoice_breakdown":{"anyOf":[{"items":{"$ref":"#/components/schemas/StripePayoutInvoiceBreakdownItem"},"type":"array"},{"type":"null"}],"title":"Invoice Breakdown","description":"Structured per-charge invoice rows for expandable payout UI."},"arrival_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Arrival Date","description":"Expected bank arrival date from Stripe."},"bank_deposit_match_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Deposit Match Id","description":"Matched Plaid bank deposit transaction id, if linked."},"journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Id","description":"Payout journal entry UUID, if created."},"is_matched":{"type":"boolean","title":"Is Matched","description":"True when bank_deposit_match_id is set.","default":false},"bank_transaction":{"anyOf":[{"$ref":"#/components/schemas/StripePayoutBankTransactionSummary"},{"type":"null"}],"description":"Matched bank deposit summary when linked."}},"type":"object","required":["stripe_payout_id","status","amount_cents"],"title":"StripePayoutSummary","description":"Stripe payout metadata for reconciliation audit trails."},"StripeSettlementInfo":{"properties":{"payout":{"$ref":"#/components/schemas/StripePayoutSummary","description":"Stripe payout that settled this invoice's card payment."}},"type":"object","required":["payout"],"title":"StripeSettlementInfo","description":"Stripe settlement chain for a stripe_paid invoice (payout → bank deposit)."},"SubledgerGlReconciliationResponse":{"properties":{"generated_at":{"type":"string","format":"date-time","title":"Generated At","description":"Timestamp when reconciliation was computed."},"ar":{"$ref":"#/components/schemas/SubledgerGlSectionResponse","description":"Accounts receivable sub-ledger vs AR control account."},"ap":{"$ref":"#/components/schemas/SubledgerGlSectionResponse","description":"Accounts payable sub-ledger vs AP control account."}},"type":"object","required":["generated_at","ar","ap"],"title":"SubledgerGlReconciliationResponse","description":"AR/AP sub-ledger to GL control-account reconciliation snapshot."},"SubledgerGlSectionResponse":{"properties":{"subledger_open_balance_cents":{"type":"integer","title":"Subledger Open Balance Cents","description":"Open-balance total from the sub-ledger in cents."},"gl_control_balance_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gl Control Balance Cents","description":"Control-account balance from the GL in cents (normalized to natural sign)."},"difference_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Difference Cents","description":"Sub-ledger minus GL control balance in cents."},"is_reconciled":{"type":"boolean","title":"Is Reconciled","description":"True when sub-ledger and GL balances match exactly."},"control_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Control Ledger Id","description":"Control ledger UUID when one is configured."},"control_ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Control Ledger Name","description":"Control ledger display name when one is configured."},"control_ledger_system_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Control Ledger System Key","description":"Control ledger system key (for example, accounts_receivable)."},"control_ledger_normal_balance":{"anyOf":[{"type":"string","enum":["debit","credit"]},{"type":"null"}],"title":"Control Ledger Normal Balance","description":"Normal-balance side for the control ledger."}},"type":"object","required":["subledger_open_balance_cents","is_reconciled"],"title":"SubledgerGlSectionResponse","description":"One side of sub-ledger versus GL control-account reconciliation."},"SubmitCountLineRequest":{"properties":{"counted_quantity":{"type":"number","minimum":0.0,"title":"Counted Quantity","description":"Counter-recorded quantity."},"reason":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Reason"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes"}},"type":"object","required":["counted_quantity"],"title":"SubmitCountLineRequest"},"SubmitCountLineResponse":{"properties":{"id":{"type":"string","title":"Id"},"count_id":{"type":"string","title":"Count Id"},"variant_id":{"type":"string","title":"Variant Id"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"barcode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Barcode"},"expected_quantity":{"type":"number","title":"Expected Quantity","default":0},"counted_quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Counted Quantity"},"variance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Variance"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"adjustment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Adjustment Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"additionalProperties":true,"type":"object","required":["id","count_id","variant_id"],"title":"SubmitCountLineResponse","description":"Response for ``submit_count_line``."},"SubscriptionInsightItem":{"properties":{"subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Id","description":"Subscription ID"},"type":{"type":"string","title":"Type","description":"duplicate, price_increase, optimization, or unused"},"title":{"type":"string","title":"Title","description":"Short headline"},"description":{"type":"string","title":"Description","description":"Explanation"},"potential_savings":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Potential Savings","description":"Potential savings in cents"}},"type":"object","required":["type","title","description"],"title":"SubscriptionInsightItem"},"SubscriptionSummaryResponse":{"properties":{"total_monthly_cents":{"type":"integer","title":"Total Monthly Cents"},"monthly_limit_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Limit Cents"},"over_limit":{"type":"boolean","title":"Over Limit","default":false},"subscription_count":{"type":"integer","title":"Subscription Count"},"top_subscriptions":{"items":{"$ref":"#/components/schemas/DetectedSubscriptionResponse"},"type":"array","title":"Top Subscriptions"}},"type":"object","required":["total_monthly_cents","subscription_count","top_subscriptions"],"title":"SubscriptionSummaryResponse"},"SuccessEnvelope_AIDiscoverResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AIDiscoverResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AIDiscoverResponse]"},"SuccessEnvelope_AIRecommendResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AIRecommendResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AIRecommendResponse]"},"SuccessEnvelope_APITokenCreateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/APITokenCreateResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[APITokenCreateResponse]"},"SuccessEnvelope_APITokenListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/APITokenListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[APITokenListResponse]"},"SuccessEnvelope_APITokenRevokeResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/APITokenRevokeResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[APITokenRevokeResponse]"},"SuccessEnvelope_APInventoryListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/APInventoryListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[APInventoryListResponse]"},"SuccessEnvelope_AcceptInvitationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AcceptInvitationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AcceptInvitationResponse]"},"SuccessEnvelope_AccessibleBusinessListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AccessibleBusinessListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AccessibleBusinessListResponse]"},"SuccessEnvelope_AccountingDimensionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AccountingDimensionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AccountingDimensionResponse]"},"SuccessEnvelope_AccountingDimensionsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AccountingDimensionsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AccountingDimensionsListResponse]"},"SuccessEnvelope_AccountingPeriodResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AccountingPeriodResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AccountingPeriodResponse]"},"SuccessEnvelope_AccountingPeriodsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AccountingPeriodsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AccountingPeriodsListResponse]"},"SuccessEnvelope_AddCountLineResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AddCountLineResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AddCountLineResponse]"},"SuccessEnvelope_AddTeamBusinessResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AddTeamBusinessResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AddTeamBusinessResponse]"},"SuccessEnvelope_AddTeamMemberResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AddTeamMemberResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AddTeamMemberResponse]"},"SuccessEnvelope_AddToInvoiceResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AddToInvoiceResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AddToInvoiceResponse]"},"SuccessEnvelope_AddUserToBusinessResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AddUserToBusinessResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AddUserToBusinessResponse]"},"SuccessEnvelope_AdjustmentReasonsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AdjustmentReasonsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AdjustmentReasonsResponse]"},"SuccessEnvelope_AdvisoryFirmListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AdvisoryFirmListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AdvisoryFirmListResponse]"},"SuccessEnvelope_AdvisoryFirmResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AdvisoryFirmResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AdvisoryFirmResponse]"},"SuccessEnvelope_AgingResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AgingResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AgingResponse]"},"SuccessEnvelope_AnalyticsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AnalyticsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AnalyticsResponse]"},"SuccessEnvelope_AnalyzeBalanceSheetResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AnalyzeBalanceSheetResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AnalyzeBalanceSheetResponse]"},"SuccessEnvelope_AnalyzeCashFlowResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AnalyzeCashFlowResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AnalyzeCashFlowResponse]"},"SuccessEnvelope_AnalyzeContractsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AnalyzeContractsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AnalyzeContractsResponse]"},"SuccessEnvelope_AnalyzeIncomeStatementResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AnalyzeIncomeStatementResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AnalyzeIncomeStatementResponse]"},"SuccessEnvelope_AnalyzePaymentBehaviorResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AnalyzePaymentBehaviorResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AnalyzePaymentBehaviorResponse]"},"SuccessEnvelope_AnalyzeStatusResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AnalyzeStatusResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AnalyzeStatusResponse]"},"SuccessEnvelope_AnalyzeSubscriptionsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AnalyzeSubscriptionsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AnalyzeSubscriptionsResponse]"},"SuccessEnvelope_AnalyzeTaskResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AnalyzeTaskResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AnalyzeTaskResponse]"},"SuccessEnvelope_Annotated_Union_CoverSlide__ExecSummarySlide__PnlSummarySlide__ArAgingSlide__CashPositionSlide__InventoryCogsSlide__CustomerConcentrationSlide__AsksSlide__CustomSlideSpec___FieldInfo_annotation_NoneType__required_True__discriminator__slide_type____":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/CoverSlide"},{"$ref":"#/components/schemas/ExecSummarySlide"},{"$ref":"#/components/schemas/PnlSummarySlide"},{"$ref":"#/components/schemas/ArAgingSlide"},{"$ref":"#/components/schemas/CashPositionSlide"},{"$ref":"#/components/schemas/InventoryCogsSlide"},{"$ref":"#/components/schemas/CustomerConcentrationSlide"},{"$ref":"#/components/schemas/AsksSlide"},{"$ref":"#/components/schemas/CustomSlideSpec"}],"discriminator":{"propertyName":"slide_type","mapping":{"ar_aging":"#/components/schemas/ArAgingSlide","asks":"#/components/schemas/AsksSlide","cash_position":"#/components/schemas/CashPositionSlide","cover":"#/components/schemas/CoverSlide","custom":"#/components/schemas/CustomSlideSpec","customer_concentration":"#/components/schemas/CustomerConcentrationSlide","exec_summary":"#/components/schemas/ExecSummarySlide","inventory_cogs":"#/components/schemas/InventoryCogsSlide","pnl_summary":"#/components/schemas/PnlSummarySlide"}}},{"type":"null"}],"title":"Data"}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[Annotated[Union[CoverSlide, ExecSummarySlide, PnlSummarySlide, ArAgingSlide, CashPositionSlide, InventoryCogsSlide, CustomerConcentrationSlide, AsksSlide, CustomSlideSpec], FieldInfo(annotation=NoneType, required=True, discriminator='slide_type')]]"},"SuccessEnvelope_ApApprovalGetResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ApApprovalGetResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ApApprovalGetResponse]"},"SuccessEnvelope_ApApprovalProvisionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ApApprovalProvisionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ApApprovalProvisionResponse]"},"SuccessEnvelope_ApplyCoaResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ApplyCoaResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ApplyCoaResponse]"},"SuccessEnvelope_ApplyResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ApplyResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ApplyResponse]"},"SuccessEnvelope_ApprovalRiskResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ApprovalRiskResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ApprovalRiskResponse]"},"SuccessEnvelope_ApproveMatchResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ApproveMatchResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ApproveMatchResponse]"},"SuccessEnvelope_ApproversResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ApproversResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ApproversResponse]"},"SuccessEnvelope_AssetCategoryListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AssetCategoryListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AssetCategoryListResponse]"},"SuccessEnvelope_AssetCategoryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AssetCategoryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AssetCategoryResponse]"},"SuccessEnvelope_AssociatedUserCursorListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AssociatedUserCursorListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AssociatedUserCursorListResponse]"},"SuccessEnvelope_AttachmentResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AttachmentResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AttachmentResponse]"},"SuccessEnvelope_AttentionItem_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AttentionItem"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AttentionItem]"},"SuccessEnvelope_AttentionListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AttentionListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AttentionListResponse]"},"SuccessEnvelope_AttentionSummary_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AttentionSummary"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AttentionSummary]"},"SuccessEnvelope_AutoNumberingPreviewResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AutoNumberingPreviewResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AutoNumberingPreviewResponse]"},"SuccessEnvelope_AutoNumberingSettingsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/AutoNumberingSettingsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AutoNumberingSettingsResponse]"},"SuccessEnvelope_BankDepositResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BankDepositResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BankDepositResponse]"},"SuccessEnvelope_BankDepositsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BankDepositsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BankDepositsListResponse]"},"SuccessEnvelope_BatchApproveResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BatchApproveResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BatchApproveResponse]"},"SuccessEnvelope_BillAICreatePayloadResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BillAICreatePayloadResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BillAICreatePayloadResponse]"},"SuccessEnvelope_BillAgingResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BillAgingResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BillAgingResponse]"},"SuccessEnvelope_BillBatchPaymentResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BillBatchPaymentResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BillBatchPaymentResponse]"},"SuccessEnvelope_BillMetricsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BillMetricsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BillMetricsResponse]"},"SuccessEnvelope_BillPaymentResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BillPaymentResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BillPaymentResponse]"},"SuccessEnvelope_BillPaymentSuggestionRejectResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BillPaymentSuggestionRejectResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BillPaymentSuggestionRejectResponse]"},"SuccessEnvelope_BillPaymentSuggestionsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BillPaymentSuggestionsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BillPaymentSuggestionsListResponse]"},"SuccessEnvelope_BillResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BillResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BillResponse]"},"SuccessEnvelope_BillsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BillsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BillsListResponse]"},"SuccessEnvelope_BudgetDetailResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BudgetDetailResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BudgetDetailResponse]"},"SuccessEnvelope_BudgetLineListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BudgetLineListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BudgetLineListResponse]"},"SuccessEnvelope_BudgetLineResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BudgetLineResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BudgetLineResponse]"},"SuccessEnvelope_BudgetListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BudgetListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BudgetListResponse]"},"SuccessEnvelope_BudgetResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BudgetResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BudgetResponse]"},"SuccessEnvelope_BudgetVsActualResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BudgetVsActualResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BudgetVsActualResponse]"},"SuccessEnvelope_BulkApproveMatchesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkApproveMatchesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkApproveMatchesResponse]"},"SuccessEnvelope_BulkApproveSuggestionsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkApproveSuggestionsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkApproveSuggestionsResponse]"},"SuccessEnvelope_BulkDismissAllResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkDismissAllResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkDismissAllResponse]"},"SuccessEnvelope_BulkDismissByPeriodResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkDismissByPeriodResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkDismissByPeriodResponse]"},"SuccessEnvelope_BulkDismissTypeResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkDismissTypeResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkDismissTypeResponse]"},"SuccessEnvelope_BulkEntityTagAttachResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkEntityTagAttachResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkEntityTagAttachResponse]"},"SuccessEnvelope_BulkEntityTagDetachResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkEntityTagDetachResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkEntityTagDetachResponse]"},"SuccessEnvelope_BulkEntityTagsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkEntityTagsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkEntityTagsResponse]"},"SuccessEnvelope_BulkLockPeriodsResult_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkLockPeriodsResult"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkLockPeriodsResult]"},"SuccessEnvelope_BulkOpResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkOpResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkOpResponse]"},"SuccessEnvelope_BulkRejectMatchesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkRejectMatchesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkRejectMatchesResponse]"},"SuccessEnvelope_BulkSuggestedMatchesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkSuggestedMatchesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkSuggestedMatchesResponse]"},"SuccessEnvelope_BulkTransactionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkTransactionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkTransactionResponse]"},"SuccessEnvelope_BulkTransactionUploadPreviewResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkTransactionUploadPreviewResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkTransactionUploadPreviewResponse]"},"SuccessEnvelope_BulkTransactionUploadResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkTransactionUploadResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkTransactionUploadResponse]"},"SuccessEnvelope_BulkUploadHeadersResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkUploadHeadersResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkUploadHeadersResponse]"},"SuccessEnvelope_BusinessCursorListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BusinessCursorListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BusinessCursorListResponse]"},"SuccessEnvelope_BusinessFirmAssociationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BusinessFirmAssociationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BusinessFirmAssociationResponse]"},"SuccessEnvelope_BusinessResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BusinessResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BusinessResponse]"},"SuccessEnvelope_CancelCountResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CancelCountResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CancelCountResponse]"},"SuccessEnvelope_CashForecastOneTimeItemList_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CashForecastOneTimeItemList"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CashForecastOneTimeItemList]"},"SuccessEnvelope_CashForecastOneTimeItem_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CashForecastOneTimeItem"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CashForecastOneTimeItem]"},"SuccessEnvelope_CashForecastOverrideList_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CashForecastOverrideList"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CashForecastOverrideList]"},"SuccessEnvelope_CashForecastVersionApplyResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CashForecastVersionApplyResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CashForecastVersionApplyResponse]"},"SuccessEnvelope_CashForecastVersionDetail_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CashForecastVersionDetail"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CashForecastVersionDetail]"},"SuccessEnvelope_CashForecastVersionList_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CashForecastVersionList"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CashForecastVersionList]"},"SuccessEnvelope_CashReceiptDismissResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CashReceiptDismissResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CashReceiptDismissResponse]"},"SuccessEnvelope_CashReceiptsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CashReceiptsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CashReceiptsResponse]"},"SuccessEnvelope_CatalogItemResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CatalogItemResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CatalogItemResponse]"},"SuccessEnvelope_CatalogItemsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CatalogItemsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CatalogItemsListResponse]"},"SuccessEnvelope_CategorizationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CategorizationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CategorizationResponse]"},"SuccessEnvelope_CategorizeAllResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CategorizeAllResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CategorizeAllResponse]"},"SuccessEnvelope_CfoPortalAskResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CfoPortalAskResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CfoPortalAskResponse]"},"SuccessEnvelope_CfoPortalBoardMemoResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CfoPortalBoardMemoResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CfoPortalBoardMemoResponse]"},"SuccessEnvelope_CfoPortalSectionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CfoPortalSectionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CfoPortalSectionResponse]"},"SuccessEnvelope_ChangeFirmTierResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ChangeFirmTierResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ChangeFirmTierResponse]"},"SuccessEnvelope_ChangePlanResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ChangePlanResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ChangePlanResponse]"},"SuccessEnvelope_ClarificationCountResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ClarificationCountResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ClarificationCountResponse]"},"SuccessEnvelope_ClarificationListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ClarificationListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ClarificationListResponse]"},"SuccessEnvelope_ClarificationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ClarificationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ClarificationResponse]"},"SuccessEnvelope_ClearAttentionDismissalsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ClearAttentionDismissalsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ClearAttentionDismissalsResponse]"},"SuccessEnvelope_ClientBusinessAccessResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ClientBusinessAccessResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ClientBusinessAccessResponse]"},"SuccessEnvelope_CloseChecklistAckResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CloseChecklistAckResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CloseChecklistAckResponse]"},"SuccessEnvelope_CloseChecklistAcksListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CloseChecklistAcksListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CloseChecklistAcksListResponse]"},"SuccessEnvelope_CloseReadinessResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CloseReadinessResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CloseReadinessResponse]"},"SuccessEnvelope_CoaGenerateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CoaGenerateResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CoaGenerateResponse]"},"SuccessEnvelope_CompareBillAgainstContractResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CompareBillAgainstContractResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CompareBillAgainstContractResponse]"},"SuccessEnvelope_Contractor1099ReportResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/Contractor1099ReportResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[Contractor1099ReportResponse]"},"SuccessEnvelope_ContractorResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ContractorResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ContractorResponse]"},"SuccessEnvelope_ContractorsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ContractorsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ContractorsListResponse]"},"SuccessEnvelope_ConversationDetailResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ConversationDetailResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ConversationDetailResponse]"},"SuccessEnvelope_ConversationListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/app__api__v1__schemas__client_messages__ConversationListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ConversationListResponse]"},"SuccessEnvelope_ConvertProductToVariantResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ConvertProductToVariantResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ConvertProductToVariantResponse]"},"SuccessEnvelope_CostBreakdown_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CostBreakdown"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CostBreakdown]"},"SuccessEnvelope_CostHistoryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CostHistoryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CostHistoryResponse]"},"SuccessEnvelope_CounterpartyDefaultListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CounterpartyDefaultListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CounterpartyDefaultListResponse]"},"SuccessEnvelope_CounterpartyDefaultResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CounterpartyDefaultResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CounterpartyDefaultResponse]"},"SuccessEnvelope_CreateBatchInvoicesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CreateBatchInvoicesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreateBatchInvoicesResponse]"},"SuccessEnvelope_CreateCheckoutSessionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CreateCheckoutSessionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreateCheckoutSessionResponse]"},"SuccessEnvelope_CreateDraftReordersResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CreateDraftReordersResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreateDraftReordersResponse]"},"SuccessEnvelope_CreateNotesBulkResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CreateNotesBulkResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreateNotesBulkResponse]"},"SuccessEnvelope_CreatePeriodSignOffResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CreatePeriodSignOffResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreatePeriodSignOffResponse]"},"SuccessEnvelope_CreatePortalSessionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CreatePortalSessionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreatePortalSessionResponse]"},"SuccessEnvelope_CreateReconciliationWithUploadResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CreateReconciliationWithUploadResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreateReconciliationWithUploadResponse]"},"SuccessEnvelope_CreditMemoApplicationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CreditMemoApplicationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreditMemoApplicationResponse]"},"SuccessEnvelope_CreditMemoResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CreditMemoResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreditMemoResponse]"},"SuccessEnvelope_CreditMemosListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CreditMemosListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreditMemosListResponse]"},"SuccessEnvelope_CursorPaginatedResponse_DeckListItem__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CursorPaginatedResponse_DeckListItem_"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CursorPaginatedResponse[DeckListItem]]"},"SuccessEnvelope_CustomBucketResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CustomBucketResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CustomBucketResponse]"},"SuccessEnvelope_CustomBucketsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CustomBucketsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CustomBucketsListResponse]"},"SuccessEnvelope_CustomerAutoCategorizeResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CustomerAutoCategorizeResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CustomerAutoCategorizeResponse]"},"SuccessEnvelope_CustomerBulkUploadResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CustomerBulkUploadResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CustomerBulkUploadResponse]"},"SuccessEnvelope_CustomerCreditSummary_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CustomerCreditSummary"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CustomerCreditSummary]"},"SuccessEnvelope_CustomerListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CustomerListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CustomerListResponse]"},"SuccessEnvelope_CustomerPendingChargesSummary_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CustomerPendingChargesSummary"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CustomerPendingChargesSummary]"},"SuccessEnvelope_CustomerResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CustomerResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CustomerResponse]"},"SuccessEnvelope_CustomerStatementResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CustomerStatementResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CustomerStatementResponse]"},"SuccessEnvelope_DebtContractApproveResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DebtContractApproveResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DebtContractApproveResponse]"},"SuccessEnvelope_DebtPaymentResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DebtPaymentResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DebtPaymentResponse]"},"SuccessEnvelope_DeckShareList_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DeckShareList"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DeckShareList]"},"SuccessEnvelope_DeckSpec_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DeckSpec"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DeckSpec]"},"SuccessEnvelope_DelayedChargeResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DelayedChargeResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DelayedChargeResponse]"},"SuccessEnvelope_DelayedChargesListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DelayedChargesListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DelayedChargesListResponse]"},"SuccessEnvelope_DemandPlanScenarioResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DemandPlanScenarioResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DemandPlanScenarioResponse]"},"SuccessEnvelope_DepreciationEntryListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DepreciationEntryListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DepreciationEntryListResponse]"},"SuccessEnvelope_DepreciationPreviewResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DepreciationPreviewResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DepreciationPreviewResponse]"},"SuccessEnvelope_DepreciationScheduleResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DepreciationScheduleResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DepreciationScheduleResponse]"},"SuccessEnvelope_DimensionalPnLResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DimensionalPnLResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DimensionalPnLResponse]"},"SuccessEnvelope_DismissAnomalyResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DismissAnomalyResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DismissAnomalyResponse]"},"SuccessEnvelope_DismissSubscriptionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DismissSubscriptionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DismissSubscriptionResponse]"},"SuccessEnvelope_DismissSuggestedMatchResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DismissSuggestedMatchResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DismissSuggestedMatchResponse]"},"SuccessEnvelope_DisposalResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DisposalResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DisposalResponse]"},"SuccessEnvelope_DocumentDownloadResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DocumentDownloadResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DocumentDownloadResponse]"},"SuccessEnvelope_DocumentRequestCountResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DocumentRequestCountResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DocumentRequestCountResponse]"},"SuccessEnvelope_DocumentRequestListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DocumentRequestListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DocumentRequestListResponse]"},"SuccessEnvelope_DocumentRequestResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DocumentRequestResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DocumentRequestResponse]"},"SuccessEnvelope_DownloadReconciliationPdfResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DownloadReconciliationPdfResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DownloadReconciliationPdfResponse]"},"SuccessEnvelope_DuplicateCheckResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DuplicateCheckResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DuplicateCheckResponse]"},"SuccessEnvelope_EntityContactResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/EntityContactResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[EntityContactResponse]"},"SuccessEnvelope_EntityTagListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/EntityTagListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[EntityTagListResponse]"},"SuccessEnvelope_EntityTagResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/EntityTagResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[EntityTagResponse]"},"SuccessEnvelope_EstimateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/EstimateResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[EstimateResponse]"},"SuccessEnvelope_EstimatesListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/EstimatesListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[EstimatesListResponse]"},"SuccessEnvelope_ExpenseReportDetailResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ExpenseReportDetailResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ExpenseReportDetailResponse]"},"SuccessEnvelope_ExpenseReportsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ExpenseReportsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ExpenseReportsListResponse]"},"SuccessEnvelope_ExpiringLotsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ExpiringLotsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ExpiringLotsResponse]"},"SuccessEnvelope_ExplainMatchesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ExplainMatchesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ExplainMatchesResponse]"},"SuccessEnvelope_ExportDeckResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ExportDeckResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ExportDeckResponse]"},"SuccessEnvelope_FirmBusinessesCursorResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FirmBusinessesCursorResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FirmBusinessesCursorResponse]"},"SuccessEnvelope_FirmClientsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FirmClientsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FirmClientsListResponse]"},"SuccessEnvelope_FirmTemplateDeleteResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FirmTemplateDeleteResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FirmTemplateDeleteResponse]"},"SuccessEnvelope_FirmTemplateDeployResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FirmTemplateDeployResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FirmTemplateDeployResponse]"},"SuccessEnvelope_FirmTemplateDeploymentListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FirmTemplateDeploymentListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FirmTemplateDeploymentListResponse]"},"SuccessEnvelope_FirmTemplateListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FirmTemplateListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FirmTemplateListResponse]"},"SuccessEnvelope_FirmTemplateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FirmTemplateResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FirmTemplateResponse]"},"SuccessEnvelope_FirmUserApiAccessResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FirmUserApiAccessResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FirmUserApiAccessResponse]"},"SuccessEnvelope_FirmUsersListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FirmUsersListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FirmUsersListResponse]"},"SuccessEnvelope_FixedAssetListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FixedAssetListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FixedAssetListResponse]"},"SuccessEnvelope_FixedAssetResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FixedAssetResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FixedAssetResponse]"},"SuccessEnvelope_ForecastConfigResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ForecastConfigResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ForecastConfigResponse]"},"SuccessEnvelope_ForecastResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ForecastResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ForecastResponse]"},"SuccessEnvelope_FxRateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FxRateResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FxRateResponse]"},"SuccessEnvelope_FxRatesListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FxRatesListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FxRatesListResponse]"},"SuccessEnvelope_FxRevaluationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FxRevaluationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FxRevaluationResponse]"},"SuccessEnvelope_GenerateDeckResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GenerateDeckResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GenerateDeckResponse]"},"SuccessEnvelope_GenerateFirmReportResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GenerateFirmReportResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GenerateFirmReportResponse]"},"SuccessEnvelope_GenerateOrderPdfResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GenerateOrderPdfResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GenerateOrderPdfResponse]"},"SuccessEnvelope_GenericListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GenericListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GenericListResponse]"},"SuccessEnvelope_GetAiUsageDetailsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetAiUsageDetailsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetAiUsageDetailsResponse]"},"SuccessEnvelope_GetAiUsageResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetAiUsageResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetAiUsageResponse]"},"SuccessEnvelope_GetAnomalyDetailResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetAnomalyDetailResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetAnomalyDetailResponse]"},"SuccessEnvelope_GetAttachmentDownloadUrlResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetAttachmentDownloadUrlResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetAttachmentDownloadUrlResponse]"},"SuccessEnvelope_GetAttachmentUploadUrlResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetAttachmentUploadUrlResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetAttachmentUploadUrlResponse]"},"SuccessEnvelope_GetBalanceSheetResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetBalanceSheetResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetBalanceSheetResponse]"},"SuccessEnvelope_GetBalanceValidationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetBalanceValidationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetBalanceValidationResponse]"},"SuccessEnvelope_GetBillingCatalogResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetBillingCatalogResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetBillingCatalogResponse]"},"SuccessEnvelope_GetBillingStatusResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetBillingStatusResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetBillingStatusResponse]"},"SuccessEnvelope_GetBooksStandupResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetBooksStandupResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetBooksStandupResponse]"},"SuccessEnvelope_GetCashFlowOutflowBreakdownResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetCashFlowOutflowBreakdownResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetCashFlowOutflowBreakdownResponse]"},"SuccessEnvelope_GetCashFlowStatementResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetCashFlowStatementResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetCashFlowStatementResponse]"},"SuccessEnvelope_GetCashFlowStatementsPeriodicResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetCashFlowStatementsPeriodicResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetCashFlowStatementsPeriodicResponse]"},"SuccessEnvelope_GetCloseScoreResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetCloseScoreResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetCloseScoreResponse]"},"SuccessEnvelope_GetConsolidatedBalanceSheetResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetConsolidatedBalanceSheetResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetConsolidatedBalanceSheetResponse]"},"SuccessEnvelope_GetConsolidatedPnlResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetConsolidatedPnlResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetConsolidatedPnlResponse]"},"SuccessEnvelope_GetCountResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetCountResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetCountResponse]"},"SuccessEnvelope_GetCoverageReportResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetCoverageReportResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetCoverageReportResponse]"},"SuccessEnvelope_GetDailyBriefResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetDailyBriefResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetDailyBriefResponse]"},"SuccessEnvelope_GetFirmAIInsightsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetFirmAIInsightsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetFirmAIInsightsResponse]"},"SuccessEnvelope_GetFirmApSummaryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetFirmApSummaryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetFirmApSummaryResponse]"},"SuccessEnvelope_GetFirmClientUsageResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetFirmClientUsageResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetFirmClientUsageResponse]"},"SuccessEnvelope_GetFirmLogoResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetFirmLogoResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetFirmLogoResponse]"},"SuccessEnvelope_GetGrandfatheredSummaryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetGrandfatheredSummaryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetGrandfatheredSummaryResponse]"},"SuccessEnvelope_GetIncomeStatementFlatResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetIncomeStatementFlatResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetIncomeStatementFlatResponse]"},"SuccessEnvelope_GetIncomeStatementResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetIncomeStatementResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetIncomeStatementResponse]"},"SuccessEnvelope_GetInvoiceHistoryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetInvoiceHistoryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetInvoiceHistoryResponse]"},"SuccessEnvelope_GetInvoicePdfUrlResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetInvoicePdfUrlResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetInvoicePdfUrlResponse]"},"SuccessEnvelope_GetLedgerStatementResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetLedgerStatementResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetLedgerStatementResponse]"},"SuccessEnvelope_GetLedgerVendorBreakdownResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetLedgerVendorBreakdownResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetLedgerVendorBreakdownResponse]"},"SuccessEnvelope_GetLedgerVendorPeriodMatrixResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetLedgerVendorPeriodMatrixResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetLedgerVendorPeriodMatrixResponse]"},"SuccessEnvelope_GetLedgerVendorTransactionsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetLedgerVendorTransactionsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetLedgerVendorTransactionsResponse]"},"SuccessEnvelope_GetLocationInventoryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetLocationInventoryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetLocationInventoryResponse]"},"SuccessEnvelope_GetMigrationReportResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetMigrationReportResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetMigrationReportResponse]"},"SuccessEnvelope_GetOrderPdfsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetOrderPdfsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetOrderPdfsResponse]"},"SuccessEnvelope_GetPaymentRecommendationsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetPaymentRecommendationsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetPaymentRecommendationsResponse]"},"SuccessEnvelope_GetPricingConfigResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetPricingConfigResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetPricingConfigResponse]"},"SuccessEnvelope_GetProfileResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetProfileResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetProfileResponse]"},"SuccessEnvelope_GetReconciliationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetReconciliationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetReconciliationResponse]"},"SuccessEnvelope_GetScoreHistoryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetScoreHistoryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetScoreHistoryResponse]"},"SuccessEnvelope_GetSettingsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetSettingsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetSettingsResponse]"},"SuccessEnvelope_GetTransactionAllocationsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetTransactionAllocationsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetTransactionAllocationsResponse]"},"SuccessEnvelope_GetTransferSummaryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetTransferSummaryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetTransferSummaryResponse]"},"SuccessEnvelope_GetUserRoleInBusinessResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/GetUserRoleInBusinessResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetUserRoleInBusinessResponse]"},"SuccessEnvelope_IntentResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/IntentResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[IntentResponse]"},"SuccessEnvelope_InventoryActivityResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InventoryActivityResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InventoryActivityResponse]"},"SuccessEnvelope_InventoryAdjustmentResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InventoryAdjustmentResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InventoryAdjustmentResponse]"},"SuccessEnvelope_InvitationListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InvitationListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InvitationListResponse]"},"SuccessEnvelope_InvitationPreviewResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InvitationPreviewResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InvitationPreviewResponse]"},"SuccessEnvelope_InviteClientResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InviteClientResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InviteClientResponse]"},"SuccessEnvelope_InviteStaffResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InviteStaffResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InviteStaffResponse]"},"SuccessEnvelope_InvoiceAICreatePayloadResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InvoiceAICreatePayloadResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InvoiceAICreatePayloadResponse]"},"SuccessEnvelope_InvoiceAgingResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InvoiceAgingResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InvoiceAgingResponse]"},"SuccessEnvelope_InvoiceCollectionsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InvoiceCollectionsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InvoiceCollectionsResponse]"},"SuccessEnvelope_InvoiceListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InvoiceListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InvoiceListResponse]"},"SuccessEnvelope_InvoiceMetricsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InvoiceMetricsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InvoiceMetricsResponse]"},"SuccessEnvelope_InvoicePaymentLinkResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InvoicePaymentLinkResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InvoicePaymentLinkResponse]"},"SuccessEnvelope_InvoicePaymentResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/app__api__v1__schemas__invoices__invoice__InvoicePaymentResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InvoicePaymentResponse]"},"SuccessEnvelope_InvoiceResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InvoiceResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InvoiceResponse]"},"SuccessEnvelope_InvoiceSendEmailResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InvoiceSendEmailResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InvoiceSendEmailResponse]"},"SuccessEnvelope_InvoiceSettingsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/InvoiceSettingsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[InvoiceSettingsResponse]"},"SuccessEnvelope_JournalEntryListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/JournalEntryListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[JournalEntryListResponse]"},"SuccessEnvelope_JournalEntryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/JournalEntryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[JournalEntryResponse]"},"SuccessEnvelope_JournalEntryReverseResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/JournalEntryReverseResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[JournalEntryReverseResponse]"},"SuccessEnvelope_LastBusinessResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/LastBusinessResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[LastBusinessResponse]"},"SuccessEnvelope_LedgerBulkUpdateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/LedgerBulkUpdateResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[LedgerBulkUpdateResponse]"},"SuccessEnvelope_LedgerListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/LedgerListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[LedgerListResponse]"},"SuccessEnvelope_LedgerMergeResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/LedgerMergeResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[LedgerMergeResponse]"},"SuccessEnvelope_LedgerResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/LedgerResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[LedgerResponse]"},"SuccessEnvelope_ListAnomaliesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListAnomaliesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListAnomaliesResponse]"},"SuccessEnvelope_ListBillPaymentsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListBillPaymentsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListBillPaymentsResponse]"},"SuccessEnvelope_ListClientBusinessAccessResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListClientBusinessAccessResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListClientBusinessAccessResponse]"},"SuccessEnvelope_ListCloseBlockersResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListCloseBlockersResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListCloseBlockersResponse]"},"SuccessEnvelope_ListCountsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListCountsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListCountsResponse]"},"SuccessEnvelope_ListDepositCandidatesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListDepositCandidatesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListDepositCandidatesResponse]"},"SuccessEnvelope_ListExpenseCandidatesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListExpenseCandidatesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListExpenseCandidatesResponse]"},"SuccessEnvelope_ListFirmReportTypesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListFirmReportTypesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListFirmReportTypesResponse]"},"SuccessEnvelope_ListInvoicePaymentsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListInvoicePaymentsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListInvoicePaymentsResponse]"},"SuccessEnvelope_ListInvoiceSuggestionsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListInvoiceSuggestionsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListInvoiceSuggestionsResponse]"},"SuccessEnvelope_ListPeriodSignOffsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListPeriodSignOffsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListPeriodSignOffsResponse]"},"SuccessEnvelope_ListReconciliationsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListReconciliationsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListReconciliationsResponse]"},"SuccessEnvelope_ListScenariosResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListScenariosResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListScenariosResponse]"},"SuccessEnvelope_ListSubscriptionsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListSubscriptionsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListSubscriptionsResponse]"},"SuccessEnvelope_ListSuggestionsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListSuggestionsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListSuggestionsResponse]"},"SuccessEnvelope_LocationInventorySummary_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/LocationInventorySummary"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[LocationInventorySummary]"},"SuccessEnvelope_LocationListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/LocationListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[LocationListResponse]"},"SuccessEnvelope_LocationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/LocationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[LocationResponse]"},"SuccessEnvelope_MailboxUniquenessResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/MailboxUniquenessResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[MailboxUniquenessResponse]"},"SuccessEnvelope_MarginByVariantResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/MarginByVariantResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[MarginByVariantResponse]"},"SuccessEnvelope_MarkAllAttentionReadResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/MarkAllAttentionReadResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[MarkAllAttentionReadResponse]"},"SuccessEnvelope_MarkAttentionItemReadResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/MarkAttentionItemReadResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[MarkAttentionItemReadResponse]"},"SuccessEnvelope_MatchTriggerResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/MatchTriggerResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[MatchTriggerResponse]"},"SuccessEnvelope_MfaStatusResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/MfaStatusResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[MfaStatusResponse]"},"SuccessEnvelope_MigrateFromGrandfatheredResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/MigrateFromGrandfatheredResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[MigrateFromGrandfatheredResponse]"},"SuccessEnvelope_MonthEndPackageDownloadResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/MonthEndPackageDownloadResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[MonthEndPackageDownloadResponse]"},"SuccessEnvelope_MonthEndPackageQueuedResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/MonthEndPackageQueuedResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[MonthEndPackageQueuedResponse]"},"SuccessEnvelope_MonthEndPackageResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/MonthEndPackageResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[MonthEndPackageResponse]"},"SuccessEnvelope_MonthEndPackagesListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/MonthEndPackagesListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[MonthEndPackagesListResponse]"},"SuccessEnvelope_NLSearchResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/NLSearchResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[NLSearchResponse]"},"SuccessEnvelope_NavPreferencesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/NavPreferencesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[NavPreferencesResponse]"},"SuccessEnvelope_NavSuggestResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/NavSuggestResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[NavSuggestResponse]"},"SuccessEnvelope_NoteListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/NoteListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[NoteListResponse]"},"SuccessEnvelope_NoteResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/NoteResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[NoteResponse]"},"SuccessEnvelope_NoteRewriteResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/NoteRewriteResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[NoteRewriteResponse]"},"SuccessEnvelope_NotificationCountResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/NotificationCountResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[NotificationCountResponse]"},"SuccessEnvelope_NotificationListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/NotificationListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[NotificationListResponse]"},"SuccessEnvelope_NotificationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/NotificationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[NotificationResponse]"},"SuccessEnvelope_NotificationTopicCountsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/NotificationTopicCountsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[NotificationTopicCountsResponse]"},"SuccessEnvelope_NotifyBusinessResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/NotifyBusinessResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[NotifyBusinessResponse]"},"SuccessEnvelope_OnboardingProfileResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/OnboardingProfileResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[OnboardingProfileResponse]"},"SuccessEnvelope_OnboardingResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/OnboardingResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[OnboardingResponse]"},"SuccessEnvelope_OnboardingUploadUrlResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/OnboardingUploadUrlResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[OnboardingUploadUrlResponse]"},"SuccessEnvelope_OrderListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/OrderListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[OrderListResponse]"},"SuccessEnvelope_OrderPaymentResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/OrderPaymentResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[OrderPaymentResponse]"},"SuccessEnvelope_OrderResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/OrderResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[OrderResponse]"},"SuccessEnvelope_POAnalyzeStatusResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/POAnalyzeStatusResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[POAnalyzeStatusResponse]"},"SuccessEnvelope_POAnalyzeTaskResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/POAnalyzeTaskResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[POAnalyzeTaskResponse]"},"SuccessEnvelope_POApplyResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/POApplyResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[POApplyResponse]"},"SuccessEnvelope_POForecastSettingsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/POForecastSettingsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[POForecastSettingsResponse]"},"SuccessEnvelope_POPreviewResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/POPreviewResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[POPreviewResponse]"},"SuccessEnvelope_ParseDebtContractResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ParseDebtContractResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ParseDebtContractResponse]"},"SuccessEnvelope_PasteTransactionTextResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PasteTransactionTextResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PasteTransactionTextResponse]"},"SuccessEnvelope_PauseAiFeaturesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PauseAiFeaturesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PauseAiFeaturesResponse]"},"SuccessEnvelope_PaymentListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PaymentListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PaymentListResponse]"},"SuccessEnvelope_PaymentTermResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PaymentTermResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PaymentTermResponse]"},"SuccessEnvelope_PaymentTermsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PaymentTermsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PaymentTermsListResponse]"},"SuccessEnvelope_PendingApprovalsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PendingApprovalsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PendingApprovalsResponse]"},"SuccessEnvelope_PostBulkJeUploadResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PostBulkJeUploadResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PostBulkJeUploadResponse]"},"SuccessEnvelope_PostCountResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PostCountResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PostCountResponse]"},"SuccessEnvelope_PrepareCheckoutResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PrepareCheckoutResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PrepareCheckoutResponse]"},"SuccessEnvelope_PreviewAddonChangeResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PreviewAddonChangeResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PreviewAddonChangeResponse]"},"SuccessEnvelope_PreviewBulkJeUploadResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PreviewBulkJeUploadResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PreviewBulkJeUploadResponse]"},"SuccessEnvelope_PreviewResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PreviewResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PreviewResponse]"},"SuccessEnvelope_ProductResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ProductResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ProductResponse]"},"SuccessEnvelope_ProductsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ProductsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ProductsListResponse]"},"SuccessEnvelope_ProjectProfitabilityResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ProjectProfitabilityResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ProjectProfitabilityResponse]"},"SuccessEnvelope_ProjectResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ProjectResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ProjectResponse]"},"SuccessEnvelope_ProjectionActualsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ProjectionActualsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ProjectionActualsResponse]"},"SuccessEnvelope_ProjectionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ProjectionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ProjectionResponse]"},"SuccessEnvelope_ProjectsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ProjectsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ProjectsListResponse]"},"SuccessEnvelope_PurchaseRequisitionConvertResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PurchaseRequisitionConvertResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PurchaseRequisitionConvertResponse]"},"SuccessEnvelope_PurchaseRequisitionDetailResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PurchaseRequisitionDetailResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PurchaseRequisitionDetailResponse]"},"SuccessEnvelope_PurchaseRequisitionsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PurchaseRequisitionsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PurchaseRequisitionsListResponse]"},"SuccessEnvelope_QuickBooksDisconnectResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/QuickBooksDisconnectResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[QuickBooksDisconnectResponse]"},"SuccessEnvelope_RecategorizeByCounterpartyResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RecategorizeByCounterpartyResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RecategorizeByCounterpartyResponse]"},"SuccessEnvelope_RecategorizeLineEntriesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RecategorizeLineEntriesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RecategorizeLineEntriesResponse]"},"SuccessEnvelope_RecipeListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RecipeListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RecipeListResponse]"},"SuccessEnvelope_RecipeResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RecipeResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RecipeResponse]"},"SuccessEnvelope_RecomputeCloseScoreResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RecomputeCloseScoreResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RecomputeCloseScoreResponse]"},"SuccessEnvelope_RecomputeForecastResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RecomputeForecastResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RecomputeForecastResponse]"},"SuccessEnvelope_RecurringTemplateHistoryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RecurringTemplateHistoryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RecurringTemplateHistoryResponse]"},"SuccessEnvelope_RecurringTemplateListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RecurringTemplateListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RecurringTemplateListResponse]"},"SuccessEnvelope_RecurringTemplateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RecurringTemplateResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RecurringTemplateResponse]"},"SuccessEnvelope_RejectMatchResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RejectMatchResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RejectMatchResponse]"},"SuccessEnvelope_RejectSuggestionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RejectSuggestionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RejectSuggestionResponse]"},"SuccessEnvelope_ReminderListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ReminderListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ReminderListResponse]"},"SuccessEnvelope_ReminderResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ReminderResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ReminderResponse]"},"SuccessEnvelope_ReorderCashImpactResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ReorderCashImpactResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ReorderCashImpactResponse]"},"SuccessEnvelope_ReorderSettingsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ReorderSettingsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ReorderSettingsResponse]"},"SuccessEnvelope_ReorderSuggestionsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ReorderSuggestionsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ReorderSuggestionsResponse]"},"SuccessEnvelope_ReportResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ReportResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ReportResponse]"},"SuccessEnvelope_ReportTaskResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ReportTaskResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ReportTaskResponse]"},"SuccessEnvelope_ReportTypesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ReportTypesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ReportTypesResponse]"},"SuccessEnvelope_ReportsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ReportsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ReportsListResponse]"},"SuccessEnvelope_RescanAnomaliesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RescanAnomaliesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RescanAnomaliesResponse]"},"SuccessEnvelope_ResendInvitationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ResendInvitationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ResendInvitationResponse]"},"SuccessEnvelope_ResolveAnomalyResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ResolveAnomalyResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ResolveAnomalyResponse]"},"SuccessEnvelope_RestoreAnomalyResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RestoreAnomalyResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RestoreAnomalyResponse]"},"SuccessEnvelope_RestoreSubscriptionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RestoreSubscriptionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RestoreSubscriptionResponse]"},"SuccessEnvelope_RestoreTransactionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RestoreTransactionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RestoreTransactionResponse]"},"SuccessEnvelope_ResumeAiFeaturesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ResumeAiFeaturesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ResumeAiFeaturesResponse]"},"SuccessEnvelope_RunDepreciationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RunDepreciationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RunDepreciationResponse]"},"SuccessEnvelope_RunListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RunListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RunListResponse]"},"SuccessEnvelope_RunResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RunResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RunResponse]"},"SuccessEnvelope_SalesReceiptResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SalesReceiptResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SalesReceiptResponse]"},"SuccessEnvelope_SalesReceiptsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SalesReceiptsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SalesReceiptsListResponse]"},"SuccessEnvelope_ScenarioResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ScenarioResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ScenarioResponse]"},"SuccessEnvelope_SearchResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SearchResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SearchResponse]"},"SuccessEnvelope_SendStatementResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SendStatementResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SendStatementResponse]"},"SuccessEnvelope_ShareLinkResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ShareLinkResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ShareLinkResponse]"},"SuccessEnvelope_ShipmentListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ShipmentListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ShipmentListResponse]"},"SuccessEnvelope_ShipmentResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ShipmentResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ShipmentResponse]"},"SuccessEnvelope_SkipOccurrenceResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SkipOccurrenceResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SkipOccurrenceResponse]"},"SuccessEnvelope_SkuForecastDetailResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SkuForecastDetailResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SkuForecastDetailResponse]"},"SuccessEnvelope_SkuForecastListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SkuForecastListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SkuForecastListResponse]"},"SuccessEnvelope_SlackDisconnectResult_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SlackDisconnectResult"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SlackDisconnectResult]"},"SuccessEnvelope_SlackIntegrationStatus_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SlackIntegrationStatus"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SlackIntegrationStatus]"},"SuccessEnvelope_SlackTestSendResult_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SlackTestSendResult"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SlackTestSendResult]"},"SuccessEnvelope_SpendHistoryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SpendHistoryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SpendHistoryResponse]"},"SuccessEnvelope_StaffAssignmentListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/StaffAssignmentListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[StaffAssignmentListResponse]"},"SuccessEnvelope_StaffAssignmentResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/app__api__v1__schemas__advisory_firms__firm__StaffAssignmentResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[StaffAssignmentResponse]"},"SuccessEnvelope_StartCountResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/StartCountResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[StartCountResponse]"},"SuccessEnvelope_StartImportResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/StartImportResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[StartImportResponse]"},"SuccessEnvelope_StartReconciliationProcessingResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/StartReconciliationProcessingResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[StartReconciliationProcessingResponse]"},"SuccessEnvelope_SubledgerGlReconciliationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SubledgerGlReconciliationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SubledgerGlReconciliationResponse]"},"SuccessEnvelope_SubmitCountLineResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SubmitCountLineResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SubmitCountLineResponse]"},"SuccessEnvelope_SubscriptionSummaryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionSummaryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SubscriptionSummaryResponse]"},"SuccessEnvelope_SuccessResponseModel_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SuccessResponseModel"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SuccessResponseModel]"},"SuccessEnvelope_SuggestAccountCleanupResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SuggestAccountCleanupResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SuggestAccountCleanupResponse]"},"SuccessEnvelope_SuggestCapitalizationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SuggestCapitalizationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SuggestCapitalizationResponse]"},"SuccessEnvelope_SuggestCashFlowResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SuggestCashFlowResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SuggestCashFlowResponse]"},"SuccessEnvelope_SuggestCategoriesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SuggestCategoriesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SuggestCategoriesResponse]"},"SuccessEnvelope_SuggestCreditMemosResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SuggestCreditMemosResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SuggestCreditMemosResponse]"},"SuccessEnvelope_SuggestPaymentPriorityResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SuggestPaymentPriorityResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SuggestPaymentPriorityResponse]"},"SuccessEnvelope_SuggestRecurringTemplatesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SuggestRecurringTemplatesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SuggestRecurringTemplatesResponse]"},"SuccessEnvelope_SuggestReportResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SuggestReportResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SuggestReportResponse]"},"SuccessEnvelope_SuggestTaxRateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SuggestTaxRateResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SuggestTaxRateResponse]"},"SuccessEnvelope_SuggestTaxRatesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SuggestTaxRatesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SuggestTaxRatesResponse]"},"SuccessEnvelope_SupplyChainResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SupplyChainResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SupplyChainResponse]"},"SuccessEnvelope_SyncLogoBrandingResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SyncLogoBrandingResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SyncLogoBrandingResponse]"},"SuccessEnvelope_SyncStatus_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/SyncStatus"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SyncStatus]"},"SuccessEnvelope_TableSavedViewsDataSchema_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TableSavedViewsDataSchema"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TableSavedViewsDataSchema]"},"SuccessEnvelope_TableViewsMapResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TableViewsMapResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TableViewsMapResponse]"},"SuccessEnvelope_TagGroupListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TagGroupListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TagGroupListResponse]"},"SuccessEnvelope_TagGroupResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TagGroupResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TagGroupResponse]"},"SuccessEnvelope_TagListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TagListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TagListResponse]"},"SuccessEnvelope_TagResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TagResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TagResponse]"},"SuccessEnvelope_TagSuggestResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TagSuggestResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TagSuggestResponse]"},"SuccessEnvelope_TaggedEntitiesListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TaggedEntitiesListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TaggedEntitiesListResponse]"},"SuccessEnvelope_TaxCodeResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TaxCodeResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TaxCodeResponse]"},"SuccessEnvelope_TaxCodesListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TaxCodesListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TaxCodesListResponse]"},"SuccessEnvelope_TaxDedupeResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TaxDedupeResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TaxDedupeResponse]"},"SuccessEnvelope_TaxRateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TaxRateResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TaxRateResponse]"},"SuccessEnvelope_TaxRatesListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TaxRatesListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TaxRatesListResponse]"},"SuccessEnvelope_TealInstanceCursorListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TealInstanceCursorListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TealInstanceCursorListResponse]"},"SuccessEnvelope_TeamDetailResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TeamDetailResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TeamDetailResponse]"},"SuccessEnvelope_TeamListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TeamListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TeamListResponse]"},"SuccessEnvelope_TeamSummaryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/app__api__v1__schemas__advisory_firms__firm__TeamSummaryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TeamSummaryResponse]"},"SuccessEnvelope_TemplateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TemplateResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TemplateResponse]"},"SuccessEnvelope_ThreeWayMatchResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ThreeWayMatchResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ThreeWayMatchResponse]"},"SuccessEnvelope_TimeEntriesListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TimeEntriesListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TimeEntriesListResponse]"},"SuccessEnvelope_TimeEntryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TimeEntryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TimeEntryResponse]"},"SuccessEnvelope_ToggleAddonResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ToggleAddonResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ToggleAddonResponse]"},"SuccessEnvelope_TopicChannelOverridesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TopicChannelOverridesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TopicChannelOverridesResponse]"},"SuccessEnvelope_TransactionBulkDeleteResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TransactionBulkDeleteResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TransactionBulkDeleteResponse]"},"SuccessEnvelope_TransactionDateRangeDeleteResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TransactionDateRangeDeleteResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TransactionDateRangeDeleteResponse]"},"SuccessEnvelope_TransactionListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TransactionListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TransactionListResponse]"},"SuccessEnvelope_TransactionMarkReviewedByPeriodResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TransactionMarkReviewedByPeriodResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TransactionMarkReviewedByPeriodResponse]"},"SuccessEnvelope_TransactionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TransactionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TransactionResponse]"},"SuccessEnvelope_TransactionSuggestedMatchesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TransactionSuggestedMatchesResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TransactionSuggestedMatchesResponse]"},"SuccessEnvelope_TransferListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TransferListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TransferListResponse]"},"SuccessEnvelope_TransferResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TransferResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TransferResponse]"},"SuccessEnvelope_TransferSuggestionsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TransferSuggestionsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TransferSuggestionsResponse]"},"SuccessEnvelope_TriggerBillMatchingResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/TriggerBillMatchingResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[TriggerBillMatchingResponse]"},"SuccessEnvelope_UndepositedItemsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UndepositedItemsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UndepositedItemsResponse]"},"SuccessEnvelope_UnitCostBulkApplyResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UnitCostBulkApplyResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UnitCostBulkApplyResponse]"},"SuccessEnvelope_UnitCostBulkPreviewResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UnitCostBulkPreviewResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UnitCostBulkPreviewResponse]"},"SuccessEnvelope_UnreadCountResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UnreadCountResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UnreadCountResponse]"},"SuccessEnvelope_UpdateEntriesStartResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UpdateEntriesStartResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UpdateEntriesStartResponse]"},"SuccessEnvelope_UpdateSettingsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UpdateSettingsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UpdateSettingsResponse]"},"SuccessEnvelope_UpdateStripeCustomerResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UpdateStripeCustomerResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UpdateStripeCustomerResponse]"},"SuccessEnvelope_UpdateStripeSubscriptionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UpdateStripeSubscriptionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UpdateStripeSubscriptionResponse]"},"SuccessEnvelope_UpdateSubscriptionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UpdateSubscriptionResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UpdateSubscriptionResponse]"},"SuccessEnvelope_UpdateThresholdsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UpdateThresholdsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UpdateThresholdsResponse]"},"SuccessEnvelope_UpdateUserRoleInBusinessResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UpdateUserRoleInBusinessResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UpdateUserRoleInBusinessResponse]"},"SuccessEnvelope_UploadBillFileResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UploadBillFileResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UploadBillFileResponse]"},"SuccessEnvelope_UpsertProfileResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UpsertProfileResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UpsertProfileResponse]"},"SuccessEnvelope_UserCursorListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UserCursorListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UserCursorListResponse]"},"SuccessEnvelope_UserFirmAssociationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UserFirmAssociationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UserFirmAssociationResponse]"},"SuccessEnvelope_UserResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UserResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UserResponse]"},"SuccessEnvelope_ValidateCoaTemplateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ValidateCoaTemplateResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ValidateCoaTemplateResponse]"},"SuccessEnvelope_ValuationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ValuationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ValuationResponse]"},"SuccessEnvelope_VariantResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/VariantResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[VariantResponse]"},"SuccessEnvelope_VariantsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/VariantsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[VariantsListResponse]"},"SuccessEnvelope_VendorBulkUploadResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/VendorBulkUploadResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[VendorBulkUploadResponse]"},"SuccessEnvelope_VendorContractListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/VendorContractListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[VendorContractListResponse]"},"SuccessEnvelope_VendorContractResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/VendorContractResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[VendorContractResponse]"},"SuccessEnvelope_VendorCreditApplicationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/VendorCreditApplicationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[VendorCreditApplicationResponse]"},"SuccessEnvelope_VendorCreditResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/VendorCreditResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[VendorCreditResponse]"},"SuccessEnvelope_VendorCreditSummary_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/VendorCreditSummary"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[VendorCreditSummary]"},"SuccessEnvelope_VendorCreditsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/VendorCreditsListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[VendorCreditsListResponse]"},"SuccessEnvelope_VendorDuplicateCheckResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/VendorDuplicateCheckResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[VendorDuplicateCheckResponse]"},"SuccessEnvelope_VendorHistoryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/VendorHistoryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[VendorHistoryResponse]"},"SuccessEnvelope_VendorListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/VendorListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[VendorListResponse]"},"SuccessEnvelope_VendorResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/VendorResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[VendorResponse]"},"SuccessEnvelope_WeekDetailResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/WeekDetailResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[WeekDetailResponse]"},"SuccessEnvelope_list_ForecastConfigResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"items":{"$ref":"#/components/schemas/ForecastConfigResponse"},"type":"array"},{"type":"null"}],"title":"Data"}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[list[ForecastConfigResponse]]"},"SuccessResponseModel":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"type":"string","title":"Message"},"code":{"type":"string","title":"Code"},"data":{"anyOf":[{},{"type":"null"}],"title":"Data"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"succeeded":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Succeeded"},"failed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed"},"errors":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Errors"}},"additionalProperties":true,"type":"object","required":["message","code"],"title":"SuccessResponseModel","description":"Pydantic model for API success responses."},"SuggestAccountCleanupResponse":{"properties":{"suggestions":{"items":{"$ref":"#/components/schemas/AccountCleanupSuggestionItem"},"type":"array","title":"Suggestions"},"cached":{"type":"boolean","title":"Cached","description":"True if the response was served from short-TTL cache.","default":false}},"type":"object","title":"SuggestAccountCleanupResponse"},"SuggestCapitalizationResponse":{"properties":{"suggestions":{"items":{"$ref":"#/components/schemas/CapitalizationSuggestionItem"},"type":"array","title":"Suggestions"}},"type":"object","title":"SuggestCapitalizationResponse"},"SuggestCashFlowResponse":{"properties":{"suggestions":{"items":{"$ref":"#/components/schemas/CashFlowSuggestionItem"},"type":"array","title":"Suggestions"}},"type":"object","title":"SuggestCashFlowResponse"},"SuggestCategoriesResponse":{"properties":{"suggestions":{"items":{"$ref":"#/components/schemas/CategorySuggestionItem"},"type":"array","title":"Suggestions"},"groups":{"items":{"$ref":"#/components/schemas/CounterpartySuggestionGroup"},"type":"array","title":"Groups","description":"Suggestions grouped by counterparty for bulk operations"},"count":{"type":"integer","title":"Count","description":"Number of suggestions returned","default":0},"total_uncategorized":{"type":"integer","title":"Total Uncategorized","description":"Total uncategorized transactions in the business","default":0}},"type":"object","title":"SuggestCategoriesResponse"},"SuggestCreditMemosResponse":{"properties":{"suggestions":{"items":{"$ref":"#/components/schemas/CreditMemoSuggestionItem"},"type":"array","title":"Suggestions"}},"type":"object","title":"SuggestCreditMemosResponse"},"SuggestPaymentPriorityResponse":{"properties":{"recommendations":{"items":{"$ref":"#/components/schemas/PaymentPriorityItem"},"type":"array","title":"Recommendations"},"projected_balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Projected Balance","description":"Projected balance in cents"}},"type":"object","title":"SuggestPaymentPriorityResponse"},"SuggestRecurringTemplatesResponse":{"properties":{"suggestions":{"items":{"$ref":"#/components/schemas/RecurringTemplateSuggestionItem"},"type":"array","title":"Suggestions"}},"type":"object","title":"SuggestRecurringTemplatesResponse"},"SuggestReportResponse":{"properties":{"suggestions":{"items":{"$ref":"#/components/schemas/ReportSuggestionItem"},"type":"array","title":"Suggestions"}},"type":"object","title":"SuggestReportResponse"},"SuggestTaxRateResponse":{"properties":{"suggestions":{"items":{"$ref":"#/components/schemas/TaxRateSuggestion"},"type":"array","title":"Suggestions"}},"type":"object","required":["suggestions"],"title":"SuggestTaxRateResponse","description":"AI-generated tax rate suggestions for a projection scenario."},"SuggestTaxRatesResponse":{"properties":{"suggestions":{"items":{"$ref":"#/components/schemas/TaxRateSuggestionItem"},"type":"array","title":"Suggestions"}},"type":"object","title":"SuggestTaxRatesResponse"},"SuggestedMatch":{"properties":{"type":{"type":"string","enum":["invoice","bill"],"title":"Type","description":"Whether this match is an invoice (income) or a bill (expense)."},"id":{"type":"string","title":"Id","description":"UUID of the matched invoice or bill."},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number","description":"Invoice number or vendor bill number, if set."},"party_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Party Name","description":"Customer name (invoice) or vendor name (bill)."},"balance_due":{"type":"integer","title":"Balance Due","description":"Open balance of the invoice/bill in cents."},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date","description":"Due date of the invoice/bill (ISO 8601 date)."},"suggested_amount":{"type":"integer","title":"Suggested Amount","description":"Suggested allocation amount in cents (capped at the open balance)."},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"Composite match confidence score (0-1)."},"signals":{"additionalProperties":true,"type":"object","title":"Signals","description":"Per-signal score breakdown (amount, date, memo, counterparty)."},"match_group_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Group Id","description":"Set when this match is part of a multi-document group (one transaction paying several invoices/bills)."}},"type":"object","required":["type","id","balance_due","suggested_amount","confidence"],"title":"SuggestedMatch","description":"A single suggested invoice or bill match for a bank transaction."},"SupplementalDisclosures":{"properties":{"cash_paid_for_interest":{"type":"integer","title":"Cash Paid For Interest","description":"Cash paid for interest during the period (cents)","default":0},"cash_paid_for_income_taxes":{"type":"integer","title":"Cash Paid For Income Taxes","description":"Cash paid for income taxes during the period (cents)","default":0},"indirect_reconciliation":{"items":{"$ref":"#/components/schemas/IndirectReconciliationItem"},"type":"array","title":"Indirect Reconciliation","description":"Mirror of the operating-section line items as a flat label/amount list; preserved for backwards compatibility with consumers built against the prior schema."},"non_cash_activities":{"items":{"$ref":"#/components/schemas/NonCashActivity"},"type":"array","title":"Non Cash Activities","description":"Significant non-cash investing and financing activities"}},"type":"object","title":"SupplementalDisclosures","description":"ASC 230 supplemental disclosures.\n\nEven under the indirect method, businesses must disclose cash paid\nfor interest and income taxes, plus significant non-cash investing\nand financing activities. We surface those here."},"SupplyChainEdge":{"properties":{"id":{"type":"string","title":"Id","description":"Underlying PO or Transfer ID."},"kind":{"type":"string","title":"Kind","description":"'purchase_order' or 'transfer'."},"from_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Location Id","description":"Source location ID."},"to_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Location Id","description":"Destination location ID."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Human-readable label (e.g. 'PO-123' or 'TRF-456')."},"status":{"type":"string","title":"Status","description":"Current status of the PO or transfer."},"total_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Cents","description":"PO total (for PO edges) in cents. None for transfers."},"expected_arrival_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Arrival Date","description":"When goods are expected to arrive."}},"type":"object","required":["id","kind","status"],"title":"SupplyChainEdge","description":"A directed edge between two nodes representing in-flight goods.\n\n``kind`` is either ``\"purchase_order\"`` (PO waiting to be\nreceived) or ``\"transfer\"`` (in-transit InventoryTransfer). UIs\nshould render them with different line styles."},"SupplyChainNode":{"properties":{"id":{"type":"string","title":"Id","description":"Location ID."},"name":{"type":"string","title":"Name","description":"Display name of the location."},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code","description":"Short code (e.g. 'WH1')."},"location_type":{"type":"string","title":"Location Type","description":"LocationTypeEnum value."},"is_default":{"type":"boolean","title":"Is Default","description":"Whether this is the business default location.","default":false},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City","description":"City for layout grouping."},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"State/region for layout grouping."},"on_hand_units":{"type":"number","title":"On Hand Units","description":"Total units on hand at this location across all variants.","default":0.0},"on_hand_value_cents":{"type":"integer","title":"On Hand Value Cents","description":"Total value of on-hand inventory at this location, in cents.","default":0},"open_po_count":{"type":"integer","title":"Open Po Count","description":"POs with this location as ship_from or ship_to and a non-terminal status.","default":0},"low_stock_count":{"type":"integer","title":"Low Stock Count","description":"Variants at this location whose available <= reorder_point.","default":0},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Vendor whose default_location_id points here, if any."}},"type":"object","required":["id","name","location_type"],"title":"SupplyChainNode","description":"A location node on the supply-chain map.\n\n``on_hand_value_cents`` is a SUM of ``inventory_levels.on_hand *\nvariant.unit_cost`` at the node, expressed in business-currency\ncents. ``open_po_count`` counts POs whose ship_from or ship_to\npoints at this node and whose status is not terminal."},"SupplyChainResponse":{"properties":{"nodes":{"items":{"$ref":"#/components/schemas/SupplyChainNode"},"type":"array","title":"Nodes"},"edges":{"items":{"$ref":"#/components/schemas/SupplyChainEdge"},"type":"array","title":"Edges"},"generated_at":{"type":"string","format":"date-time","title":"Generated At","description":"Server time the payload was computed."}},"type":"object","required":["generated_at"],"title":"SupplyChainResponse","description":"Full supply-chain map payload: nodes + edges."},"SyncLogoBrandingResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Sync status: 'synced', 'no_logo', or 'no_stripe_account'."},"stripe_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe File Id","description":"Stripe file ID for the uploaded logo (if synced)."},"synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Synced At","description":"Timestamp when the sync completed."}},"type":"object","required":["status"],"title":"SyncLogoBrandingResponse","description":"Response schema for logo sync to Stripe operation."},"SyncStatus":{"properties":{"status":{"type":"string","enum":["syncing","completed","nothing_to_sync"],"title":"Status","description":"Sync status: 'syncing', 'completed', or 'nothing_to_sync'"},"last_synced":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Synced","description":"ISO timestamp of last successful sync"},"sync_in_progress":{"type":"boolean","title":"Sync In Progress","description":"Whether a teal-sync task is currently running (from tasks table)","default":false}},"type":"object","required":["status"],"title":"SyncStatus","description":"Sync status for a business."},"TableSavedViewSchema":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"createdAt":{"type":"string","title":"Createdat","default":""},"updatedAt":{"type":"string","title":"Updatedat","default":""},"state":{"$ref":"#/components/schemas/TableSavedViewStateSchema"}},"type":"object","required":["id","name"],"title":"TableSavedViewSchema"},"TableSavedViewStateSchema":{"properties":{"filters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filters"},"sort":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Sort"},"columns":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Columns"}},"type":"object","title":"TableSavedViewStateSchema","description":"Filter/sort/column snapshot for one saved view."},"TableSavedViewsDataSchema":{"properties":{"v":{"type":"integer","title":"V","description":"Schema version","default":1},"views":{"items":{"$ref":"#/components/schemas/TableSavedViewSchema"},"type":"array","title":"Views"},"defaultViewId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Defaultviewid","description":"Auto-applied view id on load"}},"type":"object","title":"TableSavedViewsDataSchema","description":"Saved views blob for a single DataTable ``persistKey``."},"TableViewsMapResponse":{"properties":{"tables":{"additionalProperties":{"$ref":"#/components/schemas/TableSavedViewsDataSchema"},"type":"object","title":"Tables","description":"Keyed by DataTable persistKey / tableKey"},"version":{"type":"integer","title":"Version","description":"Optimistic-concurrency version for this user+business prefs blob","default":0}},"type":"object","title":"TableViewsMapResponse","description":"All saved table views for the current user+business."},"TableViewsPatchRequest":{"properties":{"tables":{"additionalProperties":{"$ref":"#/components/schemas/TableSavedViewsDataSchema"},"type":"object","title":"Tables","description":"Table keys to upsert. Empty views removes the key."},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version","description":"Expected prefs version (If-Match alternative in PATCH body)"}},"type":"object","title":"TableViewsPatchRequest","description":"Merge one or more table view blobs (upsert per key)."},"TagCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Name of the tag"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Description of the tag"},"tag_group_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag Group Id","description":"Optional tag group to organize this tag under"}},"type":"object","required":["name"],"title":"TagCreate","description":"Schema for creating a new tag."},"TagGroupCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Name of the tag group"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Description of the tag group"}},"type":"object","required":["name"],"title":"TagGroupCreate","description":"Schema for creating a new tag group."},"TagGroupListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TagGroupResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"TagGroupListResponse","description":"Cursor-paginated list of tag groups."},"TagGroupResponse":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Name of the tag group"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Description of the tag group"},"id":{"type":"string","title":"Id","description":"Unique identifier for the tag group"},"tag_count":{"type":"integer","title":"Tag Count","description":"Number of tags in this group","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when the tag group was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Timestamp when the tag group was last updated"}},"type":"object","required":["name","id","created_at","updated_at"],"title":"TagGroupResponse","description":"Schema for tag group response."},"TagGroupUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name","description":"Name of the tag group"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Description of the tag group"}},"type":"object","title":"TagGroupUpdate","description":"Schema for updating a tag group."},"TagListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TagResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"TagListResponse","description":"Cursor-paginated list of tags."},"TagResponse":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Name of the tag"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Description of the tag"},"id":{"type":"string","title":"Id","description":"Unique identifier for the tag"},"tag_group_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag Group Id","description":"Tag group this tag belongs to"},"tag_group_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag Group Name","description":"Name of the tag group (if any)"},"usage_count":{"type":"integer","title":"Usage Count","description":"Number of entities using this tag","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when the tag was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Timestamp when the tag was last updated"}},"type":"object","required":["name","id","created_at","updated_at"],"title":"TagResponse","description":"Schema for tag response."},"TagSuggestRequest":{"properties":{"existing_tags":{"items":{"type":"string"},"type":"array","title":"Existing Tags","description":"Names of tags that already exist (to avoid duplicates)"},"context":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Context","description":"Optional business context to guide suggestions"}},"type":"object","title":"TagSuggestRequest","description":"Schema for requesting AI-powered tag name suggestions."},"TagSuggestResponse":{"properties":{"suggestions":{"items":{"$ref":"#/components/schemas/TagSuggestionItem"},"type":"array","title":"Suggestions","description":"List of suggested tag names"}},"type":"object","title":"TagSuggestResponse","description":"Response containing AI-generated tag suggestions."},"TagSuggestionItem":{"properties":{"name":{"type":"string","title":"Name","description":"Suggested tag name"},"reason":{"type":"string","title":"Reason","description":"Brief reason for the suggestion"}},"type":"object","required":["name","reason"],"title":"TagSuggestionItem","description":"A single AI-suggested tag name."},"TagUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name","description":"Name of the tag"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Description of the tag"},"tag_group_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag Group Id","description":"Tag group to organize this tag under"}},"type":"object","title":"TagUpdate","description":"Schema for updating a tag."},"TaggedEntitiesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TaggedEntityItem"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"TaggedEntitiesListResponse","description":"Cursor-paginated list of entities that have a specific tag."},"TaggedEntityItem":{"properties":{"tag_id":{"type":"string","title":"Tag Id","description":"UUID of the tag"},"tag_name":{"type":"string","title":"Tag Name","description":"Name of the tag"},"model_type":{"type":"string","title":"Model Type","description":"Type of entity"},"entity_id":{"type":"string","title":"Entity Id","description":"UUID of the tagged entity"}},"type":"object","required":["tag_id","tag_name","model_type","entity_id"],"title":"TaggedEntityItem","description":"Entity reference returned when listing entities that have a tag."},"TaxCodeCreateRequest":{"properties":{"code":{"type":"string","title":"Code","description":"Tax code (e.g., 'TAXABLE', 'EXEMPT')"},"name":{"type":"string","title":"Name","description":"Display name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description"},"is_taxable":{"type":"boolean","title":"Is Taxable","description":"Whether items are taxable","default":true}},"type":"object","required":["code","name"],"title":"TaxCodeCreateRequest","description":"Request schema for creating a tax code.","example":{"code":"TAXABLE","description":"Standard taxable goods and services","is_taxable":true,"name":"Taxable"}},"TaxCodeResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Tax code UUID"},"business_id":{"type":"string","title":"Business Id","description":"Business UUID"},"code":{"type":"string","title":"Code","description":"Tax code"},"name":{"type":"string","title":"Name","description":"Display name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description"},"is_taxable":{"type":"boolean","title":"Is Taxable","description":"Is taxable"},"is_active":{"type":"boolean","title":"Is Active","description":"Is active"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["id","business_id","code","name","is_taxable","is_active","created_at","updated_at"],"title":"TaxCodeResponse","description":"Response schema for a tax code."},"TaxCodeUpdateRequest":{"properties":{"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_taxable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Taxable"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"TaxCodeUpdateRequest","description":"Request schema for updating a tax code."},"TaxCodesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TaxCodeResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"TaxCodesListResponse","description":"Paginated list of tax codes."},"TaxDedupeResponse":{"properties":{"rates_deactivated":{"type":"integer","title":"Rates Deactivated","description":"Duplicate tax rates deactivated","default":0},"codes_deactivated":{"type":"integer","title":"Codes Deactivated","description":"Duplicate tax codes deactivated","default":0}},"type":"object","title":"TaxDedupeResponse","description":"Counts from deduping imported tax master data."},"TaxRateCreateRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Tax rate name (e.g., 'CA Sales Tax')"},"rate":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Rate","description":"Tax rate as decimal (e.g., 0.0725 for 7.25%)"},"tax_type":{"type":"string","title":"Tax Type","description":"Type: sales, use, vat, gst, hst, pst","default":"sales"},"country":{"type":"string","title":"Country","description":"Country code","default":"US"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"State/province code"},"county":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"County","description":"County name"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City","description":"City name"},"tax_liability_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Liability Ledger Id","description":"Ledger ID for posting tax liability"},"is_default":{"type":"boolean","title":"Is Default","description":"Set as default tax rate","default":false}},"type":"object","required":["name","rate"],"title":"TaxRateCreateRequest","description":"Request schema for creating a tax rate.","example":{"country":"US","is_default":true,"name":"California Sales Tax","rate":0.0725,"state":"CA","tax_type":"sales"}},"TaxRateResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Tax rate UUID"},"business_id":{"type":"string","title":"Business Id","description":"Business UUID"},"name":{"type":"string","title":"Name","description":"Tax rate name"},"rate":{"type":"number","title":"Rate","description":"Tax rate as decimal"},"rate_percent":{"type":"number","title":"Rate Percent","description":"Tax rate as percentage"},"tax_type":{"type":"string","title":"Tax Type","description":"Tax type"},"country":{"type":"string","title":"Country","description":"Country code"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"State/province"},"county":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"County","description":"County"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City","description":"City"},"tax_liability_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Liability Ledger Id","description":"Tax liability ledger"},"is_default":{"type":"boolean","title":"Is Default","description":"Is default"},"is_active":{"type":"boolean","title":"Is Active","description":"Is active"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["id","business_id","name","rate","rate_percent","tax_type","country","is_default","is_active","created_at","updated_at"],"title":"TaxRateResponse","description":"Response schema for a tax rate."},"TaxRateSuggestion":{"properties":{"label":{"type":"string","title":"Label"},"rate":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Rate"},"reasoning":{"type":"string","title":"Reasoning"},"recommended":{"type":"boolean","title":"Recommended","default":false}},"type":"object","required":["label","rate","reasoning"],"title":"TaxRateSuggestion","description":"A single AI-suggested effective tax rate option."},"TaxRateSuggestionItem":{"properties":{"jurisdiction":{"type":"string","title":"Jurisdiction","description":"Tax jurisdiction"},"rate":{"type":"number","title":"Rate","description":"Suggested tax rate percentage"},"code":{"type":"string","title":"Code","description":"Tax code"},"reason":{"type":"string","title":"Reason","description":"Reason for this suggestion"}},"type":"object","required":["jurisdiction","rate","code","reason"],"title":"TaxRateSuggestionItem"},"TaxRateUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"rate":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Rate"},"tax_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Type"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"county":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"County"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"tax_liability_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Liability Ledger Id"},"is_default":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Default"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"TaxRateUpdateRequest","description":"Request schema for updating a tax rate."},"TaxRatesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TaxRateResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"TaxRatesListResponse","description":"Paginated list of tax rates."},"TealCleanupSummary":{"properties":{"transactions_deleted":{"type":"integer","title":"Transactions Deleted","description":"Teal transactions deleted remotely.","default":0},"journal_entries_deleted":{"type":"integer","title":"Journal Entries Deleted","description":"Teal journal entries deleted remotely.","default":0},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","description":"Per-record Teal cleanup failures (kind, id, error)."}},"type":"object","title":"TealCleanupSummary","description":"Best-effort remote Teal cleanup result for legacy Teal businesses."},"TealInstanceCursorListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TealInstanceResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"TealInstanceCursorListResponse","description":"Schema for list of Teal instances response (cursor-based pagination)."},"TealInstanceResponse":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Teal instance ID"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name","description":"Company name"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name","description":"Associated business name"},"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id","description":"Associated business ID"},"environment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Environment","description":"Environment name"},"entries_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Entries Start","description":"Entries start date"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Instance status"}},"additionalProperties":true,"type":"object","title":"TealInstanceResponse","description":"Response schema for Teal instance data."},"TeamBusinessRequest":{"properties":{"business_id":{"type":"string","title":"Business Id","description":"Business ID to add to the team."}},"type":"object","required":["business_id"],"title":"TeamBusinessRequest","description":"Request to add a business to a team."},"TeamDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"firm_id":{"type":"string","title":"Firm Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"members":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Members"},"businesses":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Businesses"}},"type":"object","required":["id","firm_id","name","created_by","created_at","updated_at"],"title":"TeamDetailResponse","description":"Detailed team response with members and businesses."},"TeamListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/app__api__v1__schemas__firm_team__TeamSummaryResponse"},"type":"array","title":"Items"}},"additionalProperties":true,"type":"object","required":["items"],"title":"TeamListResponse","description":"List of firm teams with member and business counts."},"TeamMemberRequest":{"properties":{"user_id":{"type":"string","title":"User Id","description":"User ID to add to the team."}},"type":"object","required":["user_id"],"title":"TeamMemberRequest","description":"Request to add a member to a team."},"TemplateResponse":{"properties":{"template_name":{"type":"string","title":"Template Name","description":"Template identifier."},"csv_content_stringified":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Csv Content Stringified","description":"CSV content as string."},"csv_content_object":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Csv Content Object","description":"CSV parsed as JSON array."},"csv_content_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Csv Content Base64","description":"Base64-encoded CSV for direct download."},"xls_content_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xls Content Base64","description":"Base64-encoded XLS/XLSX for direct download."}},"type":"object","required":["template_name"],"title":"TemplateResponse","description":"Response schema for an upload template.\n\nProvides the template in multiple formats for flexibility.\nCSV-based templates populate csv_* fields; XLS-based templates populate xls_content_base64.","example":{"csv_content_base64":"Y3VzdG9tZXJfZW1haWwsZHVlX2RhdGUuLi4=","csv_content_object":[{"customer_email":"example@customer.com","due_date":"2024-02-15","line_item_amount":"10000","line_item_description":"Service fee"}],"csv_content_stringified":"customer_email,due_date,line_item_description,line_item_amount\n","template_name":"invoices"}},"ThreeWayMatchLineDrift":{"properties":{"variant_id":{"type":"string","title":"Variant Id"},"ordered_qty":{"type":"integer","title":"Ordered Qty"},"received_qty":{"type":"integer","title":"Received Qty"},"variance":{"type":"integer","title":"Variance"}},"type":"object","required":["variant_id","ordered_qty","received_qty","variance"],"title":"ThreeWayMatchLineDrift","description":"One line whose received qty differs from the ordered qty."},"ThreeWayMatchResponse":{"properties":{"match_status":{"type":"string","title":"Match Status"},"variance_qty":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Variance Qty"},"variance_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Variance Amount Cents"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"lines":{"items":{"$ref":"#/components/schemas/ThreeWayMatchLineDrift"},"type":"array","title":"Lines"}},"type":"object","required":["match_status"],"title":"ThreeWayMatchResponse","description":"Result of a 3-way-match evaluation for a single bill."},"TimeEntriesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TimeEntryResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"TimeEntriesListResponse","description":"A flat list of time entries."},"TimeEntryCreateRequest":{"properties":{"entry_date":{"type":"string","format":"date","title":"Entry Date","description":"Date the work was performed."},"duration_minutes":{"type":"integer","exclusiveMinimum":0.0,"title":"Duration Minutes","description":"Duration in minutes."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description."},"person_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person Name","description":"Who performed the work."},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id","description":"Customer worked for."},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project / job."},"catalog_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Catalog Item Id","description":"Service item to use as the invoice line."},"billable":{"type":"boolean","title":"Billable","description":"Whether the time is billable.","default":true},"rate_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Rate Cents","description":"Billing rate per hour, in cents."}},"type":"object","required":["entry_date","duration_minutes"],"title":"TimeEntryCreateRequest","description":"Request schema for creating a time entry."},"TimeEntryResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"entry_date":{"type":"string","format":"date","title":"Entry Date"},"duration_minutes":{"type":"integer","title":"Duration Minutes"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"person_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person Name"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"project_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Name"},"catalog_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Catalog Item Id"},"billable":{"type":"boolean","title":"Billable"},"rate_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rate Cents"},"billable_amount":{"type":"integer","title":"Billable Amount","description":"Computed billable amount in cents.","default":0},"status":{"type":"string","title":"Status"},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","entry_date","duration_minutes","billable","status","is_active","created_at","updated_at"],"title":"TimeEntryResponse","description":"Response schema for a time entry."},"TimeEntryUpdateRequest":{"properties":{"entry_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Entry Date"},"duration_minutes":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Duration Minutes"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"person_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person Name"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"catalog_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Catalog Item Id"},"billable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Billable"},"rate_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Rate Cents"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"TimeEntryUpdateRequest","description":"Request schema for updating a time entry (all fields optional)."},"ToggleAddonResponse":{"properties":{"status":{"type":"string","title":"Status"},"action":{"type":"string","enum":["add","remove"],"title":"Action"},"addon_slug":{"type":"string","title":"Addon Slug"},"active_addons":{"items":{"type":"string"},"type":"array","title":"Active Addons"},"effective_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective Date"}},"additionalProperties":true,"type":"object","required":["status","action","addon_slug","active_addons"],"title":"ToggleAddonResponse","description":"Response for ``toggle_addon``."},"TopicCatalogEntry":{"properties":{"value":{"type":"string","title":"Value","description":"NotificationTopic enum value"},"label":{"type":"string","title":"Label","description":"Human-readable label"}},"type":"object","required":["value","label"],"title":"TopicCatalogEntry","description":"A selectable notification topic and its display label."},"TopicChannelOverridesResponse":{"properties":{"overrides":{"additionalProperties":{"additionalProperties":{"type":"boolean"},"type":"object"},"type":"object","title":"Overrides","description":"Map of topic -> {channel: bool}"},"available_channels":{"items":{"type":"string"},"type":"array","title":"Available Channels","description":"Channels the override grid can toggle"},"available_topics":{"items":{"$ref":"#/components/schemas/TopicCatalogEntry"},"type":"array","title":"Available Topics","description":"Every notification topic + label, generated from the backend enum so the preference grid never hardcodes the topic list"}},"type":"object","title":"TopicChannelOverridesResponse","description":"User's per-topic channel overrides + the channel set this UI accepts.\n\nThe ``available_channels`` field lets the frontend stay in\nsync with backend without hardcoding the channel list."},"TopicChannelOverridesUpdate":{"properties":{"overrides":{"additionalProperties":{"additionalProperties":{"type":"boolean"},"type":"object"},"type":"object","title":"Overrides"}},"type":"object","title":"TopicChannelOverridesUpdate","description":"Replace-style update for the per-topic override map.\n\nSending an empty dict for a topic clears that topic's\noverrides (falls back to ``CHANNEL_POLICY`` defaults).\nSending an empty top-level dict clears all overrides."},"TransactionApplication":{"properties":{"type":{"type":"string","title":"Type","description":"'invoice' or 'bill'."},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id"},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number"},"bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Id"},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Number"},"amount":{"type":"integer","title":"Amount","description":"Amount applied in cents."}},"type":"object","required":["type","amount"],"title":"TransactionApplication","description":"A single invoice or bill payment linked to a deposit transaction."},"TransactionBulkDeleteFailure":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"Transaction UUID that failed."},"message":{"type":"string","title":"Message","description":"Human-readable failure reason."}},"type":"object","required":["transaction_id","message"],"title":"TransactionBulkDeleteFailure","description":"Per-transaction failure from a bulk delete attempt."},"TransactionBulkDeleteRequest":{"properties":{"transaction_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Transaction Ids","description":"Array of transaction UUIDs to delete or hide."}},"type":"object","required":["transaction_ids"],"title":"TransactionBulkDeleteRequest","description":"Request schema for deleting multiple transactions by ID.","example":{"transaction_ids":["019ab37c-0001-7000-8000-000000000001","019ab37c-0002-7000-8000-000000000002"]}},"TransactionBulkDeleteResponse":{"properties":{"deleted":{"type":"integer","title":"Deleted","description":"Manual/bulk-upload rows permanently removed.","default":0},"hidden":{"type":"integer","title":"Hidden","description":"Plaid rows soft-deleted (hidden) on the local engine.","default":0},"failed":{"items":{"$ref":"#/components/schemas/TransactionBulkDeleteFailure"},"type":"array","title":"Failed","description":"Rows that could not be deleted, with reasons."}},"type":"object","title":"TransactionBulkDeleteResponse","description":"Summary of a bulk delete operation."},"TransactionBulkUpdateCategoryRequest":{"properties":{"transaction_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Transaction Ids","description":"Array of transaction UUIDs to update."},"ledger_id":{"type":"string","title":"Ledger Id","description":"UUID of the ledger to assign to opposing line entries."}},"type":"object","required":["transaction_ids","ledger_id"],"title":"TransactionBulkUpdateCategoryRequest","description":"Request schema for bulk updating transaction categories.\n\nUpdates the opposing line entries' ledger for multiple transactions at once.\nThis recategorizes transactions by changing the ledger on their opposing line entries.","example":{"ledger_id":"019ab37c-ledg-7000-8000-000000000001","transaction_ids":["019ab37c-0001-7000-8000-000000000001","019ab37c-0002-7000-8000-000000000002","019ab37c-0003-7000-8000-000000000003"]}},"TransactionBulkUpdateCounterpartyRequest":{"properties":{"transaction_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Transaction Ids","description":"Array of transaction UUIDs to update."},"counterparty":{"type":"string","maxLength":500,"minLength":1,"title":"Counterparty","description":"Counterparty / merchant name to set on all selected transactions."}},"type":"object","required":["transaction_ids","counterparty"],"title":"TransactionBulkUpdateCounterpartyRequest","description":"Request schema for bulk updating transaction counterparty names.","example":{"counterparty":"Acme Corp","transaction_ids":["019ab37c-0001-7000-8000-000000000001","019ab37c-0002-7000-8000-000000000002"]}},"TransactionCreateRequest":{"properties":{"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount","description":"Amount in cents. Positive for deposits/income, negative for withdrawals/expenses."},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Currency code (USD, CAD, AUD, EUR, or GBP). Defaults to business default currency.","default":"USD"},"datetime":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Datetime","description":"Transaction date in ISO 8601 format (YYYY-MM-DD)."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Human-readable description of the transaction."},"source_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Account Id","description":"UUID of the bank account (ledger) this transaction belongs to."},"reconciled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Reconciled","description":"Whether this transaction has been reconciled with bank statement.","default":false}},"type":"object","title":"TransactionCreateRequest","description":"Request schema for creating a manual transaction.\n\nManual transactions are used for recording transactions that don't come\nfrom a connected bank account (e.g., cash transactions, internal transfers).","example":{"amount":-25000,"datetime":"2024-01-15","description":"Office supplies purchase - Staples","reconciled":false,"source_account_id":"019ab37c-c309-7698-a8d9-14e0409977d8"}},"TransactionDateRangeDeleteResponse":{"properties":{"deleted":{"$ref":"#/components/schemas/DateRangeDeletedCounts","description":"Local DB deletion counts."},"teal":{"$ref":"#/components/schemas/TealCleanupSummary","description":"Remote Teal cleanup summary (zeros for local-engine businesses)."},"start_date":{"type":"string","title":"Start Date","description":"Inclusive start date (YYYY-MM-DD)."},"end_date":{"type":"string","title":"End Date","description":"Inclusive end date (YYYY-MM-DD)."},"ledger_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Ledger Ids","description":"Ledger IDs the deletion was restricted to, if any."}},"additionalProperties":true,"type":"object","required":["deleted","teal","start_date","end_date"],"title":"TransactionDateRangeDeleteResponse","description":"Response for ``delete_transactions_in_date_range``."},"TransactionListItemResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier (UUID7)."},"amount":{"type":"integer","title":"Amount","description":"Amount in cents. Positive = deposit/income, negative = withdrawal/expense."},"currency":{"type":"string","title":"Currency","description":"Currency code (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"datetime":{"type":"string","format":"date","title":"Datetime","description":"The date the transaction occurred."},"counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty","description":"Clean counterparty/merchant name extracted from bank data."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Transaction memo/description (cleaned)."},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta","description":"Additional metadata (raw Plaid description in raw_plaid_description)."},"categorization_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Categorization Method","description":"How categorized: 'manual', 'rule', 'ai', or null if uncategorized."},"posted_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted Status","description":"Bank status: 'pending' or 'posted'."},"review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Status","description":"Review status: 'unreviewed', 'reviewed', 'flagged'."},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Transaction origin: 'manual', 'plaid', or 'bulk_upload'. Determines if the transaction can be deleted."},"opposing_line_entry_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Opposing Line Entry Ids","description":"Linked line entry UUIDs for categorization."},"personal":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Personal","description":"True if marked as personal (non-business) expense."},"journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Id","description":"Linked journal entry UUID."},"teal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Id","description":"External Teal accounting system ID."},"teal_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Ledger Id","description":"Teal ledger ID."},"teal_source_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Source Account Id","description":"Teal source account ID."},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"Bank account (ledger) UUID."},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name","description":"Bank account (ledger) name for display."},"ledger_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Type","description":"Ledger account type: asset, liability, equity, revenue, or expense."},"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id","description":"Business UUID."},"reconciled":{"type":"boolean","title":"Reconciled","description":"True if reconciled with bank statement.","default":false},"invoice_ids":{"items":{"type":"string"},"type":"array","title":"Invoice Ids","description":"Invoice UUIDs linked via payments (from invoice_payments junction table)."},"bill_ids":{"items":{"type":"string"},"type":"array","title":"Bill Ids","description":"Bill UUIDs linked via payments (from bill_payments junction table)."},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Record creation timestamp."},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp."},"comment_count":{"type":"integer","title":"Comment Count","description":"Number of comments on this transaction.","default":0},"journal_entry":{"anyOf":[{"$ref":"#/components/schemas/JournalEntryResponse"},{"type":"null"}],"description":"Full journal entry details if categorized."},"opposing_line_entries":{"items":{"$ref":"#/components/schemas/OpposingLineEntryResponse"},"type":"array","title":"Opposing Line Entries","description":"Opposing line entries showing the category/account(s) this transaction was posted to. Empty if uncategorized."},"can_be_deleted":{"type":"boolean","title":"Can Be Deleted","description":"True iff the caller can delete this transaction. Manual and bulk-uploaded rows are permanently deletable on any engine; Plaid rows can be hidden on the DayZero local engine or permanently deleted on the Teal engine.","default":false}},"additionalProperties":true,"type":"object","required":["id","amount","datetime"],"title":"TransactionListItemResponse","description":"Response schema for a transaction in list endpoints.\n\nOptimized for list views - includes comment_count instead of full thread data.\nUse GET /transactions/{id} to retrieve full thread details.","example":{"amount":-15000,"bill_ids":[],"business_id":"019ab37c-bus1-7000-8000-000000000001","can_be_deleted":true,"categorization_method":"rule","comment_count":3,"counterparty":"Staples","created_at":"2024-01-15T10:30:00Z","datetime":"2024-01-15","description":"Office Supplies","id":"019ab37c-0001-7000-8000-000000000001","invoice_ids":["019ab37c-inv1-7000-8000-000000000001"],"journal_entry_id":"019ab37c-je01-7000-8000-000000000001","ledger_id":"019ab37c-led1-7000-8000-000000000001","ledger_name":"Chase Checking ****1234","opposing_line_entries":[{"amount":15000,"debit_credit":"debit","description":"Office supplies purchase","id":"019ab37c-a1b2-7c3d-e4f5-6a7b8c9d0e1f","ledger":{"id":"019ab37c-led2-7000-8000-000000000002","name":"Office Supplies","type":"expense"}}],"personal":false,"posted_status":"posted","reconciled":true,"review_status":"reviewed","updated_at":"2024-01-16T09:00:00Z"}},"TransactionListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TransactionListItemResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"TransactionListResponse","description":"Paginated list of transactions with cursor-based navigation.\n\nUses TransactionListItemResponse with comment_count for efficiency.\nUse GET /transactions/{id} to get full thread details with comments."},"TransactionMarkReconciledRequest":{"properties":{"transaction_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Transaction Ids","description":"Array of transaction UUIDs to mark as reconciled."}},"type":"object","title":"TransactionMarkReconciledRequest","description":"Request schema for batch marking transactions as reconciled.","example":{"transaction_ids":["019ab37c-0001-7000-8000-000000000001","019ab37c-0002-7000-8000-000000000002"]}},"TransactionMarkReviewedByPeriodRequest":{"properties":{"period_start":{"type":"string","format":"date","title":"Period Start","description":"Inclusive start date of the period (YYYY-MM-DD)."},"period_end":{"type":"string","format":"date","title":"Period End","description":"Inclusive end date of the period (YYYY-MM-DD)."}},"type":"object","required":["period_start","period_end"],"title":"TransactionMarkReviewedByPeriodRequest","description":"Request schema for bulk-marking every unreviewed transaction in a date range.","example":{"period_end":"2024-01-31","period_start":"2024-01-01"}},"TransactionMarkReviewedByPeriodResponse":{"properties":{"period_start":{"type":"string","format":"date","title":"Period Start"},"period_end":{"type":"string","format":"date","title":"Period End"},"marked_count":{"type":"integer","minimum":0.0,"title":"Marked Count","description":"Number of transactions transitioned to reviewed."}},"type":"object","required":["period_start","period_end","marked_count"],"title":"TransactionMarkReviewedByPeriodResponse","description":"Result of bulk-marking transactions reviewed in a date range."},"TransactionMarkReviewedRequest":{"properties":{"transaction_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Transaction Ids","description":"Array of transaction UUIDs to mark as reviewed."}},"type":"object","title":"TransactionMarkReviewedRequest","description":"Request schema for batch marking transactions as reviewed.","example":{"transaction_ids":["019ab37c-0001-7000-8000-000000000001","019ab37c-0002-7000-8000-000000000002","019ab37c-0003-7000-8000-000000000003"]}},"TransactionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier (UUID7)."},"amount":{"type":"integer","title":"Amount","description":"Amount in cents. Positive = deposit/income, negative = withdrawal/expense."},"currency":{"type":"string","title":"Currency","description":"Currency code (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"datetime":{"type":"string","format":"date","title":"Datetime","description":"The date the transaction occurred."},"counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty","description":"Clean counterparty/merchant name extracted from bank data."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Transaction memo/description (cleaned)."},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta","description":"Additional metadata (raw Plaid description in raw_plaid_description)."},"categorization_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Categorization Method","description":"How categorized: 'manual', 'rule', 'ai', or null if uncategorized."},"posted_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted Status","description":"Bank status: 'pending' or 'posted'."},"review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Status","description":"Review status: 'unreviewed', 'reviewed', 'flagged'."},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Transaction origin: 'manual', 'plaid', or 'bulk_upload'. Determines if the transaction can be deleted."},"opposing_line_entry_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Opposing Line Entry Ids","description":"Linked line entry UUIDs for categorization."},"personal":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Personal","description":"True if marked as personal (non-business) expense."},"journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Id","description":"Linked journal entry UUID."},"teal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Id","description":"External Teal accounting system ID."},"teal_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Ledger Id","description":"Teal ledger ID."},"teal_source_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Source Account Id","description":"Teal source account ID."},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"Bank account (ledger) UUID."},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name","description":"Bank account (ledger) name for display."},"ledger_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Type","description":"Ledger account type: asset, liability, equity, revenue, or expense."},"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id","description":"Business UUID."},"reconciled":{"type":"boolean","title":"Reconciled","description":"True if reconciled with bank statement.","default":false},"invoice_ids":{"items":{"type":"string"},"type":"array","title":"Invoice Ids","description":"Invoice UUIDs linked via payments (from invoice_payments junction table)."},"bill_ids":{"items":{"type":"string"},"type":"array","title":"Bill Ids","description":"Bill UUIDs linked via payments (from bill_payments junction table)."},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Record creation timestamp."},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp."},"thread":{"anyOf":[{"$ref":"#/components/schemas/TransactionThreadResponse"},{"type":"null"}],"description":"Comment thread if any discussion exists."},"journal_entry":{"anyOf":[{"$ref":"#/components/schemas/JournalEntryResponse"},{"type":"null"}],"description":"Full journal entry details if categorized."},"opposing_line_entries":{"items":{"$ref":"#/components/schemas/OpposingLineEntryResponse"},"type":"array","title":"Opposing Line Entries","description":"Opposing line entries showing the category/account(s) this transaction was posted to. Empty if uncategorized."},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"True iff the row is in soft-deleted (hidden) state. Hidden rows are excluded from list endpoints and reports; the Restore endpoint can bring them back.","default":false},"can_be_deleted":{"type":"boolean","title":"Can Be Deleted","description":"True iff the caller can delete this transaction. Manual and bulk-uploaded rows are permanently deletable on any engine; Plaid rows can be soft-deleted (hidden) only on the DayZero local accounting engine; Teal-engine and other-integration rows are not deletable.","default":false},"can_be_restored":{"type":"boolean","title":"Can Be Restored","description":"True iff the caller can restore this previously hidden Plaid transaction. Always False for non-Plaid sources and for rows that are not currently in deleted state.","default":false},"deletes_as_soft_hide":{"type":"boolean","title":"Deletes As Soft Hide","description":"True when DELETE will hide (soft-delete) this Plaid row on the DayZero local engine rather than permanently removing it.","default":false},"stripe_payout":{"anyOf":[{"$ref":"#/components/schemas/StripePayoutSummary"},{"type":"null"}],"description":"Linked Stripe payout when this transaction is a matched bank deposit."}},"additionalProperties":true,"type":"object","required":["id","amount","datetime"],"title":"TransactionResponse","description":"Response schema for a bank transaction.\n\nTransactions represent money movement in/out of connected bank accounts.\nEach transaction can be categorized, tagged, and linked to journal entries\nfor proper accounting treatment.","example":{"amount":-15000,"bill_ids":[],"business_id":"019ab37c-bus1-7000-8000-000000000001","can_be_deleted":true,"can_be_restored":false,"categorization_method":"rule","counterparty":"Staples","created_at":"2024-01-15T10:30:00Z","datetime":"2024-01-15","description":"Office Supplies","id":"019ab37c-0001-7000-8000-000000000001","invoice_ids":["019ab37c-inv1-7000-8000-000000000001"],"is_deleted":false,"journal_entry_id":"019ab37c-je01-7000-8000-000000000001","ledger_id":"019ab37c-led1-7000-8000-000000000001","ledger_name":"Chase Checking ****1234","meta":{"category_code":"5943","merchant_name":"Staples","raw_plaid_description":"a1b2c3d4-e5f6-7890-abcd-ef1234567890 | STAPLES | Mon Jan 15 2024 | -150.00 | Purchase | STAPLES | Office Supplies"},"opposing_line_entries":[{"amount":15000,"debit_credit":"debit","description":"Office supplies purchase","id":"019ab37c-a1b2-7c3d-e4f5-6a7b8c9d0e1f","ledger":{"id":"019ab37c-led2-7000-8000-000000000002","name":"Office Supplies","type":"expense"}}],"personal":false,"posted_status":"posted","reconciled":true,"review_status":"reviewed","updated_at":"2024-01-16T09:00:00Z"}},"TransactionSuggestedMatchesResponse":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the transaction."},"amount":{"type":"integer","title":"Amount","description":"Absolute transaction amount in cents."},"direction":{"type":"string","enum":["inflow","outflow"],"title":"Direction","description":"`inflow` (money in → invoices) or `outflow` (money out → bills)."},"matches":{"items":{"$ref":"#/components/schemas/SuggestedMatch"},"type":"array","title":"Matches","description":"Suggested matches ranked by confidence (highest first)."}},"type":"object","required":["transaction_id","amount","direction"],"title":"TransactionSuggestedMatchesResponse","description":"Suggested matches for a single transaction."},"TransactionThreadResponse":{"properties":{"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id","description":"UUID of the associated comment thread."},"comments":{"items":{"$ref":"#/components/schemas/CommentResponse"},"type":"array","title":"Comments","description":"List of comments in the thread."},"comment_count":{"type":"integer","title":"Comment Count","description":"Total number of comments.","default":0}},"type":"object","title":"TransactionThreadResponse","description":"Nested thread information for transactions.\n\nContains comment thread data when a transaction has associated comments/discussion."},"TransactionUpdateRequest":{"properties":{"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount","description":"Amount in cents."},"datetime":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Datetime","description":"Transaction date."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Transaction description."},"counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty","description":"Counterparty / merchant name override."},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta","description":"Metadata JSON object for storing additional transaction details."},"categorization_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Categorization Method","description":"How this transaction was categorized: 'manual', 'rule', 'ai'."},"posted_status":{"anyOf":[{"type":"string","enum":["not_posted","posted","deleted"]},{"type":"null"}],"title":"Posted Status","description":"Bank posting status: 'not_posted', 'posted', or 'deleted'."},"review_status":{"anyOf":[{"type":"string","enum":["unreviewed","reviewed"]},{"type":"null"}],"title":"Review Status","description":"Review status: 'unreviewed' or 'reviewed'."},"opposing_line_entry_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Opposing Line Entry Ids","description":"UUIDs of opposing line entries for double-entry accounting."},"personal":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Personal","description":"Mark as personal expense (not business-related)."},"journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Id","description":"UUID of linked journal entry for categorization."},"teal_source_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teal Source Account Id","description":"Teal accounting system source account ID."},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"UUID of the ledger (bank account) this transaction belongs to."},"reconciled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Reconciled","description":"Mark transaction as reconciled with bank statement."},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id","description":"UUID of linked invoice (for payment transactions)."}},"type":"object","title":"TransactionUpdateRequest","description":"Request schema for updating a transaction.\n\nAll fields are optional - only include the fields you want to update.","example":{"description":"Updated: Office supplies - Staples receipt #12345","reconciled":true,"review_status":"reviewed"}},"TransferCancelRequest":{"properties":{"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Reason"}},"type":"object","title":"TransferCancelRequest","description":"Schema for cancelling a transfer."},"TransferCreate":{"properties":{"transfer_number":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Transfer Number","description":"Human-readable transfer number"},"from_location_id":{"type":"string","title":"From Location Id","description":"Source location ID"},"to_location_id":{"type":"string","title":"To Location Id","description":"Destination location ID"},"transfer_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Transfer Date","description":"Date transfer ships"},"expected_arrival_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expected Arrival Date","description":"Expected arrival"},"tracking_number":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Tracking Number"},"carrier":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Carrier"},"shipping_cost":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Shipping Cost","description":"Confirmed shipping cost in cents (carrier invoice)."},"expected_freight_cost":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Expected Freight Cost","description":"Operator's freight estimate in cents at ship time."},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"},"items":{"items":{"$ref":"#/components/schemas/TransferItemCreate"},"type":"array","minItems":1,"title":"Items","description":"Items to transfer"}},"type":"object","required":["from_location_id","to_location_id","items"],"title":"TransferCreate","description":"Schema for creating a new transfer.","example":{"expected_arrival_date":"2026-01-15","from_location_id":"loc-uuid-1","items":[{"quantity":50,"variant_id":"var-uuid-1"},{"quantity":25,"variant_id":"var-uuid-2"}],"notes":"Monthly stock replenishment","to_location_id":"loc-uuid-2","transfer_number":"TRF-0001"}},"TransferInTransitSummary":{"properties":{"item_count":{"type":"integer","title":"Item Count","default":0},"total_quantity":{"type":"integer","title":"Total Quantity","default":0},"total_value":{"type":"integer","title":"Total Value","default":0}},"additionalProperties":true,"type":"object","title":"TransferInTransitSummary"},"TransferItemAddRequest":{"properties":{"variant_id":{"type":"string","title":"Variant Id","description":"Variant ID to add"},"quantity":{"type":"integer","exclusiveMinimum":0.0,"title":"Quantity","description":"Quantity to transfer"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes"}},"type":"object","required":["variant_id","quantity"],"title":"TransferItemAddRequest","description":"Request to add an item to an existing transfer."},"TransferItemCreate":{"properties":{"variant_id":{"type":"string","title":"Variant Id","description":"Variant being transferred"},"quantity":{"type":"integer","exclusiveMinimum":0.0,"title":"Quantity","description":"Quantity to transfer"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes"}},"type":"object","required":["variant_id","quantity"],"title":"TransferItemCreate","description":"Schema for creating a transfer item."},"TransferItemReceive":{"properties":{"transfer_item_id":{"type":"string","title":"Transfer Item Id","description":"ID of the transfer item"},"received_quantity":{"type":"integer","minimum":0.0,"title":"Received Quantity","description":"Actual quantity received"},"has_damage":{"type":"boolean","title":"Has Damage","default":false},"damage_notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Damage Notes"}},"type":"object","required":["transfer_item_id","received_quantity"],"title":"TransferItemReceive","description":"Schema for receiving a transfer item."},"TransferItemResponse":{"properties":{"variant_id":{"type":"string","title":"Variant Id","description":"Variant being transferred"},"quantity":{"type":"integer","exclusiveMinimum":0.0,"title":"Quantity","description":"Quantity to transfer"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes"},"id":{"type":"string","title":"Id"},"transfer_id":{"type":"string","title":"Transfer Id"},"received_quantity":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Received Quantity"},"has_damage":{"type":"boolean","title":"Has Damage","default":false},"damage_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Damage Notes"},"final_quantity":{"type":"integer","title":"Final Quantity"},"has_discrepancy":{"type":"boolean","title":"Has Discrepancy"},"discrepancy_amount":{"type":"integer","title":"Discrepancy Amount"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"variant_sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Sku"}},"type":"object","required":["variant_id","quantity","id","transfer_id","final_quantity","has_discrepancy","discrepancy_amount","created_at","updated_at"],"title":"TransferItemResponse","description":"Schema for transfer item response."},"TransferListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TransferResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"TransferListResponse","description":"Paginated list of transfers."},"TransferReceiveRequest":{"properties":{"received_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Received Date","description":"Date of receipt (defaults to today)"},"items":{"items":{"$ref":"#/components/schemas/TransferItemReceive"},"type":"array","minItems":1,"title":"Items","description":"Items received with quantities"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","required":["items"],"title":"TransferReceiveRequest","description":"Schema for receiving a transfer."},"TransferResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"transfer_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Number"},"status":{"$ref":"#/components/schemas/TransferStatusEnum"},"from_location_id":{"type":"string","title":"From Location Id"},"to_location_id":{"type":"string","title":"To Location Id"},"from_location":{"anyOf":[{"$ref":"#/components/schemas/LocationSummary"},{"type":"null"}]},"to_location":{"anyOf":[{"$ref":"#/components/schemas/LocationSummary"},{"type":"null"}]},"transfer_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Transfer Date"},"expected_arrival_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expected Arrival Date"},"received_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Received Date"},"tracking_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Number"},"carrier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Carrier"},"shipping_cost":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Shipping Cost"},"expected_freight_cost":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Freight Cost"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"items":{"items":{"$ref":"#/components/schemas/TransferItemResponse"},"type":"array","title":"Items","default":[]},"total_items":{"type":"integer","title":"Total Items","default":0},"total_quantity":{"type":"integer","title":"Total Quantity","default":0},"total_received_quantity":{"type":"integer","title":"Total Received Quantity","default":0},"has_discrepancy":{"type":"boolean","title":"Has Discrepancy","default":false},"is_editable":{"type":"boolean","title":"Is Editable","default":false},"can_ship":{"type":"boolean","title":"Can Ship","default":false},"can_receive":{"type":"boolean","title":"Can Receive","default":false},"can_cancel":{"type":"boolean","title":"Can Cancel","default":false},"shipped_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shipped By User Id"},"received_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Received By User Id"},"version":{"type":"integer","title":"Version","default":1},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"cost_basis":{"type":"integer","title":"Cost Basis","default":0},"bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Id"},"bill_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Status"},"bill_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Bill Amount"},"bill_balance_due":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Bill Balance Due"},"bill_received_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Bill Received On"},"bill_paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Bill Paid On"}},"type":"object","required":["id","business_id","status","from_location_id","to_location_id","created_at","updated_at"],"title":"TransferResponse","description":"Schema for transfer response."},"TransferShipRequest":{"properties":{"transfer_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Transfer Date","description":"Date of shipment (defaults to today)"},"tracking_number":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Tracking Number"},"carrier":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Carrier"},"expected_freight_cost":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Expected Freight Cost","description":"Operator's freight estimate in cents. Saved on the transfer at ship time and amortized onto destination cost lots when ``shipping_cost`` lands."}},"type":"object","title":"TransferShipRequest","description":"Schema for shipping a transfer."},"TransferStatusEnum":{"type":"string","enum":["draft","pending","in_transit","received","cancelled"],"title":"TransferStatusEnum","description":"Status of an inventory transfer."},"TransferSuggestion":{"properties":{"variant_id":{"type":"string","title":"Variant Id"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"from_location_id":{"type":"string","title":"From Location Id"},"to_location_id":{"type":"string","title":"To Location Id"},"from_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Location Name"},"to_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Location Name"},"donor_available":{"type":"number","title":"Donor Available"},"donor_reorder_point":{"type":"number","title":"Donor Reorder Point"},"receiver_on_hand":{"type":"number","title":"Receiver On Hand"},"receiver_reorder_point":{"type":"number","title":"Receiver Reorder Point"},"suggested_quantity":{"type":"integer","title":"Suggested Quantity"}},"type":"object","required":["variant_id","from_location_id","to_location_id","donor_available","donor_reorder_point","receiver_on_hand","receiver_reorder_point","suggested_quantity"],"title":"TransferSuggestion"},"TransferSuggestionsResponse":{"properties":{"suggestions":{"items":{"$ref":"#/components/schemas/TransferSuggestion"},"type":"array","title":"Suggestions"},"total":{"type":"integer","title":"Total","default":0}},"type":"object","title":"TransferSuggestionsResponse"},"TransferUpdate":{"properties":{"transfer_number":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Transfer Number"},"transfer_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Transfer Date"},"expected_arrival_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expected Arrival Date"},"tracking_number":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Tracking Number"},"carrier":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Carrier"},"shipping_cost":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Shipping Cost"},"expected_freight_cost":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Expected Freight Cost"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","title":"TransferUpdate","description":"Schema for updating a transfer."},"TriggerBillMatchingRequest":{"properties":{"min_confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Min Confidence","description":"Minimum confidence threshold (0.0–1.0)"},"auto_match":{"type":"boolean","title":"Auto Match","description":"If true, automatically accept high-confidence matches (>= 0.85)","default":false},"bill_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Bill Ids","description":"Limit matching to specific bill UUIDs"}},"type":"object","title":"TriggerBillMatchingRequest","description":"Request schema for triggering bill payment matching."},"TriggerBillMatchingResponse":{"properties":{"suggestions_created":{"type":"integer","title":"Suggestions Created","description":"New suggestions created","default":0},"auto_linked":{"type":"integer","title":"Auto Linked","description":"Auto-accepted high-confidence matches","default":0},"total_candidates":{"type":"integer","title":"Total Candidates","description":"Total candidates evaluated","default":0}},"type":"object","title":"TriggerBillMatchingResponse","description":"Response schema for bill payment matching results."},"UnappliedTransaction":{"properties":{"id":{"type":"string","title":"Id"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty"},"amount":{"type":"integer","title":"Amount","description":"Full transaction amount in cents."},"applied":{"type":"integer","title":"Applied","description":"Amount already applied in cents."},"unapplied":{"type":"integer","title":"Unapplied","description":"Remaining unapplied amount in cents."},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name"}},"type":"object","required":["id","amount","applied","unapplied"],"title":"UnappliedTransaction","description":"A deposit transaction with remaining unapplied balance."},"UndepositedItem":{"properties":{"receipt_id":{"type":"string","title":"Receipt Id"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"receipt_date":{"type":"string","format":"date","title":"Receipt Date"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"total":{"type":"integer","title":"Total"},"deposit_to_ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deposit To Ledger Name"}},"type":"object","required":["receipt_id","receipt_date","total"],"title":"UndepositedItem","description":"A posted sales receipt sitting in Undeposited Funds, awaiting deposit."},"UndepositedItemsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UndepositedItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"UndepositedItemsResponse","description":"The undeposited-funds queue plus its running total (cents)."},"UnitCostBulkApplyRequest":{"properties":{"updates":{"items":{"$ref":"#/components/schemas/UnitCostBulkUpdateRowInput"},"type":"array","maxItems":5000,"minItems":1,"title":"Updates","description":"Rows with new_unit_cost_cents set and validated via preview."}},"type":"object","required":["updates"],"title":"UnitCostBulkApplyRequest","description":"Confirmed unit-cost updates to apply."},"UnitCostBulkApplyResponse":{"properties":{"updated_count":{"type":"integer","title":"Updated Count"},"skipped_count":{"type":"integer","title":"Skipped Count"},"error_count":{"type":"integer","title":"Error Count"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","required":["updated_count","skipped_count","error_count"],"title":"UnitCostBulkApplyResponse","description":"Result of applying unit-cost bulk updates."},"UnitCostBulkPreviewRequest":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/UnitCostBulkUpdateRowInput"},"type":"array","maxItems":5000,"minItems":1,"title":"Rows","description":"Rows from the uploaded CSV after client-side parsing."}},"type":"object","required":["rows"],"title":"UnitCostBulkPreviewRequest","description":"Parsed CSV rows to validate before applying unit-cost updates."},"UnitCostBulkPreviewResponse":{"properties":{"total_rows":{"type":"integer","title":"Total Rows"},"to_update":{"type":"integer","title":"To Update"},"unchanged":{"type":"integer","title":"Unchanged"},"skipped":{"type":"integer","title":"Skipped"},"errors":{"type":"integer","title":"Errors"},"rows":{"items":{"$ref":"#/components/schemas/UnitCostBulkPreviewRow"},"type":"array","title":"Rows"}},"type":"object","required":["total_rows","to_update","unchanged","skipped","errors","rows"],"title":"UnitCostBulkPreviewResponse","description":"Summary and per-row preview for a unit-cost bulk upload."},"UnitCostBulkPreviewRow":{"properties":{"row_number":{"type":"integer","title":"Row Number"},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id"},"sku":{"type":"string","title":"Sku"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"current_unit_cost_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Unit Cost Cents"},"new_unit_cost_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"New Unit Cost Cents"},"status":{"type":"string","title":"Status","description":"update | unchanged | skip | error"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},"type":"object","required":["row_number","sku","status"],"title":"UnitCostBulkPreviewRow","description":"Preview result for a single row."},"UnitCostBulkUpdateRowInput":{"properties":{"row_number":{"type":"integer","minimum":1.0,"title":"Row Number","description":"1-based row number from the spreadsheet."},"sku":{"type":"string","maxLength":100,"minLength":1,"title":"Sku","description":"Variant SKU."},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Optional variant UUID; when set, used instead of SKU matching."},"new_unit_cost_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"New Unit Cost Cents","description":"New unit cost in cents. Omit or null to skip the row."}},"type":"object","required":["row_number","sku"],"title":"UnitCostBulkUpdateRowInput","description":"One CSV row for unit-cost bulk preview/apply."},"UnitEconomicsSettingsUpdateRequest":{"properties":{"aov_mode":{"type":"string","pattern":"^(shopify|manual)$","title":"Aov Mode","description":"AOV source mode: 'shopify' or 'manual'."},"manual_aov_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Manual Aov Cents","description":"Manual AOV override in cents; required when aov_mode='manual'."},"shopify_sections":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Shopify Sections","description":"Optional list of CFO sections where Shopify data is allowed to flow. If omitted, existing scope is preserved. Example: ['unit-economics', 'shipping-analysis']"}},"type":"object","required":["aov_mode"],"title":"UnitEconomicsSettingsUpdateRequest","description":"Request payload for Unit Economics input settings."},"UnreadCountResponse":{"properties":{"unread_conversations":{"type":"integer","title":"Unread Conversations","description":"Number of conversations with unread messages","default":0}},"type":"object","title":"UnreadCountResponse","description":"Unread message count for sidebar badge."},"UpdateConversationStatusRequest":{"properties":{"status":{"$ref":"#/components/schemas/ConversationStatus","description":"New conversation status"}},"type":"object","required":["status"],"title":"UpdateConversationStatusRequest","description":"Update conversation status (advisor-only).","example":{"status":"resolved"}},"UpdateEntriesStartRequest":{"properties":{"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id","description":"Business ID"},"entries_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entries Start","description":"Entries start date in YYYY-MM-DD format"}},"type":"object","title":"UpdateEntriesStartRequest","description":"Request schema for updating entries start date."},"UpdateEntriesStartResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the update was successful"},"entries_start":{"type":"string","format":"date-time","title":"Entries Start","description":"Updated entries start date"}},"type":"object","required":["success","entries_start"],"title":"UpdateEntriesStartResponse","description":"Response schema for updating entries start date."},"UpdateReorderSettingsRequest":{"properties":{"reorder_point":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Reorder Point","description":"Trigger reorder when available falls to or below this."},"reorder_quantity":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Reorder Quantity","description":"Quantity to order when reorder point is reached."}},"type":"object","title":"UpdateReorderSettingsRequest","description":"Update per-location reorder point and reorder quantity for a variant."},"UpdateSettingsResponse":{"properties":{"monthly_limit_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Limit Cents"}},"additionalProperties":true,"type":"object","title":"UpdateSettingsResponse","description":"Response for ``update_settings``."},"UpdateSlideRequest":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"hidden":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hidden"}},"additionalProperties":false,"type":"object","title":"UpdateSlideRequest","description":"Body for ``PATCH /ai-reporting/decks/{deck_id}/slides/{slide_id}``."},"UpdateStaffAssignmentRequest":{"properties":{"engagement_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engagement Type"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"UpdateStaffAssignmentRequest","description":"Request to update engagement metadata on an assignment."},"UpdateStripeCustomerRequest":{"properties":{"stripe_customer_id":{"type":"string","title":"Stripe Customer Id","description":"Stripe customer ID (e.g., cus_xxx)"}},"type":"object","required":["stripe_customer_id"],"title":"UpdateStripeCustomerRequest","description":"Request schema for linking an advisory firm to a Stripe customer."},"UpdateStripeCustomerResponse":{"properties":{"advisory_firm_id":{"type":"string","title":"Advisory Firm Id","description":"Advisory firm ID"},"stripe_customer_id":{"type":"string","title":"Stripe Customer Id","description":"Linked Stripe customer ID"}},"type":"object","required":["advisory_firm_id","stripe_customer_id"],"title":"UpdateStripeCustomerResponse","description":"Response schema for linking an advisory firm to a Stripe customer."},"UpdateStripeSubscriptionRequest":{"properties":{"stripe_subscription_id":{"type":"string","title":"Stripe Subscription Id","description":"Stripe subscription ID (e.g., sub_xxx)"}},"type":"object","required":["stripe_subscription_id"],"title":"UpdateStripeSubscriptionRequest","description":"Request schema for updating a business's Stripe subscription ID."},"UpdateStripeSubscriptionResponse":{"properties":{"business_id":{"type":"string","title":"Business Id","description":"Business ID"},"stripe_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Subscription Id","description":"Updated Stripe subscription ID"}},"type":"object","required":["business_id"],"title":"UpdateStripeSubscriptionResponse","description":"Response schema for updating a business's Stripe subscription ID."},"UpdateSubscriptionRequest":{"properties":{"counterparty_key":{"type":"string","title":"Counterparty Key"},"registry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registry Id"},"custom_name":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Custom Name"},"custom_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Custom Amount Cents","description":"Override monthly cost in cents"},"custom_frequency":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Custom Frequency"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","required":["counterparty_key"],"title":"UpdateSubscriptionRequest"},"UpdateSubscriptionResponse":{"properties":{"status":{"type":"string","title":"Status"},"counterparty_key":{"type":"string","title":"Counterparty Key"}},"additionalProperties":true,"type":"object","required":["status","counterparty_key"],"title":"UpdateSubscriptionResponse","description":"Response for ``update_subscription``."},"UpdateTeamRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"UpdateTeamRequest","description":"Request to update a firm team."},"UpdateThresholdsRequest":{"properties":{"auto_approve_max_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Auto Approve Max Cents","description":"Max bill amount (cents) for auto-approval. Must be less than ops threshold."},"ops_approve_max_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Ops Approve Max Cents","description":"Max bill amount (cents) for ops-tier approval. Must be greater than auto threshold."},"escalation_hours":{"anyOf":[{"type":"integer","maximum":720.0,"minimum":1.0},{"type":"null"}],"title":"Escalation Hours","description":"Hours before a pending approval automatically escalates to the next tier. Applies to ops and advisor gates. Set to null to use per-gate defaults."}},"type":"object","title":"UpdateThresholdsRequest","description":"Body for ``PATCH /ap-approval/thresholds``.\n\nAll fields are optional — only provided fields are updated."},"UpdateThresholdsResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id","description":"Workflow UUID."},"auto_approve_max_cents":{"type":"integer","title":"Auto Approve Max Cents","description":"Auto-approve threshold in cents."},"ops_approve_max_cents":{"type":"integer","title":"Ops Approve Max Cents","description":"Ops approval threshold in cents."},"escalation_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Escalation Hours","description":"Escalation timeout in hours (null = per-gate default)."}},"type":"object","required":["workflow_id","auto_approve_max_cents","ops_approve_max_cents"],"title":"UpdateThresholdsResponse","description":"Response for ``PATCH /ap-approval/thresholds``."},"UpdateUserRoleInBusinessResponse":{"properties":{"business_id":{"type":"string","title":"Business Id"},"user_id":{"type":"string","title":"User Id"},"new_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Role"}},"additionalProperties":true,"type":"object","required":["business_id","user_id"],"title":"UpdateUserRoleInBusinessResponse","description":"Envelope data for ``update_user_role_in_business``."},"UploadBillFileResponse":{"properties":{"s3_key":{"type":"string","title":"S3 Key"}},"additionalProperties":true,"type":"object","required":["s3_key"],"title":"UploadBillFileResponse","description":"Response for ``upload_bill_file``."},"UpsertProfileResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"accounting_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accounting Basis"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"key_personnel":{"items":{"type":"string"},"type":"array","title":"Key Personnel","default":[]},"convention_overrides":{"additionalProperties":{"type":"string"},"type":"object","title":"Convention Overrides","default":{}},"tax_remittance_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Remittance Ledger Id"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"additionalProperties":true,"type":"object","required":["id","business_id"],"title":"UpsertProfileResponse","description":"Response for ``upsert_profile``."},"UserCreate":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"User email address (unique identifier)."},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"User's first name."},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"User's last name."},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Photo Url","description":"URL to user's profile photo."},"onboarded":{"type":"boolean","title":"Onboarded","description":"Whether user has completed onboarding.","default":false},"props":{"additionalProperties":true,"type":"object","title":"Props","description":"Additional user properties/settings."}},"type":"object","required":["email"],"title":"UserCreate","description":"Request schema for creating a new user.\n\nUsers can be associated with multiple businesses with different roles.","example":{"email":"john.doe@example.com","first_name":"John","last_name":"Doe","onboarded":false,"photo_url":"https://example.com/photos/john.jpg","props":{"timezone":"America/Los_Angeles"}}},"UserCursorListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UserResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"UserCursorListResponse","description":"Paginated list of users with cursor-based navigation."},"UserFirmAssociationCreateRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User UUID. Supply either user_id or email."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email. When provided without user_id, the backend resolves it."},"role":{"type":"string","enum":["owner","admin","member","client"],"title":"Role","description":"User's role in the firm. `owner`: Full access + billing + user management. `admin`: Full access + user management (no billing). `member`: Access to assigned businesses only.","default":"member"}},"type":"object","title":"UserFirmAssociationCreateRequest"},"UserFirmAssociationResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"advisory_firm_id":{"type":"string","title":"Advisory Firm Id"},"role":{"type":"string","enum":["owner","admin","member","client"],"title":"Role","description":"User's role in the firm. `owner`: Full access + billing + user management. `admin`: Full access + user management (no billing). `member`: Access to assigned businesses only.","default":"member"}},"type":"object","required":["id","user_id","advisory_firm_id"],"title":"UserFirmAssociationResponse"},"UserResponse":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"User email address (unique identifier)."},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"User's first name."},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"User's last name."},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Photo Url","description":"URL to user's profile photo."},"onboarded":{"type":"boolean","title":"Onboarded","description":"Whether user has completed onboarding.","default":false},"props":{"additionalProperties":true,"type":"object","title":"Props","description":"Additional user properties/settings."},"id":{"type":"string","title":"Id","description":"User UUID."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Account creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last profile update timestamp."},"firm_ids":{"items":{"type":"string"},"type":"array","title":"Firm Ids","description":"Advisory firm UUIDs the user belongs to."},"role":{"anyOf":[{"$ref":"#/components/schemas/Role"},{"type":"null"}],"description":"User's role in a business (only included when filtering by business_id)."}},"type":"object","required":["email","id","created_at","updated_at"],"title":"UserResponse","description":"Response schema for a user.\n\nContains user profile information and firm associations.","example":{"created_at":"2024-01-10T10:30:00Z","email":"john.doe@example.com","firm_ids":[],"first_name":"John","id":"019ab37c-user-7000-8000-000000000001","last_name":"Doe","onboarded":true,"photo_url":"https://example.com/photos/john.jpg","props":{"timezone":"America/Los_Angeles"},"updated_at":"2024-01-15T14:00:00Z"}},"UserRoleUpdateRequest":{"properties":{"role":{"type":"string","enum":["owner","admin","member","client"],"title":"Role","description":"New role for the user. `owner`: Full access + billing + user management. `admin`: Full access + user management (no billing). `member`: Access to assigned businesses only."}},"type":"object","required":["role"],"title":"UserRoleUpdateRequest"},"UserSource":{"type":"string","enum":["business_user","advisor_user"],"title":"UserSource","description":"Source of user association with a business."},"UserUpdate":{"properties":{"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"Updated first name."},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Updated last name."},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Photo Url","description":"Updated photo URL."},"onboarded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Onboarded","description":"Mark onboarding complete."},"props":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Props","description":"Updated user properties."}},"type":"object","title":"UserUpdate","description":"Request schema for updating a user.\n\nAll fields are optional - only include fields you want to change.","example":{"first_name":"Jonathan","onboarded":true,"props":{"theme":"dark","timezone":"America/New_York"}}},"ValidateCoaTemplateResponse":{"properties":{"valid":{"type":"boolean","title":"Valid","description":"Whether the COA template is valid"},"errors":{"items":{"$ref":"#/components/schemas/CoaValidationError"},"type":"array","title":"Errors","description":"List of validation errors (empty when valid)"},"ledger_count":{"type":"integer","title":"Ledger Count","description":"Number of ledgers in the template","default":0}},"additionalProperties":true,"type":"object","required":["valid"],"title":"ValidateCoaTemplateResponse","description":"Envelope data for ``validate_coa_template``."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ValuationBucket":{"properties":{"key":{"type":"string","title":"Key","description":"Group key (id or label)."},"label":{"type":"string","title":"Label","description":"Human-readable label."},"on_hand_units":{"type":"number","title":"On Hand Units","description":"Sum of `quantity_remaining` across lots."},"total_value_cents":{"type":"integer","title":"Total Value Cents","description":"Sum of `quantity_remaining * unit_cost_cents` across lots."},"lot_count":{"type":"integer","title":"Lot Count","description":"Number of contributing lots."}},"type":"object","required":["key","label","on_hand_units","total_value_cents","lot_count"],"title":"ValuationBucket","description":"One row of a valuation breakdown."},"ValuationResponse":{"properties":{"group_by":{"type":"string","enum":["location","category","vendor"],"title":"Group By"},"total_value_cents":{"type":"integer","title":"Total Value Cents","default":0},"total_on_hand_units":{"type":"number","title":"Total On Hand Units","default":0},"buckets":{"items":{"$ref":"#/components/schemas/ValuationBucket"},"type":"array","title":"Buckets"}},"type":"object","required":["group_by"],"title":"ValuationResponse"},"VariableDriverValue":{"properties":{"pct_rev":{"type":"number","title":"Pct Rev","description":"Fraction of projected revenue, e.g. 0.085","default":0.0}},"type":"object","title":"VariableDriverValue"},"VarianceTypeEnum":{"type":"string","enum":["favorable","unfavorable","neutral"],"title":"VarianceTypeEnum","description":"Variance classification."},"VariantCostHistory":{"properties":{"variant_id":{"type":"string","title":"Variant Id"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"variant_sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Sku"},"product_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Id"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"points":{"items":{"$ref":"#/components/schemas/CostSnapshotPoint"},"type":"array","title":"Points"},"latest_total_per_unit":{"type":"integer","title":"Latest Total Per Unit","default":0},"trailing_delta_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trailing Delta Pct","description":"Percent change vs. the earliest point in the window. Null if <2 points."}},"type":"object","required":["variant_id"],"title":"VariantCostHistory"},"VariantCreateRequest":{"properties":{"product_id":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Product Id","description":"UUID of the parent product this variant belongs to."},"unit_price":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Unit Price","description":"Sale price in cents (e.g., 2999 = $29.99)."},"unit_cost":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Unit Cost","description":"Cost price in cents for margin calculations."},"unit_cost_precise":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Unit Cost Precise","description":"Precise unit cost in dollars with sub-cent precision (e.g. 0.0478 for $0.0478/gram)."},"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name","description":"Variant name (e.g., 'Large - Blue')."},"sku":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Sku","description":"Stock Keeping Unit - unique identifier for inventory."},"manufacturer_sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Manufacturer Sku","description":"Manufacturer's SKU for supplier ordering."},"barcode":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Barcode","description":"Scannable barcode (UPC/EAN/QR). Distinct from SKU."},"uom":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Uom","description":"Unit of measure: EA, LB, G, KG, OZ, L, ML, etc."},"default_vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Vendor Id","description":"UUID of the preferred vendor for this variant."},"initial_inventory_quantity":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Initial Inventory Quantity","description":"Starting inventory quantity.","default":0},"initial_inventory_quantity_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Initial Inventory Quantity Date","description":"Date for the initial inventory count (ISO 8601)."}},"type":"object","title":"VariantCreateRequest","description":"Request schema for creating a product variant.\n\nVariants represent different versions of a product (size, color, etc.)\nwith their own SKU, pricing, and inventory levels.","example":{"initial_inventory_quantity":50,"name":"Large - Blue","product_id":"019ab37c-prod-7000-8000-000000000001","sku":"WIDGET-PRO-LG-BLU","unit_cost":1200,"unit_price":2999}},"VariantInventoryAcrossLocations":{"properties":{"variant_id":{"type":"string","title":"Variant Id"},"variant_name":{"type":"string","title":"Variant Name"},"variant_sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Sku"},"total_on_hand":{"type":"integer","title":"Total On Hand","default":0},"total_available":{"type":"integer","title":"Total Available","default":0},"unit_cost_cents":{"type":"integer","title":"Unit Cost Cents","default":0},"locations":{"items":{"$ref":"#/components/schemas/VariantLocationLevel"},"type":"array","title":"Locations","default":[]}},"type":"object","required":["variant_id","variant_name"],"title":"VariantInventoryAcrossLocations","description":"Total inventory for a variant across all locations."},"VariantLocationLevel":{"properties":{"location_id":{"type":"string","title":"Location Id"},"location_name":{"type":"string","title":"Location Name"},"location_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Code"},"on_hand":{"type":"integer","title":"On Hand","default":0},"available":{"type":"integer","title":"Available","default":0},"reorder_point":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reorder Point"},"reorder_quantity":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reorder Quantity"},"needs_reorder":{"type":"boolean","title":"Needs Reorder","default":false}},"type":"object","required":["location_id","location_name"],"title":"VariantLocationLevel","description":"Inventory level for a variant at a specific location."},"VariantLocationQuantityInput":{"properties":{"location_id":{"type":"string","title":"Location Id","description":"Location UUID."},"on_hand":{"type":"number","minimum":0.0,"title":"On Hand","description":"Absolute on-hand quantity to set at this location."}},"type":"object","required":["location_id","on_hand"],"title":"VariantLocationQuantityInput","description":"Absolute on-hand quantity for a variant at one location."},"VariantResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Variant UUID."},"product_id":{"type":"string","title":"Product Id","description":"Parent product UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"name":{"type":"string","title":"Name","description":"Variant name."},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku","description":"Stock Keeping Unit."},"manufacturer_sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manufacturer Sku","description":"Manufacturer's SKU."},"barcode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Barcode","description":"Scannable barcode (UPC/EAN/QR). Distinct from SKU."},"archived":{"type":"boolean","title":"Archived","description":"Whether variant is archived.","default":false},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price","description":"Unit price in dollars (legacy field, prefer unit_price)."},"cost":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost","description":"Unit cost in dollars (legacy field, prefer unit_cost)."},"inventory_quantity":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inventory Quantity","description":"Current inventory quantity (legacy, prefer inventory.on_hand)."},"shopify_variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shopify Variant Id","description":"Shopify variant ID if synced from Shopify."},"stripe_price_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Price Id","description":"Stripe price ID if synced to Stripe."},"stripe_product_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Product Id","description":"Stripe product ID if synced to Stripe."},"unit_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Price","description":"Sale price in cents."},"unit_cost":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Cost","description":"Cost price in cents."},"unit_cost_precise":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unit Cost Precise","description":"Precise unit cost in dollars with sub-cent precision."},"uom":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uom","description":"Unit of measure: EA, LB, G, KG, OZ, etc."},"default_vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Vendor Id","description":"Preferred vendor UUID."},"inventory":{"anyOf":[{"$ref":"#/components/schemas/InventorySummary"},{"type":"null"}],"description":"Detailed inventory breakdown."},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name","description":"Parent product name (resolved)."},"margin_cents":{"type":"integer","title":"Margin Cents","description":"Profit margin in cents (unit_price - unit_cost).","readOnly":true},"margin_percentage":{"type":"number","title":"Margin Percentage","description":"Profit margin as percentage of sale price.","readOnly":true}},"additionalProperties":true,"type":"object","required":["id","product_id","business_id","created_at","updated_at","name","margin_cents","margin_percentage"],"title":"VariantResponse","description":"Response schema for a product variant.\n\nContains pricing, inventory, and margin information.\nIncludes computed fields for profit margin calculations.","example":{"archived":false,"business_id":"019ab37c-bus1-7000-8000-000000000001","created_at":"2024-01-10T10:30:00Z","id":"019ab37c-var1-7000-8000-000000000001","inventory":{"available":50,"in_transit":0,"on_hand":50,"ordered":0},"manufacturer_sku":"MFR-12345","margin_cents":1799,"margin_percentage":60.02,"name":"Large - Blue","product_id":"019ab37c-prod-7000-8000-000000000001","product_name":"Premium Widget","sku":"WIDGET-PRO-LG-BLU","unit_cost":1200,"unit_price":2999,"updated_at":"2024-01-15T14:00:00Z"}},"VariantUpdateRequest":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Variant UUID (set from URL path)."},"unit_price":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Unit Price","description":"Sale price in cents (e.g., 2999 = $29.99)."},"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name","description":"Variant name (e.g., 'Large - Blue')."},"sku":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Sku","description":"Stock Keeping Unit for inventory tracking."},"manufacturer_sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Manufacturer Sku","description":"Manufacturer's SKU for ordering from suppliers."},"barcode":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Barcode","description":"Scannable barcode (UPC/EAN/QR). Distinct from SKU."},"unit_cost":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Unit Cost","description":"Cost price in cents for margin calculations."},"unit_cost_precise":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Unit Cost Precise","description":"Precise unit cost in dollars with sub-cent precision (e.g. 0.0478)."},"uom":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Uom","description":"Unit of measure: EA, LB, G, KG, OZ, L, ML, etc."},"default_vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Vendor Id","description":"UUID of the preferred vendor for this variant."},"archived":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Archived","description":"Set to true to archive (hide) the variant."},"initial_inventory_quantity":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Initial Inventory Quantity","description":"Set initial inventory count (use when first setting up)."},"initial_inventory_quantity_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Initial Inventory Quantity Date","description":"Date for the initial inventory count (ISO 8601)."}},"type":"object","title":"VariantUpdateRequest","description":"Request schema for updating a product variant.\n\nAll fields are optional - only include fields you want to change.","example":{"sku":"WIDGET-PRO-LG-BLU","unit_cost":1500,"unit_price":3499}},"VariantsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VariantResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"VariantsListResponse","description":"Paginated list of variants with cursor-based navigation."},"VendorBulkRowError":{"properties":{"row":{"type":"integer","title":"Row","description":"1-based row number from the CSV."},"error":{"type":"string","title":"Error","description":"Description of the validation error."}},"type":"object","required":["row","error"],"title":"VendorBulkRowError","description":"Error detail for a single row in a bulk upload."},"VendorBulkUploadResponse":{"properties":{"created":{"type":"integer","title":"Created","description":"Number of vendors successfully created.","default":0},"skipped":{"type":"integer","title":"Skipped","description":"Number of rows skipped (duplicates).","default":0},"errors":{"items":{"$ref":"#/components/schemas/VendorBulkRowError"},"type":"array","title":"Errors","description":"Per-row validation errors."}},"type":"object","title":"VendorBulkUploadResponse","description":"Response for bulk vendor CSV upload."},"VendorContactResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Contact UUID."},"vendor_id":{"type":"string","title":"Vendor Id","description":"Vendor UUID."},"name":{"type":"string","title":"Name","description":"Contact name."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Contact email."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Contact phone."},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role","description":"Contact role (e.g., 'Sales', 'Support')."},"is_primary":{"type":"boolean","title":"Is Primary","description":"Whether this is the primary contact.","default":false},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Notes about this contact."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."}},"type":"object","required":["id","vendor_id","name","created_at","updated_at"],"title":"VendorContactResponse","description":"Response schema for a vendor contact."},"VendorContractCreateRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Contract/agreement name."},"vendor_id":{"type":"string","title":"Vendor Id","description":"Vendor UUID."},"status":{"type":"string","title":"Status","description":"Contract status: draft, active, expired, terminated.","default":"draft"},"effective_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Effective Date","description":"Contract start date."},"expiration_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expiration Date","description":"Contract end date."},"contracted_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Contracted Amount Cents","description":"Agreed amount per billing period in cents."},"billing_frequency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Frequency","description":"Billing frequency: monthly, quarterly, annually, one_time, weekly, biweekly."},"terms_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Terms Summary","description":"Summary of key contract terms (AI-extracted or manual)."},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key","description":"S3 key for the original MSA/contract PDF."}},"type":"object","required":["name","vendor_id"],"title":"VendorContractCreateRequest","description":"Request schema for creating a vendor contract."},"VendorContractListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VendorContractResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"VendorContractListResponse","description":"Paginated list of vendor contracts."},"VendorContractResponse":{"properties":{"name":{"type":"string","title":"Name","description":"Contract/agreement name."},"vendor_id":{"type":"string","title":"Vendor Id","description":"Vendor UUID."},"status":{"type":"string","title":"Status","description":"Contract status: draft, active, expired, terminated.","default":"draft"},"effective_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Effective Date","description":"Contract start date."},"expiration_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expiration Date","description":"Contract end date."},"contracted_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Contracted Amount Cents","description":"Agreed amount per billing period in cents."},"billing_frequency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Frequency","description":"Billing frequency: monthly, quarterly, annually, one_time, weekly, biweekly."},"terms_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Terms Summary","description":"Summary of key contract terms (AI-extracted or manual)."},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key","description":"S3 key for the original MSA/contract PDF."},"id":{"type":"string","title":"Id","description":"Contract UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name","description":"Vendor name (resolved)."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["name","vendor_id","id","business_id"],"title":"VendorContractResponse","description":"Response schema for a vendor contract."},"VendorContractUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"effective_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Effective Date"},"expiration_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expiration Date"},"contracted_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Contracted Amount Cents"},"billing_frequency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Frequency"},"terms_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Terms Summary"},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key"}},"type":"object","title":"VendorContractUpdateRequest","description":"Request schema for updating a vendor contract."},"VendorCreateRequest":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Vendor name (company or individual)."},"email":{"type":"string","format":"email","title":"Email","description":"Vendor email for communications."},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"Vendor business address."},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone","description":"Vendor phone number."},"tax_id":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Tax Id","description":"Tax identification number (EIN, VAT, etc.)."},"website":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Website","description":"Vendor website URL."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Internal notes about this vendor."},"credit_limit_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Credit Limit Cents","description":"Credit limit in cents."},"default_payment_term_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Payment Term Id","description":"Default payment term ID for new bills."},"status":{"$ref":"#/components/schemas/CounterpartyStatus","description":"Vendor status (active, inactive, blocked).","default":"active"},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category","description":"Business category (e.g., 'Raw Materials', 'Services')."}},"type":"object","required":["name","email"],"title":"VendorCreateRequest","description":"Request schema for creating a new vendor.\n\nVendors are the companies or individuals you purchase from and receive bills from.\nSupports credit limits, default payment terms, tax IDs, and categorization.","example":{"address":"123 Industrial Way, Oakland, CA 94612","category":"Raw Materials","email":"orders@acmesupplies.com","name":"Acme Supplies","phone":"(555) 987-6543","status":"active","tax_id":"98-7654321","website":"https://acmesupplies.com"}},"VendorCreditApplicationCreate":{"properties":{"bill_id":{"type":"string","title":"Bill Id","description":"Bill to apply credit to"},"amount_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount Cents","description":"Amount to apply in cents"}},"type":"object","required":["bill_id","amount_cents"],"title":"VendorCreditApplicationCreate","description":"Request schema for applying a vendor credit to a bill.","example":{"amount_cents":2500,"bill_id":"019ab37c-bill-7000-8000-000000000002"}},"VendorCreditApplicationResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Application record ID"},"vendor_credit_id":{"type":"string","title":"Vendor Credit Id","description":"Source vendor credit ID"},"bill_id":{"type":"string","title":"Bill Id","description":"Bill the credit was applied to"},"amount_applied":{"type":"integer","title":"Amount Applied","description":"Amount applied in cents"},"amount_applied_dollars":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount Applied Dollars","description":"Amount applied in dollars"},"applied_at":{"type":"string","format":"date-time","title":"Applied At","description":"When the credit was applied"},"applied_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applied By User Id","description":"User who applied the credit"},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Number","description":"Vendor bill number (when application loaded with bill)"}},"type":"object","required":["id","vendor_credit_id","bill_id","amount_applied","amount_applied_dollars","applied_at"],"title":"VendorCreditApplicationResponse","description":"Response schema for a vendor credit application."},"VendorCreditCreate":{"properties":{"vendor_id":{"type":"string","title":"Vendor Id","description":"Vendor issuing the credit"},"amount_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount Cents","description":"Credit amount in cents"},"reason":{"$ref":"#/components/schemas/VendorCreditReasonEnum","description":"Reason for the vendor credit","default":"other"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the credit"},"bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Id","description":"Original bill being credited (optional)"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"Expense or asset ledger to reverse when issued (defaults to Uncategorized Expense)"},"issue_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issue Date","description":"Issue date (defaults to today)"},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/VendorCreditLineItem"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Optional line items for credit detail"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes","description":"Internal notes"},"vendor_credit_number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Vendor Credit Number","description":"Vendor's reference number from the credit document"}},"type":"object","required":["vendor_id","amount_cents"],"title":"VendorCreditCreate","description":"Request schema for creating a vendor credit.","example":{"amount_cents":5000,"bill_id":"019ab37c-bill-7000-8000-000000000001","description":"Overcharged on bill #BILL-001","reason":"pricing_error","vendor_credit_number":"CM-9087","vendor_id":"019ab37c-vend-7000-8000-000000000001"}},"VendorCreditLineItem":{"properties":{"description":{"type":"string","title":"Description","description":"Line item description"},"quantity":{"type":"integer","minimum":1.0,"title":"Quantity","description":"Quantity","default":1},"unit_price_cents":{"type":"integer","title":"Unit Price Cents","description":"Unit price in cents"},"amount_cents":{"type":"integer","title":"Amount Cents","description":"Total amount in cents (qty * unit_price)"}},"type":"object","required":["description","unit_price_cents","amount_cents"],"title":"VendorCreditLineItem","description":"Line item for vendor credit details."},"VendorCreditReasonEnum":{"type":"string","enum":["returned_goods","damaged_goods","service_issue","pricing_error","billing_adjustment","rebate","duplicate_charge","other"],"title":"VendorCreditReasonEnum","description":"Standard reasons for receiving a vendor credit."},"VendorCreditResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Vendor credit ID"},"business_id":{"type":"string","title":"Business Id","description":"Business receiving the credit"},"vendor_id":{"type":"string","title":"Vendor Id","description":"Vendor issuing the credit"},"bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Id","description":"Original bill being credited"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"Expense or asset ledger reversed on issue"},"journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Id","description":"Journal entry posted when the credit was issued"},"void_journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Void Journal Entry Id","description":"Reversing journal entry posted on void"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number","description":"Auto-generated vendor credit number (e.g. VC-0001)"},"vendor_credit_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Credit Number","description":"Vendor's own reference number (from the credit doc)"},"status":{"type":"string","title":"Status","description":"Status: draft, issued, partially_applied, applied, void"},"currency":{"type":"string","title":"Currency","description":"ISO currency code (e.g. USD)"},"amount":{"type":"integer","title":"Amount","description":"Total credit amount in cents"},"amount_in_dollars":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount In Dollars","description":"Total credit amount in dollars"},"amount_applied":{"type":"integer","title":"Amount Applied","description":"Amount applied in cents"},"amount_applied_in_dollars":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount Applied In Dollars","description":"Amount applied in dollars"},"amount_remaining":{"type":"integer","title":"Amount Remaining","description":"Remaining amount in cents"},"amount_remaining_in_dollars":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount Remaining In Dollars","description":"Remaining amount in dollars"},"issue_date":{"type":"string","format":"date","title":"Issue Date","description":"Date the credit was issued"},"applied_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Applied Date","description":"When credits were fully applied"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Record creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"},"reason":{"type":"string","title":"Reason","description":"Reason code"},"reason_display":{"type":"string","title":"Reason Display","description":"Human-readable reason label"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the credit"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes","description":"Internal notes"},"line_items":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Line Items","description":"Detailed line items breakdown"},"voided_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Voided At","description":"When the credit was voided"},"voided_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voided Reason","description":"Reason for voiding"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name","description":"Vendor display name"},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Number","description":"Original bill number"},"bill_applications":{"anyOf":[{"items":{"$ref":"#/components/schemas/VendorCreditApplicationResponse"},"type":"array"},{"type":"null"}],"title":"Bill Applications","description":"Applications to bills"},"can_be_applied":{"type":"boolean","title":"Can Be Applied","description":"Whether credits can be applied to bills"},"can_be_voided":{"type":"boolean","title":"Can Be Voided","description":"Whether the credit can be voided"},"can_be_deleted":{"type":"boolean","title":"Can Be Deleted","description":"Whether the credit can be deleted (all statuses except void; applied credits reverse bill links first)"},"has_applications":{"type":"boolean","title":"Has Applications","description":"Whether any credits have been applied"}},"type":"object","required":["id","business_id","vendor_id","status","currency","amount","amount_in_dollars","amount_applied","amount_applied_in_dollars","amount_remaining","amount_remaining_in_dollars","issue_date","created_at","updated_at","reason","reason_display","can_be_applied","can_be_voided","can_be_deleted","has_applications"],"title":"VendorCreditResponse","description":"Response schema for a vendor credit.","example":{"amount":5000,"amount_applied":0,"amount_applied_in_dollars":0.0,"amount_in_dollars":50.0,"amount_remaining":5000,"amount_remaining_in_dollars":50.0,"business_id":"019ab37c-bus1-7000-8000-000000000001","can_be_applied":true,"can_be_deleted":true,"can_be_voided":true,"currency":"USD","description":"Overcharged on bill #BILL-001","has_applications":false,"id":"019ab37c-vc01-7000-8000-000000000001","issue_date":"2026-01-07","number":"VC-0001","reason":"pricing_error","reason_display":"Pricing Error","status":"issued","vendor_id":"019ab37c-vend-7000-8000-000000000001"}},"VendorCreditStatusEnum":{"type":"string","enum":["draft","issued","applied","partially_applied","void"],"title":"VendorCreditStatusEnum","description":"Vendor credit status values."},"VendorCreditSummary":{"properties":{"vendor_id":{"type":"string","title":"Vendor Id","description":"Vendor ID"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name","description":"Vendor display name"},"total_credits_available":{"type":"integer","title":"Total Credits Available","description":"Total available credits in cents"},"total_credits_available_dollars":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total Credits Available Dollars","description":"Total available credits in dollars"},"vendor_credits_count":{"type":"integer","title":"Vendor Credits Count","description":"Number of vendor credits with available balance"},"vendor_credits":{"items":{"$ref":"#/components/schemas/VendorCreditResponse"},"type":"array","title":"Vendor Credits","description":"Vendor credits with available balance"}},"type":"object","required":["vendor_id","total_credits_available","total_credits_available_dollars","vendor_credits_count"],"title":"VendorCreditSummary","description":"Summary of available vendor credits for a vendor."},"VendorCreditUpdate":{"properties":{"amount_cents":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Amount Cents","description":"Credit amount in cents"},"reason":{"anyOf":[{"$ref":"#/components/schemas/VendorCreditReasonEnum"},{"type":"null"}],"description":"Reason for the vendor credit"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the credit"},"bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Id","description":"Original bill being credited"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"Expense or asset ledger to reverse when issued"},"issue_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issue Date","description":"Issue date"},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/VendorCreditLineItem"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Line items for credit detail"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes","description":"Internal notes"},"vendor_credit_number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Vendor Credit Number","description":"Vendor's reference number"}},"type":"object","title":"VendorCreditUpdate","description":"Request schema for updating a vendor credit (draft only)."},"VendorCreditVoid":{"properties":{"reason":{"type":"string","minLength":1,"title":"Reason","description":"Reason for voiding"}},"type":"object","required":["reason"],"title":"VendorCreditVoid","description":"Request schema for voiding a vendor credit.","example":{"reason":"Issued in error — vendor reissued correctly"}},"VendorCreditsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VendorCreditResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"VendorCreditsListResponse","description":"Paginated list of vendor credits."},"VendorDuplicateCandidateResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Vendor UUID."},"name":{"type":"string","title":"Name","description":"Vendor name."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Vendor email."},"similarity_score":{"type":"number","title":"Similarity Score","description":"Similarity score (0.0-1.0)."},"match_type":{"type":"string","title":"Match Type","description":"Type of match (name, email, tax_id, phone)."}},"type":"object","required":["id","name","similarity_score","match_type"],"title":"VendorDuplicateCandidateResponse","description":"A potential duplicate vendor."},"VendorDuplicateCheckResponse":{"properties":{"has_duplicates":{"type":"boolean","title":"Has Duplicates","description":"Whether duplicates were found."},"duplicates":{"items":{"$ref":"#/components/schemas/VendorDuplicateCandidateResponse"},"type":"array","title":"Duplicates","description":"List of potential duplicates."}},"type":"object","required":["has_duplicates"],"title":"VendorDuplicateCheckResponse","description":"Response for duplicate check operation."},"VendorHistoryBill":{"properties":{"id":{"type":"string","title":"Id","description":"Bill UUID."},"amount":{"type":"integer","title":"Amount","description":"Bill amount in cents."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Bill status."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Bill description."},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Number","description":"Vendor-issued bill number."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"ISO timestamp when the bill was created."}},"type":"object","required":["id","amount"],"title":"VendorHistoryBill","description":"A single bill in a vendor's payment history."},"VendorHistoryResponse":{"properties":{"vendor_id":{"type":"string","title":"Vendor Id","description":"Vendor UUID."},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name","description":"Resolved vendor name."},"recent_bills":{"items":{"$ref":"#/components/schemas/VendorHistoryBill"},"type":"array","title":"Recent Bills","description":"Most recent bills from this vendor (newest first)."},"total_paid_cents":{"type":"integer","title":"Total Paid Cents","description":"Sum of paid bill amounts in cents (status = paid).","default":0},"bill_count":{"type":"integer","title":"Bill Count","description":"Total number of bills from this vendor.","default":0}},"type":"object","required":["vendor_id"],"title":"VendorHistoryResponse","description":"Response for ``GET /ap-approval/vendor/{vendor_id}/history``."},"VendorListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VendorResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"VendorListResponse","description":"Paginated list of vendors with cursor-based navigation."},"VendorResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Vendor UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"name":{"type":"string","title":"Name","description":"Vendor name."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Vendor email address."},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"Vendor business address."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Vendor phone number."},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id","description":"Tax identification number."},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website","description":"Vendor website URL."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Internal notes."},"credit_limit_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credit Limit Cents","description":"Credit limit in cents."},"default_payment_term_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Payment Term Id","description":"Default payment term ID."},"status":{"type":"string","title":"Status","description":"Vendor status.","default":"active"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Business category."},"default_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Location Id","description":"Default ship-from location ID for purchase orders."},"default_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Location Name","description":"Default ship-from location name (resolved)."},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Whether vendor is soft deleted.","default":false},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"Timestamp when vendor was deleted."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"contacts":{"anyOf":[{"items":{"$ref":"#/components/schemas/VendorContactResponse"},"type":"array"},{"type":"null"}],"title":"Contacts","description":"Vendor contacts."}},"additionalProperties":true,"type":"object","required":["id","business_id","name","created_at","updated_at"],"title":"VendorResponse","description":"Response schema for a vendor.\n\nVendors are companies or individuals you purchase from.\nThey are linked to bills for expense tracking.","example":{"address":"123 Industrial Way, Oakland, CA 94612","business_id":"019ab37c-bus1-7000-8000-000000000001","category":"Raw Materials","created_at":"2024-01-10T10:30:00Z","email":"orders@acmesupplies.com","id":"019ab37c-vend-7000-8000-000000000001","name":"Acme Supplies","phone":"(555) 987-6543","status":"active","tax_id":"98-7654321","updated_at":"2024-01-15T14:00:00Z"}},"VendorSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["id"],"title":"VendorSummary","description":"Summary of vendor for response."},"VendorUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Updated vendor name."},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email","description":"Updated email address."},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"Updated address."},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone","description":"Updated phone number."},"tax_id":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Tax Id","description":"Updated tax ID."},"website":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Website","description":"Updated website URL."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Updated internal notes."},"credit_limit_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Credit Limit Cents","description":"Updated credit limit in cents."},"default_payment_term_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Payment Term Id","description":"Updated default payment term ID."},"status":{"anyOf":[{"$ref":"#/components/schemas/CounterpartyStatus"},{"type":"null"}],"description":"Updated status."},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category","description":"Updated category."}},"type":"object","title":"VendorUpdateRequest","description":"Request schema for updating a vendor.\n\nAll fields are optional - only include fields you want to change.","example":{"address":"456 Industrial Way, Suite 200, Oakland, CA 94612","credit_limit_cents":500000,"name":"Acme Supplies Inc."}},"WeekDetailResponse":{"properties":{"week_start":{"type":"string","title":"Week Start"},"week_end":{"type":"string","title":"Week End"},"total_received":{"type":"integer","title":"Total Received","description":"Total deposits in this week in cents."},"total_applied":{"type":"integer","title":"Total Applied","description":"Total applied in this week in cents."},"unapplied":{"type":"integer","title":"Unapplied","description":"Unapplied remainder in cents."},"transactions":{"items":{"$ref":"#/components/schemas/WeekTransactionDetail"},"type":"array","title":"Transactions","description":"Individual deposit transactions for the week."}},"type":"object","required":["week_start","week_end","total_received","total_applied","unapplied","transactions"],"title":"WeekDetailResponse","description":"Detail view for a single week of cash receipts."},"WeekTransactionDetail":{"properties":{"id":{"type":"string","title":"Id"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty"},"amount":{"type":"integer","title":"Amount","description":"Full transaction amount in cents."},"applied":{"type":"integer","title":"Applied","description":"Amount already applied in cents."},"unapplied":{"type":"integer","title":"Unapplied","description":"Remaining unapplied amount in cents."},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name"},"applications":{"items":{"$ref":"#/components/schemas/TransactionApplication"},"type":"array","title":"Applications","description":"Invoice/bill payments linked to this transaction."}},"type":"object","required":["id","amount","applied","unapplied"],"title":"WeekTransactionDetail","description":"A deposit transaction within a week, with its applied breakdown."},"WeeklyDemandPoint":{"properties":{"week_start":{"type":"string","title":"Week Start"},"units":{"type":"number","title":"Units"}},"type":"object","required":["week_start","units"],"title":"WeeklyDemandPoint"},"WorkflowGraphSchema-Output":{"properties":{"nodes":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Nodes"},"edges":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Edges"}},"additionalProperties":true,"type":"object","title":"WorkflowGraphSchema","description":"Loose schema for a custom workflow graph.\n\nThe full graph shape is governed elsewhere (custom workflow builder); this\nschema just types the top-level ``nodes`` / ``edges`` arrays so the\nfrontend gets a non-``unknown`` field."},"app__api__v1__schemas__advisory_firm_reports__GetPortfolioOverviewResponse":{"properties":{"report":{"additionalProperties":true,"type":"object","title":"Report"}},"additionalProperties":true,"type":"object","required":["report"],"title":"GetPortfolioOverviewResponse","description":"SuccessEnvelope data for ``get_portfolio_overview``."},"app__api__v1__schemas__advisory_firm_reports__GetWorkQueueResponse":{"properties":{"report":{"additionalProperties":true,"type":"object","title":"Report"}},"additionalProperties":true,"type":"object","required":["report"],"title":"GetWorkQueueResponse","description":"SuccessEnvelope data for ``get_work_queue``."},"app__api__v1__schemas__advisory_firms__firm__StaffAssignmentResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"business_id":{"type":"string","title":"Business Id"},"firm_id":{"type":"string","title":"Firm Id"},"assigned_by":{"type":"string","title":"Assigned By"},"engagement_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engagement Type"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","user_id","business_id","firm_id","assigned_by","created_at","updated_at"],"title":"StaffAssignmentResponse","description":"Response for a staff business assignment."},"app__api__v1__schemas__advisory_firms__firm__TeamSummaryResponse":{"properties":{"id":{"type":"string","title":"Id"},"firm_id":{"type":"string","title":"Firm Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_by":{"type":"string","title":"Created By"},"member_count":{"type":"integer","title":"Member Count","default":0},"business_count":{"type":"integer","title":"Business Count","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","firm_id","name","created_by","created_at","updated_at"],"title":"TeamSummaryResponse","description":"Summary of a firm team with counts."},"app__api__v1__schemas__anomaly__DismissRequest":{"properties":{"fingerprint":{"type":"string","title":"Fingerprint","description":"SHA-256 fingerprint of the anomaly"},"anomaly_type":{"type":"string","title":"Anomaly Type","description":"Type key, e.g. duplicate_payment"},"reason":{"type":"string","title":"Reason","description":"One of: expected, resolved, false_positive, other"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Snapshot of the anomaly description"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional user-provided notes"}},"type":"object","required":["fingerprint","anomaly_type","reason"],"title":"DismissRequest"},"app__api__v1__schemas__client_messages__ConversationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ConversationSummaryResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"ConversationListResponse","description":"Paginated list of conversation summaries."},"app__api__v1__schemas__client_messages__MessageResponse":{"properties":{"id":{"type":"string","title":"Id"},"conversation_id":{"type":"string","title":"Conversation Id"},"sender_user_id":{"type":"string","title":"Sender User Id"},"sender_role":{"$ref":"#/components/schemas/SenderRole"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"},"body":{"type":"string","title":"Body"},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Read At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","conversation_id","sender_user_id","sender_role","body","created_at"],"title":"MessageResponse","description":"A single message within a conversation."},"app__api__v1__schemas__customer__ListContactsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/EntityContactResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"additionalProperties":true,"type":"object","required":["items","has_next","has_prev"],"title":"ListContactsResponse","description":"Response for ``list_contacts`` on ``/{customer_id}/contacts``."},"app__api__v1__schemas__firm_team__StaffAssignmentResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"business_id":{"type":"string","title":"Business Id"},"firm_id":{"type":"string","title":"Firm Id"},"assigned_by":{"type":"string","title":"Assigned By"},"engagement_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engagement Type"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"additionalProperties":true,"type":"object","required":["id","user_id","business_id","firm_id","assigned_by","created_at","updated_at"],"title":"StaffAssignmentResponse","description":"Response for staff business assignment CRUD."},"app__api__v1__schemas__firm_team__TeamSummaryResponse":{"properties":{"id":{"type":"string","title":"Id"},"firm_id":{"type":"string","title":"Firm Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_by":{"type":"string","title":"Created By"},"member_count":{"type":"integer","title":"Member Count","default":0},"business_count":{"type":"integer","title":"Business Count","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"additionalProperties":true,"type":"object","required":["id","firm_id","name","created_by","created_at","updated_at"],"title":"TeamSummaryResponse","description":"Response for ``create_team`` / ``update_team``."},"app__api__v1__schemas__invoice__InvoicePaymentResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Payment record UUID."},"invoice_id":{"type":"string","title":"Invoice Id","description":"UUID of the invoice being paid."},"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the bank transaction."},"amount":{"type":"integer","title":"Amount","description":"Allocated payment amount in cents."},"currency":{"type":"string","title":"Currency","description":"Currency (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"paid_on":{"type":"string","format":"date-time","title":"Paid On","description":"Effective payment date."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Record creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"transaction":{"anyOf":[{"$ref":"#/components/schemas/InvoicePaymentTransactionSummary"},{"type":"null"}],"description":"Linked bank transaction summary. Included when listing payments."}},"type":"object","required":["id","invoice_id","transaction_id","amount","paid_on","created_at","updated_at","business_id"],"title":"InvoicePaymentResponse","description":"Response for payment create/update endpoints.","example":{"amount":12000,"business_id":"019ab37c-bus1-7000-8000-000000000001","created_at":"2026-02-10T12:00:00Z","currency":"USD","id":"019ab37c-pay1-7000-8000-000000000001","invoice_id":"019ab37c-inv1-7000-8000-000000000001","paid_on":"2026-02-10T00:00:00Z","transaction":{"amount":12000,"counterparty":"Acme Corp","currency":"USD","datetime":"2026-02-10T00:00:00Z","description":"Invoice payment","id":"019ab37c-txn1-7000-8000-000000000001","ledger_id":"019ab37c-led1-7000-8000-000000000001"},"transaction_id":"019ab37c-txn1-7000-8000-000000000001","updated_at":"2026-02-10T12:00:00Z"}},"app__api__v1__schemas__invoices__invoice__InvoicePaymentResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Payment record UUID."},"invoice_id":{"type":"string","title":"Invoice Id","description":"UUID of the invoice being paid."},"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the bank transaction."},"amount":{"type":"integer","title":"Amount","description":"Allocated payment amount in cents."},"currency":{"type":"string","title":"Currency","description":"Currency (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"paid_on":{"type":"string","format":"date-time","title":"Paid On","description":"Effective payment date."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Record creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"transaction":{"anyOf":[{"$ref":"#/components/schemas/InvoicePaymentTransactionSummary"},{"type":"null"}],"description":"Linked bank transaction summary. Included when listing payments."}},"type":"object","required":["id","invoice_id","transaction_id","amount","paid_on","created_at","updated_at","business_id"],"title":"InvoicePaymentResponse","description":"Response schema for an invoice payment record.\n\nRepresents a payment made against an invoice, linking to the bank\ntransaction with a specific allocated amount.","example":{"amount":12000,"business_id":"019ab37c-bus1-7000-8000-000000000001","created_at":"2026-02-10T12:00:00Z","currency":"USD","id":"019ab37c-pay1-7000-8000-000000000001","invoice_id":"019ab37c-inv1-7000-8000-000000000001","paid_on":"2026-02-10T00:00:00Z","transaction":{"amount":12000,"counterparty":"Acme Corp","currency":"USD","datetime":"2026-02-10T00:00:00Z","description":"Invoice payment","id":"019ab37c-txn1-7000-8000-000000000001","ledger_id":"019ab37c-led1-7000-8000-000000000001"},"transaction_id":"019ab37c-txn1-7000-8000-000000000001","updated_at":"2026-02-10T12:00:00Z"}},"app__api__v1__schemas__quickbooks__responses__GetConnectUrlResponse":{"properties":{"connect_url":{"type":"string","title":"Connect Url"},"state":{"type":"string","title":"State"}},"additionalProperties":true,"type":"object","required":["connect_url","state"],"title":"GetConnectUrlResponse","description":"Response for ``get_connect_url``."},"app__api__v1__schemas__quickbooks__responses__GetConnectionStatusResponse":{"properties":{"connected":{"type":"boolean","title":"Connected"},"healthy":{"type":"boolean","title":"Healthy","default":false},"realm_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Realm Id"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced At"},"import_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Import Status"},"import_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Import Summary"},"last_error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error Message"}},"additionalProperties":true,"type":"object","required":["connected"],"title":"GetConnectionStatusResponse","description":"Response for ``get_connection_status``."},"app__api__v1__schemas__quickbooks__responses__MigrationReportTotals":{"properties":{"qbo_cents":{"type":"integer","title":"Qbo Cents"},"local_cents":{"type":"integer","title":"Local Cents"},"delta_cents":{"type":"integer","title":"Delta Cents"}},"additionalProperties":true,"type":"object","required":["qbo_cents","local_cents","delta_cents"],"title":"MigrationReportTotals"},"app__api__v1__schemas__reconciliation__CompleteReconciliationResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},"additionalProperties":true,"type":"object","title":"CompleteReconciliationResponse","description":"Complete and lock reconciliation."},"app__api__v1__schemas__reconciliation__CreateReconciliationResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id"},"ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Name"},"status":{"type":"string","title":"Status"},"status_display":{"type":"string","title":"Status Display"},"statement_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement Filename"},"statement_start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement Start Date"},"statement_end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement End Date"},"opening_balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Opening Balance"},"closing_balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Closing Balance"},"locked":{"type":"boolean","title":"Locked"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"input_txns":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationInputTxns"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Txns"},"ai_match_results":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationAIMatchResults"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Ai Match Results"},"user_committed_matches":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationCommittedMatches"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Committed Matches"},"match_counts":{"anyOf":[{"$ref":"#/components/schemas/ReconciliationMatchCounts"},{"type":"null"}]},"workflow_started":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Workflow Started"}},"additionalProperties":true,"type":"object","required":["id","business_id","status","status_display","locked"],"title":"CreateReconciliationResponse","description":"Newly created reconciliation."},"app__api__v1__schemas__recurring__recurring__RecurrenceTypeEnum":{"type":"string","enum":["invoice","bill"],"title":"RecurrenceTypeEnum","description":"Type of recurring document."},"app__api__v1__schemas__subscriptions__DismissRequest":{"properties":{"counterparty_key":{"type":"string","title":"Counterparty Key","description":"Normalized counterparty name to dismiss"},"registry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registry Id"}},"type":"object","required":["counterparty_key"],"title":"DismissRequest"},"app__api__v1__schemas__vendors__ListContactsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/EntityContactResponse"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"additionalProperties":true,"type":"object","required":["items","has_next","has_prev"],"title":"ListContactsResponse","description":"Paginated vendor contacts."},"app__core__success__MessageResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},"additionalProperties":true,"type":"object","title":"MessageResponse","description":"Envelope for data-less mutations: ``{success, message, code}``, no ``data``.\n\nCanonical ``response_model`` for deletes and other message-only mutations so\nthe generated TypeScript client gets a single, named ``MessageResponse`` type\ninstead of dozens of empty per-route stubs. Pairs with the\n``SuccessResponse.*`` builders (which already emit this exact shape)."},"app__core__success__SuccessEnvelope_CompleteReconciliationResponse___2":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/app__api__v1__schemas__reconciliation__CompleteReconciliationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CompleteReconciliationResponse]"},"app__core__success__SuccessEnvelope_CreateReconciliationResponse___2":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/app__api__v1__schemas__reconciliation__CreateReconciliationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreateReconciliationResponse]"},"app__core__success__SuccessEnvelope_GetConnectUrlResponse___4":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/app__api__v1__schemas__quickbooks__responses__GetConnectUrlResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetConnectUrlResponse]"},"app__core__success__SuccessEnvelope_GetConnectionStatusResponse___5":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/app__api__v1__schemas__quickbooks__responses__GetConnectionStatusResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetConnectionStatusResponse]"},"app__core__success__SuccessEnvelope_GetPortfolioOverviewResponse___2":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/app__api__v1__schemas__advisory_firm_reports__GetPortfolioOverviewResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetPortfolioOverviewResponse]"},"app__core__success__SuccessEnvelope_GetWorkQueueResponse___2":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/app__api__v1__schemas__advisory_firm_reports__GetWorkQueueResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetWorkQueueResponse]"},"app__core__success__SuccessEnvelope_ListContactsResponse___1":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/app__api__v1__schemas__customer__ListContactsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListContactsResponse]"},"app__core__success__SuccessEnvelope_ListContactsResponse___2":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/app__api__v1__schemas__vendors__ListContactsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListContactsResponse]"},"app__models__recurring_templates__RecurrenceTypeEnum":{"type":"string","enum":["invoice","bill"],"title":"RecurrenceTypeEnum","description":"Type of recurring document to generate."}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"tags":[{"name":"accounting-periods","description":"Manage fiscal periods (month/quarter/year) and period locks."},{"name":"advisory-firms","description":"Advisory firm management for multi-tenant accounting."},{"name":"advisory-firm-reports","description":"Cross-client reporting for advisory firms."},{"name":"advisory-firm-teams","description":"Team management within advisory firms — assign staff to teams and manage client access."},{"name":"anomalies","description":"AI-powered anomaly detection for unusual transactions and patterns."},{"name":"ap-approval","description":"Accounts payable approval workflows for bill review and authorization."},{"name":"api-tokens","description":"Create, list, and revoke Bearer API tokens."},{"name":"billing","description":"Subscription billing, plan management, and usage tracking."},{"name":"bills","description":"Accounts payable — create and manage vendor bills."},{"name":"budgets","description":"Financial budgets and forecasts with variance tracking."},{"name":"businesses","description":"Business entities — the core tenant in DayZero."},{"name":"client-messages","description":"Messaging between advisory firms and their clients."},{"name":"credit-memos","description":"Customer credits that can be applied to invoices."},{"name":"customers","description":"Customer records for invoicing and AR."},{"name":"fixed-assets","description":"Asset tracking, depreciation schedules, and disposal."},{"name":"inventory:adjustments","description":"Inventory quantity and value adjustments."},{"name":"inventory:import","description":"Bulk import inventory data from CSV or external systems."},{"name":"inventory:locations","description":"Warehouse and storage location management."},{"name":"inventory:payments","description":"Payments linked to inventory orders."},{"name":"inventory:production","description":"Production orders and bill-of-materials management."},{"name":"inventory:products","description":"Product catalog with SKUs, costs, and variants."},{"name":"inventory:shipments","description":"Inbound and outbound shipment tracking."},{"name":"inventory:transfers","description":"Inter-location inventory transfers."},{"name":"vendors","description":"Vendor management — accounts payable counterparties."},{"name":"invoices","description":"Accounts receivable — create, finalize, and track invoice payments."},{"name":"journal-entries","description":"Double-entry bookkeeping with balanced debit/credit lines."},{"name":"ledgers","description":"Chart of accounts — asset, liability, equity, revenue, and expense accounts."},{"name":"notes","description":"Internal notes attached to businesses and entities."},{"name":"notification-preferences","description":"Manage email and in-app notification settings."},{"name":"oauth","description":"OAuth 2.0 authorization code flow for third-party integrations."},{"name":"onboarding","description":"User and business onboarding workflows."},{"name":"payment-advisory","description":"AI-powered payment recommendations and cash flow optimization."},{"name":"payment-terms","description":"Net payment terms (Net 30, Due on Receipt, etc.)."},{"name":"reconciliations","description":"Bank statement reconciliation with AI-assisted matching."},{"name":"recurring","description":"Recurring invoice and bill templates with auto-generation."},{"name":"reports","description":"Financial report generation (P&L, Balance Sheet, Trial Balance, etc.)."},{"name":"search","description":"Full-text search across transactions, contacts, and entities."},{"name":"subscriptions","description":"Manage recurring subscription billing for customers."},{"name":"tags","description":"Custom tag groups and tags for categorizing entities."},{"name":"tax","description":"Tax rate configuration and tax calculations."},{"name":"transactions","description":"Bank transactions — sync, categorize, review, and reconcile."},{"name":"user","description":"User profile and preferences."},{"name":"vendor-contracts","description":"Vendor contract tracking with renewal alerts and spend analysis."}],"security":[{"BearerAuth":[]}]}