Stripe API

For applications using the Stripe API directly (not Checkout).


When to Use This

Use this method if you:

  • Create charges or payment intents via API

  • Use Stripe Billing for subscriptions

  • Have a custom payment flow

  • Don't use Stripe Checkout


Step 1: Install Tracking Script

Add to your frontend:

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

Step 2: Get Referral ID

On your frontend, retrieve the referral:

Send this to your backend with the payment request.


Step 3: Add Metadata to Stripe

For Payment Intents

For Subscriptions

For Invoices


Step 4: Customer Metadata (Optional)

For recurring attribution, also add to the customer:

This ensures future purchases from this customer are attributed to the affiliate.


Complete Example

Frontend

Backend (Node.js)


Webhooks

PromoteBoost automatically listens for these Stripe events:

Event
Action

invoice.paid

Records sale, calculates commission

charge.refunded

Cancels commission

customer.subscription.deleted

Ends recurring tracking

No additional webhook setup needed — it's handled when you connect Stripe.


Done!

Sales are now tracked via the Stripe API. Test with a real payment in Stripe test mode.

Last updated