Calculating Cost Previews for Subscription Changes
Hi, I'm Alex, and welcome back to the Boathous Paddle Series where we talk about everything concerning paddle. Today, we're going to delve into a topic that many of our users are curious about: how to implement a screen that shows customers what changing a plan or changing the quantity means for them in terms of costs.
Understanding Subscription Changes for Customers
When customers make changes to their subscriptions, they often wonder:
- What's due today for that change?
- What will it do to the recurring billing for that customer?
In our Boathous customer portal, for any changes to the quantity or the plan, we provide exact values for these questions. You can do the same in your own app, and in this blog post, we're going to show you how.
Using the "Preview for an Update to a Subscription" API
To display cost changes related to subscription modifications on an account screen, you can utilize an API endpoint similar to ours: the "Preview for an Update to a Subscription" endpoint. This endpoint is designed to forecast the costs of updates without actually applying them and is nearly identical to the regular subscription update endpoint.
Endpoint Overview
Standard Update Endpoint
The standard update endpoint is used to change the details of a subscription. You pass in:
- The items of the subscription: these represent the services/products included.
- New quantities: for scenarios where the amount of a specific service/product is altered.
For example, if a customer is switching their plan, you would simply switch out the price IDs. If they are adjusting the quantity, you increase or decrease the amount accordingly.