Stripe Checkout

For sites using Stripe Checkout with a custom backend.


When to Use This

Use this method if you:

  • Create Checkout sessions server-side

  • Redirect customers to Stripe-hosted checkout

  • Use stripe.checkout.sessions.create()


Step 1: Install Tracking Script

Add to all pages of your frontend:

<script src="https://api.promoteboost.com/tracker.js" data-org="YOUR_ORG_ID"></script>

Find your Org ID in Settings → Integration.


Step 2: Get Referral on Frontend

Before redirecting to checkout, capture the referral:


Step 3: Send to Your Backend

Include the referral when creating the checkout session:


Step 4: Add to Stripe Checkout

In your backend, add the referral to the session metadata:

Node.js

Python (Flask)

PHP


For Subscriptions: Add to Customer

To track recurring payments, also add metadata to the customer:


Complete Frontend Example


Done!

When a customer completes checkout:

  1. Stripe sends a webhook to PromoteBoost

  2. We read the promoteboost_referral from metadata

  3. Sale is attributed to the affiliate

  4. Commission is calculated

Test with Stripe test mode before going live.

Last updated