6 endpoints.
| Method | Path | Summary |
|---|---|---|
GET | /api/plans | Get all subscription plans |
POST | /api/plans | Create a new subscription plan (Admin only) |
DELETE | /api/plans/{id} | Delete a plan (Admin only) |
GET | /api/plans/{id} | Get a specific plan by ID |
PUT | /api/plans/{id} | Update an existing plan (Admin only) |
GET | /api/plans/comparison | Get plan comparison data |
GET /api/plansAuth: Bearer JWT required.
Responses
| Status | Description | Body |
|---|---|---|
200 | List of all subscription plans | object |
POST /api/plansAuth: Bearer JWT required.
Request body (required) — application/json
Type: CreatePlanRequest
Responses
| Status | Description | Body |
|---|---|---|
201 | Plan created successfully | — |
400 | Validation error | — |
401 | Unauthorized | — |
DELETE /api/plans/{id}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Plan deleted successfully | — |
400 | Cannot delete plan with active subscriptions | — |
404 | Plan not found | — |
GET /api/plans/{id}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Plan details | — |
404 | Plan not found | — |
PUT /api/plans/{id}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string | — |
Request body (required) — application/json
Type: CreatePlanRequest
Responses
| Status | Description | Body |
|---|---|---|
200 | Plan updated successfully | — |
404 | Plan not found | — |
GET /api/plans/comparisonAuth: Bearer JWT required.
Responses
| Status | Description | Body |
|---|---|---|
200 | Plan comparison data for frontend | — |