---
description: >-
  This documentation will go over how to setup Stripe Connect (marketplace)
  payments using Checkout in your Bubble app.
---

# Introduction

This plugin contains all the workflow actions and data calls to let your user connect their Stripe account and create marketplace payments & subscriptions while taking a platform fee.

**Demo page (editor is public):** [https://stripeconnectdemo.bubbleapps.io/version-test](https://stripeconnectdemo.bubbleapps.io/version-test)

**Plugin page:** [https://bubble.io/plugin/stripe-connect-checkout-inc-subscriptions-1642201569923x177444100576378880](https://bubble.io/plugin/stripe-connect-checkout-inc-subscriptions-1642201569923x177444100576378880)

**My contributor page:** [https://bubble.io/contributor/thimo-1531681544178x908277594484388900](https://bubble.io/contributor/thimo-1531681544178x908277594484388900)

## Support

Questions, bug reports or feature requests? You can message me on the Bubble Forum: @thimo or shoot me an email (you can find my email on [my contributor page](https://bubble.io/contributor/thimo-1531681544178x908277594484388900)).

Connect with me on [Twitter](https://twitter.com/thmawa).

{% hint style="info" %}
If you find yourself having trouble at one point in this documentation, please reach out! I want this documentation to be super clear and easy to follow (ideas to improve the docs are greatly appreciated).
{% endhint %}

## Basics

First, make sure to add the plugin to your Bubble app. Inside this step-by-step documentation we will implement the plugin from scratch. Below you will find a summary of the most important steps. You can see the demo page here: [https://bubble.io/page?name=index\&id=stripeconnectdemo\&tab=tabs-1](https://bubble.io/page?name=index\&id=stripeconnectdemo\&tab=tabs-1)

#### The plugin contains the following workflow actions:

* Stripe Connect - Checkout Single Payment
* Stripe Connect - Checkout Subscription Payment
* Refund Charge
* Perform Manual Payout
* Cancel a Subscription
* Create Stripe Account
* Create Account Link
* Update Payout Schedule for Express Account
* Create Express Dashboard Link

**The plugin contains the following data calls:**

* GET Checkout Session Details
* GET Payment Intent Details
* Retrieve Stripe Account
* Retrieve Connected Account Balances
* GET Subscription details
* List Invoices For A Subscription
* GET Charge details
* GET Balance Transaction details

## TL:DR

Below is a quick **summary** of the most important steps we will be performing to implement marketplace payments using the plugin in your Bubble app. Visit the other pages in this documentation to read a step-by-step instruction.

#### Onboarding users

1. First we will create a Stripe account using a workflow action and we will save the returned <mark style="color:blue;background-color:blue;">Account ID</mark> to the database.
2. Next we will go over how to use a workflow action to create an 'Account Link' to connect the Stripe account from your user to the created account from step 1. This account link will redirect your users to a Stripe Onboarding flow to connect their Stripe account.
3. When onboarding is completed, the user will be redirected to your specified 'Return URL' and we will perform the 'Retrieve Stripe Account' data call with the <mark style="color:blue;background-color:blue;">Account ID</mark> to check if `charges_enabled` parameter is set to true which means that the onboarding succeeded for the user.

#### Creating payments (one-time and subscription) and collecting a fee

1. **One-time marketplace payments**
   1. First we will use the 'Stripe Connect - Checkout Single Payment' workflow action to generate the Checkout URL for a one-time payment and save the <mark style="color:green;background-color:green;">Checkout ID</mark> and <mark style="color:orange;background-color:orange;">Payment Intent ID</mark> to the database. Inside this workflow action we specify the <mark style="color:blue;background-color:blue;">Account ID</mark> of the user that will receive part of the payment and a fee percentage that you (the platform) will receive. You also need to specify a 'Success URL' where the user will be redirected after completing the payment.
   2. Next we will redirect the user to that Checkout URL to let the user perform the payment.
   3. The user will be redirected to your 'Success URL'. **Note: we still need to check if the payment is successful.**&#x20;
   4. To check if the payment is successful, we need to run the 'GET Payment Intent Details' data call. The <mark style="color:orange;background-color:orange;">Payment Intent ID</mark> necessary for this call is saved in step 1. Next we look at the `charges` object and select the first item to see if it is paid. You can display / use this information how you like in your app!
2. **Subscription marketplace payments**
   1. First we will use the 'Stripe Connect - Checkout Subscription Payment' workflow action to generate the Checkout URL for a subscription and save the <mark style="color:green;background-color:green;">Checkout ID</mark> to the database. Inside this workflow action we specify the <mark style="color:blue;background-color:blue;">Account ID</mark> of the user that will receive part of the payment and a fee percentage that you (the platform) will receive. You also need to specify a 'Success URL' where the user will be redirected after completing the subscription.
   2. Next we will redirect the user to that Checkout URL to let the user create the subscription.
   3. The user will be redirected to your 'Success URL'. **Note: we still need to check if the subscription is successfully created.**&#x20;
   4. To check if the payment is successful, we need to run the 'GET Checkout Session Details' data call. The <mark style="color:green;background-color:green;">Checkout ID</mark> necessary for this call saved in step 1 to the database. Next we can look at the subscription parameter and check if it contains a value (<mark style="color:red;background-color:red;">Subscription ID</mark>). Once it is not empty you know that the subscription has succeeded. Make sure to save the <mark style="color:red;background-color:red;">Subscription ID</mark> to your database. You can display / use this information how you like in your app!&#x20;

