When to use CSV import
Use CSV import when:- You are onboarding your first batch of agents and want to test the program before building a technical integration.
- Your SaaS does not yet have a development resource available to instrument the API.
- You need to backfill historical customers who converted before your integration was live.
- You are running a time-limited beta and do not want to build automation for a short-lived test.
CSV format
Your file must be a plain.csv (comma-separated values) file with a header row matching the column names below. Column order does not matter—Refairn matches by header name, not position.
Column reference
| Column | Required | Format | Description |
|---|---|---|---|
Customer Name | Yes | Text | The customer’s full name |
Customer Email | Yes | Valid email address | Used as the primary key for deduplication and attribution matching |
Plan | Yes | Text | The name of the subscription plan the customer is on |
Amount Paid | Yes | Number (no currency symbol) | The payment amount in your base currency. Example: 99 not $99.00 |
Subscription Status | Yes | active, cancelled, past_due, trialing | The current state of the subscription |
Agent Code | Yes | Text | The referral code of the agent who referred this customer. Must match an active agent in your program |
Payment Date | Yes | YYYY-MM-DD | The date the payment was confirmed |
Renewal Date | No | YYYY-MM-DD | The next expected renewal date. Leave blank for one-time payments or cancelled subscriptions |
Preparing your file
Export your customer data
Pull a list of paying customers from your billing system, CRM, or database. You need at minimum: name, email, plan, payment amount, and payment date.
Add agent codes
For each customer, identify which agent referred them and add that agent’s referral code in the
Agent Code column. You can find each agent’s code in Agents → [Agent Name] → Profile in your Refairn dashboard. If a customer was not referred by an agent, leave the Agent Code column blank—the row will be imported as an unattributed customer.Format dates
Ensure all dates in
Payment Date and Renewal Date are in YYYY-MM-DD format. For example, June 14, 2026 should be 2026-06-14. Dates in other formats (MM/DD/YYYY, DD-MM-YYYY, etc.) will fail validation.Format amounts
Remove currency symbols and thousand-separator commas from the
Amount Paid column. Use plain numbers: 99 or 1299.50, not $99 or 1,299.50.Check subscription status values
The
Subscription Status column accepts only: active, cancelled, past_due, or trialing. Correct any other values before uploading.Uploading your file
Navigate to the import screen
In your Refairn business dashboard, go to Customers → Import or Settings → Import. Click Upload CSV.
Select your file
Click Choose file and select the
.csv file you prepared. Refairn will preview the first five rows and highlight any column mapping issues.Review the preview
Check that Refairn has mapped each column correctly. If any column headers are unrecognized, a warning will appear—correct the header names in your file and re-upload.
What happens after upload
For each valid row in your file, Refairn:- Creates or updates a customer record using the
Customer Emailas the unique key. If the email already exists in your program, the existing record is updated rather than duplicated. - Assigns agent attribution based on the
Agent Codecolumn. If the code matches an active agent in your program, the customer is linked to that agent. - Creates a commission record using the
Amount Paidand your program’s commission rules. The commission is created inpendingstatus and moves toapprovedafter the configured hold period passes. - Sets subscription state from the
Subscription Statuscolumn. Cancelled subscriptions do not generate recurring commissions for future renewals.
Validation errors
If any rows in your file contain errors, Refairn will flag them and skip those rows. The import still processes all valid rows. After the import, download the error report to see exactly which rows failed and why.| Error | Cause | Fix |
|---|---|---|
Invalid email | Malformed or missing email address | Correct the email format in the row |
Unknown agent code | The Agent Code does not match any active agent | Verify the code in Agents → Profile or leave blank |
Invalid date format | Date is not in YYYY-MM-DD format | Reformat the date column |
Invalid amount | Amount contains non-numeric characters | Remove currency symbols and commas |
Invalid status | Subscription Status is not a recognised value | Use one of: active, cancelled, past_due, trialing |
Duplicate email on same date | A record with the same email and payment date already exists | Remove the duplicate row or update the existing record manually |
Limitations
CSV import is intentionally simple, and that simplicity comes with trade-offs:- Not real-time. Agent dashboards only reflect data as of your last upload. If you import weekly, agents see a week-old view of their commissions.
- Manual effort. Someone on your team must export data, prepare the file, and upload it on a regular cadence.
- No event history. CSV import creates snapshot records. Refairn does not receive lifecycle events (upgrades, downgrades, cancellations) between imports unless you include them in each new file.
- Attribution must be known. You must identify the correct agent for each customer yourself. With API integration, attribution is captured automatically at the moment the referral link is clicked.
When to graduate to API or webhooks
Move away from CSV import when:- You have confirmed that partner-referred customers convert and retain well enough to justify automation investment.
- You have more than a handful of active agents and manual attribution is becoming error-prone.
- Agents need real-time visibility into their commission pipeline to stay motivated.
- You want Refairn to capture customer lifecycle events (upgrades, cancellations, reactivations) automatically.