---
title: "Stripe Payments: Spark! docs | Chargezen"
description: "Credit creators for subscriptions you bill in Stripe: connect your Stripe account, add the Spark! webhook, and pass the creator’s click on your Checkout Session."
url: "https://chargezen.com/docs/spark/brand-guides/stripe-payments"
lang: "en"
updated: "2026-11-05"
---

Canonical URL: https://chargezen.com/docs/spark/brand-guides/stripe-payments

# Stripe Payments

Credit creators for subscriptions you bill in Stripe: connect your Stripe account, add the Spark! webhook, and pass the creator’s click on your Checkout Session.

Last updated: 2026-11-05

If you sell subscriptions through Stripe rather than a Shopify store, Spark! can credit creators from your Stripe payments. A creator's click is matched to the Stripe customer at checkout, and each subscription invoice that customer pays earns the creator commission.

## What earns commission

*   **Paid subscription invoices** of a customer who checked out after a creator's click. One-off payments and invoices without a subscription don't earn.
*   Commission is worked out on the invoice amount **after discounts and before tax**. Invoices that collected nothing, such as free trials, earn nothing.
*   A referred customer earns for **12 months from the checkout** by default. Invoices paid after that earn nothing.
*   Each customer is credited to **one creator**: the one whose click their first checkout carried. A later checkout with another creator's click doesn't move them.
*   **Refunds** lower the commission on that invoice by the share refunded, and a full refund takes it to zero. A **dispute you lose** takes it to zero. If the commission was already paid, the difference comes off the creator's next payout.

#### Before you start

*   A Spark! program with its settings saved (Spark! > Partners > Settings)
*   Access to your Stripe dashboard to create a restricted key and a webhook endpoint
*   Access to the server code that creates your Stripe Checkout Sessions, or your Payment Link URLs

## 1\. Connect your Stripe account

1

#### Create a restricted key

In Stripe, go to **Developers > API keys** and create a restricted key with **Read** access to Checkout Sessions, Customers, Invoices, Subscriptions, Charges and Disputes. Spark! only reads from Stripe, so it doesn't need a full secret key.

2

#### Add the account in Chargezen

Go to **Settings > Integrations**, open **Stripe** and add an account. Give it a name you'll recognise and paste the restricted key into **Secret key**.

3

#### Copy the Spark! webhook URL

The Stripe card shows your workspace's Spark! webhook URL. Copy it.

4

#### Add the webhook in Stripe

In Stripe, go to **Developers > Webhooks**, add an endpoint with that URL, and select these four events: `checkout.session.completed`, `invoice.paid`, `charge.refunded` and `charge.dispute.closed`. Your existing Stripe webhooks keep working as they are.

5

#### Paste the signing secret

Stripe shows the new endpoint's signing secret (it starts with `whsec_`). Paste it into **Webhook signing secret** on the same Stripe account in Chargezen and save.

More than one Stripe account

You can connect several Stripe accounts. Add each one in **Settings > Integrations > Stripe** with its own restricted key and signing secret, and paste the same Spark! webhook URL into each account's webhook settings.

## 2\. Choose Stripe payments

In **Spark! > Partners > Settings > Tracking**, set **Orders that earn commission** to **Stripe payments** and save. A program credits one source at a time, so a workspace with both a Shopify store and Stripe never pays twice for the same sale. The option appears once a Stripe account with both a secret key and a signing secret is connected.

Make this switch before creators share their links. A link clicked while the program is set to Shopify orders carries a click value that Stripe can't hold, so that visit can't be credited from Stripe.

Set your program's **Default landing page** to the page on your site where creators' links should land. Spark! sends visitors there with a `czzn` value added to the address.

## 3\. Keep the click on your site

When a visitor lands with `?czzn=...` in the address, save that value, for example in a first-party cookie. Keep it for your program's attribution window (**Spark! > Partners > Settings > Tracking**) and don't replace a saved value with a newer one: the first click wins. A click older than the attribution window isn't credited.

Keep the value exactly as it arrived and pass it on unchanged. It's at most 100 characters of letters, digits,`-` and `_`, so it fits both Stripe fields below.

## 4\. Pass the click on the Checkout Session

When your server creates a Stripe Checkout Session in `subscription` mode, add the saved value as `metadata: { czzn }`. Setting `client_reference_id` to the value works too. That's the whole integration.

Node (stripe-node)

```javascript
// The click your site kept from ?czzn=... (for example in a cookie)
const czzn = req.cookies.czzn;

const session = await stripe.checkout.sessions.create({
  mode: 'subscription',
  line_items: [{ price: 'price_123', quantity: 1 }],
  success_url: 'https://example.com/welcome',
  cancel_url: 'https://example.com/pricing',
  ...(czzn ? { metadata: { czzn } } : {}),
});
```

Ruby (stripe-ruby)

```ruby
# The click your site kept from ?czzn=... (for example in a cookie)
czzn = cookies[:czzn].presence

params = {
  mode: 'subscription',
  line_items: [{ price: 'price_123', quantity: 1 }],
  success_url: 'https://example.com/welcome',
  cancel_url: 'https://example.com/pricing'
}
params[:metadata] = { czzn: czzn } if czzn

session = Stripe::Checkout::Session.create(params)
```

Selling through Stripe Payment Links? Add the saved value to the link as `client_reference_id`, and Stripe passes it on to the checkout:

Payment Link

```text
https://buy.stripe.com/test_abc123?client_reference_id=<czzn value>
```

## Leave some subscriptions out

To stop a subscription earning commission (a fee or an add-on, for example), put `spark_commission: "none"` in the subscription's metadata. You can set it when you create the subscription, through `subscription_data.metadata` on the Checkout Session, or later:

Node (stripe-node)

```javascript
await stripe.subscriptions.update('sub_123', {
  metadata: { spark_commission: 'none' },
});
```

## Check it works

Open a creator's tracking link in a private window, check you land on your site with `czzn` in the address, and check out a subscription. Within a few minutes the paid invoice appears under **Spark! > Partners > Orders** with the invoice number and the commission. If it doesn't, check the webhook endpoint's recent deliveries in Stripe and that the Checkout Session's metadata carries `czzn`.

## Next Steps

[

### Refunds and Clawbacks

How refunds change a commission

Learn more



](https://chargezen.com/docs/spark/brand-guides/refunds-and-clawbacks)[

### How Commissions Are Credited

Share the click rule with your creators

Learn more



](https://chargezen.com/docs/spark/creators/how-commissions-are-credited)

### Related Articles

[

#### Testing Your Tracking

Check a click reaches a credited order



](https://chargezen.com/docs/spark/brand-guides/testing-tracking)[

#### Refunds and Clawbacks

What a refund does to a commission



](https://chargezen.com/docs/spark/brand-guides/refunds-and-clawbacks)[

#### Cookie Settings

Your attribution window



](https://chargezen.com/docs/spark/attribution/cookie-settings)

Was this page helpful?

Need more help? [Contact support](https://chargezen.com/docs/checkoutos/troubleshooting/support)
