freshcom / freshcom-api

Deprecated
https://docs.freshcom.io/
BSD 3-Clause "New" or "Revised" License
43 stars 8 forks source link

Are there plans for subscription payment model? #36

Open burtondev opened 5 years ago

burtondev commented 5 years ago

Currently, the API supports fixed, variable, and wholesale pricing. Are there any plans to support a subscription model?

For example, a store offers subscribers access to all digital products with lifetime updates as long as they are subscribed. Once they stop subscribing, they can no longer receive updates for downloaded items, nor can they download new items.

An example of a subscription for physical items would be a bakery that offers a surprise assortment of goods delivered to the customer at predetermined intervals.

Parameters would include commitment and frequency of payment. These differ, as someone can have an annual commitment but pay in monthly installments, or vice-versa. Frequencies could include weekly, bi-weekly, monthly, quarterly, and annually.

Subscription models are very popular today, and would be an important addition to the Freshcom API.

rbao commented 5 years ago

Thank you taking interest in Freshcom.

A subscription model is definitely planned for the future and it is an important part of today's eCommerce business. My general thought on the implementation side is we will expose most feature that is available through Stripe (plan, subscription and subscription item) and making it accessible through our API.

The feature of getting access to digital products is basically unlocking an unlockable which can already be done but only a for a single unlockable.

My thought on this is we can generalize this use case as being once a subscription is created we want to unlock a certain number of unlockable to fulfill the subscription. So a thought on implementation is

  1. We will have a new resource called UnlockableCollection which can hold any number of unlockable, and we will have our subscription emit a event every time a subscription is created something like susbcription:create.susccess.

  2. We will need to make our notification system more advanced so that notification trigger can have some basic condition logic base on the event data, since we only want to fire the unlock action if customer subscribed to a specific plan.

  3. We will need to handle a new action_type for notification trigger namely unlock so that we can create a notification trigger in the Dashboard and listens for susbcription.create.susccess for a specific plan and unlock the collection ID specified by action_target.

As for the example of physical goods, unfortunately the fulfillment of that can't be generalized so you will have to do that manually.

Hopefully this make sense to you, but unfortunately I can't give you a specific timeline on when this will be implemented, but do let me know if you have more thought.

burtondev commented 5 years ago

Hi, rbao.

Thanks for your prompt and thorough reply.

Would it be possible to auto-fill the UnlockableCollection with all items in the store that meet a certain criteria and/or that have a specific tag?

I'm thinking that if item is Unlockable and flag equals 'include' then the item automatically is added to the collection on creation. The flag would default to the value 'include' when creating an Unlockable. Any items to be excluded from the collection would be manually flagged for exclusion. Does that make sense?

rbao commented 5 years ago

Right now we already have label field for most resource you can use. It starts of as undefined and you can set it to any value.

However I think want you means is you want to have this default behaviour so that when a new Unlockable is created it is always added to a specific collection. I don't think this is a good behaviour to have though, I think it would confuse a lot of user if this is the default behaviour. Instead we can have a way for user to configure this behaviour.

Essentially I think what you really want is a easier way or automatic way to add multiple Unlockable to a collection. I see two parts can be improved to achieve this and it can actually be generalize for any resource that have collection i.e Product and File:

  1. Improve the UI - which would be a feature for Freshcom Dasboard instead. We may need to modify the API a bit so that when creating the join object i.e UnlockableCollectionMembership we can create multiple of them in one API request.

  2. Update the notification system - we can emit a new event whenever a new Unlockable is created say goods:unlockable.create.success and you would add a new notification trigger with action_type add_to_colelction and action_target to the collection you want to add to. This trigger would then listen for this event and whenever one is created it would be added to the specified collection. We will need to handle a new action_type for notification trigger namely add_to_collection.

burtondev commented 5 years ago

Thanks again for your prompt reply.

I am new to Freshcom (API, Dashboard, etc.) so I need to familiarize myself more with the code and documentation before making further imput. But you are correct in saying that I am seeking an automatic way to add multiple Unlockables to a collection. Your suggestions sound good.