> ## 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.

# Set Package Pricing

Configures pricing for a plan or addon, supporting various billing models.

## Mutation

<CodeGroup>
  ```graphql Mutation theme={null}
  mutation SetPackagePricing($input: PackagePricingInput!) {
    setPackagePricing(input: $input) {
      packageId
      prices {
        billingModel
        billingPeriod
        billingCadence
        price {
          amount
          currency
        }
        tiers {
          upTo
          unitPrice {
            amount
            currency
          }
        }
      }
    }
  }
  ```

  ```json Variables theme={null}
  {
    "input": {
      "packageId": "plan-uuid-123",
      "pricingType": "PAID",
      "prices": [
        {
          "billingModel": "FLAT_FEE",
          "billingPeriod": "MONTHLY",
          "price": {
            "amount": 99,
            "currency": "USD"
          }
        },
        {
          "billingModel": "FLAT_FEE",
          "billingPeriod": "ANNUAL",
          "price": {
            "amount": 990,
            "currency": "USD"
          }
        }
      ]
    }
  }
  ```

  ```json Response theme={null}
  {
    "data": {
      "setPackagePricing": {
        "packageId": "plan-uuid-123",
        "prices": [
          {
            "billingModel": "FLAT_FEE",
            "billingPeriod": "MONTHLY",
            "billingCadence": "RECURRING",
            "price": {
              "amount": 99,
              "currency": "USD"
            },
            "tiers": null
          },
          {
            "billingModel": "FLAT_FEE",
            "billingPeriod": "ANNUAL",
            "billingCadence": "RECURRING",
            "price": {
              "amount": 990,
              "currency": "USD"
            },
            "tiers": null
          }
        ]
      }
    }
  }
  ```
</CodeGroup>

## Parameters

<ParamField body="input" type="PackagePricingInput" required>
  Input for setting package pricing

  <Expandable title="properties">
    <ParamField body="packageId" type="UUID" required>
      Plan or addon internal ID
    </ParamField>

    <ParamField body="pricingType" type="PricingType" required>
      FREE, PAID, or CUSTOM
    </ParamField>

    <ParamField body="prices" type="[PriceInput]" required>
      Array of price configurations

      <Expandable title="nested properties">
        <ParamField body="billingModel" type="BillingModel" required>
          FLAT\_FEE, USAGE\_BASED, TIERED, CREDIT\_BASED
        </ParamField>

        <ParamField body="billingPeriod" type="BillingPeriod" required>
          MONTHLY, ANNUAL
        </ParamField>

        <ParamField body="billingCadence" type="BillingCadence">
          RECURRING or ONE\_OFF
        </ParamField>

        <ParamField body="price" type="MoneyInputDTO">
          Price amount and currency
        </ParamField>

        <ParamField body="featureId" type="String">
          Feature ID for usage-based pricing
        </ParamField>

        <ParamField body="tiers" type="[PriceTierInput]">
          Tiers for tiered pricing
        </ParamField>

        <ParamField body="blockSize" type="Float">
          Units per block for metered pricing
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="environmentId" type="UUID">
      Environment ID
    </ParamField>
  </Expandable>
</ParamField>

## Billing Models

| Model          | Description                |
| -------------- | -------------------------- |
| `FLAT_FEE`     | Fixed recurring price      |
| `USAGE_BASED`  | Based on metered usage     |
| `TIERED`       | Volume-based tiers         |
| `CREDIT_BASED` | Deduct from credit balance |

## Examples

### Flat Fee Pricing

```json theme={null}
{
  "input": {
    "packageId": "plan-uuid-123",
    "pricingType": "PAID",
    "prices": [
      {
        "billingModel": "FLAT_FEE",
        "billingPeriod": "MONTHLY",
        "price": { "amount": 99, "currency": "USD" }
      }
    ]
  }
}
```

### Usage-Based Pricing

```json theme={null}
{
  "input": {
    "packageId": "plan-uuid-123",
    "pricingType": "PAID",
    "prices": [
      {
        "billingModel": "USAGE_BASED",
        "billingPeriod": "MONTHLY",
        "featureId": "feature-api-calls",
        "price": { "amount": 0.01, "currency": "USD" }
      }
    ]
  }
}
```

### Tiered Pricing

```json theme={null}
{
  "input": {
    "packageId": "plan-uuid-123",
    "pricingType": "PAID",
    "prices": [
      {
        "billingModel": "TIERED",
        "billingPeriod": "MONTHLY",
        "featureId": "feature-api-calls",
        "tiers": [
          { "upTo": 1000, "unitPrice": { "amount": 0, "currency": "USD" } },
          { "upTo": 10000, "unitPrice": { "amount": 0.01, "currency": "USD" } },
          { "upTo": null, "unitPrice": { "amount": 0.005, "currency": "USD" } }
        ]
      }
    ]
  }
}
```

## Related Operations

* [Create Plan](/api-and-sdks/api-reference/mutations/create-plan) - Create plan
* [Create Addon](/api-and-sdks/api-reference/mutations/create-addon) - Create addon
* [Publish Plan](/api-and-sdks/api-reference/mutations/publish-plan) - Publish plan
