Subscriptions
What subscriptions suspended in the last 2 hours?
The two query parameters needed are SubscriptionStatus and SuspendedTimestamp. SubscriptionStatus should be set to "Suspended" and SuspendedTimestamp should be 2020-01-01T03:15:00 if the current time were 5:15 AM on Jan 1st 2020. Multiple values for the same parameter are separated with a ';' character as opposed to the '&' used to separate distinct parameters
We recommend using paging for all listing calls to ensure manageable responses. This example returns the first 10 subscriptions suspended in the last 2 hours. To get the next 10 the same request could be made with pageNumber=1,2,3,4... until an empty list is returned.
Is there a way for Fusebill to notify me that a subscription suspended?
Yes. Fusebill can be configured [https://developer.fusebill.com/docs/configuring] to send notifications in near real-time with webhooks.
You can create and then activate a webhook for the event "SubscriptionStatusChanged". Copy the API key (this can be used to verify that the notification is coming from Fusebill by matching it to the authorization header). Then, provide the URL you want Fusebill to send HTTPS requests to (strongly recommended over HTTP requests).
Having done this, when the status of a subscription changes you will be notified at that URL. Various fields are present in the request body including the ID of the subscription and the new status.
Note that, as the event name implies, this will also notify you when a subscription changes from suspended to active, as well as when a subscription changes from draft to active. This does not notify you when a subscription is created. For that, there is a webhook configuration for the event "SubscriptionCreated"
What subscriptions are renewing over the weekend?
Assuming the upcoming weekend is from Saturday August 10th to Sunday August 11th 2019, then the date range should be 2019-08-10|2019-08-12 for the query parameter NextPeriodStartDate. Since suspended subscriptions still have a NextPeriodStartDate, filtering by SubscriptionStatus can limit the results to only active subscriptions.
We recommend using paging for all listing calls to ensure manageable responses. This example returns the first 10 active subscriptions renewing over the weekend. To get the next 10 the same request could be made with pageNumber=1,2,3,4... until an empty list is returned.
What subscriptions have contract dates coming due in the next month?
The query parameter needed is ContractEndTimestamp. Once again it is best to filter by SubscriptionStatus as well to get only active subscriptions. Assuming the next month is May 2019 this request will return the list of active subscriptions with contract dates ending in May.
We recommend using paging for all listing calls to ensure manageable responses. This example returns the first 10 subscriptions having contract dates coming due. To get the next 10 the same request could be made with pageNumber=1,2,3,4... until an empty list is returned.
How do I check which coupons have been used on a subscription?
Using the subscription ID, this request retrieves the subscription object:
GET https://secure.fusebill.com/v1/Subscriptions/{subscriptionId}
Contained in this is a field called coupons which is a list of coupons which have been applied to this subscription. Each coupon can be uniquely identified by its couponCode field.
How can I activate multiple subscriptions at once?
Multiple subscriptions on the same customer can be activated together, with the following POST request:
POST https://secure.fusebill.com/v1/SubscriptionsActivation?invoicePreview=false
With the following JSON body:
{
"subscriptionIds":[
{subscriptionId1},
{subscriptionId2},
{subscriptionId3},
{subscriptionId4}
],
"invoicePreview": false,
"temporarilyDisableAutoPost": false
}If the optional URL parameter invoicePreview is set to true, then that request will not result in any subscriptions going from draft to active. Instead, the list of subscriptions returned will be what the subscription objects would look like if they were activated.
Updated about 1 year ago
