Question

Adding extra data to a subscription

  • 3 March 2022
  • 1 reply
  • 166 views

Badge +4

Hi all,

 

I’m new here and I want to change my revenue flow of my flutter app by changing the non renewable subscription to renewable subscriptions using Revenuecat.

I have one question regarding montly subscriptions with groups.

My situation:
I have groups with multiple people in it. My plan is that one person of such a group can subscribe to a monthly plan which is connected to this group (everyone in the group benefits from this). I use Firebase to manage if a group is “Pro” or not. This “Pro” status which is dependend on when a subscription expires has to be updated with the subscription of the user that bought it (even when the user doesn’t open the app!). My idea is that if a subscription is (auto) renewed, a webhook can update the expiration date in my Firebase database which will make the pro status available for all users even when a user didn’t open the app.

 

The question that comes to mind is that when a user buys premium for a group, the subscription should be coupled to a “group ID” instead of only the user. I was wondering if using the Revenuecat flutter SDK it is possible to add extra data to a subscription when it is bought. This data can then be used  with a webhook to my Firebase cloud functions when this subscription is renewed.

Or if I’m thinking wrong about my approach or if there is any other way I can achieve this setup I am also curious to know how!

 

Thanks in advance!

~Navii


1 reply

Userlevel 5
Badge +10

Hi @Navii 

We have a concept of custom subscriber attributes, but not transaction attributes. Docs for reference: https://docs.revenuecat.com/docs/subscriber-attributes What you could do here is have a groupId subscriber attribute attached to the app user ID that purchased the subscription. Our webhooks have a field subscriber_attributes that will be sent for subscription lifecycle events. Docs for reference: https://docs.revenuecat.com/docs/webhooks#subscription-lifecycle-events-fields 

Note that the subscriber attribute should be attached to the app user ID before the subscription is purchased if you wish for this information to be sent with the webhook.

Reply