{"openapi":"3.1.0","info":{"title":"GET /api/v1/quickbooks/sync/status","version":"1.0.0","description":"QuickBooks live sync status"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/quickbooks/sync/status":{"get":{"tags":["quickbooks"],"summary":"QuickBooks live sync status","description":"Sync mode, health, pause state, cutover date, settings, last inbound/outbound/tie-out times, outbox counts by status, open issue counts by kind, and the feed owner of every bank/card ledger.","operationId":"get_quickbooks_sync_status","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_QuickBooksSyncStatusResponse_"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"get_quickbooks_sync_status_api_v1_quickbooks_sync_status_get"}}},"components":{"schemas":{"QuickBooksBankFeedOwnerRow":{"properties":{"ledger_id":{"type":"string","title":"Ledger Id"},"ledger_name":{"type":"string","title":"Ledger Name"},"financial_account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Account Type"},"feed_owner":{"type":"string","enum":["dayzero","quickbooks"],"title":"Feed Owner"},"default_owner":{"type":"string","enum":["dayzero","quickbooks"],"title":"Default Owner"},"overridden":{"type":"boolean","title":"Overridden","default":false},"dayzero_feed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dayzero Feed"},"quickbooks_feed_likely":{"type":"boolean","title":"Quickbooks Feed Likely","default":false},"double_count_risk":{"type":"boolean","title":"Double Count Risk","default":false},"qbo_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qbo Account Id"}},"type":"object","required":["ledger_id","ledger_name","feed_owner","default_owner"],"title":"QuickBooksBankFeedOwnerRow","description":"One bank or card ledger and who brings its transactions into the books."},"QuickBooksSyncSettingsView":{"properties":{"push":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Push"},"bank_feed_owner":{"additionalProperties":{"type":"string","enum":["dayzero","quickbooks"]},"type":"object","title":"Bank Feed Owner"},"require_approval":{"type":"boolean","title":"Require Approval"},"auto_create_accounts":{"type":"boolean","title":"Auto Create Accounts"},"pull_attachments":{"type":"boolean","title":"Pull Attachments"},"replicate_imported_entries":{"type":"boolean","title":"Replicate Imported Entries","default":false},"auto_repair":{"type":"boolean","title":"Auto Repair","default":true}},"type":"object","required":["push","bank_feed_owner","require_approval","auto_create_accounts","pull_attachments"],"title":"QuickBooksSyncSettingsView","description":"``QboSyncSettings`` as stored, with every default filled in."},"QuickBooksSyncStatusResponse":{"properties":{"connected":{"type":"boolean","title":"Connected"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"mode":{"type":"string","enum":["off","mirror","two_way"],"title":"Mode","default":"off"},"health":{"type":"string","enum":["disconnected","off","ok","attention","repair_needed","paused","reconnect_required"],"title":"Health","default":"disconnected"},"paused":{"type":"boolean","title":"Paused","default":false},"paused_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paused At"},"paused_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paused Reason"},"reauth_required":{"type":"boolean","title":"Reauth Required","default":false},"import_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Import Status"},"import_completed":{"type":"boolean","title":"Import Completed","default":false},"migration_verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Migration Verified At"},"cutover_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Cutover Date"},"settings":{"$ref":"#/components/schemas/QuickBooksSyncSettingsView"},"cdc_cursor_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Cdc Cursor At"},"last_inbound_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Inbound Sync At"},"last_outbound_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Outbound Sync At"},"last_tieout_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Tieout At"},"tieout_summary":{"anyOf":[{"$ref":"#/components/schemas/QuickBooksTieOutSummary"},{"type":"null"}]},"outbox_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Outbox Counts"},"outbox_skip_reasons":{"additionalProperties":{"type":"integer"},"type":"object","title":"Outbox Skip Reasons"},"open_issue_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Open Issue Counts"},"open_issue_total":{"type":"integer","title":"Open Issue Total","default":0},"unconfirmed_payment_writes":{"type":"integer","title":"Unconfirmed Payment Writes","default":0},"repair_needed":{"type":"boolean","title":"Repair Needed","default":false},"bank_feeds":{"items":{"$ref":"#/components/schemas/QuickBooksBankFeedOwnerRow"},"type":"array","title":"Bank Feeds"},"push_families":{"items":{"type":"string"},"type":"array","title":"Push Families"}},"type":"object","required":["connected","settings"],"title":"QuickBooksSyncStatusResponse","description":"Everything the live sync panel shows."},"QuickBooksTieOutSummary":{"properties":{"status":{"type":"string","enum":["matched","different","incomplete","unsupported"],"title":"Status","default":"incomplete"},"as_of":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of"},"drifting":{"type":"integer","title":"Drifting","default":0},"mismatched_accounts":{"type":"integer","title":"Mismatched Accounts","default":0},"excluded_accounts":{"type":"integer","title":"Excluded Accounts","default":0},"pending_outbox":{"type":"integer","title":"Pending Outbox","default":0},"abs_delta_cents":{"type":"integer","title":"Abs Delta Cents","default":0},"unmodelled":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Unmodelled"}},"additionalProperties":true,"type":"object","title":"QuickBooksTieOutSummary","description":"Coverage is separate from equality; excluded balances never mean matched."},"SuccessEnvelope_QuickBooksSyncStatusResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/QuickBooksSyncStatusResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[QuickBooksSyncStatusResponse]"},"ErrorResponse":{"title":"ErrorResponse","type":"object","description":"Envelope returned by every non-2xx response. Branch on `code` (stable) rather than `message` (human-readable, may change).","required":["error","message","code"],"properties":{"error":{"type":"string","description":"Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`."},"message":{"type":"string","description":"Human-readable explanation, safe to show to end users."},"code":{"type":"string","description":"Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`)."},"request_id":{"type":"string","description":"Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied."},"errors":{"type":"object","additionalProperties":{"type":"string"},"description":"Field-level validation messages keyed by field name. Present on 400/422 validation failures only."}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}