Cancel subscription stripe with update true/false user

Hello,

I have been looking for several days to find a way for the user to cancel his subscription with Stripe on Adalo by updating his true/false “subscription” status on the user table.

I tried several manipulations with zapier and custome action but without success.

If anyone could help me by putting a screenshot maxmium on his solution.

Thanks in advance.

Hey there @theo1

I got into some detail on this subject in a different thread:

Hello,

Yes thanks. I’ve seen this solution before but I don’t understand it anymore. Could I have more detail with screenshots on how to apply it?

I would thank you enormously.

Create an external collection of your stripe subscriptions. (Stripe API reference – List subscriptions – curl)

Add a parameter to your user collection called “Stripe Customer ID”

When a user creates a payment, add a custom action to grab the user’s stripe customer ID. Use the list all customers API and query by the logged-in user email. Update the user’s stripe customer ID with that value that’s returned from the API call.

Add a list of subscriptions and query the list by the logged-in user stripe customer ID.

Then, link to a subscription detail screen where you can delete the subscription with a “delete” action.

thank you for these valuable tips but I do not understand how the delete “current stripe subscription” queries the Stripe database by canceling its subscription.

I guess you have to use custom actions and Zapier?

No, you do not need zapier. I just showed you how to do it step by step.

Did you create an external collection of stripe subscriptions?
Did you link the stripe customer ID to the user?
Did you add a list of subscriptions?
Did you filter the subscriptions list?

how do you create the external collection?

I can’t retrieve my subscriptions.



how do you do that?

You’re very close.
Do you see here how the information is located nested in the “data” results key?

Simply put data in the results key box here.

Thanks very much ! It’s good ! We are progressing step by step!
But I can’t follow through. I don’t know used custom actions and following your instructions.

When a user creates a payment, add a custom action to grab the user’s stripe customer ID. Use the list all customers API 1 and query by the logged-in user email. Update the user’s stripe customer ID with that value that’s returned from the API call.

Normally, after I understood the rest. Can you show me screenshots of your app please.

Start by learning about custom actions here: https://help.adalo.com/integrations/custom-actions

See: Custom action, then update user, then link to a confirmation screen.

Here’s the query:

Then the update user action grabs the stripe customer ID and places it in the parameter we created several steps ago.

Thank you very much!! I feel like I’m close to getting there. For the query param, is that right?

because I have nothing that goes back in Stripe cutomer ID after the update.

There needs to be a record that matches that email address in your stripe account or it will not work.

Since this is simply creating the API custom action, it will not update anything, only display the record.

Use an email address in the ‘Example Value’ field that already exists in your stripe account and you’ll be good.

it’s good, everything works !!! Thank you very much !

In fact at the end I had a bug where I sometimes have to write Bearer like that or BEARER like that in my custom action and external collection. that’s why the custom action and the update didn’t work.

Anyway, thank you very much for your time and patience. Your help will be able to help me for the rest of the things!!

Without this function, my app could never see the light of day :slight_smile:

1 Like

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