Variable Pricing Setup for Subscriptions
The setup for variable pricing, typically based on usage charges or overage charges, is slightly complicated, and depends on a number of variables. In SpringBoard, we have tags, which are really named variables that are able to hold a positive integer value. We can use tags or quantity to accomplish variable pricing. The following are two scenarios for various situations for which we have already used tags to accomplish variable pricing, as well as an example that uses quantity. Look for a scenario that is most closely related to what you need to accomplish. If you need any assistance with setting up variable pricing, please open a support ticket.
Scenario 1: Base Charge + Cost per Additional Users
This scenario is based on one additional factor that might increase the monthly cost for your customers.
Depending on your customers' usage of your platform, you may wish to bill for additional users at the end of each month. For example, you might offer a base charge for a certain number of users, and then an additional charge for extra users at a specific rate. Specifically, you charge $100 for 10 users, and $12 for each additional user.
You will need to make a call to the Update method of the Subscription API. For example, the XML payload, for an additional 5 users, might look like:
<subscription><tags>extra=5</tags></subscription>
The price on the product will need to be a custom calculation. Go to SpringBoard's Store Home » Products and Pages. Choose the product to which you wish to add this custom pricing. Click Prices, and then click the display price. Choose Custom Calculation as the Type. This selection will allow FastSpring to use JavaScript to calculate the price, taking into account the tag value when sent via the API. When the subscription goes through its re-billing process, it will use the updated price based upon this calculation. In other words, each future re-bill will use the old pricing unless you have edited (for example, changing the quantity or tags) the existing subscription within SpringBoard or through an API. If you have edited the subscription, the future re-bills will recalculate the price based on its new details. An example of the JavaScript using our situation is below.
var price = 100; var unitPrice = 12; var extra = (tags['extra']>0) ? tags['extra'] : 0; price += extra * unitPrice; price; /* output */
Scenario 2: Base Charge + Cost per Additional User + Cost for Total Storage
This scenario is based on two additional factors that might increase the monthly cost for your customers.
Depending on your customers' usage of your platform, in addition to the number of users, you may wish to bill for total storage at the end of each month. For example, you might offer a base charge for a certain number of users and amount of storage, and then an additional charge for extra users at a specific rate and extra storage at a specific rate. Specifically, you charge $100 for 10 users, $12 for each additional user, and $15 for each additional gigabyte of storage required.
You will need to make a call to the Update method of the Subscription API. For example, the XML payload, for an additional 5 users and 2 extra gigabytes of storage, might look like:
<subscription><tags>extra=5,storage=2</tags></subscription>
The price on the product will need to be a custom calculation. Go to SpringBoard's Store Home » Products and Pages. Choose the product to which you wish to add this custom pricing. Click Prices, and then click the display price. Choose Custom Calculation as the Type. This selection will allow FastSpring to use JavaScript to calculate the price, taking into account the tag value when sent via the API. When the subscription goes through its re-billing process, it will use the updated price based upon this calculation. An example of the JavaScript using our situation is below.
var price = 100; var priceUsers = 12; var priceStorage = 15; var users = tags['users'] ? tags['users'] : 0; var storage = tags['storage'] ? tags['storage'] : 0; price += (users * priceUsers); price += (storage * priceStorage); price; /* output */
Scenario 3: No Base Charge; Per User Charge
For this scenario, you do not use tags but instead you change the quantity on the subscription product.
You will need to make a call to the Update method of the Subscription API. For example, the XML payload, for 10 users might look like:
<subscription><quantity>10</quantity></subscription>
In most situations, unlike the scenarios above, you will not need to set up a custom calculation type price. You may wish to set up tiered pricing, but you can also just use a flat price per user.
We're Here to Help
If you need any assistance with setting up variable pricing, please open a support ticket.