Built for startups,
scaled for unicorns
Successfully submitted!
Error! Please try again
Salesforce is the backbone of enterprise sales operations, and your referral program data needs to live there alongside every other lead source. By integrating GrowSurf with Salesforce, you can automatically create leads tagged with referral source information, giving your sales team immediate visibility into which prospects were referred and by whom.
This guide covers building a GrowSurf-to-Salesforce lead sync pipeline. You'll learn how to create custom fields for referral data, set up automated lead creation from GrowSurf webhooks, configure lead assignment rules for referred leads, and build Salesforce reports to track referral lead performance through your pipeline.
Add custom fields to your Lead object in Salesforce to store referral program data from GrowSurf.
Referral_Source__c (Text) β set to "GrowSurf"Referred_By__c (Email) β the referrer's email addressReferral_Code__c (Text) β GrowSurf referral codeGrowSurf_Participant_ID__c (Text, External ID) β for deduplicationReferral_Date__c (Date) β when the referral was createdCreate a Salesforce Connected App to authenticate your webhook handler with the Salesforce REST API.
api and refresh_token scopesCreate an endpoint that receives GrowSurf webhook events and creates or updates leads in Salesforce via the REST API.
PARTICIPANT_CREATED and PARTICIPANT_REFERRED eventsPOST /services/data/v58.0/sobjects/LeadSet up Salesforce Lead Assignment Rules that route referred leads to the right sales reps or queues.
Referral_Source__c equals "GrowSurf", assign to your referral lead queue or specific repBuild a Salesforce report that tracks referral lead volume, conversion rates, and pipeline contribution.
Referral_Source__c = "GrowSurf"When a referred lead progresses through your Salesforce pipeline, update GrowSurf to trigger appropriate rewards and maintain data consistency.
POST /v2/campaign/{id}/participant/{participantId}/convert to mark the referral as converted// Create referred lead in Salesforce via REST API
const jsforce = require('jsforce');
const conn = new jsforce.Connection({
loginUrl: process.env.SF_LOGIN_URL
});
app.post('/api/growsurf-to-salesforce', async (req, res) => {
const { event, participant, referrer } = req.body;
await conn.login(process.env.SF_USERNAME, process.env.SF_PASSWORD + process.env.SF_TOKEN);
if (event === 'PARTICIPANT_REFERRED' || event === 'PARTICIPANT_CREATED') {
// Check for existing lead to avoid duplicates
const existing = await conn.query(
`SELECT Id FROM Lead WHERE GrowSurf_Participant_ID__c = '${participant.id}'`
);
if (existing.records.length === 0) {
const lead = await conn.sobject('Lead').create({
FirstName: participant.firstName || '',
LastName: participant.lastName || participant.email.split('@')[0],
Email: participant.email,
Company: participant.metadata?.company || '[Not Provided]',
LeadSource: 'Referral Program',
Referral_Source__c: 'GrowSurf',
Referred_By__c: referrer ? referrer.email : '',
Referral_Code__c: participant.referralCode,
GrowSurf_Participant_ID__c: participant.id,
Referral_Date__c: new Date().toISOString().split('T')[0]
});
console.log('Created Salesforce lead:', lead.id);
}
}
res.json({ success: true });
});Set the GrowSurf_Participant_ID__c field as an External ID in Salesforce. This lets you use Salesforce's upsert operation instead of separate create/update logic, automatically handling deduplication without extra code.
Use Salesforce's data enrichment tools or a third-party service like Clearbit to auto-fill company information on referral leads. GrowSurf captures email at minimum β enrichment adds company size, industry, and revenue data that helps your sales team prioritize.
Create Salesforce Flow alerts that notify sales managers when a referral lead comes from a target account or matches your ideal customer profile. Fast response times on high-quality referral leads significantly increase win rates.
Web-to-Lead is simpler but limited β it doesn't support custom field mapping or error handling. For a production referral program, the API integration gives you more control, better deduplication, and the ability to handle edge cases like updating existing leads.
GrowSurf may only capture an email address. Set fallback values: use the email prefix as Last Name and "[Not Provided]" as Company. Alternatively, collect these fields during GrowSurf sign-up by adding custom fields to your referral widget.
Yes. When you convert a Lead to a Contact and Opportunity in Salesforce, the custom referral fields can be mapped to corresponding fields on the Contact and Opportunity objects. Set up field mapping in Setup > Lead Settings > Map Lead Fields.
Trusted by marketing and product teams at fast-growing B2C, fintech, and SaaS companies
