---
title: "Delete Plan"
method: DELETE
path: "/admin/plans/{plan_id}"
---

# Delete Plan

`DELETE /admin/plans/{plan_id}`

## Request

- Base URL: `https://api.twtapi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.twtapi.com/admin/plans/{plan_id}`
- Auth: none declared

删除套餐。默认软删（is_active=False），hard=True 才是物理删除。

默认软删的原因：订单/用户可能仍引用该套餐 id，物理删除会让历史订单的
套餐信息失去关联、也让 _load_plan_map 之外的地方出现悬空引用。

注意：硬删不会清理 User.current_plan_id 的引用，也不会给受影响用户补差，
属于"确需清理脏数据"时才用的操作。

副作用：写库（硬删=DELETE，软删=UPDATE）+ 清套餐缓存。

## Path parameters

- `plan_id` integer, required

## Query parameters

- `hard` boolean: True = permanently delete, False = soft-delete (set is_active=False)

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/twtapi/apis/twtapi-backend.md) · [All operations](https://skmtc.dev/twtapi/apis/twtapi-backend/llms.txt) · [OpenAPI document](https://skmtc.dev/twtapi/apis/twtapi-backend/revisions/5295976febaf?raw)
