{"openapi":"3.1.0","info":{"title":"PUT /api/v1/businesses/{business_id}","version":"1.0.0","description":"Update business"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/businesses/{business_id}":{"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- Stripe account ID\n- Shopify integration details\n- Stripe subscription items (subscription_items)\n\n**Note:** This endpoint updates business details only.\n\nArgs:\n    business_id (str): The ID of the business to update.\n    payload (BusinessUpdateRequest): The updated business details.\n\nReturns:\n    BusinessResponse: The updated business details.","operationId":"update_business","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"},"example":{"accounting_basis":"accrual","default_currency":"USD","name":"Acme Coffee Roasters","tax_year_end_month":12}}}},"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/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"}}}},"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":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"update_business_api_v1_businesses__business_id__put"}}},"components":{"schemas":{"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."},"external_source_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Source Account Id","description":"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."},"superseded_by_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Superseded By Item Id","description":"Set when this account sits on a Plaid connection that is no longer active and the same real account (institution, mask and subtype) is linked on another live connection of the business; the value is that connection's id. Shown as Replaced rather than Unlinked."},"linked_via_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked Via Item Id","description":"Set when this connection reports an account that is linked to a ledger through another live connection of the business; the value is that connection's id. The account is not stored under this connection. POST /plaid/account/move moves the link here."},"linked_via_institution_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked Via Institution Name","description":"Institution name of the connection in linked_via_item_id."}},"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-b051-7000-8000-000000000001","external_source_account_id":"local_src_xyz789","is_linked":true,"last_synced":"2024-01-15T14:00:00Z","ledger_id":"019ab37c-1ed1-7000-8000-000000000001","mask":"1234","name":"Chase Business Checking","official_name":"CHASE BUSINESS COMPLETE CHECKING","plaid_account_id":"plaid_acc_abc123","subtype":"checking","type":"depository"},"examples":[{"balance":{"available":1523450,"current":1548200,"iso_currency_code":"USD"},"business_id":"019ab37c-b051-7000-8000-000000000001","external_source_account_id":"local_src_xyz789","is_linked":true,"last_synced":"2024-01-15T14:00:00Z","ledger_id":"019ab37c-1ed1-7000-8000-000000000001","mask":"1234","name":"Chase Business Checking","official_name":"CHASE BUSINESS COMPLETE CHECKING","plaid_account_id":"plaid_acc_abc123","subtype":"checking","type":"depository"}]},"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"},"examples":[{"available":1523450,"current":1548200,"is_available":1,"iso_currency_code":"USD"}]},"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."},"name_aliases":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Name Aliases","description":"Other names the business goes by."},"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."},"accounting_basis":{"anyOf":[{"type":"string","enum":["cash","accrual"]},{"type":"null"}],"title":"Accounting Basis","description":"Default accounting basis financial reports open on: 'accrual' or 'cash'. Null means accrual."},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Date the business started operating (founding date). Distinct from entries_start, which anchors bookkeeping imports."},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone","description":"IANA time zone the business keeps its days in; null = not set."},"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."},"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":"Account sync status."},"inventory_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Mode","description":"Inventory module flavor: 'cpg' or 'finished_goods'."},"ap_approval_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ap Approval Enabled","description":"Whether the AP bill approval workflow is enabled for this business. When off (default), bills post directly to 'received'."},"ap_due_date_basis":{"anyOf":[{"type":"string","enum":["invoice_date","received_date"]},{"type":"null"}],"title":"Ap Due Date Basis","description":"Which date vendor-bill payment terms count from on ingest: 'invoice_date' (default, trust the invoice) or 'received_date' (terms run from the day the business received the bill)."},"ar_subledger_mode":{"anyOf":[{"type":"string","enum":["off","per_customer"]},{"type":"null"}],"title":"Ar Subledger Mode","description":"Where invoice and payment journal entries post the receivable: 'off' (one Accounts Receivable) or 'per_customer' (an 'AR - <Customer Name>' child ledger of Accounts Receivable)."},"auto_link_new_counterparties":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Link New Counterparties","description":"Whether NEW customers and vendors are linked to the counterparty registry automatically. On by default."},"auto_rename_counterparties":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Rename Counterparties","description":"Whether automated counterparty re-resolution is enabled for transactions that already have a counterparty assigned. On by default. Manually-set counterparties are always protected regardless of this setting."},"stripe_payout_sibling_matching":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stripe Payout Sibling Matching","description":"Whether an unmatched Stripe payout may be matched to a deposit in a sibling business with no Stripe account. null = only when the firm has exactly one such sibling."},"agent_close_business_day":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agent Close Business Day","description":"Business day of the month (1-23, -1 = last) the Agent window starts closing the month that just ended; null = off."}},"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-f123-7000-8000-000000000001","id":"019ab37c-b051-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"},"updated_at":"2024-01-15T14:00:00Z"},"examples":[{"created_at":"2024-01-10T10:30:00Z","entries_start":"2024-01-01T00:00:00Z","firm_id":"019ab37c-f123-7000-8000-000000000001","id":"019ab37c-b051-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"},"updated_at":"2024-01-15T14:00:00Z"}]},"BusinessUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Business display name."},"name_aliases":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":20},{"type":"null"}],"title":"Name Aliases","description":"Other names the business goes by (up to 20). find_business matches them as well as the name. Replaces the list; send [] to clear it."},"logo_url":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Logo Url","description":"URL to business logo/avatar image (https only)."},"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)."},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Date the business started operating (founding date). Distinct from entries_start, which anchors bookkeeping imports."},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone","description":"IANA time zone the business keeps its days in, e.g. 'America/New_York'. null clears it."},"accounting_basis":{"anyOf":[{"type":"string","enum":["cash","accrual"]},{"type":"null"}],"title":"Accounting Basis","description":"Default accounting basis for financial reports: 'cash' or 'accrual'. Persisted on the business."},"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."},"ap_approval_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ap Approval Enabled","description":"Toggle the AP bill approval workflow for this business. When off (default), bills post directly to 'received'. When on, bills route through 'pending_approval' and only post to the GL once approved."},"ap_due_date_basis":{"anyOf":[{"type":"string","enum":["invoice_date","received_date"]},{"type":"null"}],"title":"Ap Due Date Basis","description":"Which date vendor-bill payment terms count from for bills that arrive via the AP inbox or upload. 'invoice_date' (default) keeps the due date printed on the invoice. 'received_date' runs the terms (vendor default, else business default, else the span the invoice itself implies) from the day the bill was received, so an invoice dated weeks before it reached you isn't created overdue. Applies to bills ingested after the change; existing bills are not rewritten."},"ar_subledger_mode":{"anyOf":[{"type":"string","enum":["off","per_customer"]},{"type":"null"}],"title":"Ar Subledger Mode","description":"Where invoice and payment journal entries post the receivable. 'off' (default) uses the one Accounts Receivable ledger. 'per_customer' posts each customer's receivable to its own 'AR - <Customer Name>' child ledger of Accounts Receivable (created on first use, or an existing 'AR - X' ledger is adopted). Applies to entries posted after the change; run POST /ar/subledgers/backfill to move historical entries."},"auto_link_new_counterparties":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Link New Counterparties","description":"Toggle automatic registry linking for NEW customers and vendors (creation hooks, identity layer, nightly sweep). On by default. Turn off to keep new masters unlinked until a person links them; existing links are untouched."},"auto_rename_counterparties":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Rename Counterparties","description":"Toggle automated counterparty re-resolution for transactions that already have a counterparty assigned. On by default. Turn off to stop description edits and the tenant-wide regen from re-deriving counterparty names on existing rows. Manually-set counterparties are always protected regardless of this setting."},"stripe_payout_sibling_matching":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stripe Payout Sibling Matching","description":"Match a Stripe payout with no deposit in this business to a Stripe-looking deposit in a sibling business of the same firm that has no Stripe account. null (default) = on only when the firm has exactly one such sibling; true/false force it."},"agent_close_business_day":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agent Close Business Day","description":"Business day of the month (1-23, -1 = the last one) on which the Agent window starts closing the month that just ended: DayZero sends close.window_opened that day (Fed bank-holiday calendar, New York date). null or 0 turns it off."}},"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.","example":{"accounting_basis":"accrual","default_currency":"USD","name":"Acme Coffee Roasters","tax_year_end_month":12},"examples":[{"accounting_basis":"accrual","default_currency":"USD","name":"Acme Coffee Roasters","tax_year_end_month":12}]},"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-b051-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"},"examples":[{"accounts":[{"id":"019ab37c-acc1-7000-8000-000000000001","mask":"1234","name":"Chase Business Checking","subtype":"checking","type":"depository"}],"business_id":"019ab37c-b051-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"}]},"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]"},"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 an account-sync task is currently running (from tasks table)","default":false}},"type":"object","required":["status"],"title":"SyncStatus","description":"Sync status for a business."},"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":[]}]}