> ## Documentation Index
> Fetch the complete documentation index at: https://docs.refairn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Refairn Integration Options: Connect Your SaaS Product

> Choose the right integration method to send customer and payment data to Refairn so referral attribution and commission calculation work automatically.

Refairn can only attribute referrals and calculate commissions when it knows who signed up and who paid. That means your SaaS product needs to send two core signals: a customer creation event when someone registers, and a payment event when a subscription or one-time charge succeeds. Without those signals, Refairn has no way to close the loop between an agent's referral link click and a verified paying customer—and agents don't get paid for work they actually did.

There are four ways to send that data, ranging from a fully automated API integration to a manual CSV upload. Choose the method that matches where you are in your launch and your team's technical capacity.

<Note>
  Refairn does **not** crawl your SaaS dashboard, read your database, or use screen-scraping techniques to pull customer or payment data. Every integration method in this section is structured, explicit, and permission-based. This keeps your data secure, your integration stable, and the attribution record trustworthy—for you and your agents.
</Note>

## Integration methods

<CardGroup cols={2}>
  <Card title="API Integration" icon="code" href="/integrations/api-integration">
    Send customer and payment events directly from your backend using the Refairn REST API. The most flexible and real-time method.
  </Card>

  <Card title="Payment Providers" icon="credit-card" href="/integrations/payment-providers">
    Connect Stripe, Paystack, Flutterwave, Paddle, or LemonSqueezy webhooks to Refairn. Minimal code required.
  </Card>

  <Card title="CSV Import" icon="file-csv" href="/integrations/csv-import">
    Upload a spreadsheet of customer and payment data manually. No code required—ideal for early validation.
  </Card>

  <Card title="Webhook Events" icon="bolt" href="/integrations/webhook-events">
    Full reference for all inbound event types, payload shapes, and authentication details.
  </Card>
</CardGroup>

## Comparing your options

| Method                        | Speed                      | Code required              | Best for                                         |
| ----------------------------- | -------------------------- | -------------------------- | ------------------------------------------------ |
| **API Integration**           | Real-time                  | Yes — backend changes      | Production-ready programs with full automation   |
| **Payment Provider Webhooks** | Real-time                  | Minimal — dashboard config | Teams already using Stripe, Paystack, or similar |
| **CSV Import**                | Manual — hours or days lag | None                       | Early validation, beta programs, one-off imports |

## Recommended approach

**Start with CSV import to validate your partner channel before you commit engineering time.**

Before building a technical integration, run your first cohort of agents manually. Upload a CSV of paying customers attributed to each agent, verify that commissions calculate correctly, and confirm that partner-sourced customers are retaining at the rate you expect. Once you've validated the model, graduate to the API or payment provider webhooks to automate attribution for your production program.

<Steps>
  <Step title="Validate with CSV import">
    Upload your first batch of customers manually. Confirm attribution, commission calculations, and agent dashboards are working as expected before investing in automation.
  </Step>

  <Step title="Connect your payment provider">
    Add Refairn as a webhook endpoint in Stripe, Paystack, or your payment provider of choice. Refairn will automatically attribute payments to the right agent from that point forward.
  </Step>

  <Step title="Add API events for signups">
    Fire the `customer-created` event from your signup flow so Refairn can attribute customers at the moment they register—before they pay—giving agents credit for the full customer journey.
  </Step>

  <Step title="Handle edge cases">
    Use additional API events for upgrades, downgrades, cancellations, and reactivations so commission calculations stay accurate across the full subscription lifecycle.
  </Step>
</Steps>
