Skip to main content
Before importing subscriptions, verify that the required customers have already been imported into Stigg.

Free plans

Using the CLI

  1. To migrate subscriptions to free plans, create a file named free-subscriptions.json containing all subscriptions that you want to import. The file must follow this schema:
{
  "subscriptions": [
    {
      "customerId": "lorem-ipsum",
      "planId": "plan-1",
      "resourceId": "site-1", // optional - required for multiple subscriptions product
      "startDate": "2022-01-01T00:00:00.000Z", // optional - used for backdating
      "endDate": "2022-01-01T00:00:00.000Z", // optional - end date for the subscription
      }
      ],
      "additionalMetaData": { // optional - set metadata for the subscription
        "isTest": "true"
      }
    },
    // ...
  ]
}
  1. Initiate the bulk import process:
npx @stigg/bulk-import --subscriptions-file free-subscriptions.json

Using the API and SDKs

Use the importSubscriptionBulk endpoint. To migrate subscriptions to paid plans, repeat the below process for each subscription:
  1. Provision a subscription in Stigg with the start date of the subscription that currently exists in your billing provider and include the billingInformation.isBackdated: true property. Doing so will create the subscription as backdated in the billing provider and ensure that customers will be billed again for the subscription starting from the next billing period. You may optionally sync additional metadata for the subscription that’s synced to the billing provider to indicate that this is a migrated subscription by passing the billingInformation.metadata property when provisioning the subscription Stigg.
  2. Cancel the original subscription in your billing provider immediately and without prorations.

Custom plans

Using the CLI

  1. To migrate subscriptions to custom plans, create a file named custom-subscriptions.json containing all subscriptions that you want to import. The file must follow this schema:
{
  "subscriptions": [
    {
      "customerId": "lorem-ipsum",
      "planId": "plan-1",
      "resourceId": "site-1", // optional - required for multiple subscriptions product
      "startDate": "2022-01-01T00:00:00.000Z", // optional - used for backdating
      "endDate": "2022-01-01T00:00:00.000Z", // optional - end date for the subscription
      "subscriptionEntitlements": [ // optional - required custom entitlements)
        { "featureId": "feature-seats", "usageLimit": 10 },
        { "featureId": "feature-projects", "usageLimit": 25 },
      ],
      "addons": [ // optional - set subscription addons
        { "addonId": "addon-1", "quantity": 6 },
        { "addonId": "addon-2", "quantity": 3 },
      ],
      "additionalMetaData": { // optional - set metadata for the subscription
        "isTest": "true"
      }
    },
    // ...
  ]
}
  1. Initiate the bulk import process:
npx @stigg/bulk-import --subscriptions-file custom-subscriptions.json

Using the API and SDKs

Use the importSubscriptionBulk endpoint.