Manage Stigg product catalog via GraphQL API. Use when working with Stigg environments, plans, features, add-ons, coupons, or pricing. Covers viewing environments, dumping/exporting product catalogs, comparing environments, merging changes between environments, and creating environments from JSON templates. Triggers include "stigg", "product catalog", "environments", "merge environment", "pricing", "plans", "features", "entitlements".
This skill enables management of Stigg's product catalog through the GraphQL API.
https://api.stigg.io/graphqlAll requests require the X-API-KEY header:
curl -X POST https://api.stigg.io/graphql \
-H "Content-Type: application/json" \
-H "X-API-KEY: $STIGG_API_KEY" \
-d '{"query": "..."}'
MANDATORY: Before executing any mutation that modifies an environment, you MUST:
mergeEnvironmentdumpEnvironmentForMergeComparison to get the pre-merge and post-merge statesNever apply changes without showing the preview first and receiving user approval.
The migrationType field determines how existing customer subscriptions are affected:
NEW_CUSTOMERS (default) - Changes only apply to new subscriptions; existing customers keep their current plan versionsALL_CUSTOMERS - Migrate all existing customers to the new plan versionsMANDATORY: If the user has not explicitly specified the migration type:
NEW_CUSTOMERS in your previewALL_CUSTOMERS without explicit user confirmationFetch all environments in the account:
query {
environments(paging: { first: 25 }) {
edges {
node {
id
slug
displayName
type
description
isSandbox
provisionStatus
createdAt
}
}
}
}
Environment types: DEVELOPMENT, PRODUCTION, SANDBOX
Export the complete product catalog of an environment as JSON:
query DumpCatalog($input: DumpEnvironmentProductCatalogInput!) {
dumpEnvironmentProductCatalog(input: $input) {
dump
}
}
Variables:
{
"input": {
"environmentSlug": "development"
}
}
The dump contains: products, plans, addons, features, featureGroups, coupons, customCurrencies, packageGroups, widgetConfiguration, workflows
Compare source and destination environments before merging:
query PreviewMerge($input: DumpEnvironmentForForMergeComparisonInput!) {
dumpEnvironmentForMergeComparison(input: $input) {
preMergeDump
postMergeDump
}
}
Variables:
{
"input": {
"sourceEnvironmentSlug": "development",
"destinationEnvironmentSlug": "production",
"mergeConfiguration": {
"includeCoupons": true
}
}
}
Use this to show users what will change before executing the merge.
The mergeEnvironment mutation supports three use cases:
mutation MergeEnvToEnv($input: MergeEnvironmentInput!) {
mergeEnvironment(input: $input) {
environmentSlug
taskIds
}
}
Variables:
{
"input": {
"sourceEnvironmentSlug": "development",
"destinationEnvironmentSlug": "production",
"mergeConfiguration": {
"includeCoupons": true
},
"migrationType": "NEW_CUSTOMERS"
}
}
Omit destinationEnvironmentSlug to create a new environment:
{
"input": {
"sourceEnvironmentSlug": "development",
"destinationEnvironmentName": "staging",
"destinationEnvironmentType": "DEVELOPMENT"
}
}
Use sourceTemplate instead of sourceEnvironmentSlug to apply a JSON catalog:
{
"input": {
"sourceTemplate": {
/* product catalog JSON */
},
"destinationEnvironmentSlug": "development"
}
}
Or create a new environment from JSON:
{
"input": {
"sourceTemplate": {
/* product catalog JSON */
},
"destinationEnvironmentName": "new-environment",
"destinationEnvironmentType": "DEVELOPMENT"
}
}
When merging, migrationType controls how existing customers are handled:
NEW_CUSTOMERS (default) - Changes only apply to new subscriptions; existing customers keep their current plan versionsALL_CUSTOMERS - Migrate all existing customers to the new plan versionsImportant: Always ask the user which migration type they want if not explicitly specified. Do not assume.
The catalog JSON has these top-level keys:
{
"products": {},
"plans": {},
"addons": {},
"features": {},
"featureGroups": {},
"coupons": {},
"customCurrencies": {},
"packageGroups": {},
"widgetConfiguration": {},
"workflows": {}
}
Products - Container for plans, the billing entity
refId: Unique identifier (e.g., "product-revvenu")displayName: Human-readable namestatus: PUBLISHED or DRAFTproductSettings: Subscription behavior settingsPlans - Pricing tiers within a product
refId: Unique identifier (e.g., "plan-basic")pricingType: FREE, PAID, or CUSTOMprices: Pricing configuration by billing modelpackageEntitlements: Features included in the planparentPlanRefId: For plan inheritancecompatibleAddonRefIds: Add-ons that can be purchased with this planFeatures - Capabilities that can be entitled
featureType: BOOLEAN, NUMBER, or ENUMmeterType: INCREMENTAL, FLUCTUATING, or NonefeatureUnits/featureUnitsPlural: Display unitsAdd-ons - Purchasable extras for plans
compatibleAddonRefIds on plansPrices - Billing configuration
billingModel: FLAT_FEE, PER_UNIT, or USAGE_BASEDbillingPeriod: MONTHLY or ANNUALLYbillingCadence: RECURRING or ONE_TIMESee references/catalog-schema.md for complete schema details.
dumpEnvironmentProductCatalogdump JSON to a filedumpEnvironmentForMergeComparison to preview changesmigrationType they want (NEW_CUSTOMERS or ALL_CUSTOMERS) if not already specifiedmergeEnvironment mutation with the confirmed settingsmergeEnvironment with sourceTemplate and target environmentdumpEnvironmentProductCatalogThe scripts/stigg_api.py script provides a CLI for common operations:
# Set API key
export STIGG_API_KEY="your-api-key"
# List environments
python scripts/stigg_api.py list-environments
# Dump catalog to file
python scripts/stigg_api.py dump-catalog --env development --output catalog.json
# Preview merge
python scripts/stigg_api.py preview-merge --source development --dest production
# Merge environments
python scripts/stigg_api.py merge --source development --dest production
# Create environment from template
python scripts/stigg_api.py merge --template catalog.json --new-env staging --type DEVELOPMENT
# Apply template to existing environment
python scripts/stigg_api.py merge --template catalog.json --dest development
dumpEnvironmentForMergeComparison before merging and get user confirmationNEW_CUSTOMERS but confirm with the user