Stripe - Dynamically generated price to create a subscription

Hi, I’m creating a customer panel where you can buy credits on a subscription basis.

The price varies depending on the selected number of credits and months.

As mentioned above, I need to use a subscription payment method so that the user is billed monthly and not on a one-off basis.

I was able to create a subscription and assign it to a previously defined product with a price created in the Stripe panel. The problem is that the price would have to be constructed dynamically based on the provided price argument.

I used the Stripe API Subscriptions plugin to create the subscription .(Plugins | Bubble)

The only price parameter that I can pass is its ID, once created in the Stripe panel.

Is it possible to dynamically create a given price and pass it on in some way? I was looking for similar threads in the forum, but they refer to the older version of the Stripe.js plugin.

I attach screenshots of how the workflow looks like now and the arguments passed. If it would be useful, I can make a video showing how the workflow currently created works.

Dynamically pricing for subscription is not possible. Can you give me some actual product that have similar pricing like you?

@ankur1 @filip1 This is a good example of a Dynamic pricing subscription:
https://maisonplan.com/fees

1 Like

This is 100% possible to create dynamic prices for subscriptions.

Firstly, a subscription in Stripe is nothing more than a price which has the type parameter set to recurring.

Screen Shot 2023-08-04 at 12.39.20 PM

Also, a price is simply attached to a product, and a product can have multiple prices attached to it…when a user is getting charged, all that is really needed is the price_ID so you can even charge different users different amounts for the same product, just depends on which price (ie: what price ID) you charge them with.

So, as long as you have your product already created, to create the dynamic price for the subscription, all you need to do is create a price with the create price api.

You can also use the subscription api to change a price of a subscription later in time…I do this to give a discounted subscription of 3 months before I change the price of the subscription to the normal price after the first 3 months.

If you need to fully understand how the Stripe API works, I have a course that has been available for a couple of years (and yes is still 100% relevant to how stripe api works today) that you might find valuable. It is a paid course that goes into great detail.

Is this still viable? I reached out to stripe support and they told me this is not possible. If it is viable, do you mind jumping on a call and helping me set it up for a quick workflow? I can pay if necessary

Stripe support doesn’t know anything about how Stripe works. All they know is how to search their FAQ pages and provide links to documentation. Hands down the worst support provided by a tech company.

yes, as far as I know for most any use case where you need to create a price via the API you can.

Sure, you can book a training session with me via the Bubble coaching marketplace