Automatically Create Stripe Subscriptions

Hey All,

Asking if anyone has been able to figure out the way to automatically create a subscription within the official Stripe plugin workflow-

The idea is to have the products dynamically created within Stripe then from there it creates a subscription.

But there’s some caveats to this, the users are not logged in upon checkout- it’s all purchased as a guest then from there, their account gets created by a separate flow / process. I’m open to using Zapier for this, I’d like to not use it if that’s even possible, but open to suggestions for what anyone thinks.

Bump, Stripe is looking into this- still curious on the community’s finds/thoughts.

A bit confused by the question. Is your use case different from the “subscribe the user to a plan” action from the official Bubble plugin? is the only difference that they are logged out?

according to Bubble’s docs:

This user must be signed up already because we need to have their saved credit card information. The user does not need to be logged in for the transaction to happen.

so you could then, in theory, collect their email and create an account for them using the “Create an account for someone else” action, then have them go through the stripe flow and it will save it to that email account. you could then take them through a password set flow or something.

Yes so what ideally should happen in a perfect world is:

  • The user never has an account
  • The price of the product and payment subscription are created dynamically based on a checkout page’s data

To my knowledge the way Stripe operates is a user would have to already be within the Stripe system and from there an existing subscription would need to be assigned to that user.

I was thinking about this too, but to create an account for someone else, wouldn’t I still need a password field? I could just randomize it and leave it inaccessible- but that seems clunky no?

Doesn’t need a password!

Another option is to just use the Stripe API through the API connector and not use Bubble’s plugin. In that case you wouldn’t need the user to have an account at all.

You’re indeed right!

Experimenting with this, for some reason it keeps asking for an email as an error when the email being provided is valid and present.

I was also experimenting with Zapier, but from what I realized Zapier doesn’t allow Stripe test environments, only live which seems really weird.

I was looking at the documentation for the Stripe API integration, but it still asks me to specify a subscription_id, when the whole idea is to have this automatically created for me.

For anyone in the future that may encounter this challenge, a workaround has been created-

Please note this is for creating “Guest” automatic Stripe subscriptions with dynamic pricing / intervals:

The workflow is as follows:

  • –Sign the user up
  • –Log the user in
  • –Create a Stripe Product (Stripe.js)
  • –Create a Stripe Price (Stripe.js)
  • –Subscribe the current user to the subscription (Stripe)
  • –Delete the user
  • –Log the user out

Plugins used: Stripe & Stripe.js

@NoCodePete thank you again for your contribution to this solution!

This topic was automatically closed after 69 days. New replies are no longer allowed.