Collapse Menu
Docs Home
Extensibility Options
Contact Support

Limit Free Trial Sign-Ups

Overview

Limit how many times a consumer signs up for a free trial subscription.

If you detect that a customer has repeatedly signed up for the same free trial subscription, you can potentially determine the customer and cancel their subsequent subscriptions. Note that this solution requires some degree of technical capabilities, including the use of Webhooks and FastSpring API.

Webhooks and the FastSpring API

If you subscribe to the subscription.activated Webhook event, FastSpring notifies you when a new subscription is activated. The subscription.activated event payload includes the customer's account ID. FastSpring automatically creates new customer accounts when an order is made from an email that is unaffiliated with previous store orders. When a customer places an order with a previously-established email address, FastSpring automatically associates the new order with the same customer account ID.

You can use the customer account ID from subscription.activated to check for previous orders of the same free trial subscription product (by product ID).There are two ways to do this, depending on whether or not you automatically populate your own External Database from all Webhook data.

 

Option 1: Check Your External Database

If your Webhook script populates an external database each time new Webhook events come in, you can design to detect duplicate trial orders. Then, the script will react to subscription.activated events for a given free trial product by checking your database for previous orders of the same product bearing the same customer account ID.
 

Option 2: Check Previous Orders with the API

Look up accounts by the parameters of it. To do this, Design your Webhook script to react to subscription.activated events for a given free trial product by triggering a GET request to the /accounts endpoint of the FastSpring API. The response will include a list of all orders associated with the customer account. For example, if the account ID is ABCDEF123456:

GET https://api.fastspring.com/accounts/ABCDEF123456

Then, call GET /orders once with all order IDs returned in response to GET /accounts, to find the products that the customer has previously ordered. For example, if GET /accounts returns the following three IDs in the orders array of the response:

  • NTjP8IMnQya1X9jxhXFiXQ
  • eShDqjTVS4SmroSANRnL8g
  • sE2PBBihSUKNX_vUxBfHww
GET https://api.fastspring.com/orders/NTjP8IMnQya1X9jxhXFiXQ,eShDqjTVS4SmroSANRnL8g,sE2PBBihSUKNX_vUxBfHww

Finally, you would parse the response to this GET /orders request, looking for previous orders with the same free trial subscription's product ID in the product field of each order's items array.

Handling Exploitation of Free Trial Periods

If a previous free trial subscription is found for the same customer, you can design your script to automatically trigger a Delete call to the /subscriptions endpoint of the FastSpring API. Your Delete request would include the new subscription's ID and the parameter &billingPeriod=0. The new free trial subscription would thus be deactivated immediately. For example, if the new subscription's ID is OU8128675309:

DELETE https://api.fastspring.com/subscriptions/OU8128675309?billingPeriod=0

By default, FastSpring sends a subscription deactivated email message to the customer upon deactivation of the subscription. However, you might also want your script to trigger a separate email message from your side, letting the customer know why you have canceled the subscription.

 

Try FastSpring

Get a free account and see why FastSpring is the ecommerce partner of choice for software providers around the world. Try our full-service ecommerce solution today to unlock revenue growth for your online company.