Everything you need to integrate OfferTown into your platform
Get the WordPress plugin
Complete API documentation
Step-by-step setup
Integration Overview
OfferTown helps you track referrals from lead generation to paying customer. This guide shows how to install the WordPress plugin, use our API to fetch new leads hourly, and report conversions when leads become paying customers.
https://www.offertown.net/auth/sign-in
For WordPress plugin integration only
Example: trp_67759518e0eb2de0900bfd47dfc76e5e553581522...For API calls and external integrations
Example: tlp_a8f5c2d1b9e7f3a2c8d4e9f1a2b3c4d5e6f7a8b9...Important: Generate separate keys for different purposes. Use trp_ keys exclusively for WordPress, and tlp_ keys for API integrations.
tenant-referral-program folder to /wp-content/plugins/Go to Settings → Offertown in WordPress admin:
API Key: [Your WordPress API Key (trp_...)] API Base URL: https://offertown.net (auto-filled) Status: Connected ✓
✓ The plugin automatically detects your tenant ID from the API key and connects to production
For user dashboard/member areas:
[tenant_referral_widget]
Complete referral management widget with history and link generation
For signup/conversion pages:
[tenant_referral_signup]
Handles referral conversions from URLs like: yoursite.com/join/?ref_code=ABC123
New Workflow: Use the list endpoint with status=pending_verification to fetch new leads. This automatically verifies them in the background and makes them ready for conversion tracking.
curl -X GET "https://offertown.net/api/v1/admin/referrals?status=pending_verification" \ -H "Authorization: Bearer <YOUR_API_KEY>" \ -H "Content-Type: application/json"
How Auto-Verification Works:
GET /referrals/[id]) do NOT trigger auto-verification.verified status (which is processing internally for v1 API backward compatibility).processing status with a processing_started_at timestamp.verified (v1 API) or processing (internally).⚠️ Important: This feature requires the AUTO_VERIFY_ON_FETCH=true environment variable. If you're self-hosting, ensure this is set in your production environment.
For ongoing/automated fetching, you can also fetch leads that are being processed:
Note: The status "verified" has been renamed to "processing" for better semantic accuracy. For backward compatibility, V1 API will continue to accept "verified" and return it in responses until 2025-12-01.
curl -X GET "https://offertown.net/api/v1/admin/referrals?status=processing" \ -H "Authorization: Bearer <YOUR_API_KEY>" \ -H "Content-Type: application/json"
curl -X POST "https://offertown.net/api/v1/admin/referrals/48b48e96-2bec-4b87-a352-d0d329307212/convert" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"conversionValue": 99.99,
"currency": "EUR",
"externalTransactionId": "ORDER-2025-001",
"metadata": {
"monthlyValue": 99.99,
"planName": "Professional"
}
}'Referral IDs in the API are standard UUIDs without any prefix:
48b48e96-2bec-4b87-a352-d0d329307212{
"success": true,
"data": {
"results": [
{
"id": "48b48e96-2bec-4b87-a352-d0d329307212",
"referred": {
"email": "customer@example.com",
"name": "John Doe"
},
"referrer": {
"id": "352d9bb7-12eb-49b1-b426-c2aa77278dee",
"customerId": "USER_352D9BB712EB"
}
}
]
},
"meta": {
"timestamp": "2025-07-01T14:30:00.000Z",
"requestId": "req_abc123",
"version": "1.1"
}
}POST /api/v1/admin/referrals/48b48e96-2bec-4b87-a352-d0d329307212/convert
{
"conversionValue": 99.99,
"currency": "EUR",
"externalTransactionId": "ORDER-2025-001",
"metadata": {
"customerId": "CUST-12345",
"planName": "Professional"
}
}Track referrals through purchase completion:
Track trial-to-paid conversions:
Track leads to appointments:
Track referrals in your CRM:
{
"UF_REFERRAL_ID": "48b48e96-2bec-4b87-a352-d0d329307212",
"UF_REFERRER_ID": "USER_352D9BB712EB",
"TITLE": "Lead from John Doe referral",
"SOURCE_ID": "REFERRAL"
}