LostChurn Docs
Integrations

Salesforce Integration

Sync recovery data with Salesforce for enterprise CRM workflows and reporting.

LostChurn integrates with Salesforce to sync customer and recovery data into your org. Contacts, Accounts, Opportunities, and custom objects are kept in sync so your sales and success teams have full visibility into payment recovery.

Prerequisites

  • A Salesforce org (any edition: Essentials, Professional, Enterprise, or Unlimited)
  • System Administrator profile or a user with "Manage Connected Apps" permission
  • A LostChurn account with at least one active payment processor connected

LostChurn supports both Production and Sandbox Salesforce orgs. Choose your environment when connecting.

Connection Steps

OAuth Setup

  1. In your LostChurn dashboard, navigate to Settings > CRM.
  2. Click Connect Salesforce.
  3. Select your environment: Production or Sandbox.
  4. You will be redirected to Salesforce's OAuth login page. Sign in with your admin credentials.
  5. Review the requested permissions and click Allow.
  6. You are redirected back to LostChurn with a confirmation showing your Salesforce org ID and org name.

LostChurn registers as a Connected App in your Salesforce org. The following OAuth scopes are requested:

  • api — REST API access for CRUD operations
  • refresh_token — offline access for background sync
  • custom_permissions — access to custom objects

What Gets Synced

Contacts

LostChurn syncs customer data to Salesforce Contacts, matched by email address.

LostChurn FieldSalesforce FieldDirection
Customer emailEmailPush
Customer nameFirstName / LastNamePush
Monthly recurring revenueLostChurn_MRR__c (custom)Push
Recovery countLostChurn_Recovery_Count__c (custom)Push
Churn risk scoreLostChurn_Churn_Risk__c (custom)Push
LostChurn customer IDLostChurn_ID__c (custom)Push

Accounts

If a customer's email domain matches an existing Account, LostChurn links the Contact to that Account. Otherwise, a new Account is created using the domain name.

Opportunities

Successful recoveries create Opportunities in Salesforce:

  • Record Type: Recovery
  • Name: Recovery - {customer_email} - {date}
  • Amount: Recovered payment amount
  • Stage mapping:
    • Recovery Started → Prospecting
    • Retry In Progress → Negotiation/Review
    • Recovery Succeeded → Closed Won
    • Recovery Exhausted → Closed Lost
  • Close Date: Set to the recovery completion date

Custom Object: LostChurn_Recovery__c

LostChurn installs a custom object to store detailed recovery data:

FieldAPI NameType
Recovery IDRecovery_ID__cText (External ID)
StatusStatus__cPicklist
Decline CodeDecline_Code__cText
Decline CategoryDecline_Category__cText
Retry CountRetry_Count__cNumber
Recovered AmountRecovered_Amount__cCurrency
Started AtStarted_At__cDateTime
Completed AtCompleted_At__cDateTime
ContactContact__cLookup(Contact)
OpportunityOpportunity__cLookup(Opportunity)

This object is created automatically when you connect Salesforce. You can click Install Custom Objects in Settings if it was not created during initial setup.

Platform Events

LostChurn publishes Salesforce Platform Events (LostChurn_Recovery_Event__e) for real-time triggers. Use these in Salesforce Flows, Process Builder, or Apex triggers:

  • Recovery_ID__c — The LostChurn recovery ID
  • Event_Type__c — One of: started, succeeded, failed, exhausted
  • Customer_Email__c — The customer's email address
  • Amount__c — The payment amount
  • Decline_Code__c — The decline reason code

Sync Behavior

Event-Driven Sync

Updates are pushed to Salesforce in real time as recovery events occur. Salesforce API calls are batched when multiple events occur within a short window to optimize API usage.

Batch Sync

Trigger a full sync from Settings > CRM > Salesforce > Re-sync All. For orgs with large data volumes, LostChurn uses the Salesforce Bulk API 2.0 to process records efficiently.

Conflict Resolution

  • Recovery fields: LostChurn always wins (MRR, recovery count, churn risk)
  • Sales fields: Salesforce always wins (Owner, Stage overrides, custom sales fields)
  • Contact fields: Configurable per-field in Settings > CRM > Salesforce > Field Mapping

API Limits

LostChurn is designed to work within Salesforce's API limits:

Salesforce EditionDaily API LimitLostChurn Usage
Essentials15,000Batched to minimize calls
Professional75,000Batched to minimize calls
Enterprise150,000Batched to minimize calls
Unlimited300,000Batched to minimize calls

LostChurn monitors your org's remaining API calls and throttles sync operations if you approach 80% of your daily limit. You can configure the throttle threshold in Settings.

Monitoring

View sync status at Settings > CRM > Salesforce:

  • Org info: Org ID, org name, environment (Production/Sandbox)
  • Last sync: Timestamp of the most recent successful sync
  • Records synced: Contacts, Opportunities, and Recovery records synced
  • API usage: Current API call count vs. daily limit
  • Errors: Failed syncs with error details and retry options

Disconnecting

  1. Go to Settings > CRM > Salesforce.
  2. Click Disconnect.
  3. Choose whether to:
    • Keep custom fields and objects in Salesforce
    • Remove all LostChurn custom metadata
  4. Confirm the disconnection.

Removing custom objects will delete all LostChurn_Recovery__c records in your Salesforce org. This action cannot be undone.

Troubleshooting

"INVALID_SESSION_ID" error

Your Salesforce session has expired. Go to Settings > CRM > Salesforce and click Reconnect to re-authorize.

Custom object not created

  1. Go to Settings > CRM > Salesforce
  2. Click Install Custom Objects
  3. Ensure the connecting user has "Customize Application" permission

Duplicate Contacts

LostChurn matches contacts by email. If you have duplicate contacts in Salesforce with the same email, LostChurn updates the first match returned by Salesforce. Consider using Salesforce's built-in duplicate management rules to merge duplicates.

Next Steps

On this page