Create Subscription

This action will create a new Subscription. Subscriptions are applied to specific Customers, identified by the customerId field, and are instances of a specific frequency of a specific Plan, identified by the planFrequencyId below.

When you create a Subscription you have the option of providing a subscriptionOverride. This override will allow you to change the name and description of the subscription, as it appears on the Customer's invoice, as well as specify a different recurring charge value and setup fee value. This allows you to customize the pricing for this Subscription for your Customer if you want.

Creating a Subscription will include all the Products in the associated Plan in the newly created Subscription. You can Edit the Subscription if you wish to modify aspects of the Products. See the Edit Subscription page for details.

Subscriptions have a status of Draft when created and you will need to perform an additional action to Activate the Subscription. See the Activation page for details.

This action will return the full Subscription object of the newly created Subscription.

Minimum Request: The minimum request key-value pairs include fields "customerID", "PlanID", "PlanName", "Reference" and "PlanFrequencyID".

Subscription Object Fields

PropertyTypeDescription
idDecimalThis is the Subscription Id which uniquely identifies this individual Subscription. This Id is used to refer to this Subscription specifically.
customerIdDecimalThis is the Id of the Customer to whom this Subscription has been applied.
planCodeStringThis is the unique code which represents the Plan of which this Subscription is an instance.
planNameStringThis is the name of the Plan of which this Subscription is an instance.
planDescriptionStringThis is the description text of the Plan of which this Subscription is an instance.
planReferenceStringThis is a text field which will be populated with the reference text from the Plan. This field is not exposed on the Invoice.
statusStringThis is the status of this subscription. Accepted values are "Active", "Draft", "Canceled", "Provisioning" and "Expired". Draft indicates that the Subscription has not yet been activated. Provisioning indicates this Subscription has been provisioned but that the Setup Fee and recurring Charge has not been applied to the Customer. To set a Subscription as "Provisioned" you must set a Scheduled Activation Date for some time in the future.
referenceStringThis is a text field you can populate with reference text for this subscription. This field is not exposed on the Invoice.
hasPostedInvoiceBooleanThis indicates if this Subscription has caused an invoice to be created and posted against the Customer's account.
CreatedTimestampDateTimeThis indicates when the Subscription was created.
ActivatedTimestampDateTimeThis indicates when the Subscription was activated.
ProvisionedTimestampDateTimeThis indicates when the Subscription was provisioned.
NextPeriodStartDateDateTimeThis indicates when the next billing period for the Subscription will begin. Normally, this indicates when the Subscription will bill and apply charges to the Customer's account.This indicates when the next billing period for the Subscription will begin. Normally, this indicates when the Subscription will bill and apply charges to the Customer's account.
remainingIntervalDecimalThis is the number of billing intervals in the lifetime of this Subscription. If this value is set to "null" the Subscription will renew indefinitely. If this is set to a number than after that number of intervals has passed the subscription will change into an "Expired" status automatically and stop billing the Customer.
ScheduledActivationTimestampDateTimeIf set, this indicates when the Subscription should activate. To set a Subscription as "Provisioned" you must set a Scheduled Activation Date for some time in the future. The Subscription will automatically set to an "Active" status on the Scheduled Activation Date.
remainingIntervalDecimalThis lists the default number of intervals that remain before expiry. This is a default set at the plan level.
remainingIntervalPushOutDecimalThis is the setting to default what the new remaining interval when the subscription is up for renewal.
openSubscriptionPeriodEndDateDateTimeThis is the date that the current billing period will end. Often, this field will match the "nextPeriodStartDate" value.
chargeDiscountchargeDiscountThis is the Discount entity which applies to the base recurring charge for this subscription. (This is a legacy object use chargeDiscounts collection)
setupFeeDiscountDecimalThis is the Discount entity which applies to the base setup fee charge for this subscription.(This is a legacy object use setupFeeDiscounts collection)
chargeDiscountsDecimalThis is the Discount entity which applies to the base recurring charge for this subscription. (Use this collection for discounts)
setupFeeDiscountDecimalThis is the Discount entity which applies to the base setup fee charge for this subscription.(This is a legacy object use setupFeeDiscounts collection)
chargeDiscountsDiscountThis is the Discount entity which applies to the base recurring charge for this subscription. (Use this collection for discounts)
setupFeeDiscountsDecimalThis is the Discount entity which applies to the base setup fee charge for this subscription. (Use this collection for discounts)
planAutoApplyChangesBooleanThis field related to Grandfathering control. If True, this indicates that the Plan from which this Subscription is made usually pushes changes to the Plan down to existing Subscriptions - this forces existing customers onto the newest version of the Plan.
If set to False, this 'grandfathers' the Customer into the version of the Plan they Subscribed to and does not push changes.
autoApplyCatalogChangesBooleanThis field controls if this specific Subscription should automatically push changes to the underlying Plan to this Subscription. If set to True, changes will be pushed automatically. If False, this Subscription will not reflect updates to the Plan from which it was made.
monthlyRecurringRevenueDecimalThe calculated monthly recurring revenue value for this Customer. This is calculated based on expected income based on the current Subscription value. Only recurring charges are included in this calculation and One Time Goods and Physical Goods purchases, which do not recur, are not included.
netMonthlyRecurringRevenueDecimalThe net MRR of the customer. Calculated by considering any discounts on the customers active subscription products.
amountDecimalThe amount of the subscription.
contractStartTimestampDateTimeThis is the date that the contract period will begin.
contractEndTimestampDateTimeThis is the date that the contract period will end.
uriStringThis is the URI which can be used to reference this Subscription Product directly.

PlanFrequency Fields

PropertyTypeDescription
planRevisionIdDecimalThis is the unique identifier for this plan revision
numberOfIntervalsDecimalThis is the number of intervals that this plan will renew for
intervalStringValid strings are “Monthly”, “Yearly”
numberOfSubscriptionsDecimalThis is the number of instances of this plan currently in the system as subscriptions
statusStringValid strings are “Draft”, “Active”, “Retired”
setupFeesArrayThis is an Array of Setup Fee objects. There are up to one object per active currency. Setup Fees are optional and may not be included in a plan. If they are not included this array would be empty.
chargesArrayThis is an Array of Charges objects. There are up to one object per active currency. These Charges are optional and may not be included in a plan. If they are not included this array would be empty.
isProratedBooleanThis indicates if this Subscription should prorate its charges if activated in the middle of a billing cycle.
prorationGranularityStringThis defines how granular the proration calculation should be. Valid strings are "Monthly" or "Daily".
planFrequencyUniqueIdNumberThis is an internal only identifier, do not modify this value.
idDecimalThis is the unique identifier.
uriStringThis is the URI referring to this Plan Frequency object.

Setup Fee Fields

PropertyTypeDescription
amountDecimalThis is the cost of the setup fee
currencyStringThis indicates which currency this fee applied is charged in
idDecimalThis is the unique identifier for this fee
urlStringThis is the URI to view this object

Charge Fields

PropertyTypeDescription
amountDecimalThis is the monthly recurring charge
currencyStringThis indicates which currency this charge is charged in
idDecimalThis is the unique identifier for this charge
urlStringThis is the URI to view this object

Subscription Override Properties

PropertyTypeDescription
NameStringThis is the value which will override the PlanName field value. This override value will appear on invoices and in other Customer facing locations.
DescriptionStringThis is the value which will override the PlanDescription field value. This override value will appear on invoices and in other Customer facing locations.
ChargeDecimalThis value will override the cost of the recurring charge in the Plan. The amount entered here becomes the new amount charged to the Customer when the Subscription bills each period. Additional charges, from Products for example, are not affected by this and will continue to bill normally.
SetupFeeDecimalThis value will override the cost of the setup fee charge in the Plan. The amount entered here becomes the new amount charged to the Customer when the Subscription is activated. Additional charges, from Products for example, are not affected by this and will continue to bill normally.

PlanProducts Fields

PropertyTypeDescription
subscriptionIdDecimalThis is the Subscription Product Id that uniquely refers to this Subscription product. This is important for action including this object such as managing the Subscription Product Items inventory.
planProductArrayThis is the Plan Product object. This object contains most of the details and configuration regarding the product being sold as part of this subscription. See Plan Product for more details.
QuantityDecimalThis is the number of units of this Subscription Product being purchased.
isIncludedBooleanThis indicates if this Subscription Product is included in the Customer's Subscription
subscriptionProductOverrideArrayThis contains a set of fields to override the name and description of the Subscription Product.
subscriptionProductPriceOverrideArrayThis contains a set of fields to override the pricing for the Subscription Product
ChargeAtSubscriptionActivationBooleanThis flag informs the system to either charge for this Subscription Product when the Subscription is activated (True) or to charge when it is Provisioned (False).
StartDateDateTimeThis is the date on which this Subscription Product should begin to charge the Customer
IsChargedBooleanThis flag indicates if this Subscription Product has been charged. If it has applied a charge then this field will be True.
subscriptionProductDiscountArrayThis is the Discount entity applied to this Subscription Product. See the ChargeDiscount description below for details.
customFieldsArrayThis is the list of Custom Fields applied to this Subscription Product. These fields will match the Plan Product fields unless the field values in the Subscription have been changed in which case these fields show the data applied to the Subscription Product and not the default value seen in the Plan Product.
monthlyRecurringRevenueNumberThe calculated monthly recurring revenue value for this Customer. This is calculated based on expected income based on the current Subscription value. Only recurring charges are included in this calculation and One Time Goods and Physical Goods purchases, which do not recur, are not included.
netMonthlyRecurringRevenueDecimalThe net MRR of the customer. Calculated by considering any discounts on the customers active subscription products.
customServiceDateNumberOfIntervalsDecimalThis value represents the number of intervals in the past or in the future that you would like to set this service date for.
customServiceDateIntervalStringPossible service date values are "Periods", "Dates" and "Months".
customServiceDateProjectionStringPossible values are "Past" or "Future".
amountDecimalThis is the dollar amount to apply against the above invoice.
statusStringThis is the current status of the plan product.
lastPurchaseDateDateTimeThis is the last date of purchase.
earningSettingsArrayThis is a small collection of th earning interval type and timing.
idDecimalThis is the unique identifier
uriStringThis is the URI which can be used to reference this Subscription Product directly.

Earning Interval Settings

PropertyTypeDescription
earningIntervalStringThe period in which a product will earn. Strings may be "Daily", "Monthly", or "Yearly".
earningNumberOfIntervalsNumber
earningTimingIntervalString
earningTimingTypeStringThis delineates if the earnage is to occur at the beginning or the end of the period. The accepted strings are "StartOfInterval" or "EndOfInterval"

Subscription Product Override Fields

PropertyTypeDescription
NameStringThis is the value which will override the ProductName field value. This override value will appear on invoices and in other Customer facing locations.
DescriptionStringThis is the value which will override the Product Description field value. This override value will appear on invoices and in other Customer facing locations.

Subscription Product Price Fields

PropertyTypeDescription
ChargeAmountDecimalThis value will override the cost of the Product. The amount entered here becomes the new amount charged to the Customer when the Subscription bills each period or when the Quantity is increased on this Product. Additional charges, from the Subscription for example, are not affected by this and will continue to bill normally.

Subscription Product Discounts

PropertyTypeDescription
discountTypeStringThis field indicates the type of discount applied. Valid entries are "Percentage" or "Amount".
amountNumberFor Percentage discounts, this is the percentage which is discounted from the charge (if the discount is 25%, this value will be 25). For Amount discounts this is the actual value to subtract from the charge.
remainingUsagesUntilStartNumberThis is the number of billing cycles which must pass before the discount is applied.
remainingUsageNumberThis is the number of billing cycles which must pass before the discount automatically expires and is removed. This will be NULL for discounts which are perpetual.

Custom Fields

PropertyTypeDescription
keyStringThis is the unique key of the Custom Field you wish to modify.
friendlyNameStringThis is the text friendly label for the key.
dataTypeStringThis is the data type for the custom field.
valueStringThis is the value you wish to update the custom field to. This will always be the string version of the value. If you wish to pass a number, for example, pass it as "123". Likewise, a DateTime would be passed as "2014-06-26T04:00:00". We will use the known data type of the custom field to properly convert the String to a Number, DateTime, etc.

Price Uplift Fields

PropertyTypeDescription
priceUpliftEnabledBooleanThis is a True or False value, which allows you to set the price uplift feature as enabled or disabled.
priceUpliftsListThis is a list of price uplift interval objects.
historicalPriceUpliftsListThis is list of surpassed price uplift intervals.
Examples
curl -X POST "https://stg-secure.fusebill.com/v1/subscriptions" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{customerid:{customerId},code:'YourPlanCodeHere',name:'YourPlanNameHere',reference:null,planFrequencyId:{planFrequencyId}}"
//Json Payload
string jsonData = "{customerid:{customerId},code:'YourPlanCodeHere',name:'YourPlanNameHere',reference:null,planFrequencyId:{planFrequencyId}}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://stg-secure.fusebill.com/v1/subscriptions");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "POST";
//Add the json data to request
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
  streamWriter.Write(jsonData);
  streamWriter.Flush();
  streamWriter.Close();
}
//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":'sampleplan',"name":"Sample Plan","reference":None,"planFrequencyId":{id}}
#Pass in your URI, Payload and Headers
r = requests.post('https://stg-secure.fusebill.com/v1/subscriptions', data=json.dumps(payload), headers=headers)
print(r.content)
Response
{
    "customerId": 1930362,
    "planFrequency": {
        "planRevisionId": 3135696,
        "numberOfIntervals": 1,
        "interval": "Monthly",
        "numberOfSubscriptions": 1,
        "status": "Active",
        "setupFees": [
        ],
        "charges": [
        ],
        "isProrated": false,
        "prorationGranularity": null,
        "planFrequencyUniqueId": 1283935,
        "remainingInterval": null,
        "id": 1868701,
        "uri": null
    },
    "planCode": "premiumplan",
    "planName": "Premium Plan",
    "planDescription": null,
    "planReference": null,
    "status": "Active",
    "reference": null,
    "subscriptionOverride": null,
    "hasPostedInvoice": true,
    "createdTimestamp": "2017-05-12T21:36:31.0000794Z",
    "activatedTimestamp": "2017-05-12T21:36:31.0000794Z",
    "provisionedTimestamp": null,
    "nextPeriodStartDate": "2017-06-12T04:00:00",
    "scheduledActivationTimestamp": null,
    "subscriptionProducts": [
        {
            "subscriptionId": 3135696,
            "planProduct": {
                "status": "Active",
                "productId": 1421752,
                "planId": 828556,
                "productCode": "premiumproduct",
                "productName": "Premium Product",
                "productStatus": "Active",
                "productDescription": null,
                "productType": "RecurringService",
                "productGLCode": "",
                "quantity": 1,
                "maxQuantity": null,
                "isRecurring": true,
                "isFixed": false,
                "isOptional": true,
                "isIncludedByDefault": true,
                "isTrackingItems": false,
                "chargeAtSubscriptionActivation": true,
                "orderToCashCycles": [
                    {
                        "planFrequencyId": 1868701,
                        "planProductId": 1719495,
                        "numberOfIntervals": 1,
                        "interval": "Monthly",
                        "chargeModels": [
                            {
                                "chargeModelType": "Signup",
                                "chargeTimingType": "StartOfPeriod",
                                "prorationGranularity": "Daily",
                                "prorateOnPositiveQuantity": false,
                                "prorateOnNegativeQuantity": false,
                                "reverseChargeOnNegativeQuantity": false,
                                "id": 56403857,
                                "uri": null
                            },
                            {
                                "chargeModelType": "Lifetime",
                                "chargeTimingType": "Immediate",
                                "prorationGranularity": "Daily",
                                "prorateOnPositiveQuantity": false,
                                "prorateOnNegativeQuantity": false,
                                "reverseChargeOnNegativeQuantity": false,
                                "id": 56403857,
                                "uri": null
                            }
                        ],
                        "remainingInterval": null,
                        "groupQuantityChangeCharges": false,
                        "planProductPriceUplifts": null,
                        "customServiceDateNumberOfIntervals": 0,
                        "customServiceDateInterval": "Periods",
                        "customServiceDateProjection": "Future",
                        "earningInterval": "Monthly",
                        "earningNumberOfIntervals": 1,
                        "earningTimingInterval": "Daily",
                        "earningTimingType": "StartOfInterval",
                        "pricingModel": {
                            "pricingModelType": "Standard",
                            "quantityRanges": [
                                {
                                    "min": 0,
                                    "max": null,
                                    "prices": [
                                        {
                                            "amount": 39.99,
                                            "currency": "USD",
                                            "id": 56403857,
                                            "uri": null
                                        }
                                    ],
                                    "id": 0,
                                    "uri": null
                                }
                            ],
                            "id": 56403857,
                            "uri": null
                        },
                        "id": 56403857,
                        "uri": null
                    }
                ],
                "resetType": "Never",
                "planProductUniqueId": 1509277,
                "id": 1719495,
                "uri": ""
            },
            "quantity": 1,
            "isIncluded": true,
            "startDate": null,
            "subscriptionProductOverride": null,
            "subscriptionProductPriceOverride": null,
            "chargeAtSubscriptionActivation": true,
            "isCharged": true,
            "subscriptionProductDiscount": null,
            "subscriptionProductDiscounts": [
            ],
            "customFields": null,
            "monthlyRecurringRevenue": 39.99,
            "netMonthlyRecurringRevenue": 39.99,
            "amount": 39.99,
            "status": "Active",
            "lastPurchaseDate": "2017-05-12T21:36:31.0000794Z",
            "earningSettings": {
                "earningTimingInterval": "Daily",
                "earningTimingType": "StartOfInterval"
            },
            "remainingInterval": null,
            "groupQuantityChangeCharges": false,
            "priceUpliftsEnabled": false,
            "priceUplifts": [
            ],
            "historicalPriceUplifts": [
            ],
            "customServiceDateNumberOfIntervals": 0,
            "customServiceDateInterval": "Periods",
            "customServiceDateProjection": "Future",
            "id": 56403857,
            "uri": "https://qa-secure.fusebill.com/v1/SubscriptionProducts/56403857"
        }
    ],
    "remainingInterval": null,
    "remainingIntervalPushOut": null,
    "openSubscriptionPeriodEndDate": "2017-06-12T04:00:00",
    "chargeDiscount": null,
    "setupFeeDiscount": null,
    "chargeDiscounts": null,
    "setupFeeDiscounts": null,
    "customFields": null,
    "planAutoApplyChanges": false,
    "autoApplyCatalogChanges": false,
    "monthlyRecurringRevenue": 39.99,
    "netMonthlyRecurringRevenue": 39.99,
    "amount": 39.99,
    "contractStartTimestamp": null,
    "contractEndTimestamp": null,
    "expiredTimestamp": null,
    "coupons": [
    ],
    "subscriptionHasRecurringEndOfPeriodCharge": false,
    "id": 3135696,
    "uri": "https://qa-secure.fusebill.com/v1/subscriptions/3135696"
}
Response
200
Language
Credentials
Header
LoadingLoading…