Skip to main content
All CollectionsIntegrationsStripe
How to set up Stripe with Tolt
How to set up Stripe with Tolt

Learn how to set up Tolt with your Stripe account and SaaS. We made sure it only takes 15 minutes from start to finish!

Valentin avatar
Written by Valentin
Updated over 7 months ago

There are a few steps that you have to do to set up your SaaS and Stripe with Tolt.

You can find the integration set up in your Tolt dashboard within Program Settings.

First, authenticate your Stripe account with Tolt:

Then, you'll need to add our tracking script:

<script async src="https://cdn.tolt.io/tolt.js" data-tolt="YOUR-TOLT-PUBLIC-ID"></script>

You can find your unique public ID and the full script tag in Account Settings -> Integrations, please navigate there to copy it. The script needs to be added on your landing page, or even better, on every page, so we never miss a referral. This script will add a global variable called "tolt" to your window object. The size of the script is around 4KB.

Send Referral ID to Stripe:

You'll need to send a Tolt generated unique ID to Stripe via metadata

The user's Tolt ID can be received from the script that was added in the previous step. To access the unique ID use window.tolt_referral

You'll need to send the Tolt generated ID to your backend server when creating a stripe subscription.

Examples:

Subscription:

const subscription = await stripe.subscriptions.create({ 
customer: 'cus_Mzbketpctz1F',
metadata: { tolt_referral: req.body.referral, },
items: [
{price: 'price_1MFMsUToeCS20juA2Y'},
],
});

Checkout Session:

const session = await stripe.checkout.sessions.create({ 
success_url: 'https://example.com/success',
cancel_url: 'https://example.com/cancel',
metadata: { tolt_referral: req.body.referral, },
line_items: [ {price: 'price_H5vtDq1fbrJ', quantity:
1},
],
mode: 'subscription',
});

* Example above is with Javascript, but it is the same with every language. You just need to send the Tolt ID from client side to your backend server either with params, query, or body and then send it to Stripe with metadata when a stripe checkout session.

* If the Stripe API is called on the client side, you will need to use the Tolt Referral ID from window.tolt_referral

You can always contact us via live chat and we can set up Stripe together!

Signup a Referral

You can learn more about Stripe x Tolt here: Stripe Affiliate Program with Tolt

Did this answer your question?