Skip to main content

Overview

The referral tools allow you to track and manage the complete referral lifecycle from initial click to conversion. All tools support both Markdown and JSON response formats.

Available Tools

ToolDescriptionPermission
affonso_list_referralsList referrals with filteringread:referrals
affonso_get_referralGet a single referral by IDread:referrals
affonso_create_referralCreate a new referral/clickwrite:referrals
affonso_update_referralUpdate referral statuswrite:referrals
affonso_delete_referralDelete a referraldelete:referrals

Referral Types

TypeDescription
CLICKInitial click on affiliate link
LEADSigned up but not converted
CONVERSIONCompleted purchase/signup
REJECTEDReferral was rejected
CANCELLEDReferral was cancelled

affonso_list_referrals

List and filter referrals across your program.

Parameters

page
number
default:"1"
Page number for pagination
limit
number
default:"50"
Results per page (max 100)
affiliateId
string
Filter by affiliate ID
type
string
Filter by type: CLICK, LEAD, CONVERSION, REJECTED, CANCELLED
startDate
string
Filter from date (ISO 8601)
endDate
string
Filter to date (ISO 8601)
responseFormat
string
default:"markdown"
Response format: markdown or json

Example Prompts

List all referrals
Show conversions from last month
List referrals for affiliate aff_abc123
Show all pending leads
Get referrals between January 1 and January 31

Response

## Referrals (Page 1 of 5)

### ref_abc123
- **Type:** CONVERSION
- **Affiliate:** John Smith (aff_123)
- **Customer:** [email protected]
- **Amount:** $99.00
- **Created:** Jan 15, 2024

### ref_def456
- **Type:** LEAD
- **Affiliate:** Jane Doe (aff_456)
- **Customer:** [email protected]
- **Created:** Jan 14, 2024

---
Showing 2 of 50 referrals

affonso_get_referral

Get detailed information about a specific referral.

Parameters

id
string
required
The referral ID (starts with ref_)
responseFormat
string
default:"markdown"
Response format: markdown or json

Example Prompts

Get referral ref_abc123
Show details for referral ref_xyz789
What's the status of referral ref_pending123

Response

## Referral: ref_abc123

| Field | Value |
|-------|-------|
| Type | CONVERSION |
| Affiliate | John Smith (aff_123) |
| Customer | [email protected] |
| Amount | $99.00 |
| Commission | $9.90 |
| Source | Direct Link |
| Created | Jan 15, 2024 |

### Timeline
1. **Click** - Jan 15, 2024 10:00 AM
2. **Lead** - Jan 15, 2024 10:05 AM
3. **Conversion** - Jan 15, 2024 10:15 AM

affonso_create_referral

Create a new referral, typically representing a click or initial tracking event.

Parameters

affiliateId
string
required
The affiliate ID for this referral
type
string
default:"CLICK"
Referral type: CLICK, LEAD, CONVERSION
customerEmail
string
Customer’s email address
amount
number
Transaction amount in cents (for conversions)
externalId
string
Your system’s reference ID
metadata
object
Additional custom data
responseFormat
string
default:"markdown"
Response format: markdown or json

Example Prompts

Track a click for affiliate aff_abc123
Create a conversion for aff_xyz with amount $150
Record a lead from [email protected] for affiliate aff_123
Create a referral with external ID "order_12345"

Response

## Referral Created

| Field | Value |
|-------|-------|
| ID | ref_new123 |
| Type | CLICK |
| Affiliate | John Smith (aff_abc123) |
| Created | Jan 15, 2024 |

The referral is now being tracked.

affonso_update_referral

Update an existing referral’s status or information.

Parameters

id
string
required
The referral ID to update
type
string
New referral type
amount
number
Updated transaction amount in cents
customerEmail
string
Updated customer email
responseFormat
string
default:"markdown"
Response format: markdown or json

Example Prompts

Convert referral ref_abc123 to a conversion with amount $99
Update referral ref_xyz to type LEAD
Change the amount on referral ref_123 to $150
Mark referral ref_456 as rejected

Response

## Referral Updated

**ref_abc123** has been updated:
- Type: LEAD → CONVERSION
- Amount: $0.00 → $99.00

A commission will be calculated automatically.

affonso_delete_referral

This is a destructive operation. The referral and associated data will be permanently deleted.

Parameters

id
string
required
The referral ID to delete
responseFormat
string
default:"markdown"
Response format: markdown or json

Example Prompts

Delete referral ref_abc123
Remove referral ref_test456

Response

## Referral Deleted

Referral **ref_abc123** has been permanently deleted.

Common Workflows

Track a Complete Conversion

1. "Create a click referral for affiliate aff_abc123"
2. "Update referral ref_xxx to type LEAD with email [email protected]"
3. "Convert referral ref_xxx with amount $99"

Analyze Affiliate Performance

"List all conversions for affiliate aff_abc123 from last month"
"Show me the referral funnel for aff_xyz - how many clicks vs conversions?"

Error Handling

ErrorCauseSolution
NOT_FOUNDReferral ID doesn’t existVerify the ID is correct
INVALID_AFFILIATEAffiliate ID not foundCheck the affiliate exists
INVALID_TRANSITIONInvalid status changeCheck allowed type transitions
PERMISSION_DENIEDMissing required scopeCheck your API key permissions