Warning
You are browsing the documentation for the new Sharetribe Web Template. If you are using FTW-daily, hourly or product, see the legacy documentation.

Last updated

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 Sharetribe Web Template.

Table of Contents

1. Create and confirm your free Stripe account

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 top bar and fill in all the fields according to the instructions. The activation form varies based on your country.

Activate Stripe account

Once activated, your dashboard should display the message "Your account is now active":

Active Stripe account

2. Enable Stripe Connect in your platform

Sharetribe uses the Stripe Connect features with custom accounts.

If you're in any another country, follow these instructions to enable Stripe Connect:

  • Click the Connect menu item, and the Get started button.

Stripe connect

  • This will open a popup. Click the Continue button.

Get started

3. Account types and connect onboarding settings

To enable Stripe Connect Onboarding, you need to navigate to Connect settings page in your Stripe Dashboard. For the Connect onboarding to work, you need to provide name, color, and icon for your marketplace.

Stripe dashboard

Great! You now have to get your API keys and input them into your marketplace.

4. Get your API keys from Stripe and add them to your Sharetribe marketplace

  • Click the Developers left menu item and go to DevelopersAPI 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. Sharetribe Web Template) 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>

Get API keys from Stripe

5. Add your Stripe secret API key to Console

  • Log in to Console and go to BuildPayments
  • In the section Stripe configuration paste your secret key to "Stripe secret key" field and save the changes.

Add Stripe secret key to Console

6. Add you Stripe publishable key to your client application

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 Sharetribe Web Template, 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 text editor.

Read more about configurations in the template in Getting started with Sharetribe Web Template

7. Test the Stripe account in Sharetribe Web Template

If you are using the Sharetribe Web Template, refer to these instructions on testing your Stripe account.

Test adding payout details

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 Sharetribe Web Template, you can add payout details for the account in Account SettingsPayments. After filling the form you should see a new account when you go to Stripe Dashboard and to ConnectAccounts.

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.

Hong Kong bank number

It is also good to know that in the template, these are all separate fields, but in Stripe, clearing code and branch code are mapped together as routing number.

Stripe bank numbers

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.

Add more owners alert

Test checkout

Stripe provides various test card numbers for testing the checkout. There are also test numbers for specific responses and errors so e.g. testing different error scenarios is possible.

Checkout

8. Advanced: Adding new country to supported Stripe countries

By default, the template 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.

  1. Add a new country to configStripe.js file (use other country configurations as an example). See Stripe documentation for minimum verification requirements and bank account format.

  2. Add new microcopy keys to the microcopy file you are using (e.g. translations/en.json). Add at least PayoutDetailsForm.countryNames.COUNTRYCODE and PayoutDetailsForm.companyTaxIdLabel.COUNTRYCODE keys but there might be also other keys needed.

  3. If you add new fields or you want to edit the existing ones, see forms/PayoutDetailsForm and the subcomponents in the folder. E.g. to enable personal ID number field you need to add the new country in forms/PayoutDetailsForm/PayoutDetailsPersonalDetails.js file where showing the ID number field is handled.