Skip to main content

Overview

Customer referrals allow your existing customers to become advocates for your product. Each customer gets a unique referral link they can share with friends.

Setting Up Customer Referrals

Step 1: Create a Referral Program

  1. Go to Programs → Create Program
  2. Select Referral Program
  3. Configure basic settings

Step 2: Define Rewards

Configure what customers earn for successful referrals:
Add credits to the customer’s account balance.
{
  "reward_type": "credit",
  "amount": 10,
  "currency": "USD"
}
Provide discount codes for future purchases.
{
  "reward_type": "discount",
  "amount": 20,
  "unit": "percentage"
}
Pay customers directly via PayPal or Wise.
{
  "reward_type": "cash",
  "amount": 25,
  "currency": "USD"
}

Step 3: Set Triggers

Define when rewards are granted:
TriggerDescription
signupWhen referred friend creates an account
purchaseWhen referred friend makes first purchase
subscriptionWhen referred friend subscribes

Creating Customers

Customers are created when they sign up for your product. Sync them with Partnero: Use integrations to sync customers automatically:

API Sync

Create customers via the API:
curl -X POST https://api.partnero.com/v1/customers \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "name": "Jane Doe",
    "key": "cust_123"
  }'

JavaScript SDK

Create customers from your frontend:
po('createCustomer', {
  email: '[email protected]',
  name: 'Jane Doe',
  key: 'cust_123'
});
Each customer automatically receives a referral link:
{
  "customer": {
    "key": "cust_123",
    "referral_code": "JANE20",
    "referral_url": "https://yoursite.com/?ref=JANE20"
  }
}
curl -X GET https://api.partnero.com/v1/customers/cust_123/referral_links \
  -H "Authorization: Bearer YOUR_API_KEY"
curl -X POST https://api.partnero.com/v1/customer_referral_links \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_key": "cust_123",
    "destination_url": "https://yoursite.com/signup"
  }'

Displaying Referral Info

Get Customer Stats

Retrieve referral statistics to display in your app:
curl -X GET https://api.partnero.com/v1/customers/cust_123/stats \
  -H "Authorization: Bearer YOUR_API_KEY"
Response:
{
  "total_referrals": 5,
  "successful_referrals": 3,
  "pending_referrals": 2,
  "total_rewards": 30.00,
  "currency": "USD"
}

Get Customer Balance

curl -X GET https://api.partnero.com/v1/customers/cust_123/balance \
  -H "Authorization: Bearer YOUR_API_KEY"
Response:
{
  "balance": 45.00,
  "currency": "USD",
  "pending": 10.00
}

Embedding Referral Widgets

Add a referral widget to your customer dashboard:
<div id="referral-widget"></div>

<script>
  po('renderReferralWidget', {
    container: '#referral-widget',
    customer_key: 'cust_123',
    theme: 'light',
    show_stats: true
  });
</script>

Managing Customers

List Customers

curl -X GET https://api.partnero.com/v1/customers \
  -H "Authorization: Bearer YOUR_API_KEY"

Update Customer

curl -X PUT https://api.partnero.com/v1/customers/cust_123 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Smith",
    "metadata": {"plan": "premium"}
  }'

Credit Customer Balance

Add credits to a customer’s account:
curl -X POST https://api.partnero.com/v1/customers/cust_123/balance/credit \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 10,
    "currency": "USD",
    "note": "Referral bonus"
  }'

Next Steps