Creating a Product in Stripe Programmatically (Without Stripe Dashboard)

Hello All,

My first Bubble project is a book publishing collaboration platform and so far the community and tool has been super helpful! Thanks to all who contribute and support.

I’m running into an issue that I haven’t found documentation to solve. One key workflow in my app allows for any user to submit a book idea, which then creates a new book in the DB and dynamically generates a book collaboration page. Each book collaboration page contains a “fund” button to crowdsource the cost of book production. I’ve been able to set up Stripe to successfully identify a test book and confirm that the transaction is working, however I had to manually set up the book through the Stripe Dashboard. As I’d like users to submit a book idea and immediately be able to share with friends for funding (rather than wait for an admin to manually set up a new product through Stripe Dashboard), ideally I could included a “set up Stripe product” step in the “submit a book idea” workflow.

I see this type of action referred to in Stripe’s documentation but cannot find explicit direction on how to make this happen. It appears it may only be possible through the Managed Account settings, which will certainly be a challenge for a novice such as myself.

Any help or insight would be greatly appreciated! Thank you in advance.

Hi Jeff,

Here’s the page in Stripe API reference you need:

https://stripe.com/docs/api#create_product

You can use Bubble’s API Connector in your collaboration page setup workflow to make the API call to Stripe and create the product.

As far as I can tell, you don’t need to touch Manage Accounts for this to work (which is good because Bubble doesn’t support that functionality).

Andrew

Thanks, Andrew! Very helpful and appreciate your quick response. I’m knee-deep in the API Connector now and your advice is spot on.

Jeff

1 Like

@iamsalar is mere hours away from dropping a new Stripe pluggin which may make some of this easier (not sure until we know what’s being released).

Just saw the update. Thanks, @andrew1

How can I connect a purchase to a product on Stripe to auto calculate shipping?

Hi Andrew I can create a plan or u can say a product easily but can u guide how to link this product to the seller account because the paid plugin has a workflow to create a plan but no provision to state the product belongs to whom or we can say to which seller? M bit confused and one more thing do we need to create a customer every different seller’s product while subscribing or charing him directly or not?

Thanks in advance