Refgrow

API Overview

Integrate and extend Refgrow programmatically.

Introduction

Refgrow provides a RESTful API that allows you to integrate affiliate tracking and management functionality directly into your applications. The API enables you to track conversions, manage affiliates, retrieve statistics, and automate workflows.

The API is organized around REST principles. All requests should be made over HTTPS, and most API actions return JSON-encoded responses. Error responses include descriptive messages to help identify issues.

Base URL

The base URL for all API requests is:

bash
https://refgrow.com/api/v1

Authentication

Authentication to the API is performed via API keys. Each request must include your API key in the Authorization header.

javascript
const headers = {
  'Authorization': 'Bearer YOUR_API_KEY',
  'Content-Type': 'application/json'
};

For more details on obtaining and using API keys, see the Authentication documentation.

Available Endpoints

Refgrow API provides several endpoint categories:

Program Management

EndpointMethodDescription
/api/v1/projects/:projectId/stripe-customer-referral-info/:stripeCustomerIdGETGet Stripe customer referral info for a project

Affiliate Management

EndpointMethodDescription
/api/v1/affiliatesGETList affiliates
/api/v1/affiliatesPOSTCreate affiliate
/api/v1/affiliates/:emailGETGet affiliate details by email

Tracking

EndpointMethodDescription
/api/v1/referralsGETList referrals
/api/v1/referralsPOSTCreate a referral

Coupons

EndpointMethodDescription
/api/v1/couponsGETList coupons
/api/v1/couponsPOSTCreate a coupon

Conversions Management

EndpointMethodDescription
/api/v1/conversionsGETList conversions (registrations and purchases)
/api/v1/conversionsPOSTCreate a new conversion
/api/v1/conversions/:idGETGet conversion by ID
/api/v1/conversions/:idPUTUpdate conversion by ID
/api/v1/conversions/:idDELETEDelete conversion by ID

Rate Limits

To ensure service stability, API requests are subject to rate limiting. Current limits are:

  • 100 requests per minute per IP address
  • 1000 requests per hour per API key

When a rate limit is exceeded, the API will return a 429 Too Many Requests response with a Retry-After header indicating when you can resume making requests.

Error Handling

The API uses conventional HTTP response codes to indicate success or failure of requests:

  • 2xx - Success
  • 4xx - Client errors (invalid parameters, authentication issues)
  • 5xx - Server errors

Error responses include a JSON object with error details:

json
{
  "error": {
    "code": "invalid_parameters",
    "message": "Missing required parameter: program_id",
    "status": 400
  }
}

Example Requests

Below is an example of how to make a request to track a conversion:

javascript
// Example Node.js code for creating a conversion
const axios = require('axios');

async function createConversion() {
  try {
    const response = await axios.post('https://refgrow.com/api/v1/conversions', {
      customer_email: 'customer@example.com',
      amount: 49.99,
      referral_code: 'REF123'
    }, {
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      }
    });

    console.log('Conversion created:', response.data);
  } catch (error) {
    console.error('Error creating conversion:', error.response ? error.response.data : error.message);
  }
}

Next Steps

To learn more about specific API endpoints and functionality, explore these resources:

  • Authentication Guide - Detailed information on API authentication
  • API Endpoints - Complete reference for all available endpoints
  • Webhooks - Set up real-time notifications for events in your affiliate program
Start Free Trial
API Overview — Refgrow Docs