{"name":"Oasis AI Backend","description":"Financial intelligence platform API — Shopify, QuickBooks, Klaviyo, Meta integrations","version":"1.0.0","endpoints":{"health":"GET /health","shopify_oauth":{"install":"GET /auth/shopify/install?shop=SHOP_NAME (Shopify-initiated or dashboard)","authorize":"GET /auth/shopify/authorize?shop=SHOP_NAME (authenticated AJAX)","callback":"GET /auth/shopify/callback","pending":"GET /auth/shopify/pending?pendingId=ID","claim":"POST /auth/shopify/claim?pendingId=ID (authenticated)"},"quickbooks_oauth":{"authorize":"GET /auth/quickbooks/authorize","token":"POST /auth/quickbooks/token","refresh":"POST /auth/quickbooks/refresh","connections":"GET /auth/quickbooks/connections","callback":"GET /auth/quickbooks/callback"},"klaviyo_oauth":{"authorize":"GET /api/auth/klaviyo/authorize","callback":"GET /api/auth/klaviyo/callback","status":"GET /api/auth/klaviyo/status","disconnect":"POST /api/auth/klaviyo/disconnect","account":"GET /api/auth/klaviyo/account","sample_data":"GET /api/auth/klaviyo/sample-data"},"meta_oauth":{"install":"GET /api/auth/meta/install","callback":"GET /api/auth/meta/callback","status":"GET /api/auth/meta/status","disconnect":"POST /api/auth/meta/disconnect","account":"GET /api/auth/meta/account","ad_accounts":"GET /api/auth/meta/ad-accounts","pages":"GET /api/auth/meta/pages","instagram":"GET /api/auth/meta/instagram-accounts","sample_data":"GET /api/auth/meta/sample-data","test":"POST /api/auth/meta/test"},"google_ads_oauth":{"authorize":"GET /api/auth/google-ads/authorize","install":"GET /api/auth/google-ads/install","callback":"GET /api/auth/google-ads/callback","status":"GET /api/auth/google-ads/status","disconnect":"POST /api/auth/google-ads/disconnect","customers":"GET /api/auth/google-ads/customers","select_customer":"POST /api/auth/google-ads/select-customer","sample_data":"GET /api/auth/google-ads/sample-data","test":"POST /api/auth/google-ads/test"},"shopify_api":{"products":"GET /api/shopify/products?shop=SHOP_NAME","create_product":"POST /api/shopify/products?shop=SHOP_NAME","update_product":"PUT /api/shopify/products/:id?shop=SHOP_NAME","orders":"GET /api/shopify/orders?shop=SHOP_NAME","shop_info":"GET /api/shopify/shop?shop=SHOP_NAME"},"shopify_compliance_webhooks":{"customers_data_request":"POST /api/webhooks/shopify/compliance/customers-data-request","customers_redact":"POST /api/webhooks/shopify/compliance/customers-redact","shop_redact":"POST /api/webhooks/shopify/compliance/shop-redact"},"quickbooks_api":{"customers":"GET /api/quickbooks/customers?realm_id=REALM_ID","items":"GET /api/quickbooks/items?realm_id=REALM_ID","invoices":"GET /api/quickbooks/invoices?realm_id=REALM_ID","create_invoice":"POST /api/quickbooks/invoices","company_info":"GET /api/quickbooks/company-info?realm_id=REALM_ID","profit_loss":"GET /api/quickbooks/profit-loss?realm_id=REALM_ID&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD","profit_loss_detail":"GET /api/quickbooks/profit-loss-detail?realm_id=REALM_ID&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD&account_type=TYPE","sales_by_customer":"GET /api/quickbooks/sales-by-customer?realm_id=REALM_ID&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD","balance_sheet":"GET /api/quickbooks/balance-sheet?realm_id=REALM_ID&report_date=YYYY-MM-DD","cash_flow":"GET /api/quickbooks/cash-flow?realm_id=REALM_ID&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD","ar_aging":"GET /api/quickbooks/ar-aging?realm_id=REALM_ID&report_date=YYYY-MM-DD","ap_aging":"GET /api/quickbooks/ap-aging?realm_id=REALM_ID&report_date=YYYY-MM-DD","general_ledger":"GET /api/quickbooks/general-ledger?realm_id=REALM_ID&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD","query":"GET /api/quickbooks/query?realm_id=REALM_ID&query=SQL_QUERY","status":"GET /api/quickbooks/status?realm_id=REALM_ID"},"legal":{"terms":"GET /legal/terms","privacy":"GET /legal/privacy","launch":"GET /legal/launch","disconnect":"GET /legal/disconnect"},"tenant_security":{"status":"GET /api/tenant-security/status","audit_logs":"GET /api/tenant-security/audit-logs","test_isolation":"POST /api/tenant-security/test-isolation","security_scan":"POST /api/tenant-security/run-security-scan","manual_audit":"POST /api/tenant-security/manual-audit-log (dev only)"},"tenant_reports":{"available":"GET /api/tenant-reports/available","generate_all":"POST /api/tenant-reports/generate-all","generate_single":"POST /api/tenant-reports/generate/:reportId","sheets":"GET /api/tenant-reports/sheets","sync_history":"GET /api/tenant-reports/sync-history","create_sheet":"POST /api/tenant-reports/create-sheet","data_cursors":"GET /api/tenant-reports/data-cursors","status":"GET /api/tenant-reports/status"},"agent_data":{"shopify":"GET /api/agent/data/shopify?brandId=BRAND_ID&startDate=YYYY-MM-DD&endDate=YYYY-MM-DD&limit=100","quickbooks":"GET /api/agent/data/quickbooks?brandId=BRAND_ID&startDate=YYYY-MM-DD&endDate=YYYY-MM-DD&reportTypes=income_statement,balance_sheet,cash_flow","klaviyo":"GET /api/agent/data/klaviyo?brandId=BRAND_ID&startDate=YYYY-MM-DD&endDate=YYYY-MM-DD&includeCampaigns=true&includeFlows=true","metrics":"GET /api/agent/data/metrics?brandId=BRAND_ID&period=30","health":"GET /api/agent/health"},"klaviyo_sync":{"sync":"POST /api/klaviyo/sync","sync_brand":"POST /api/klaviyo/sync/:brandId","status":"GET /api/klaviyo/sync-status"},"api_keys":{"create":"POST /api/keys/create","list":"GET /api/keys/list","rotate":"POST /api/keys/:id/rotate","revoke":"DELETE /api/keys/:id","update":"PATCH /api/keys/:id"},"chat":{"message":"POST /api/chat/message","stream":"GET /api/chat/stream?message=MESSAGE&sessionId=SESSION_ID","history":"GET /api/chat/history?sessionId=SESSION_ID&limit=50&offset=0","sessions":"GET /api/chat/sessions?limit=20&offset=0&activeOnly=true","delete_session":"DELETE /api/chat/session?sessionId=SESSION_ID","search":"POST /api/chat/search","rate_limit_info":"GET /api/chat/rate-limit-info","health":"GET /api/chat/health"}},"authentication":{"methods":["JWT Bearer Token (Dashboard)","API Key (Agent)"],"headers":{"jwt":"Authorization: Bearer <jwt_token>","agent_api_key":"Authorization: Bearer <oasis_live_...>"},"notes":{"dashboard":"Dashboard routes use JWT tokens in HTTP-only cookies","agent":"Agent data routes require API key in Authorization header","admin":"API key management routes require JWT with admin role"}},"arcade_provider_config":{"shopify":{"authorization_endpoint":"https://oasis-ai-backend-production.up.railway.app/auth/shopify/authorize","token_endpoint":"https://oasis-ai-backend-production.up.railway.app/auth/shopify/token","client_id":"70232964dc85d01f5a18a3b0c03d7011","scopes":"read_products,read_orders,read_all_orders"},"quickbooks":{"authorization_endpoint":"https://oasis-ai-backend-production.up.railway.app/auth/quickbooks/authorize","token_endpoint":"https://oasis-ai-backend-production.up.railway.app/auth/quickbooks/token","client_id":"ABVI090JDuV82JJsZbVElAJWPcdue6YDqPgM7ShkTUtdAa9vzs","scopes":"com.intuit.quickbooks.accounting"},"meta":{"authorization_endpoint":"https://oasis-ai-backend-production.up.railway.app/api/auth/meta/install","callback_endpoint":"https://oasis-ai-backend-production.up.railway.app/api/auth/meta/callback","app_id":"833920199326880","scopes":"public_profile,email,ads_management,ads_read,business_management,pages_show_list,pages_read_engagement"}}}