{"openapi":"3.1.0","info":{"title":"Arise.tw API","version":"1.0.0","description":"Arise 銳緒創意設計工作室的認證、產品、訂閱、授權與諮詢 API。","contact":{"url":"https://arise.tw/contact/"}},"servers":[{"url":"https://arise.tw","description":"Arise.tw production API"}],"externalDocs":{"description":"Arise.tw developer resources","url":"https://arise.tw/developers/"},"tags":[{"name":"Auth","description":"Session authentication and current-user operations."},{"name":"Products","description":"Public product catalog operations."},{"name":"Subscriptions","description":"Authenticated subscription operations."},{"name":"Licenses","description":"License generation and validation operations."},{"name":"Leads","description":"Contact and AI diagnosis inquiry submissions."}],"paths":{"/api/auth/register":{"post":{"tags":["Auth"],"summary":"Register a user","operationId":"registerUser","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}}},"responses":{"201":{"description":"User registered and a session was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"400":{"description":"Invalid registration input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The email is already registered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server configuration or processing error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/auth/login":{"post":{"tags":["Auth"],"summary":"Create a session","operationId":"loginUser","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"Authenticated user and session token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"400":{"description":"Missing credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Credentials are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server configuration or processing error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/auth/logout":{"post":{"tags":["Auth"],"summary":"Clear the current session","operationId":"logoutUser","responses":{"200":{"description":"Session cleared.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}}}}},"/api/auth/me":{"get":{"tags":["Auth"],"summary":"Get the current user","operationId":"getCurrentUser","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Current authenticated user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentUserResponse"}}}},"401":{"description":"No valid session was supplied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The session user no longer exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server processing error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/products/list":{"get":{"tags":["Products"],"summary":"List available products","operationId":"listProducts","responses":{"200":{"description":"Available products.","content":{"application/json":{"schema":{"type":"object","required":["products"],"properties":{"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}}}}},"500":{"description":"Server processing error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/contact/submit":{"post":{"tags":["Leads"],"summary":"Submit a contact inquiry","operationId":"submitContactInquiry","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactRequest"}}}},"responses":{"201":{"description":"Inquiry accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Required fields or verification are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Turnstile verification failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server configuration or processing error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/ai-diagnosis/submit":{"post":{"tags":["Leads"],"summary":"Submit an AI diagnosis inquiry","operationId":"submitAiDiagnosisInquiry","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiDiagnosisRequest"}}}},"responses":{"201":{"description":"Diagnosis inquiry accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Required fields or verification are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Turnstile verification failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server configuration or processing error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/subscriptions/list":{"get":{"tags":["Subscriptions"],"summary":"List the current user subscriptions","operationId":"listSubscriptions","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"User subscriptions.","content":{"application/json":{"schema":{"type":"object","required":["subscriptions"],"properties":{"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}}}}}}},"401":{"description":"No valid session was supplied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server processing error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/subscriptions/create":{"post":{"tags":["Subscriptions"],"summary":"Create a subscription","operationId":"createSubscription","security":[{"cookieAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductIdRequest"}}}},"responses":{"201":{"description":"Subscription and license created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubscriptionResponse"}}}},"400":{"description":"Product ID is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"No valid session was supplied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Product was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server processing error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/subscriptions/cancel":{"post":{"tags":["Subscriptions"],"summary":"Cancel a subscription","operationId":"cancelSubscription","security":[{"cookieAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionIdRequest"}}}},"responses":{"200":{"description":"Subscription cancelled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Subscription ID is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"No valid session was supplied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Subscription belongs to another user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Subscription was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server processing error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/license/list":{"get":{"tags":["Licenses"],"summary":"List the current user licenses","operationId":"listLicenses","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"User license keys.","content":{"application/json":{"schema":{"type":"object","required":["license_keys"],"properties":{"license_keys":{"type":"array","items":{"$ref":"#/components/schemas/License"}}}}}}},"401":{"description":"No valid session was supplied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server processing error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/license/generate":{"post":{"tags":["Licenses"],"summary":"Generate a license for a subscription","operationId":"generateLicense","security":[{"cookieAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionIdRequest"}}}},"responses":{"201":{"description":"License generated.","content":{"application/json":{"schema":{"type":"object","required":["success","license_key"],"properties":{"success":{"const":true},"license_key":{"$ref":"#/components/schemas/License"}}}}}},"400":{"description":"Subscription ID is missing or inactive.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"No valid session was supplied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Subscription belongs to another user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Subscription was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server processing error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/license/validate":{"post":{"tags":["Licenses"],"summary":"Validate a license key","operationId":"validateLicense","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseValidationRequest"}}}},"responses":{"200":{"description":"Validation result. Invalid licenses are represented by valid=false.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseValidationResponse"}}}},"400":{"description":"License key is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server processing error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"components":{"securitySchemes":{"cookieAuth":{"type":"apiKey","in":"cookie","name":"arise_session","description":"Session cookie set by the login or registration endpoint."}},"schemas":{"ApiError":{"type":"object","required":["error","code","message","hint"],"properties":{"error":{"type":"string","description":"Backward-compatible short error message."},"code":{"type":"string","example":"BAD_REQUEST"},"message":{"type":"string"},"hint":{"type":"string","description":"Actionable resolution guidance."}}},"SuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true},"message":{"type":"string"}},"required":["success"]},"RegisterRequest":{"type":"object","required":["email","password","name"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":8},"name":{"type":"string","minLength":1}}},"LoginRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":1}}},"AuthResponse":{"type":"object","required":["success","user","token"],"properties":{"success":{"type":"boolean","const":true},"user":{"$ref":"#/components/schemas/User"},"token":{"type":"string"}}},"CurrentUserResponse":{"type":"object","required":["user"],"properties":{"user":{"$ref":"#/components/schemas/User"}}},"User":{"type":"object","required":["id","email","name"],"properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"name":{"type":"string"}}},"Product":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"number"},"billing_cycle":{"type":"string"}}},"ProductIdRequest":{"type":"object","required":["product_id"],"properties":{"product_id":{"type":"string"}}},"SubscriptionIdRequest":{"type":"object","required":["subscription_id"],"properties":{"subscription_id":{"type":"string"}}},"Subscription":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string"},"status":{"type":"string"},"start_date":{"type":"integer"},"end_date":{"type":"integer"}}},"License":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"expires_at":{"type":["integer","null"]},"status":{"type":"string"}}},"ContactRequest":{"type":"object","required":["name","email","message"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"message":{"type":"string"},"phone":{"type":"string"},"source":{"type":"string"},"turnstileToken":{"type":"string"},"website":{"type":"string"}}},"AiDiagnosisRequest":{"type":"object","required":["companyName","contactName","email","turnstileToken"],"properties":{"companyName":{"type":"string"},"contactName":{"type":"string"},"email":{"type":"string","format":"email"},"phoneLine":{"type":"string"},"industry":{"type":"string"},"companySize":{"type":"string"},"websiteUrl":{"type":"string"},"tools":{"type":"array","items":{"type":"string"}},"painPoints":{"type":"array","items":{"type":"string"}},"biggestPain":{"type":"string"},"currentAiExperience":{"type":"string"},"budgetRange":{"type":"string"},"expectedTimeline":{"type":"string"},"turnstileToken":{"type":"string"}}},"LicenseValidationRequest":{"type":"object","required":["key"],"properties":{"key":{"type":"string"}}},"LicenseValidationResponse":{"type":"object","required":["valid"],"properties":{"valid":{"type":"boolean"},"error":{"type":"string"},"license_key":{"$ref":"#/components/schemas/License"}}},"CreateSubscriptionResponse":{"type":"object","required":["success","subscription"],"properties":{"success":{"type":"boolean","const":true},"subscription":{"type":"object"}}}}}}