Hi Chamin

it is a great idea to level up monetization support for APIM. +1 !

There are some building blocks already in place and the sample billing
engine for 2.6.0 is in alpha state :
https://github.com/ruks/wso2-am-billing-engine/releases/tag/v2.6.0-alpha

question 1 : I understand that you are choosing to begin with Stripe since
it is easy to access it. Do you plan to take care of allowing customers to
choose their own billing system easily ?
question 2 : Do we plan to add subscription follow-up on the publisher side
to handle paying customers ? like enable alerts regarding end of period
(before it happens) ? or some mailing action to communicate with customers
? (other than the automatic new version email)

Thanks,
Cyril


Le ven. 5 avr. 2019 à 10:36, Chamin Dias <cham...@wso2.com> a écrit :

> Hi all,
>
> We are in the process of providing support for monetization in APIM. We
> have performed a pre-analysis of $subject and came up with the initial
> design.
>
> For the initial implementation, we plan to use Stripe and implement the
> necessary functions to support monetization flow in the product.
>
> Please find the details below.
>
> *A) Prerequisites*
>
> 1. API provider should have a stripe account.
> 2. API subscriber should have a credit card (to use paid APIs).
> 3. API analytics should be enabled (since we need to publish some data in
> the DB related to this)
>
>
> *B) There should be few mappings between APIM and Stripe for some
> objects/actions.*
>
>    - Object/action in APIM : Attaching a paid tier to an API
>    - Corresponding object/action in Stripe : Plan [1]
>
>
>    - Object/action in APIM : API subscriber
>    - Corresponding object/action in Stripe : Customer [2]
>
>
>    - Object/action in APIM : Subscribing to an API
>    - Corresponding object/action in Stripe : Create a subscription [3] in
>    stripe
>
>
>    - Object/action in APIM : Invoking APIs
>    - Corresponding object/action in Stripe : Charging [4] in stripe
>
>
> *C) This is the flow.*
>
> 1. API provider creates an API. At the time of attaching a paid tier to
> his API, we check for the existence for the stripe account of the provider.
> If it is there, we create a "plan" [1] in the stripe side to indicate the
> attachment if the tier to the API. If the API provider does not have a
> stripe account, then we notify them to create an account and come back.
>
> 2. API subscriber (app developer) subscribes to an API. If this is done
> through a paid tier, then we create a "customer" [2] object in stripe side
> using the stripe account of the API provider. In other words, this is the
> indication that this app developer is a customer if the corresponding API
> provider. A "subscription" [3] will be created in stripe side after
> capturing the credit card data.
>
> 3. When the API is consumed (i.e - invoked), we record the data in the
> corresponding data table (we will need a separate table(s) for this).
>
> 4. Every day, at a given time (say at 00:00), we run a scheduled task and
> identify the customers (i.e - who has reached the end of the billing cycle
> - say 1 month) to be billed. If we find such customer, then APIM sends a
> "charge" [4] request to the respective customer (i.e - App developer) based
> on the usage data we have collected in the DB.
>
> Please share your thoughts/suggestions if you have any.
>
> [1] Plan : https://stripe.com/docs/api/plans?lang=curl
> [2] Customer : https://stripe.com/docs/api/customers?lang=curl
> [3] Subscription : https://stripe.com/docs/api/subscriptions?lang=curl
> [4] Charge : https://stripe.com/docs/api/charges?lang=curl
>
> Thanks.
>
> --
> Chamin Dias
> Mobile : 0716097455
> Email : cham...@wso2.com
> LinkedIn : https://www.linkedin.com/in/chamindias
>
> _______________________________________________
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to