> ## Documentation Index
> Fetch the complete documentation index at: https://docs.waffo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# サブスクリプション注文エンドポイント

> サブスクリプション注文の作成と管理

サブスクリプション注文エンドポイントにより、定期課金注文の作成とライフサイクルの管理が可能です。サブスクリプションはチェックアウトセッション（`productType: "subscription"`）を通じて作成され、キャンセルとステータス遷移によって管理されます。

## サブスクリプションステータス値

| ステータス       | 説明                    |
| ----------- | --------------------- |
| `pending`   | サブスクリプション作成済み、初回支払い待ち |
| `active`    | 有効で通常課金中              |
| `trialing`  | 無料トライアル期間中            |
| `canceling` | キャンセルリクエスト済み、期間終了まで有効 |
| `past_due`  | 支払い失敗、リトライ中           |
| `canceled`  | サブスクリプション終了、以降の課金なし   |
| `expired`   | サブスクリプション期限切れ         |

## エンドポイント

<CardGroup cols={2}>
  <Card title="サブスクリプションのキャンセル" icon="ban" href="/api-reference/endpoints/subscriptions/cancel-subscription">
    有効または保留中のサブスクリプションをキャンセルします。
  </Card>
</CardGroup>

## 近日公開

以下のエンドポイントは計画中ですが未実装です（現在は `501 Not Implemented` を返します）：

* **商品の変更** (`POST /v1/actions/subscription-order/change-product`) -- サブスクリプションを別の商品にアップグレードまたはダウングレードします。
* **サブスクリプションの再有効化** (`POST /v1/actions/subscription-order/reactivate-order`) -- キャンセルされたサブスクリプションを再有効化します。
