> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stigg.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Plan

Represents a subscription plan in the Stigg system. Plans define the features, entitlements, and pricing available to customers.

## Type Definition

```graphql theme={null}
type Plan {
  id: UUID!
  refId: String!
  displayName: String!
  description: String
  status: PackageStatus!
  type: String!
  versionNumber: Int!
  isLatest: Boolean
  isParent: Boolean!

  # Pricing
  pricingType: PricingType
  prices: [Price!]
  overagePrices: [Price!]
  overageBillingPeriod: OverageBillingPeriod
  minimumSpend: [MinimumSpend!]

  # Entitlements
  packageEntitlements: [PackageEntitlementUnion!]
  inheritedPackageEntitlements: [PackageEntitlementUnion!]

  # Related entities
  product: Product!
  productId: String
  basePlan: Plan
  compatibleAddons: [Addon!]
  compatiblePackageGroups: [PlanCompatiblePackageGroups!]

  # Trial configuration
  defaultTrialConfig: DefaultTrialConfig

  # Metadata
  additionalMetaData: JSON
  hiddenFromWidgets: [WidgetType!]

  # Integrations
  billingId: String
  billingLinkUrl: String
  awsMarketplacePlanDimension: String
  syncStates: [SyncState!]

  # Draft management
  draftDetails: PackageDraftDetails
  draftSummary: PackageDraftSummary
  offer: Offer

  # Timestamps
  createdAt: DateTime
  updatedAt: DateTime
  environmentId: UUID!
  environment: Environment!
}
```

## Fields

### Core Fields

| Field           | Type                                                                      | Description                                        |
| --------------- | ------------------------------------------------------------------------- | -------------------------------------------------- |
| `id`            | `UUID!`                                                                   | Unique identifier for the plan                     |
| `refId`         | `String!`                                                                 | Your application's unique identifier for this plan |
| `displayName`   | `String!`                                                                 | Display name shown to customers                    |
| `description`   | `String`                                                                  | Plan description                                   |
| `status`        | [`PackageStatus!`](/api-and-sdks/api-reference/types/enums#packagestatus) | Publication status (DRAFT, PUBLISHED, ARCHIVED)    |
| `type`          | `String!`                                                                 | Package type identifier                            |
| `versionNumber` | `Int!`                                                                    | Version number of this plan                        |
| `isLatest`      | `Boolean`                                                                 | Whether this is the latest version                 |
| `isParent`      | `Boolean!`                                                                | Whether this plan has child plans                  |

### Pricing

| Field                  | Type                                                                 | Description                              |
| ---------------------- | -------------------------------------------------------------------- | ---------------------------------------- |
| `pricingType`          | [`PricingType`](/api-and-sdks/api-reference/types/enums#pricingtype) | Type of pricing (FREE, PAID, CUSTOM)     |
| `prices`               | [`[Price!]`](/api-and-sdks/api-reference/types/price)                | Price configurations for this plan       |
| `overagePrices`        | [`[Price!]`](/api-and-sdks/api-reference/types/price)                | Overage pricing for usage-based features |
| `overageBillingPeriod` | `OverageBillingPeriod`                                               | When overage is billed                   |
| `minimumSpend`         | `[MinimumSpend!]`                                                    | Minimum spend configuration              |

### Entitlements

| Field                          | Type                         | Description                           |
| ------------------------------ | ---------------------------- | ------------------------------------- |
| `packageEntitlements`          | `[PackageEntitlementUnion!]` | Entitlements included in this plan    |
| `inheritedPackageEntitlements` | `[PackageEntitlementUnion!]` | Entitlements inherited from base plan |

### Related Entities

| Field                     | Type                                                  | Description                        |
| ------------------------- | ----------------------------------------------------- | ---------------------------------- |
| `product`                 | `Product!`                                            | The product this plan belongs to   |
| `productId`               | `String`                                              | Product identifier                 |
| `basePlan`                | [`Plan`](/api-and-sdks/api-reference/types/plan)      | Parent plan (for plan inheritance) |
| `compatibleAddons`        | [`[Addon!]`](/api-and-sdks/api-reference/types/addon) | Addons compatible with this plan   |
| `compatiblePackageGroups` | `[PlanCompatiblePackageGroups!]`                      | Compatible package groups          |

### Trial Configuration

| Field                | Type                 | Description                          |
| -------------------- | -------------------- | ------------------------------------ |
| `defaultTrialConfig` | `DefaultTrialConfig` | Default trial settings for this plan |

## PackageStatus Enum

| Value       | Description                                           |
| ----------- | ----------------------------------------------------- |
| `DRAFT`     | Plan is in draft mode, not available for subscription |
| `PUBLISHED` | Plan is published and available for subscription      |
| `ARCHIVED`  | Plan is archived and no longer available              |

## PricingType Enum

| Value    | Description             |
| -------- | ----------------------- |
| `FREE`   | Plan has no charge      |
| `PAID`   | Plan requires payment   |
| `CUSTOM` | Plan has custom pricing |

## Example Response

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "refId": "plan-pro",
  "displayName": "Pro Plan",
  "description": "For growing teams",
  "status": "PUBLISHED",
  "versionNumber": 2,
  "isLatest": true,
  "isParent": false,
  "pricingType": "PAID",
  "prices": [
    {
      "id": "price-123",
      "billingModel": "FLAT_FEE",
      "billingPeriod": "MONTHLY",
      "price": {
        "amount": 99.00,
        "currency": "USD"
      }
    }
  ],
  "packageEntitlements": [
    {
      "feature": {
        "refId": "feature-api-calls",
        "displayName": "API Calls"
      },
      "usageLimit": 10000,
      "hasUnlimitedUsage": false
    }
  ],
  "defaultTrialConfig": {
    "duration": 14,
    "units": "DAY"
  },
  "compatibleAddons": [
    {
      "refId": "addon-extra-seats",
      "displayName": "Extra Seats"
    }
  ],
  "product": {
    "refId": "product-saas",
    "displayName": "SaaS Platform"
  },
  "createdAt": "2024-01-10T10:00:00Z",
  "updatedAt": "2024-01-15T15:30:00Z"
}
```

## Related Types

* [Price](/api-and-sdks/api-reference/types/price) - Price configuration type
* [Addon](/api-and-sdks/api-reference/types/addon) - Addon type
* [Feature](/api-and-sdks/api-reference/types/feature) - Feature type
* [Entitlement](/api-and-sdks/api-reference/types/entitlement) - Entitlement type

## Related Operations

* [Get Plan](/api-and-sdks/api-reference/queries/get-plan) - Fetch a single plan
* [List Plans](/api-and-sdks/api-reference/queries/list-plans) - Query plans
* [Create Plan](/api-and-sdks/api-reference/mutations/create-plan) - Create new plan
* [Publish Plan](/api-and-sdks/api-reference/mutations/publish-plan) - Publish plan changes
