Stripe Checkout (marketplace)

Enables multi-party transactions and payouts in marketplace applications using Stripe Connect.

This API call is similar to the standard checkout session, along with two additional fields typically used to facilitate marketplace payments.

  • payment_intent_data[application_fee_amount]

  • payment_intent_data[transfer_data][destination]

Link to stripe docs: https://docs.stripe.com/api/checkout/sessions/create

Parameters:

success_url

In this field you should enter the URL that the user should be taken to when they make a successful payment.

cancel_url

In this field you should enter the URL that the user should be taken to when they cancel the payment.

Users cancel the payment by clicking the back button in the checkout session portal.

customer (not required)

In this field you should enter the users stripe customer id.

This field is not required to capture a payment however with a customer id you are able to easily identify and save information about customers with stripe.

line_items[0][price_data][currency]

In this field you should enter the currency code for the amount to be paid.

this value should be in lower case.

Here is a link to a list of currency codes accepted by Stripe: https://docs.stripe.com/currencies

line_items[0][price_data][product_data][name]

In this field you should enter the product name to be displayed to the user in the checkout portal.

mode

In this field you should enter one of the following values:

payment - Accept one-time payments for cards, iDEAL, and more.

setup - Save payment details to charge your customers later.

subscription - Use Stripe Billing to set up fixed-price subscriptions.

Here is a link to the relevant Stripe documentation: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-mode

payment_intent_data[application_fee_amount]

In this field you should enter the application fee you are taking for the transaction (typically seen on marketplace transactions).

note that the value should be in cents.

payment_intent_data[transfer_data][destination]

metadata[custom_value] (optional)

If you need to pass a custom data through the checkout session you can do so by creating custom fields in the metadata, you can create as many as needed, all you have to do is replace "custom_value" with a name that makes sense for your use case.

When a response is returned from a checkout session, you will be able to access these custom values.

As an example, you might create a field called metadata[users_bubble_id], then when a checkout session is created you enter the current users id into this field. When the user completes a checkout session you will get a response and in that response under 'metadata', you will have access to the user id you entered.

Last updated