Integration Guide

Get Started in Minutes

Follow these simple steps to integrate ReferralAny and start your affiliate program.

1

Create Your Account

Register as a merchant to get started

Visit the registration page and sign up as a merchant. You'll need to provide:

Company Name
Your business name
Email Address
For login & notifications
Password
Minimum 8 characters
Website URL
Optional but recommended
2

Create Your Program

Set up your affiliate program details

After logging in, navigate to Dashboard → Programs and click "Create Program".

Program Name
A descriptive name for your affiliate program
Commission Rate
Percentage or fixed amount per conversion
Cookie Duration
How long referrals are tracked (default: 30 days)
Description
Tell affiliates what makes your program great
3

Get Your API Key

Retrieve your credentials for integration

Navigate to Dashboard → Settings to find your API key. You'll need this for tracking conversions.

Keep Your API Key Secure
Never expose it in client-side code. Store it in environment variables on your server.
4

Install the SDK

Add tracking to your website

Add our tracking script to your website's <head> section:

<script src="https://www.referralany.com/sdk.js"></script>
<script>
  ReferralAny.init({
    apiKey: 'YOUR_API_KEY',
    baseUrl: 'https://www.referralany.com',
    debug: false  // Set to true for console logging
  });
</script>

How It Works

1Affiliate shares their referral link (e.g., yoursite.com?ref=ABC123)
2SDK automatically captures the ref parameter from URL
3Click is recorded and referral code stored in cookie
4Cookie persists for 30 days (configurable)
Automatic Click Tracking
The SDK automatically tracks clicks when visitors arrive via referral links. No extra code needed!
5

Track Conversions

Record successful sales and sign-ups

Recommended

JavaScript SDK

Track conversions when a purchase is made:

// Call this after a successful purchase
ReferralAny.trackConversion({
  orderId: 'ORDER_123',      // Required: unique order ID
  amount: 99.99,             // Required: order amount
  currency: 'USD',           // Optional: currency code
  customerEmail: 'user@example.com'  // Optional: for attribution
}, function(err, result) {
  if (err) console.error('Tracking failed:', err);
  else console.log('Conversion tracked:', result);
});

REST API

Send conversion data directly from your server:

POST https://www.referralany.com/api/conversions
Content-Type: application/json
X-API-Key: YOUR_API_KEY

{
  "externalId": "ORDER_123",
  "amount": 99.99,
  "currency": "USD",
  "referralCode": "ABC123",
  "customerEmail": "customer@example.com"
}

Use X-API-Key header for authentication. Get your API key from Dashboard → Settings.

Stripe Integration

Pass the referral code to Stripe Checkout:

// When creating Stripe Checkout Session
const session = await stripe.checkout.sessions.create({
  mode: 'payment',
  line_items: [...],
  success_url: 'https://yoursite.com/success',
  // Pass referral code for attribution
  client_reference_id: referralCode,
  metadata: {
    referralCode: referralCode
  }
});

Then set up webhook in Dashboard → Settings → Integrations.

Test Before Going Live
Enable debug mode in the SDK to see tracking logs in the browser console.
6

Invite Affiliates

Grow your affiliate network

There are several ways to invite affiliates to your program:

Share Registration Link

Share your unique program link from Dashboard → Programs:

https://referralany.com/join/YOUR_PROGRAM_ID

Email Invitation

Go to Dashboard → Affiliates → "Invite Affiliate" and enter their email.

Public Applications

Enable public applications in settings. Affiliates apply and you approve them.

Pro Tip
Set minimum payout thresholds to reduce transaction fees for both you and your affiliates.

You're All Set!

Your affiliate program is ready to go. Need help with anything?