New(ish) Billing API Feature: Trial Periods

David Underwood

We recently added a new feature to the Billing API that didn't get much attention at the time: Trial Periods.
Trial periods are pretty simple. They allow apps with monthly subscriptions to delay the start of a recurring charge by a specified number of days once the charge has been approved. As an app developer, all you need to do to include a trial period in your app is add the following parameter to a new recurring charge:

"trial_days": 5

Or if you're using XML:

<trial-days type="integer">5</trial-days>

If you look carefully, you'll see a new parameter on the application charge object too. Called trial_ends_on, it simply contains the date that the trial period will end on (Or null if there's no trial). This data could be used to notify users that their trial is about to end.

This functionality is documented in our Billing API documentation. Go take a look!