Skip to main content
Configures pricing for a plan or addon, supporting various billing models.

Mutation

mutation SetPackagePricing($input: PackagePricingInput!) {
  setPackagePricing(input: $input) {
    packageId
    prices {
      billingModel
      billingPeriod
      billingCadence
      price {
        amount
        currency
      }
      tiers {
        upTo
        unitPrice {
          amount
          currency
        }
      }
    }
  }
}
{
  "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"
        }
      }
    ]
  }
}
{
  "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
        }
      ]
    }
  }
}

Parameters

input
PackagePricingInput
required
Input for setting package pricing

Billing Models

ModelDescription
FLAT_FEEFixed recurring price
USAGE_BASEDBased on metered usage
TIEREDVolume-based tiers
CREDIT_BASEDDeduct from credit balance

Examples

Flat Fee Pricing

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

Usage-Based Pricing

{
  "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

{
  "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" } }
        ]
      }
    ]
  }
}