cURL
curl --request POST \ --url https://api.zangsho.com/v1/subscriptions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "customer_id": 123, "plan_name": "Pro Plan", "mrr": "990.00", "billing_cycle": "monthly", "started_at": "2026-01-01T00:00:00Z", "current_period_start": "2026-01-01T00:00:00Z" } '
{ "data": { "id": 123, "customer_id": 123, "status": "active", "plan_name": "<string>", "mrr": "<string>", "billing_cycle": "<string>", "source": "api", "started_at": "2023-11-07T05:31:56Z", "current_period_start": "2023-11-07T05:31:56Z", "cancelled_at": "2023-11-07T05:31:56Z", "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z" } }
為客戶建立新訂閱。每位客戶同時只能有一個有效訂閱。
使用 Laravel Sanctum Token 進行認證。
Token 可在商家後台的「API 設定」頁面取得。
客戶 ID
月經常性收入
"990.00"
訂閱週期
monthly
quarterly
semi-annual
yearly
訂閱開始時間
目前週期開始時間
方案名稱
"Pro Plan"
訂閱建立成功
Show child attributes