6 endpoints.
| Method | Path | Summary |
|---|---|---|
GET | /api/subscriptions | Get all subscriptions (Admin only) |
POST | /api/subscriptions | Create a new subscription |
GET | /api/subscriptions/{tenantId} | Get subscription details for a tenant |
PUT | /api/subscriptions/{tenantId} | Update subscription plan |
POST | /api/subscriptions/{tenantId}/cancel | Cancel subscription |
POST | /api/subscriptions/{tenantId}/renew | Renew subscription |
GET /api/subscriptionsAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
page | query | no | integer | — |
limit | query | no | integer | — |
status | query | no | enum: PENDING, TRIAL, ACTIVE, CANCELLED, EXPIRED | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | List of subscriptions | — |
POST /api/subscriptionsAuth: Bearer JWT required.
Request body (required) — application/json
Type: CreateSubscriptionRequest
Responses
| Status | Description | Body |
|---|---|---|
201 | Subscription created successfully | — |
400 | Validation error or tenant already has subscription | — |
404 | Tenant or plan not found | — |
GET /api/subscriptions/{tenantId}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tenantId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Subscription details | — |
404 | Subscription not found | — |
PUT /api/subscriptions/{tenantId}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tenantId | path | yes | string (uuid) | — |
Request body (required) — application/json
| Field | Type | Required | Description |
|---|---|---|---|
planId | string (uuid) | yes | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Subscription updated successfully | — |
404 | Subscription or plan not found | — |
POST /api/subscriptions/{tenantId}/cancelAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tenantId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Subscription cancelled successfully | — |
404 | Subscription not found | — |
POST /api/subscriptions/{tenantId}/renewAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tenantId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Subscription renewed successfully | — |
404 | Subscription not found | — |