# Copy plugin subscription plan

`POST /api/plugin-plans/copy`

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

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

- `sourcePlanId` (required)
  Type: string
  
  Source plan ID to copy from

- `newName` (required)
  Type: string
  
  New plan name

- `newDescription` (optional)
  Type: string
  
  New plan description

- `newPrice` (optional)
  Type: number
  
  New plan price

Responses:

- 201: Plugin subscription plan copied 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 POST 'http://localhost:3000/api/plugin-plans/copy' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "sourcePlanId": "string",
  "newName": "string",
  "newDescription": "string",
  "newPrice": 0
}'
```

### JavaScript

```javascript
const body = `{
  "sourcePlanId": "string",
  "newName": "string",
  "newDescription": "string",
  "newPrice": 0
}`;

const response = await fetch('http://localhost:3000/api/plugin-plans/copy', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

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

### Python

```python
import requests

body = '''{
  "sourcePlanId": "string",
  "newName": "string",
  "newDescription": "string",
  "newPrice": 0
}'''

response = requests.post(
    'http://localhost:3000/api/plugin-plans/copy',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
