Skip to main content
All CollectionsDeveloper
How to set up Stripe Buy Button with Tolt
How to set up Stripe Buy Button with Tolt

Easily set up Tolt with your Stripe account and SaaS in under 15 minutes!

Damjan avatar
Written by Damjan
Updated over a week ago

To integrate your SaaS and Stripe with Tolt, begin by following these steps:

Head over to the Tolt dashboard and navigate to Program Settings > Integration.


Here, you'll find the initial step to connect with Stripe.

Then, you'll need to insert our script in your website's head tag:

<script async src="https://cdn.tolt.io/tolt.js" data-tolt="YOUR-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.

You can skip the other steps in the Integration page, as they won't be needed.

The last step of the integration, adding the script for the Buy Button in your website's body tag:

<script>
const updateStripeBtns = () => {
var stripeBuyButtons = document.querySelectorAll("stripe-buy-button");
if (window.tolt_referral && stripeBuyButtons.length > 0) {
stripeBuyButtons.forEach(stripeBuyButton => {
stripeBuyButton.setAttribute("client-reference-id", window.tolt_referral);
})
}
}


setTimeout(updateStripeBtns, 1000);
setTimeout(updateStripeBtns, 1900);
setTimeout(updateStripeBtns, 2600);

window.addEventListener("tolt_referral_ready", function() {
if (window.tolt_referral) {
updateStripeBtns();
}
});
</script>


That's it! Your affiliate links should now work.



To test out the integration:
1.
Create a demo affiliate through your affiliate portal and copy your link
2. Open your affiliate link
3. Make a test purchase on your website

BONUS: You can create a 100% off coupon on Stripe and use that code to make the test purchase, so you do not get charged.

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

Did this answer your question?