Subscriptions in Elastic Path Commerce

Creating Subscriptions in EPC:

The eCommerce subscription model is a business model in which a company provides ongoing services or products on a regular basis in exchange for regular payments from the customer. A Subscription program can strengthen customer’s loyalty, reduce inventory risk, increase the lifetime value of each customer and boost ROI. Customers have learned to love them too. There has been exponential growth of subscription box services over the past years. And illustration to it is big players like netflix, Amazon, Youtube Red, Spotify, Playstation Plus and many more .
Evolution of different eCommerce platforms shows how these platforms have been able to incorporate all the subscription related functionalities into it, which also reflects as to be one of the major reasons of success of those eCommerce platforms. Few platforms have plugins and extensions available to support subscriptions. We have also implemented our Subscription Offering in EPC for one of our happy client, and the project is a great success.

Subscriptions in Elastic Path Commerce:

EPC neither has subscription support OOTB nor it provides an accelerator to do so. But EPC can be extended and customized to support complete end to end subscription model.
Other then Conventional products, EPC can be customized to support subscription based products as well. A complete end to end subscription Service in EPC involves the following subscription related functionalities:

1. Creating a Subscription product (Catalog Modelling):
A subscription product is something offered to customers to purchase, a subscription i.e. an agreement between your store and a customer for future transactions.
Like any other product, subscription products can be added to the cart and purchased by customers via checkout. The purchase of a subscription product is recorded in an order and the terms for future payments are added to a new subscription.
A subscription product has the same data as any other standard products, like:
⦁ list price
⦁ sale price
⦁ associated taxes
⦁ shippable/digital asset/ downloadable flags
⦁ associated attributes
⦁ associated inventory
⦁ skus for a subscription product can also be created based on the frequency of the subscription product, often called subscription plan, i.e. if customer wants to purchase the subscription for a week, a month, more than one month or a year.
Like an order, a subscription can contain one or more products as line items. This is how subscription products are associated with a subscription. And a customer profile can also be associated with more then one subscription, depending upon number of plans or products the customer has subscribed to.

2. Payments for subscription (Payment provider capabilities):
The Payment gateway that is being used for subscription service is cybersource. Cybersource provides recurring billing functionality which helps in periodic renewal of customer’s subscription.
While doing payment for the subscription, all details like subscription amount, periodicity etc are captured and a token is generated by the cybersource. According to the frequency of the subscription order, cybersource keeps renewing the order. Cybersource also regularly generates reports for the particular merchant account and that can be placed to a location(for e.g. S3 bucket) and then a job in EPC can read that report from that location and will make the relevant changes in EPC database and hence the details related to the subscription would be updated.

Image : cybersource report of recorded subscription

REST API capabilities

3. Create a subscription :
Creating a subscription involves adding the subscription product into the cart and doing a checkout for it. First of all, the data related to the subscription needs to be collected. Following is the list of values that needs to be stored:
⦁ Subscription ID, customer ID, and the associated Order ID
⦁ Auto-Renewal i.e. if the customer has chosen the option of renewing the subscription automatically once it is expired
⦁ Periodicity/plan/frequency of the subscription chosen
⦁ Start Date
⦁ Canceled date
⦁ Expiration date
⦁ Renewed date
⦁ Next bill date
⦁ Next bill amount
⦁ Is active i.e the status of the referred subscription, if it is still active or has been expired.
The list can further be extended or customized as per the requirements of the project.

   Image : submitting a subscription order

4. Cancel the subscription :
To cancel an existing subscription an API has been created. The API takes the subscription ID as input. After the Subscription ID is passed, a request to cybersource is made to cancel it in cybersource as well. Upon receiving a success response from cybersource, the status of that subscription is synced with EPC database and “IS_ACTIVE” field for that subscription id is set to “FALSE”. The path to cancel subscription form is : /subscription/cf/cancelsubscription/form.

Image: Cancel subscription form API

5. Update the subscription :
Updating a subscription involves the change in already existing subscription inside a customer profile. A customer after subscribing to a product or a plan might want to change few things related to that order like customer address. EPC subscription model supports these changes ,hence, making the updation of subscription possible in EPC. The path to update subscription address is :

 Image:Update Subscription Address API

6. Reading the Subscription :
When a subscription is created, to see the details of that created subscription, an API has been created in EPC which is used to fetch the subscription details. The API for reading the subscription resides inside the Profile entry point. To fetch all the subscriptions associated with the profile we need to login with the profile credentials into the cortex and then the following path i.e. Profile -> subscriptions -> element is going to provide list of all the subscriptions associated with the profile with respective subscription details.

Image : Read API of subscription to fetch subscription details


This subscription model that has been developed , provides a complete functionality required for integrating a subscription service into website. The integration is hassle free process which requires calling just three additional API’s from the front end and rest all will be taken care of. Hence, this subscription model is certainly going to enrich and provide a solid customer experience.

~ Contributed by Aarohi Sharma and  Karamjeet Singh

About The Author