LogoLogo
Back to studio
  • 🧠Core Concepts
    • Introduction to Formsort
    • Formsort quickstart guides
      • Add content and collect answers
      • Capture demographic data
      • Add informational content
      • Template your variables
      • Add conditional logic
      • Using conditional logic with Calculated and API variables
      • Add a scheduling option
      • End the flow
      • Review your variable schema
      • Set up integrations
    • How data works in Formsort
      • Responder UUIDs
    • Understanding flows
    • Versioning in Formsort (Deploying)
      • Variant revisions
      • Managing revisions
  • ✨Creating Flows
    • Building a new flow
      • Groups
      • Steps
      • Copy-pasting form content
  • Adding questions and content
    • Questions
      • Select
      • Text
      • Address
      • Comparison
      • Confirmation
      • Date
      • Date & time
      • Email address
      • File upload
      • Grid choice
      • Iframe
      • Image upload
      • Number
      • Payment
      • Phone number
      • Postal code
      • Question group
      • Region
      • Signature
      • SSN
      • Yes/No
    • Content
      • Statement
      • Image
      • Next button
      • Video
      • Divider
      • Map
  • Controlling the flow with conditions and logic
    • Advanced logic
  • Variable templating
  • Redirects and endings
  • Field validation
  • Flow and variant management
  • Content library
  • 🧬JSON Form Definition
  • JSON schemas
  • Validating flow schemas
  • Events subscriptions
  • Flow content data format
  • 🎨Styling
    • Customizing appearance
      • Content area & form layout
      • Buttons
      • Typography
      • UI states
      • Color and dimension variables
      • Question containers
      • Inputs and dropdowns
      • Checkmarks
      • Tables
      • Sliders
      • Divider lines
      • Progress bar
      • Comparison cards
      • Animations and transitions
  • CSS & Advanced Styling
    • Custom CSS overrides
    • Step styling
    • CSS reference
  • 🔁Form Behavior Settings
    • Variant settings
      • Form behavior for returning users
      • Group ranking API
    • Navigation sidebar
  • ⚙️Response Data Collection & Management
    • Schema (variables)
      • Variables from questions
      • Externally provided variables
      • Calculated variables
      • API lookups
      • System Library variables
      • Orphaned variables
  • Saving & retrieving responses
  • Importing Data
    • URL parameters
    • POST body
    • Embed query parameters
  • 📊Analytics and Attribution
    • Built-in analytics
    • Split testing
  • 🚀Publishing and Deployment
    • Live preview overview
    • Environments
      • Loading different environments
    • Embedding
      • Web-embed API
        • React-embed
      • Adding authentication
      • Embedding forms in iOS and Android
      • Setting up a dev environment
    • Pre-deployment checklist
  • 📁Workspace Management
    • Accounts
      • Roles and permissions
    • Custom domains
    • Workspace domain detection
  • 🛠️Formsort Admin API
    • Admin API
  • 🔌Integrations
    • Form answers and events
      • Analytics events
      • Signed requests
      • Event payload shape
      • Submission frequencies
      • Runtime error reporting
    • Integration reference
      • Amplitude
        • Amplitude cross domain tracking
      • BigQuery
      • FullStory
      • Google Analytics
        • Updating from Universal Analytics to GA4
      • Google Cloud Storage
      • Google Sheets
      • Google Tag Manager (GTM)
        • JavaScript triggered by flow events
      • Hubspot
      • Jornaya
      • Optimizely
      • PostgreSQL
      • Redshift
      • Rudderstack
      • S3
      • Salesforce
      • Segment
        • Segment Setup
        • Segment cross domain tracking
      • Stripe
      • TrustedForm
      • Webhooks
        • Zapier
Powered by GitBook
On this page
  • Adding Stripe
  • Adding Stripe to your Form integrations
  • Adding the Payment component to the form
  • Stripe Payments API
  • Charge immediately
  • Products
  • Promo Codes
  • Charge later
  • Stripe in Live Preview

Was this helpful?

  1. Integrations
  2. Integration reference

Stripe

PreviousSegment cross domain trackingNextTrustedForm

Last updated 1 month ago

Was this helpful?

Integrating Stripe with Formsort allows you to collect payments seamlessly within your forms. This guide will walk you through setting up Stripe, adding it as an integration, and configuring payment components to accept payments from users.

Adding Stripe

Here is a link to Stripe to help you get a Stripe account set up: .

Adding Stripe to your Form integrations

To allow users to make payments through Stripe, you must first add your Stripe account credentials to your flow's integrations.

  1. Navigate to Integrations → Data Integrations → Stripe.

  2. Click Add a credential, then select Add New.

  3. Enter your Stripe credentials:

    • Publishable Key (required): Found in your Stripe account configuration.

    • Secret Key (required for direct card charges in Formsort).

At a minimum, you will need to provide a Publishable Key, found in your Stripe account configuration. A Secret Key will additionally be required to charge cards directly in Formsort.

  • Production Environment: Live Publishable Key (must start with pk_live_)

  • Staging or Testing Environment: Test Publishable Key (must start with pk_test_)

The Description field is optional but can help your team distinguish configurations across environments.

Adding the Payment component to the form

To enable Stripe payments in your form:

  1. Open Formsort Studio.

  2. Create a Payment question.

  3. Set Provider to Stripe.

  4. The Studio will then display which environments have Stripe credentials configured.


Stripe Payments API

There are several ways to collect payments from your users:

  • Charge immediately

Charge immediately

If you enable "Allow charging the card immediately", you can collect payments using:

You can also attach Phone and Email variables to the transaction, which will be stored in Stripe’s customer and transaction records. Currently, only these fields are supported; additional fields may be added in the future.

If you'd like to see other fields added, let us know in our Intercom chat!

A fixed amount

Once a fixed amount charge is made:

  • A Transaction is created in Stripe.

  • Transactions can be viewed in Balances → All Activity in Stripe.

  • A payment ID is sent to answer integrations, appearing as: "stripe":"pi_XXXXXXXXX".

Here is an example stripe transaction that was charged for a fixed amount of $95...


And the associated answers sent in the webhook payload at finalize; notice the Stripe object that holds the paymentIntentId:

{
  "answers": {
    "phone": "6262626262",
    "email": "test@test.com",
    "stripe": {
      "paymentIntentId": "pi_3RADdoC6ecQgQwdM0pfFGa3d"
     },
  }

A variable amount

The transaction record in Stripe will be similar to that of the fixed-amount charge, and the webhook payload will contain the Stripe object with the paymentIntentId and the variable used to determine the amount:

{
  "answers": {
    "charge_amount_in_cents": 6000,
    "stripe": {
      "paymentIntentId": "pi_3RADPfC6ecQgQwdM0VKGOZdV"
    },
    "email_address": "test@test.com",
    "phone_number": "1234567890
  },

If you store responses in Formsort, the Stripe object will also be included in the answer set.

Products

With the Product option, Formsort fetches your Stripe products in real time, allowing users to select purchase options.

Creating a Product in Stripe

First, you will need to add a product in the Product catalog section in Stripe.

  1. In Stripe, go to Product Catalog.

  2. Click Create Product.

  1. Enter:

    • Name - appears as the button/dropdown label in Formsort (pictured below).

    • Amount - visible based on pricing setup: recurring or one-time.


  1. Click Add Product.

The More options fields are required only for the needs of your business, and are not included as part of the Formsort integration.

Configuring Products in Formsort

Once Products are added in Stripe, configure the Payment component in Formsort:

It is suggested that you use the staging environment for testing, if available.

  1. Click Edit Products under How much to charge.

  2. Choose a Product Select Component style:

    • Native Dropdown: Browser-based dropdown styling.

The Product Select Component Label and Pricing Cards Label are optional fields that provide additional information when using a Select component or a pricing card.

Multiple prices

If a product has multiple price points:

  1. In Stripe, go to the product and click Edit Product.

  1. Click Add Another Price.

  1. Enable Is Multiple Price in Formsort.

Once everything is configured, you will see that the Product has a card for each price tier.

Passing data into the price cards

You can pass metadata into the pricing card, to help explain to your users what they are buying at each price point.

There are two sections of the card that can be customized: the title of the card, and the description in the card.

To pass data into these fields:

  1. Open the product in Stripe.

  2. Click a specific price and select Edit Metadata.


  1. Add:

  • formsort_title (will be inserted into the card title area, and by default will appear as an H4 element).

  • formsort_description (markdown-supported).

    • e.g. use asterisks to create a bullet list of descriptions, as in the example below.

Styling price comparison cards

General styling for comparison cards can be found in Theme -> Components -> Comparison Cards.

Transaction record

Once a transaction is made, you will see the transaction record in Stripe update.

If you receive webhooks, the Stripe transaction data will be nested in the stripe object, along with the session's other answers:

// Example
{
  "answers": {
    "time_zone": "America/Denver",
    "stripe": {
      "paymentIntentId": "pi_3R9wReC6ecQgQwdM1OMlvF7I",
      "subscriptionId": "sub_1R9wReC6ecQgQwdMp5F1ZLOh",
      "selectedProductId": "prod_ROQ0exf8TguzDz",
      "selectedProductName": "Product 2"
    }

Promo Codes

To provide a promo code field for your users, enable Allow inline promo code.

If a promo code is valid, the discount will be applied at checkout.

Autofilling promo codes

To autofill promo codes for your users:

  • enable Promotion code variable and choose the variable that is going to provide the promo code.

Formsort suggests using the following variable types to provide the promo codes:

The definition of the promo code variable should be available before the user arrives at the Stripe checkout step — trying to calculate the definition at the time of checkout could result in errors.

Charge later

By default, "Allow charging the card immediately" is disabled. In this case:

  • You must charge the user later using the Token ID via Stripe.

  • Products cannot be used with this setting.


Stripe in Live Preview

To experience a live test of the integration, deploy your form to the staging or production environments and test the functionality there.

Here is more Stripe documentation to help you set up your Stripe account for testing:

Always make sure to test before going live!

Refer to to locate your API keys and understand their usage.

Ensure that you use the correct keys based on your :

: Defined in cents by you.

: Defined dynamically based on a form variable (number-type).

and : Pulled from your Stripe Product Catalog.

Note: The payment ID is sent when are sent, not immediately.

If you , the Stripe object will also be included in the answer set:

With the Variable amount setting, the charge amount is dynamically calculated based on a previous form question. The variable must return a number .

If you don't have a number variable, create a that returns the amount (as a number) in cents.

Currently, Stripe . When testing updates to the component, you will need to deploy the form and view a production or staging instance.

Buttons: Styled as .

Dropdown: Styled as a (select-based option).

If you require custom styling, you can use the class names referenced in .

If you , the Stripe object will also be included in the answer set:

(URL parameters)

(API lookup)

(locally-calculated variable)

A Token ID (tok_XXXXXXXX) is sent to when answers are submitted.

The Stripe integration will not be functional in the window. Instead, a card-capture input area and a "start" button will be mocked up to get a sense of how the integration will sit in your form.

.

🔌
Stripe’s documentation
environment
store responses in Formsort
calculated variable function
select buttons
dropdown
store responses in Formsort
External Variable
API Variable
Calculated Variable
Live Preview
https://docs.stripe.com/testing#cards
Products
Charge later
A fixed amount
A variable amount
Product(s)
will not load in the Live Preview of a form
Stripe docs | Overview
data type
answers
answer integrations
Custom CSS
The name field from the Stripe product, as it appears in Formsort
The Stripe mock-up in the Live Preview.
The Stripe component in a live, "production" instance.
payment-provider-setup-in-studio
create-product-instruction
add-a-product-menu
product-name-field
formsort-edit-products-menu