# Update plugin subscription plan

`PUT /api/plugin-plans/{id}`

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (path, string, uuid, required) - Plugin subscription plan ID
  Type: string, uuid

Request body: application/json (required)

Type: object

Schema: [UpdatePluginSubscriptionPlanDTO](https://sourcey-gauzy.pages.dev/api-reference/models/updatepluginsubscriptionplandto/index.md)

- `id` (required)
  Type: string
  
  Unique identifier for the plugin
  
  Example:
  
  ```json
  "123e4567-e89b-12d3-a456-426614174000"
  ```

- `price` (optional)
  Type: number
  
  Plan price

- `isPopular` (optional)
  Type: boolean
  
  Whether this plan is marked as popular

- `isRecommended` (optional)
  Type: boolean
  
  Whether this plan is recommended

- `trialDays` (optional)
  Type: number
  
  Trial period duration in days

- `setupFee` (optional)
  Type: number
  
  Setup fee for the plan

- `discountPercentage` (optional)
  Type: number
  
  Discount percentage for the plan

- `name` (optional)
  Type: string
  
  Plan name

- `description` (optional)
  Type: string
  
  Plan description

- `type` (optional)
  Type: string
  
  Plan type
  
  enum: ["free","trial","basic","premium","enterprise","custom"]

- `currency` (optional)
  Type: string
  
  Plan currency
  
  enum: ["AFN","AFA","ALL","ALK","DZD","ADP","AOA","AOK","AON","AOR","ARA","ARS","ARM","ARP","ARL","AMD","AWG","AUD","ATS","AZN","AZM","BSD","BHD","BDT","BBD","BYN","BYB","BYR","BEF","BEC","BEL","BZD","BMD","BTN","BOB","BOL","BOV","BOP","BAM","BAD","BAN","BWP","BRC","BRZ","BRE","BRR","BRN","BRB","BRL","GBP","BND","BGL","BGN","BGO","BGM","BUK","BIF","XPF","KHR","CAD","CVE","KYD","XAF","CLE","CLP","CLF","CNX","CNY","COP","COU","KMF","CDF","CRC","HRD","HRK","CUC","CUP","CYP","CZK","CSK","DKK","DJF","DOP","NLG","XCD","DDM","ECS","ECV","EGP","GQE","ERN","EEK","ETB","EUR","XEU","FKP","FJD","FIM","FRF","XFO","XFU","GMD","GEK","GEL","DEM","GHS","GHC","GIP","GRD","GTQ","GWP","GNF","GNS","GYD","HTG","HNL","HKD","HUF","ISK","ISJ","INR","IDR","IRR","IQD","IEP","ILS","ILP","ILR","ITL","JMD","JPY","JOD","KZT","KES","KWD","KGS","LAK","LVL","LVR","LBP","LSL","LRD","LYD","LTL","LTT","LUL","LUC","LUF","MOP","MKD","MKN","MGA","MGF","MWK","MYR","MVR","MVP","MLF","MTL","MTP","MRO","MUR","MXV","MXN","MXP","MDC","MDL","MCF","MNT","MAD","MAF","MZE","MZN","MZM","MMK","NAD","NPR","ANG","TWD","NZD","NIO","NIC","NGN","KPW","NOK","OMR","PKR","PAB","PGK","PYG","PEI","PEN","PES","PHP","PLN","PLZ","PTE","GWE","QAR","XRE","RHD","RON","ROL","RUB","RUR","RWF","SVC","WST","SAR","RSD","CSD","SCR","SLL","SGD","SKK","SIT","SBD","SOS","ZAR","ZAL","KRH","KRW","KRO","SSP","SUR","ESP","ESA","ESB","LKR","SHP","SDD","SDG","SDP","SRD","SRG","SZL","SEK","CHF","SYP","STD","TJR","TJS","TZS","THB","TPE","TOP","TTD","TND","TRY","TRL","TMT","TMM","USD","USN","USS","UGX","UGS","UAH","UAK","AED","UYU","UYP","UYI","UZS","VUV","VEF","VEB","VND","VNN","CHE","CHW","XOF","YDD","YER","YUN","YUD","YUM","YUR","ZRN","ZRZ","ZMW","ZMK","ZWD","ZWR","ZWL"]

- `billingPeriod` (optional)
  Type: string
  
  Billing period
  
  enum: ["daily","weekly","monthly","quarterly","yearly","one-time"]

- `features` (optional)
  Type: array
  
  Plan features
  
  Items:
    Type: string

- `limitations` (optional)
  Type: object
  
  Plan limitations

- `isActive` (optional)
  Type: boolean
  
  Is plan active

- `metadata` (optional)
  Type: object
  
  Plan metadata

- `sortOrder` (optional)
  Type: number
  
  Sort order

Responses:

- 200: Plugin subscription plan updated successfully

Content type: application/json

Type: object

Schema: [PluginSubscriptionPlan_1](https://sourcey-gauzy.pages.dev/api-reference/models/pluginsubscriptionplan-1/index.md)

- `deletedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `createdAt` (optional)
  Type: string, date-time
  
  The creation timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `updatedAt` (optional)
  Type: string, date-time
  
  The last update timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `id` (optional)
  Type: string

- `isActive` (optional)
  Type: boolean
  
  Whether the plan is active and available for purchase
  
  default: true

- `isArchived` (optional)
  Type: boolean
  
  default: false

- `archivedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `name` (required)
  Type: string
  
  Plan name

- `description` (optional)
  Type: string
  
  Plan description

- `type` (required)
  Type: string
  
  Subscription type/plan level
  
  enum: ["free","trial","basic","premium","enterprise","custom"]

- `price` (required)
  Type: number
  
  Plan price

- `currency` (required)
  Type: string
  
  Currency code (e.g., USD, EUR)

- `billingPeriod` (required)
  Type: string
  
  Billing period
  
  enum: ["daily","weekly","monthly","quarterly","yearly","one-time"]

- `features` (required)
  Type: array
  
  Plan features list
  
  Items:
    Type: string

- `limitations` (optional)
  Type: object
  
  Plan limitations and quotas

- `isPopular` (optional)
  Type: boolean
  
  Whether this plan is marked as popular

- `isRecommended` (optional)
  Type: boolean
  
  Whether this plan is recommended

- `trialDays` (optional)
  Type: number
  
  Trial period duration in days

- `setupFee` (optional)
  Type: number
  
  Setup fee for the plan

- `discountPercentage` (optional)
  Type: number
  
  Discount percentage for the plan

- `metadata` (optional)
  Type: string
  
  Plan metadata (JSON string)

- `sortOrder` (optional)
  Type: number
  
  Sort order for displaying plans

- `pluginId` (required)
  Type: string
  
  Plugin ID

- `createdById` (optional)
  Type: string
  
  User who created this plan

- `subscriptions` (optional)
  Type: array
  
  Subscriptions using this plan
  
  Items:
    Type: string

## Examples

### cURL

```bash
curl -X PUT 'http://localhost:3000/api/plugin-plans/550e8400-e29b-41d4-a716-446655440000' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "price": 0,
  "isPopular": true,
  "isRecommended": true,
  "trialDays": 0,
  "setupFee": 0,
  "discountPercentage": 0,
  "name": "string",
  "description": "string",
  "type": "free",
  "currency": "AFN",
  "billingPeriod": "daily",
  "features": [
    "string"
  ],
  "limitations": {},
  "isActive": true,
  "metadata": {},
  "sortOrder": 0
}'
```

### JavaScript

```javascript
const body = `{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "price": 0,
  "isPopular": true,
  "isRecommended": true,
  "trialDays": 0,
  "setupFee": 0,
  "discountPercentage": 0,
  "name": "string",
  "description": "string",
  "type": "free",
  "currency": "AFN",
  "billingPeriod": "daily",
  "features": [
    "string"
  ],
  "limitations": {},
  "isActive": true,
  "metadata": {},
  "sortOrder": 0
}`;

const response = await fetch('http://localhost:3000/api/plugin-plans/550e8400-e29b-41d4-a716-446655440000', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "price": 0,
  "isPopular": true,
  "isRecommended": true,
  "trialDays": 0,
  "setupFee": 0,
  "discountPercentage": 0,
  "name": "string",
  "description": "string",
  "type": "free",
  "currency": "AFN",
  "billingPeriod": "daily",
  "features": [
    "string"
  ],
  "limitations": {},
  "isActive": true,
  "metadata": {},
  "sortOrder": 0
}'''

response = requests.put(
    'http://localhost:3000/api/plugin-plans/550e8400-e29b-41d4-a716-446655440000',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
