Packages and plans

Draft. Written from the repository's documents and code; not yet reviewed by the owner.

What a customer buys is a package. The console says package, the API says plan: they are the same thing (/v1/plans). A package is a code and a series of numbered versions; the version holds the money.

Package and version

POST /v1/plans makes the package: a code (what your app uses to refer to it) and a name. Nothing is priced yet. POST /v1/plans/{code}/versions publishes the next version, numbered 1, 2, 3, … A published version is immutable: a change of price is a new version, never an edit, and GET /v1/plans/{code}/versions/latest (or a number) reads one back.

A version holds:

Which version a customer is on

A subscription keeps the version it started on. Publishing a new version changes nothing for the customers already subscribed; a new subscription gets the latest unless it names a version. To move existing customers, schedule a price change: POST /v1/plans/{code}/price-changes moves the subscriptions of one version to another at their next renewal, no sooner than the notice you give (default 30 days, at least 14, at most 365), and each customer is told by mail in their language. dry_run counts and changes nothing. Subscriptions that cannot be moved are listed in skipped with the reason (renews_soon, has_pending_change, run_by_provider, not_changeable, customer_blocked). See Subscriptions for what happens to one subscription and Versioning for the other versions in the product.

What a package does not do

In the console this is the Packages page; the meters, packages and pricing guide goes through the form. The calls in order are in the usage-based billing tutorial.