Provision Subscription

This action will set the status of a Subscription to Provisioning. This status is in between Draft and Active and is used to represent services that have been turned on for the Customer but billing has not started. Commonly this is used to facilitate a 'free trial' period. Products in the Subscription can be configured to Charge at Provisioning in which case there may be Invoice and payment activities as a result of this call.

This call will return the Subscription that you have provisioned so you can verify the status field is set to Provisioning.

This action can only be performed against Subscriptions in Draft status.

Path Parameter

PropertyTypeDescription
subscriptionIdIntegerThis is the subscription ID of the subscription you want to provision.
Examples
curl -X POST "https://secure.fusebill.com/v1/SubscriptionProvision/{subscriptionId}" \
	-H "Content-Type: application/json" \
	-H "Content-Length: 0" \
	-H "Authorization: Basic {APIKey}"
//path parameter
int pathParameter = {subscriptionId}; 
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/SubscriptionProvision/"+pathParameter);
//Set Content Length
request.ContentLength = 0;
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "POST";
//Perform the request
var httpResponse = (HttpWebResponse)request.GetResponse();
//Record the response from our request
var result = "";
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  result = streamReader.ReadToEnd();
}
#Import library JSON
import json
#Import library Requests
import requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in a dictionary to the Payload parameter
payload = {"customerid":{id},"code":'plan-2',"name":"Plan-2"}
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/subscriptionProvision/{id}', data=json.dumps(payload), headers=headers)
print(r.content)
This request does not have a JSON payload
Response
[ 
   { 
      "customerId":84636,
      "planFrequency":{ 
         "planRevisionId":75244,
         "numberOfIntervals":1,
         "interval":"Monthly",
         "numberOfSubscriptions":1,
         "status":"Active",
         "setupFees":[ 

         ],
         "charges":[ 

         ],
         "isProrated":false,
         "prorationGranularity":null,
         "planFrequencyUniqueId":4362,
         "remainingInterval":null,
         "id":4362,
         "uri":null
      },
      "planCode":"plan1",
      "planName":"Plan1",
      "planDescription":null,
      "planReference":null,
      "status":"Provisioning",
      "reference":null,
      "subscriptionOverride":null,
      "hasPostedInvoice":true,
      "createdTimestamp":"2016-05-23T13:27:26",
      "activatedTimestamp":null,
      "provisionedTimestamp":"2016-05-23T17:53:48.0004354Z",
      "nextPeriodStartDate":null,
      "scheduledActivationTimestamp":"2016-05-25T04:00:00",
      "subscriptionProducts":[ 
         { 
            "subscriptionId":75244,
            "planProduct":{ 
               "status":"Active",
               "productId":15862,
               …
            },
            { 
               "subscriptionId":75244,
               "planProduct":{ 
                  "status":"Active",
                  "productId":15864,
                  …
               }
            ],
     "remainingInterval":null,
     "remainingIntervalPushOut":null,
     "openSubscriptionPeriodEndDate":null,
     "chargeDiscount":null,
     "setupFeeDiscount":null,
     "chargeDiscounts":null,
     "setupFeeDiscounts":null,
     "customFields":null,
     "planAutoApplyChanges":false,
     "autoApplyCatalogChanges":false,
     "monthlyRecurringRevenue":0,
     "netMonthlyRecurringRevenue":0,
     "amount":500,
     "contractStartTimestamp":null,
     "contractEndTimestamp":null,
     "expiredTimestamp":null,
     "cancellationTimestamp": null,
     "modifiedTimestamp": "2020-04-27T19:10:14.023",
     "coupons":[  

     ],
     "invoiceDay": 1,
     "invoiceMonth": null,
     "canMigrate": false,
     "migrationDate": null,
     "scheduledMigrationDate": null,
     "migrations": null,  
     "subscriptionHasRecurringEndOfPeriodCharge":false,
     "id":122453,
     "uri":"https://secure.fusebill.com/v1/subscriptions/122453"
   }
]
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Cannot provision a subscription that has been activated."
        }
    ]
}
Language
Authorization