dramaling-app/docs/04_technical/api/subscription.md

52 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 訂閱系統 API
## 概述
訂閱系統API負責管理用戶訂閱服務包括方案管理、支付處理、權限控制和訪客訂閱功能。
## API 端點
### 獲取訂閱方案
```http
GET /api/v1/subscriptions/plans
Authorization: Bearer <access_token>
Response 200 OK
{
"success": true,
"data": {
"plans": [
{
"plan_id": "PLAN_MONTHLY",
"name": "月費會員",
"description": "解鎖對話訓練功能,享受完整學習體驗",
"price": {
"monthly": {
"amount": 600,
"currency": "TWD",
"test_discount": {
"percentage": 80,
"discounted_price": 120,
"description": "內部測試期間2折優惠"
}
}
},
"features": [
"解鎖所有對話訓練關卡",
"無限制對話練習次數",
"完整語言程度評估",
"詳細學習分析報告"
]
}
]
}
}
```
## 錯誤處理
- `SUBSCRIPTION_REQUIRED`: 需要訂閱才能存取
- `SUBSCRIPTION_EXPIRED`: 訂閱已過期
- `PAYMENT_FAILED`: 付款處理失敗
---
**建立日期**: 2025-09-08
**API版本**: v1