Adalo Subscription payment actions

Hi,

I’m building a system whereby each user will have a credit balance, I have made it so that they can purchase one-off amount of credits for example, paying £10 would give them an additional 10 credits (credit balance is currently a record of the users collection). However, what I would like is to setup so that they can choose to purchase a subscription (I have setup the subscriptions inside Stripe) for which every time a payment goes through successfully, an additional amount of the same credits (depending on the subscription) is added to their credit balance.

I’ve tried setting this up and Zapier and can’t seem to find an option of adding to the credit balance… does anyone have any suggestions?

1 Like

I haven’t thought entirely through this, so bear with me, but while the easiest way for the user to have a balance is to have a balance property under the user, that probably isn’t the right way.

There should be a log (credits added, credits subtracted) where the sum is the user’s balance.

When a payment is completed on stripe, create a new log entry, thereby adding credits to the user (via the log sum, not a property).

To use the shortcut, you could have an action whenever the user logs in, calculate their total and update the balance property accordingly.

1 Like

Hi @Erik, thanks for the reply.

When you say log, would that be a collection?

“Create a new log entry” - do you mean i’d need to update this manually every time a payment is made?

I’m not sure I fully understand that last part :sweat_smile:

Yes, it should be a collection.

Something like user, credits, activity type.

When the user adds credits, it’ll be positive. When they use credits, it’ll be negative. The sum of credits is their current balance.

Activity type can explain whether it’s a top up or what they spent the tokens on. This will allow you to show user’s their history and also should help check for bugs (i.e., when users tell you their balance is wrong, you can find out exactly how the balance is derived).

2 Likes

Hi @Erik

Thanks you for this, it’s super helpful!

My next questions would be, is there a way to continuously add credits to user accounts every month with every subscription payment being made successfully (Zapier)?

Yes, I would connect zapier & adalo. Make sure it only fires on successful payments.

Thanks @Erik

i’ve created the collection to relate to users, the next thing i’m stuck on is, in the Zap, I’m not sure how make the field find the record ID of the related user… here is my workflow, any ideas?



The issue is identifying which user record id to relate the new Credit record to…

I see the issue. One work around is to not use the ID, fill in a text field with the email address. Then sum the log where the email = logged in user’s email.

1 Like

Thanks for the suggestion.

I have added in a text field which now shows below the User ID field in Zapier and then mapped this to the email address pulled from Stripe.

I’m just not sure where I would add in the sum whereby the record assigns itself to that user using the email address i.e, where do I input the sum?

Thanks so much for your help so far @Erik :slight_smile:

hi @jpotts I have the same issue (credit-based subscription for a restaurant). I’m currently investigating it with integromat. I’ll share news as I progress

Hi @axme, thanks a lot! I’m taking a break from this for today to try and think of a new solution! :sweat_smile:

You can’t automatically create a sum for the user. Basically when you want to show them the balance, you show sum of all log where email = logged in user email.

When they’re trying to “spend” credits, you only allow it if: the sum of the log where email = logged in user’s email > 0 (or the number of credits they want to spend).

To sum it and show them, you could build a feature that does that on the back end. I think it would be possible with a list of users and a countdown timer on it.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.