# Affiliate Guide Source: https://docs.refindie.com/affiliate-guide Quick start guide for affiliates joining programs # Affiliate Guide Join affiliate programs and start earning commissions. ## Finding Programs (Coming Soon) We’re building a better way to discover programs on Refindie. For now, join via creators’ public landing pages. ## How It Works * Apply to a program from its landing page * Get approved by the creator * Receive your unique referral links * Share links and earn commissions on sales you drive ## Getting Your Links After approval, log into your affiliate dashboard to copy your referral links. Share them on your content and channels. ## Promotion Codes If the creator enabled coupons, you can also share a discount code instead of a link. Customers who use your code get a discount, and the sale is credited to you automatically. ### Create Your Code 1. Open the program > Coupons 2. Enter a code (e.g. `JOHN20`) — 3–30 characters, letters, numbers, underscores or hyphens 3. Create the code and share it with your audience You can have one code per program. The page shows the program's discount and how long your code stays valid. If coupon tracking isn't enabled, ask the creator to turn it on in their program settings. ### Managing Your Code * Copy your code from the Coupons page to share it * Deactivate it at any time if you no longer want it used Sales made with your code — including recurring renewals — are tracked and commissioned just like referral links. ## Promoting Effectively Focus on products that match your audience. Be transparent about affiliate links and provide value in your recommendations. ## Tracking & Earnings Use your dashboard to track clicks, conversions, and commissions. Payouts are handled by creators according to their policies. ## Support For program-specific questions, contact the creator. For technical issues, email [support@refindie.com](mailto:support@refindie.com). # Managing Your Affiliate Program Source: https://docs.refindie.com/creator Guide for creators managing affiliate programs and affiliates # Managing Your Affiliate Program Manage affiliates, track performance, and optimize your program. ## Dashboard Overview ### Main Sections * Programs: View and edit your affiliate programs * Affiliates: Manage affiliate applications and performance * Transactions: Monitor sales and commission tracking * Analytics: Track program performance metrics ## Managing Affiliates ### Review Applications 1. Go to Affiliates > Pending 2. Review each application 3. Check applicant's background and audience 4. Approve or reject with comments ### Enable/Disable Affiliates * Activate or pause individual affiliates at any time * Add internal notes for your team ### After Approval * Affiliate receives welcome email * Access to referral links and materials * Dashboard access for performance tracking ## Program Settings * Commission structure (percentage or fixed) * Commission rates * Cookie duration * Minimum payout threshold (manual payouts) * Program status: Active / Inactive ## Promotion Codes (Coupons) Let affiliates promote your product with a discount code instead of (or in addition to) a referral link. When a customer checks out with an affiliate's code, the sale is automatically attributed to that affiliate — no link click required. ### Requirements * Your program must be connected to Stripe (Stripe Connect). Coupons are created on your connected Stripe account. * If no Stripe account is connected, saving coupon settings has no effect. ### Enable Coupons 1. Open your program > Affiliate > Coupon Settings 2. Set Enable coupon tracking to Yes 3. Set the Discount percentage (1–100%) applied when a code is used 4. Set the Validity (months) — how long each affiliate code stays valid 5. Save On save, a single shared Stripe coupon is created for the program. Each affiliate later generates their own promotion code backed by this coupon. ### Changing the Discount * Re-saving without changes does nothing (no duplicate coupons are created). * Changing the discount percentage creates a new Stripe coupon and archives the old one. Codes that affiliates create after the change use the new discount. ### How Attribution Works * A customer applies an affiliate's code at checkout and gets the discount. * The sale (and recurring renewals) is credited to that affiliate as a commission, the same as a referral link. ## Performance Monitoring ### Key Metrics * Clicks and conversions * Revenue per affiliate * Top performers * Program growth ### Affiliate Performance * Individual affiliate statistics * Click and conversion tracking * Revenue generation * Commission calculations ## Payments (Manual) * Export transactions for accounting * Decide when affiliates reach your payout threshold * Execute payouts manually (e.g., Stripe transfers, bank, etc.) * Update payment status in your records ## Communication * Share program changes and promotions * Provide marketing materials * Send performance insights ## Troubleshooting * If affiliates aren’t converting: review rates, materials, and tracking * If engagement is low: improve communication and incentives ## Next Steps 1. Create your first program (program-creation) 2. Add tracking (setup-affiliationhub) to your website 3. Start recruiting affiliates (creator) ## Support * Email: [support@refindie.com](mailto:support@refindie.com) * See: Program Creation (program-creation) # Creating an Affiliate Program Source: https://docs.refindie.com/program-creation Step-by-step guide to create and configure your affiliate program # Creating an Affiliate Program Set up your affiliate program in minutes. ## Prerequisites * Website domain ready * Commission structure planned * Stripe account (recommended) or custom integration plan ## Step 1: Create Program 1. Go to Creator Dashboard 2. Click "New Program" 3. Fill in basic details: * Program name * Website URL * Description * Target audience ## Step 2: Configure Your Program ### Reward Type * Percentage: Commission based on sale amount (e.g., 15%) * Fixed: Fixed amount per sale (e.g., \$5 per referral) ### Commission Values * Commission percentage (if Percentage) * Fixed commission amount (if Fixed) ### Tracking & Attribution * Cookie duration (how long referrals are tracked) * Tracking script required on your site ### Program Status * Active / Inactive (temporarily pause your program) ### Payout Policy (Manual) * Minimum payout threshold (e.g., \$50) * Payout schedule (e.g., monthly) * Currency for payouts > Note: Payouts are handled manually. Use Stripe exports or your own accounting to pay affiliates. ## Next Steps After creating your program: 1. [Setup Refindie to your website](setup-affiliationhub) to your website 2. [Manage affiliates](creator) and monitor performance ## Support * Email: [contact@refindie.com](mailto:contact@refindie.com) # Adding Refindie to Your Website Source: https://docs.refindie.com/setup-affiliationhub Install tracking script and integrate with your payment system # Adding Refindie to Your Website Install tracking script and integrate with your payment system. ## Integration Steps ### 1. Add the tracking script Copy and paste the script below in the `` section of your website. **Script Parameters:** * `data-program-id` - Your affiliate program ID (required) ```html theme={null} ``` ### 2. Get referral data The script sets a global object with referral information: * `refindie_metadata.program_id` (string | number) * `refindie_metadata.ref_code` (string) * `refindie_metadata.is_new_visit` (boolean) ### 3. Send data during payment Include referral data in your payment API calls to attribute commissions. ## Integration Options ### Option 1: Stripe Connect (Recommended) 1. Connect your Stripe account in Settings > Integration 2. Pass the referral metadata to Stripe Checkout using the `metadata` field (exactly the object from `window.refindie_metadata`) ```typescript theme={null} const session = await stripe.checkout.sessions.create({ // ... your items and config mode: 'payment', metadata: window.refindie_metadata, }); ``` ```typescript theme={null} const session = await stripe.checkout.sessions.create({ // ... your items and config mode: 'subscription', metadata: window.refindie_metadata, // ⚠️ Must be here, NOT in subscription_data }); ``` **For subscriptions:** Always pass `window.refindie_metadata` in the checkout session's `metadata` field. Do **NOT** use `subscription_data: { metadata: window.refindie_metadata }` — this places metadata on the subscription object instead of the checkout session, which prevents commission tracking from working. * Professional payment processing * Commission tracking via Stripe metadata * Payment history and manual payout verification ### Option 2: Referral API Use the server-to-server endpoint when you use a custom payment provider or want to record a referral manually. * Endpoint: `POST /api/referral` * Headers: `x-api-key: ` * Body (JSON): * `ref_code` (string) * `program_id` (string | number) * `spent_amount` (number, in cents) * `currency` (string, e.g. "USD") * `transaction_id` (string, unique) ```typescript theme={null} await fetch("/api/referral", { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": process.env.NEXT_PUBLIC_REFINDIE_API_KEY!, }, body: JSON.stringify({ ref_code: window.refindie_metadata.ref_code, program_id: window.refindie_metadata.program_id, spent_amount: 5000, // amount in cents currency: "USD", transaction_id: "order_12345", // unique idempotency key }), }); ``` ## Implementation Examples ### React Component (Next.js) ```jsx theme={null} "use client"; const CheckoutButton = () => { const handleCheckout = async () => { try { const response = await fetch("/api/checkout", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ amount: 1000, currency: "eur", metadata: window.refindie_metadata, // ⭐️ Referral data }), }); const { url } = await response.json(); if (url) window.location.href = url; } catch (error) { console.error("Error:", error); } }; return ; }; ``` ### API Route (app/api/checkout/route.ts) ```typescript theme={null} import { NextResponse } from "next/server"; import Stripe from "stripe"; const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, { apiVersion: "2024-06-20", }); export async function POST(req: Request) { try { const { amount, currency, metadata } = await req.json(); const session = await stripe.checkout.sessions.create({ line_items: [ { price_data: { currency: currency, product_data: { name: "Product", }, unit_amount: amount, }, quantity: 1, }, ], mode: "payment", success_url: `${process.env.NEXT_PUBLIC_APP_URL}/success`, cancel_url: `${process.env.NEXT_PUBLIC_APP_URL}/cancel`, metadata: metadata, // ⭐️ Referral data }); return NextResponse.json({ url: session.url }); } catch (error) { return NextResponse.json({ error: "Payment error" }, { status: 500 }); } } ``` ## AI Assistant Prompt Copy this prompt into your AI assistant to implement this feature: ```` I need to integrate the Refindie affiliate tracking system into my website. Here's what I need to implement: 1. Add the tracking script to my website's section: 2. In my checkout/payment flow, include the referral data from window.refindie_metadata. Example implementation for payment: ```javascript const handlePayment = async () => { const response = await fetch('/api/checkout', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ amount: 1000, currency: 'eur', metadata: window.refindie_metadata // Include affiliate data }) }); } ``` Please implement this affiliate tracking integration on my website, making sure the referral data is properly passed to my payment system. ```` ## Tips and Help ### 💡 Important Tips * Add the script to all your pages to never miss a referral * Referral data is available as soon as the script is loaded * Test the integration in development mode before production * **Subscriptions:** The first payment is tracked via the checkout session metadata. Renewal payments are tracked automatically using the subscription ID — no extra work needed * **Never** put referral metadata in `subscription_data.metadata` — always use the checkout session's `metadata` field ### ✅ Verification To verify that the integration works, open your browser console and type `window.refindie_metadata`. You should see the referral data. ## Support If you encounter any difficulties, contact us at [contact@refindie.com](mailto:contact@refindie.com) or consult our documentation. * Email: [contact@refindie.com](mailto:contact@refindie.com) * Check our [Program Creation](program-creation) guide