Working With Subscriptions

Updating Subscription Items

It looks like it's possible to replace the items of a subscription while it's in progress. This can be useful for upgrades, etc. The general technique is as follows:

  1. Take the existing subscription items.

  2. Compare with the desired subscription items based of the price ID:

    • If the subscription item is new, create a new subscription item with quantity and price (and whatever else you need).

    • If the subscription item already exists, then make note of the subscription item ID and update details as to what you need, like quantity

    • If the subscription item should be deleted, set the deleted flag to true.

  3. With these new subscription parameters, make a call to the update endpoint.

Last updated