Skip to main content
A catalog version is a published snapshot of your meters, benefits, products, custom fields and catalog settings. With Pricing as Code, every publish creates one. New checkouts sell the latest version, while customers who bought from an earlier one keep what they bought. That’s what lets you change pricing without worrying about existing customers. If you raise the price of Pro in a new version, your current Pro subscribers keep renewing at the price they signed up for.

Draft, current and archived

An organization has at most one draft and one current version at a time. Running polar config draft again replaces the draft, and if your file matches the current version again, the draft is discarded. If you edit the file after drafting, run polar config draft again before you publish. publish warns you when the two differ, and it needs the owner or admin role.

Names

Give a version a name with polar config draft --name to record why it changed. Versions you don’t name are numbered v1, v2 and so on.
Terminal
If you’re already selling on Polar, polar config init publishes your existing catalog as the first version. If you’re new, you start from an empty catalog.

What existing customers keep

Publishing changes what new customers buy, not existing subscriptions or what customers already have.
  • Renewals continue at the price of the version the customer bought.
  • Benefits granted from an earlier version stay granted, because publishing doesn’t grant or revoke anything.
  • Plan changes move a customer to a product in the current version. A customer can’t switch to a product from an archived version, and the Customer Portal only offers current products.

Use external IDs in your code

Available from API version 2027-01.
The external ID is the lookup key you give each meter, benefit and product in your config, and it stays the same in every version. A Polar ID belongs to one version of an entry, so it changes when you publish a change to that entry. A stored Polar ID can go stale: a checkout for a product ID from an archived version fails, because that version is no longer sold. Pass the external ID instead. Polar resolves it to the version on sale.
Keep catalog_status=live when you list. Without it the list also returns drafted and archived versions. Products and meters also expose catalog_id and is_current. Subscriptions, orders and benefit grants keep the Polar ID of the version they were created from. To check which plan a customer has, compare product.external_id, not product.id. Checkout links and discounts follow along on their own. When you publish, checkout links switch to the new version of their products and drop the products you removed, and a discount limited to a product applies to every version of it.

Stop selling something

You can’t remove a product from the file while customers still use it, and polar config validate reports it as an error if you try. Mark it deprecated instead:
polar.config.ts
In JSON, set "deprecated": true on the entry. A deprecated entry is left out of the next version, so it stops being sold while the customers who have it keep it. Once nobody uses it, polar config prune removes it from your file without changing anything on Polar.

Learn more