Step 1An affiliate shares their link
Every link points at https://shopslash.com/r/<code>. When someone clicks it we record the click, check the campaign's eligible markets, set a signed ss_ref cookie, and redirect to your destination URL with ?ss_ref=… appended.
https://yourapp.com/pricing?ss_ref=b2ZmZXI.9f3k2Xn7QpR4tVwZ
Step 2You capture the token at signup
Read ss_ref from the query string when the visitor lands and persist it — a cookie, session, or a column on your user row. Capturing it server-side is what makes attribution survive ad blockers and cleared cookies.
// wherever you handle signup
const ref = req.query.ss_ref ?? req.cookies.ss_ref;
await db.user.update({ where: { id: user.id }, data: { ssRef: ref } });Step 3You tell us it converted
Pick whichever fits your stack. All three land in the same place, so goal matching, budget caps and idempotency behave identically.
Conversion API — recommended
curl -X POST https://shopslash.com/api/v1/conversions \
-H "Authorization: Bearer sk_live_…" \
-H "content-type: application/json" \
-d '{
"ref": "<the ss_ref you stored>",
"event": "subscription.paid",
"externalEventId": "evt_123",
"externalCustomerId": "cus_123",
"externalSubscriptionId": "sub_123",
"plan": "price_pro_monthly",
"amountCents": 2900
}'Events: signup.verified, subscription.paid, subscription.renewed, subscription.canceled. externalEventId is your idempotency key — sending the same one twice is a safe no-op, so retry freely.
Stripe — zero code
stripe.checkout.sessions.create({
// …
metadata: { ss_ref: refFromSignup },
subscription_data: { metadata: { ss_ref: refFromSignup } }
})Then point a Stripe Connect webhook at https://shopslash.com/api/stripe/connect/webhook sending checkout.session.completed, invoice.paid and customer.subscription.deleted. That last one is what stops a recurring commission when a subscriber leaves.
MCP — for agents
{
"mcpServers": {
"shopslash": {
"url": "https://shopslash.com/api/mcp",
"headers": { "Authorization": "Bearer sk_live_…" }
}
}
}Tools: list_campaigns, campaign_performance, list_affiliates, recent_events, report_conversion.
Step 4We pay the affiliate from your funded budget
The commission accrues against your prepaid balance, waits out a refund hold, then joins a payout run. When you approve it, we transfer to the affiliate's own Stripe account. Because the budget is prepaid, there is nothing to charge at payout time and no chance of a commission you cannot cover.
OptionalDiscount the users your affiliates send
If a campaign offers a referral discount, look it up during signup and apply it in your own checkout.
GET https://shopslash.com/api/v1/referral/<ref>
Authorization: Bearer sk_live_…
→ { "valid": true, "discount": { "percent": 20, "durationMonths": 1 } }