Skip to main content
POST
/
api
/
v1
/
plans
JavaScript
import Stigg from '@stigg/typescript';

const client = new Stigg({
  apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});

const plan = await client.v1.plans.create({
  id: 'id',
  displayName: 'displayName',
  productId: 'productId',
});

console.log(plan.data);
{
  "data": {
    "id": "plan-professional",
    "displayName": "Professional",
    "description": "Professional plan with advanced features",
    "productId": "product-starter",
    "status": "PUBLISHED",
    "pricingType": "PAID",
    "billingId": "price_1234567890",
    "versionNumber": 1,
    "isLatest": true,
    "entitlements": [
      {
        "type": "FEATURE",
        "id": "feature-advanced-analytics"
      },
      {
        "type": "CREDIT",
        "id": "api-calls"
      }
    ],
    "metadata": {},
    "createdAt": "2025-10-28T10:46:14.391Z",
    "updatedAt": "2025-05-29T12:47:07.275Z",
    "parentPlanId": null,
    "defaultTrialConfig": {
      "duration": 14,
      "units": "DAY",
      "budget": null,
      "trialEndBehavior": null
    },
    "compatibleAddonIds": [
      "suus necessitatibus aro cilicium creator vociferor ancilla ipsam talio delego appello depulso patruus vado ratione victus quam adipiscor suscipio corpus caries ulterius arbustum subito quibusdam cubitum vestrum calculus quidem vapulus adicio sulum vehemen"
    ]
  }
}

Authorizations

X-API-KEY
string
header
required

Server API Key

Body

application/json

Request to create a new plan

id
string
required

The unique identifier for the entity

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$
displayName
string
required

The display name of the package

Maximum string length: 255
productId
string
required

The product ID to associate the plan with

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$
description
string | null

The description of the package

Maximum string length: 255
parentPlanId
string | null

The ID of the parent plan, if applicable

Maximum string length: 255
pricingType
enum<string> | null

The pricing type of the package

Available options:
FREE,
PAID,
CUSTOM
billingId
string | null

The unique identifier for the entity in the billing provider

Maximum string length: 255
status
enum<string>

The status of the package

Available options:
DRAFT,
PUBLISHED,
ARCHIVED
metadata
object

Metadata associated with the entity

defaultTrialConfig
DefaultTrialConfig · object

Default trial configuration for the plan

Response

The newly created plan object.

Response object

data
Plan · object
required

Plan configuration object