Payment providers
Connect Stripe
Set up Stripe tracking, pass the click ID and verify a credited purchase.
This guide connects your customer checkout to Slice. It is separate from the payment method you add in Billing and the bank details publishers add in Payouts.
1. Before you start
- Create your business, product and campaign in Slice. An owner or admin can change payment integrations.
- Open Payment providers, select the correct product and choose Test mode first. Each product and mode has its own connection.
- Access to the Stripe account that processes this product's purchases. Start with its sandbox or test mode.
- A developer who can add checkout metadata, unless you use supported Stripe Payment Links.
Choose one reporting path for each sale: a provider webhook connection or your own Conversions API integration. If your site already reports purchases to Slice, review it before enabling a second path; different order identifiers can produce duplicate sales.
2. Connect the provider
- In Stripe, select the account's sandbox/test mode and create an account-level restricted API key for Slice.
- Allow Read for Events, Checkout Sessions, Invoices, Charges, Disputes, Coupons and Promotion Codes; allow Read and Write for Webhook Endpoints. Slice does not need to create payments, payouts or discounts for tracking.
- In Slice, open Stripe, paste the matching rk_test_ or sk_test_ key and click Connect Stripe. Use the live equivalent only when setting up Live mode.
- Wait for the connection to confirm. Slice creates the webhook endpoint and stores the key encrypted. You do not need to create a second webhook manually.
Slice registers the following events automatically:
checkout.session.completed
checkout.session.async_payment_succeeded
invoice.paid
charge.refunded
charge.dispute.closed3. Pass the publisher's click ID
On your website, load slice.js on every landing page. It stores the visitor's sclid in the slice_click_id cookie. Your backend can read that cookie when creating checkout; in the browser, window.Slice.clickId() returns the same value after the script loads.
<script src="https://takeslice.com/slice.js" async></script>Metadata on the Checkout Session (one-time) or on the subscription (renewals). Keep the existing checkout configuration in the example below and add the attribution field; the snippets show the integration point, not a complete checkout. Only send an ID matching clk_ followed by 32 hexadecimal characters. Omit it if no valid click is available.
const clickId = request.cookies.get("slice_click_id")?.value ?? "";
// One-time payment
stripe.checkout.sessions.create({ /* ... */ metadata: { slice_click_id: clickId } });
// Subscription: put it on the subscription so every renewal is credited
stripe.checkout.sessions.create({ mode: "subscription", /* ... */ subscription_data: { metadata: { slice_click_id: clickId } } });- For one-time payments, use Checkout Session metadata. For subscriptions, include subscription_data.metadata so invoices can carry attribution; Slice also links later renewals to the first attributed payment.
- slice.js decorates standard buy.stripe.com Payment Links with client_reference_id. If a link already uses that field for another purpose, it is not overwritten; use a compatible checkout flow and verify attribution.
- Coupons and publisher-exclusive codes must exist in your Stripe checkout separately. Connecting Stripe does not create discounts.
4. Test delivery and attribution
- Open the product's test link on Slice's Tracking page. Use the resulting visitor session to complete a paid test checkout in the matching Stripe sandbox.
- In Payment providers, open Stripe and refresh to inspect the recent event. Confirm the conversion is attributed on Tracking; an event arriving alone does not prove a publisher was credited.
- Refund the test purchase in Stripe and check the refund result. A simulated event without a real matching checkout or click may be ignored or unattributed.
Connected means credentials were saved. A received event means a delivery reached Slice. Only an attributed conversion proves the sale was credited to a publisher. Use a test link and matching sandbox purchase for the full check; test conversions create no money.
5. Switch to Live
Return to the same product's Payment providers page and choose Live. Create the production connection separately with the production account, endpoint and credentials. Do not reuse a test click for a live purchase. Confirm the production checkout carries attribution before sharing live publisher links.
Troubleshooting
- Key rejected: use an account-level rk_test_/rk_live_ or sk_test_/sk_live_ key, not a publishable or organization key. Match the Slice mode to the key.
- Webhook creation failed: allow read and write access to Webhook Endpoints. For a failed backfill or metadata lookup, check the read permissions listed above.
- Connected but no credited sale: inspect the Checkout Session or subscription metadata, the test/live mode and the click's cookie window.
- No event in Slice: check the provider's delivery log, selected events and full HTTPS URL. Localhost cannot receive external webhooks without a public tunnel.
- No credited conversion: check the click ID, selected product, test/live mode, paid amount and currency. Slice currently supports EUR, USD and GBP.
- Disconnecting a webhook provider does not remove the endpoint from that provider's dashboard. Remove or disable it there too. Stripe endpoint removal is attempted automatically.
Official provider documentation
Provider instructions checked against the references below on 29 October 2026. Provider dashboards can change; the event names and attribution fields above describe what Slice currently handles.