> ## Documentation Index
> Fetch the complete documentation index at: https://gk-dev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Creator Guide

> Learn how to manage your affiliate program as a creator

<Frame>
  <img className="rounded-lg" src="https://mintcdn.com/gk-dev/9VqNyEZiLT_jC_hF/images/hero-dark.svg?fit=max&auto=format&n=9VqNyEZiLT_jC_hF&q=85&s=7bc4e7fb06d6eb9549267c2fc0dc5597" alt="Creator Dashboard Preview" width="700" height="320" data-path="images/hero-dark.svg" />
</Frame>

## Getting Started

<Card>
  As a creator, you can create and manage your own affiliate programs. This guide will help you understand how to:

  <CardList>
    * Create and configure affiliate programs
    * Manage your affiliates
    * Track performance and payments
    * Handle settings and customization
  </CardList>
</Card>

## Required Setup

<Steps>
  <Step title="Create an Affiliate Program">
    First, you'll need to create your affiliate program by setting up your commission structure and program details.

    <Note>
      This step is essential for having a foundation to invite affiliates.
    </Note>
  </Step>

  <Step title="Connect Your Stripe Account">
    Link your Stripe account to handle payments and transactions securely.

    <Warning>
      A valid Stripe account is required to process affiliate commissions.
    </Warning>
  </Step>

  <Step title="Subscribe to a Plan">
    Choose a subscription plan that matches your needs:

    * Number of affiliates
    * Commission structures
    * Advanced features

    <Tip>
      You can upgrade your plan anytime as your affiliate program grows.
    </Tip>
  </Step>
</Steps>

<Note>
  Complete all steps to fully activate your affiliate program and start inviting affiliates.
</Note>

## Creating a Program

<Steps>
  <Step title="Access Dashboard">
    Navigate to the Creator Dashboard
  </Step>

  <Step title="Create New Program">
    Click on the "Add New Program" button
  </Step>

  <Step title="Fill in Details">
    Configure essential information:

    * Program name
    * Commission rate
    * Payment currency
    * Program description
  </Step>

  <Step title="Launch Program">
    Click "Create Program" to start
  </Step>
</Steps>

<Note>
  Make sure to set a competitive commission rate to attract quality affiliates.
</Note>

## Managing Affiliates

### Viewing Affiliates

Access your affiliate list from the dashboard to:

* See all registered affiliates
* View individual performance metrics
* Monitor affiliate status (active/pending/inactive)
* Track clicks and conversions

### Affiliate Approval

New affiliates require your approval:

1. Go to the Affiliates section
2. Find affiliates with "Pending" status
3. Review their profile
4. Approve or reject their application

<Info>
  When a new affiliate applies to join your program:

  * You'll receive an email notification with the affiliate's details
  * The affiliate receives a confirmation email of their application

  After your decision:

  * The affiliate receives an email notification of approval/rejection
  * You receive a confirmation of your decision
</Info>

<Warning>
  Carefully review each affiliate to maintain program quality.
</Warning>

## Performance Tracking

<Tabs>
  <Tab title="Revenue Dashboard">
    <CardGroup>
      <Card title="Total Revenue" icon="chart-line">
        Track revenue generated by your program
      </Card>

      <Card title="Commissions" icon="money-bill">
        Manage commission payouts
      </Card>

      <Card title="Trends" icon="chart-mixed">
        Analyze sales trends
      </Card>

      <Card title="Top Affiliates" icon="trophy">
        Identify your best performers
      </Card>
    </CardGroup>
  </Tab>

  <Tab title="Analytics">
    <CardGroup>
      <Card title="Conversion Rate" icon="percent">
        Measure affiliate effectiveness
      </Card>

      <Card title="Click-through Rate" icon="mouse-pointer">
        Track link engagement
      </Card>

      <Card title="Revenue per Affiliate" icon="user-chart">
        Analyze individual performance
      </Card>
    </CardGroup>
  </Tab>
</Tabs>

## Payment Management

Handle affiliate payments efficiently:

1. Review pending payments
2. Verify completed transactions
3. Process payments through Stripe
4. Track payment history

<Note>
  Payments are processed automatically through Stripe Connect.
</Note>

## Program Settings

Customize your program settings:

### General Settings

* Program name and description
* Commission structure
* Payment thresholds
* Program rules

### Branding

* Custom landing pages
* Promotional materials
* Brand guidelines

## Best Practices

<CardGroup cols={2}>
  <Card title="Clear Communication" icon="messages">
    * Maintain regular contact
    * Provide clear guidelines
    * Respond promptly to queries
  </Card>

  <Card title="Fair Compensation" icon="money-check">
    * Competitive commission rates
    * Performance bonuses
    * Timely payments
  </Card>

  <Card title="Quality Control" icon="shield-check">
    * Monitor activities
    * Enforce rules
    * Maintain brand standards
  </Card>

  <Card title="Support Resources" icon="life-ring">
    * Marketing materials
    * Promotional tips
    * Technical support
  </Card>
</CardGroup>

## API Integration

### Script Installation

Add our tracking script to your website to automatically handle referrals:

```html theme={null}
<script 
  src="https://app.refindie.com/refindie.js" 
  data-refindie="YOUR_API_KEY">
</script>
```

### Features

The script automatically handles:

* Referral code tracking via URL parameters (`?ref=code`)
* Visit tracking and analytics
* Secure origin verification
* Stripe account linking
* Commission calculations

### Global Object

Once loaded, you can access referral data through the global object:

```javascript theme={null}
// Access referral data
const referral = window.AffiliationHubReferral;

// Available properties
console.log(referral.refCode);       // Current referral code
console.log(referral.stripeAccount); // Connected Stripe account
console.log(referral.apiKey);        // Your API key
```

### Stripe Integration

Include referral data in your Stripe Checkout sessions:

```javascript theme={null}
const session = await stripe.checkout.sessions.create({
  success_url: 'https://example.com/success',
  cancel_url: 'https://example.com/cancel',
  metadata: { 
    affiliationhub_referral: referral.refCode,
    affiliationhub_stripe_account: referral.stripeAccount 
  },
  line_items: [
    { price: 'price_xxx', quantity: 1 }
  ],
  mode: 'payment',
});
```

### Webhooks

Our system automatically processes the following Stripe webhook events:

* `checkout.session.completed`
* `payment_intent.succeeded`
* `charge.succeeded`
* `payout.created`
* `payout.paid`

<Note>
  Make sure your Stripe webhook endpoint is properly configured to receive these events.
</Note>

### Security

The script includes several security features:

* Origin verification for API calls
* API key validation
* Secure data transmission
* XSS protection

<Warning>
  Never expose your API key in client-side code. Always use environment variables.
</Warning>

## FAQ

<Accordion title="How do I change my commission rates?">
  You can modify commission rates in your program settings. Changes will apply to new transactions only.
</Accordion>

<Accordion title="Can I have multiple programs?">
  Yes, you can create and manage multiple affiliate programs with different commission structures.
</Accordion>

<Accordion title="How are payments processed?">
  Payments are processed automatically through Stripe Connect when they reach the payment threshold.
</Accordion>

## Support

Need help? Contact our support team:

* Email: [support@refindie.com](mailto:support@refindie.com)
* Discord: [Join our community](https://discord.gg/refindie)
* Documentation: [Technical docs](/api-reference)
