Logo

Migrate

OpenMeter plans are versioned. As you make changes to your pricing and publish new versions of your plans, by all existing subscriptions will stay on the old version. This is called grandfathering in the SaaS business. Once you're ready to move existing customers to the new version, you can use the migrate API to move them to the new version.

For example, if you have a plan with a price of $10/month and you publish a new version with a price of $15/month, you can migrate existing subscriptions to the new version or keep them on the old version.

Migrating a Subscription

Migrating a subscription is the process of changing the plan of a subscription to a new version. This is useful when you have published a new version of a plan and you want to move existing customers to the new version.

Example: Migrate a subscription to a new plan version

const response = await openmeter.subscriptions.migrate('subscription-id', {
  targetVersion: 3,
}
  • targetVersion: The version of the plan to migrate the subscription to, can be any version later than the current one. If the version is not specified, the latest published version will be used.