Set up and use Stripe
To enable payments and receive commissions in your marketplace, you need a free Stripe account. This guide will help you in creating a Stripe account and adding Stripe API keys to Console and Flex Template for Web.
Table of Contents
- 1. Create and confirm your free Stripe account
- 2. Enable Stripe Connect in your platform
- 3. Enable Stripe Connect Onboarding in your platform
- 4. Get your API keys from Stripe and add them to your Sharetribe marketplace
- 5. Add your Stripe secret API key to Console
- 6. Add you Stripe publishable key to your client application
- 7. Test the Stripe account in Flex Template for Web
- Test adding payout details
- Test checkout
- 8. Advanced: Adding new country to supported Stripe countries
Register to Stripe. After filling the form you will be asked the question "How do you want to get started with Stripe?". You can click "Skip for now" link at the bottom of the page to get directly to Stripe dashboard. Remember to confirm your email address after the registration.
As you will receive money from your users via your Stripe account, you have to provide some details such as your address and your bank account. In the Stripe dashboard, click the "Activate your account" link in the left menu and fill in all the fields according to the instructions. The activation form varies based on your country.
Sharetribe uses the Stripe Connect features with custom accounts.
Note! Stripe might need to review your platform account before you get access.
Check this article to learn how to apply for Stripe Connect review.
If you're in any another country, follow these instructions to enable Stripe Connect:
- Click the Connect left menu item.
- Click the Get started button.
- After a few seconds, you should see your Connect dashboard. From the left sidebar, go to Settings then Connect settings, at https://dashboard.stripe.com/settings
- Make sure that Custom is enabled in the Account types section
Stripe Connect Onboarding,
you need to navigate to
Connect settings page
in your Stripe Dashboard. For the Connect onboarding to work, you need
icon for your marketplace.
Great! You now have to get your API keys and input them into your marketplace.
- Click the Developers left menu item and go to Developers → API Keys.
- In the section "Standard API keys" you will see two keys: publishable key and secret key. The publishable key (with prefix pk) is one used in frontend application (e.g. Flex Template for Web) and secret key (with prefix sk) is the one you need to add to Console. If you want to use test data make sure the value of the key is eg. pk_test<somethinghere> and not pk_live<somethinghere>
Note: If you want to use test data in development make sure that "View test data" toggle is on. This way no real money will be used. In production make sure that the toggle is off.
- Log in to Console and go to Build → Payments
- In the section Stripe configuration paste your secret key to "Stripe secret key" field and save the changes.
In your client application, you need to use Stripe publishable key, when
you create accountTokens or call other Stripe API endpoints. If you are
using Flex Template for Web, calls to Stripe API are already there, but
you need to add the Stripe publishable key to your
.env file. You can
do this by running
yarn run config or editing the file directly in a
Read more about configurations in FTW from Getting started with FTW
If you are using Flex Template for Web (FTW) here is some instructions how you can test you Stripe account.
Note: When testing Stripe, make sure you are using the test API keys. To ensure that make sure the keys have prefix sk_test and pk_test. When checking the Stripe dashboard, make sure "View test data" toggle is on!
Every provider needs to add payout details to their account before they are able to publish listings. Stripe provides test values for identity verification and bank numbers. In FTW you can add payout details for the account in Account Settings → Payments. After filling the form you should see a new account when you go to Stripe Dashboard and to Connect → Accounts.
Note: After payout details are saved they can not be edited directly from FTW so you might need to create multiple accounts for testing purposes.
The form of the bank number and other required information depends on which country you have chosen. For example, most of the countries in Europe use IBAN form which is asked in one field. However, for example in Hong Kong clearing code, branch code and bank account number are all needed.
It's also good to know that in FTW these are all separate fields but in Stripe clearing code and branch code are mapped together as routing number.
With company accounts, Stripe might require information of every person that owns at least 25% of the company or exercise significant control over your company. This requirement is country specific. For more information, see Stripe support.
Note: if a company/provider doesn't include enough owners to cover most of the shares, you might need to manually state that there are no more persons that own 25% or more.
By default FTW already supports most of the countries that are available when using Stripe custom accounts. If you are not sure if your country is already supported, please contact to Stripe support before proceeding.
- Add a new country to
stripe-config.jsfile (use other country configurations as an example). See Stripe documentation for minimum verification requirements and bank account format.
- Add new translation keys to translation file you are using (e.g.
translations/en.json). Add at least
PayoutDetailsForm.companyTaxIdLabel.COUNTRYCODEkeys but there might be also other keys needed.
- If you add new fields or you want to edit the existing ones, see
forms/PayoutDetailsFormand the subcomponents in the folder. E.g. to enable personal ID number field you need to add the new country in
forms/PayoutDetailsForm/PayoutDetailsPersonalDetails.jsfile where showing the ID number field is handled.