Integration Setup Guide 

Important
This page pertains to v1.37 of the Salesforce integration. If you last installed the Salesforce integration before 6th Jan 2020, it is likely that you are using a deprecated version of the integration (package v1.31 and below) that performs a contact-based mapping. To migrate to the current version, contact [email protected] .

Introduction 

Flexibility is one of the greatest strengths of Salesforce  and that's how you are able to effectively model your organization and its processes within Salesforce. Chargebee for Salesforce follows suit and offers a high level of adaptability to meet your workflows.

This page will help you understand what to look out for while setting up this integration and also see what configuration options are available for the integration and how to set them up.

Note

On connecting multiple sites

If you are connecting multiple Chargebee sites to the same Salesforce org, the considerations discussed on this page apply to all of them.

Note

Perform installation first

A lot of the customizations that the integration allows you to do can only be made once you have installed the Chargebee for Salesforce package in Salesforce. Finish the steps outlined in the installation guide and then return to this page to tune-up your integration.

Note

Changes aren't applied retrospectively

Unless otherwise specified, all changes made to the configuration are only applicable for newly synced records from the next sync onwards. Any previously synced records are not affected.

Note

Case-sensitivity for comparisons

Whenever field values are compared between Chargebee and Salesforce to find matching records, the comparison is performed in a case-sensitive or case-insensitive manner depending on the property set for the field in Salesforce. Eg. Email addresses are compared in a case-insensitive manner. Which means that [email protected] is treated the same as [email protected]


Syncing Customer Records 

Customer records in Chargebee are mapped and synced to accounts in Salesforce. The mapping is one-to-one, which means that any given customer or account record cannot participate in more than one customer-account relationship. Person accounts are supported too. Data can move in both directions: Chargebee-to-Salesforce and the other way around. We discuss each separately.

Chargebee-to-Salesforce 

The integration sync pushes new or changed Chargebee customer data to Salesforce. By default, this sync is configured to run manually but can be set to run automatically. This is useful if your customers sign-up for your subscriptions themselves because in such cases, the customer and their subscription information is created in Chargebee directly.

Salesforce-to-Chargebee 

If you have a sales-driven model, your sales team would be starting in Salesforce. They would work through opportunities or accounts in Salesforce and create Chargebee customers and subscriptions from them. Data is pushed from Salesforce to Chargebee according to the field-level mapping described, by default.

Syncing name, email and phone fields
The name, email and phone fields for the Chargebee customer are obtained from the CB Name, CB Email and Phone fields respectively of the Salesforce account. If any of these account fields are empty, the name, email or phone fields of the preferred contact (explained next) under the account is used. If no such contact exists, then no value for the field is pushed.

Information

Preferred Contact
From among the contacts attached to the account, the preferred contact is the one for which the Sync with Chargebee checkbox field is checked. If there are more than one such contact, the one that was updated last is deemed preferred. If no contact has the box checked, then the preferred one is the last updated contact from among all the contacts under the account.

Note

Sync Direction Override

Data push can be forced to be always in a particular direction at a field level. For such fields, the regular sync direction as described above is overridden.

See also

Chargebee Actions in Salesforce to see the various operations that push data from Salesforce into Chargebee.


Configuration 

The data exchange between Salesforce accounts and Chargebee customers is configured using the settings found under:

Settings > Third-party Integrations > Salesforce > Manage preferences > Sync Rules for Accounts

These settings are automatically presented when the integration is set up for the first time.

1. Choose customers you'd like to sync 

This setting applies to only those customer records that have never been synced to Salesforce.

Sync all customers

All customer records in Chargebee are synced to Salesforce.

Sync only customers with subscriptions

Only those customer records that have at least one subscription are synced to Salesforce.

2. Map customers from Chargebee to Salesforce 

Here you choose the fields in Chargebee (on the left) and Salesforce (on the right) that are used to find matches between customer records in Chargebee and accounts in Salesforce.

Note

This setting only determines the pair of fields used to find matches. It does not alter the field-mapping for actual data sync in any way.

The available fields are as follows:

Fields available in Chargebee
Phone
Email
Customer Id
Custom fields (except the following types: URL, timestamp, date-picker and checkbox)
Company
Fields available in Salesforce
Fields from the account object
Account Id
Name
Phone
Fields from the contact object
Contact Id
Email
Phone

How customers and accounts are matched when a contact field is chosen above

When a Salesforce contact object is chosen above, the mapping between account and customer objects is achieved as follows:

Chargebee-to-Salesforce
When a Chargebee customer record is to be synced to Salesforce:

  1. The contacts are looked up to find a match.
  2. If a match is found and if that contact is attached to an account, then the latter is deemed as the mapped account and action is taken as per setting 3.
  3. If a contact is not found in step 1 or no account is found to be attached at step 2, the account is deemed to be not found and action is taken as per setting 4.

Salesforce-to-Chargebee
When a Salesforce account is to be synced to Chargebee:

  1. The account is checked for a preferred contact.
  2. The contact found at step 1 is used to look for a matching customer in Chargebee. If found, the account and customer are mapped to each other and data is pushed from the former to the latter.
  3. If a contact is not found in step 1 or a Chargebee customer is not found in step 2, a new Chargebee customer is created and data is pushed to it from the account.
Information

Salesforce custom fields are not available out-of-the-box among the options above. Contact Chargebee Support  to add any.

3. Choose what happens when a customer in Chargebee has a matching ‘account' in Salesforce 

As described above, the integration sync pushes new or changed Chargebee customer data to Salesforce. This setting determines which standard Salesforce fields the data is pushed to each time the sync runs.

Override all fields

Push data to all standard fields in Salesforce accounts from Chargebee.

Update empty Salesforce Fields

Push data only to those standard fields in Salesforce accounts that are empty.

Do not override

Do not push any data to standard fields in Salesforce accounts.

Note

Skipping records
When the field used to find a match is empty, for a customer record, it fails to sync to Salesforce. You can use this to skip records from syncing: populate the field for a customer record once you know it should be synced to Salesforce. Remember that if lead lookup (explained next) is enabled for the integration, the email address field must also be left blank to guarantee that the record is skipped from syncing.

4. Choose what happens when a customer in Chargebee does not have a matching ‘account' in Salesforce 

When the sync runs as described above, it is possible that account matches are not found for certain customer records. This setting determines the behavior for such conditions.

Always create 'account' in Salesforce

Create a new account in Salesforce and sync data to it as per setting 3.

Note

Duplicate accounts

When choosing this option, beware of Chargebee customer records with duplicate values for the field chosen in setting 2. Duplicate records will not sync if Salesforce validation rules prevent duplication of account names.

Find and convert 'leads' to account

Chargebee looks up lead records using the email address for a match. If found, it is converted as Closed Converted. The account that results from the conversion is mapped to the Chargebee customer record.

Chargebee Support  if you want Chargebee to:

  • set the converted lead status to something different from Closed-Converted.
  • create an open opportunity upon conversion. This option is good to use in tandem with option 2.1.2 in the opportunity-subscription configuration.

Do nothing

Don't do anything.

5. Choose what you'd like to do if no matching ‘leads' are found in Salesforce 

This setting is available only when the option to convert leads is chosen in the previous setting. When a lead is not found, the following options are available:

Create account in Salesforce

Create a new account in Salesforce and sync data to it as per setting 3.

Note

Duplicate accounts

When choosing this option, beware of Chargebee customer records with duplicate values for the field chosen in setting 2. Duplicate records will not sync if Salesforce validation rules prevent duplication of account names.

Do nothing

Don't do anything.

6. Allow Chargebee to create ‘contacts' for ‘accounts' in Salesforce 

When accounts are created in Salesforce via setting 4 or 5, this setting determines whether a contact is also created.

See also

Contact field-map to see what contact fields are synced.

Person Accounts 

If you are a business that sells to consumers, then you may be using person accounts in Salesforce. By default, Chargebee is configured to work with business accounts only. Contact Support  to change this. You have the following options to choose from:

  1. Always use Business accounts. This is the default option and is used if you only sell to businesses.
  2. Always use Person accounts. This is good if you only sell to consumers.
  3. Use both Business and Person accounts.

How do I setup Chargebee to use person accounts?

  1. Enable person accounts in Salesforce. Use this guide  from Salesforce to see how.

  2. Contact Chargebee Support with the following information:

    • For options 2 and 3 above: the Salesforce record types that need to be set for person accounts and optionally, business accounts too.
    • For option 3 alone: Chargebee deems a given customer record as a business account when…
      • a. The company  field is populated.
      • b. Or a certain custom field is populated.

    Tell us which criteria (a or b) should be used and if you choose the latter, give us the API name of the Chargebee custom field.


Field-level Customization 

This sections explains what field-level customizations can be added as part of the integration. Chargebee Support  or your Sales or Customer Success rep to set them up.

Custom field-mapping 

Chargebee allows you to define additional field-mapping that overrides the standard field-map. You can map standard or custom fields in Salesforce objects to standard or custom fields in a Chargebee object.

Sync direction 

The sync for every pair of mapped fields happens in one direction only: either from Chargebee to Salesforce or the other way round. However, you can choose the direction you want the sync to happen for each pair of synced fields.

Skipping sync 

Any non-mandatory fields in Salesforce can also be skipped from the sync process. No data is synced between Chargebee and Salesforce for such fields.

Tagging records modified by Chargebee 

There is also the provision to pass a constant value to any field in Salesforce. This can be useful if you wish to tag object records modified or created by Chargebee.

Example

You can define a field named "Source" in the Contact object and have us configure the integration to populate it with say, "Chargebee" for all contacts created or updated by Chargebee.


Opportunities & Subscriptions 

How Salesforce opportunities interact with Chargebee subscriptions can be configured in Chargebee:


Chargebee Quotes in Salesforce 

A quote in Chargebee is a document used to let a potential buyer know how much the goods or services will cost before they commit to the purchase.

Again, this setting is seen when setting up the integration for the first time. After first-time setup, it can be found under:

Settings > Third-party Integrations > Salesforce > Manage preferences

Note
Any changes to the settings here are effective in Salesforce only after the next sync.

The following configuration options are available for Chargebee quotes in Salesforce:

Use Salesforce approval process for quotes

Enable this if you want the Send email operation for Chargebee quotes to be restricted until the quote is approved via a Salesforce approval process .

Attach a quote acceptance link in the emails sent from Salesforce

Enabling this option will include the quote acceptance link in the email body while composing it.


Auto Sync 

Once the integration has been setup, by default, the sync runs only manually using the Sync now button available under Settings > Third-party Integrations > Salesforce. If the Auto sync toggle is enabled, the sync is automatically run every hour.


Sync Date 

This date determines which records from Chargebee are synced to Salesforce.

Subscriptions, invoices and credit notes created or updated from the sync date onwards are synced to Salesforce. However, the integration syncs all customer records, plans, addons and coupons to Salesforce regardless of the sync date setting.

Note

Once set, this date cannot be changed from the Chargebee web interface. Contact Chargebee Support  to change it.


Other Considerations 

Mandatory Fields 

Fields in Chargebee that sync to mandatory fields in Salesforce must always be populated with values, failing which, sync errors would occur.

Note
  • The name field for accounts is a mandatory one. It is usually mapped to the company field of the Chargebee customer. However, if the company field is not filled in, the Id field of the customer is used.
  • The Last Name field is mandatory for a contact in Salesforce. If creating contacts (setting 6) is enabled for the integration, then in case the last name field is not filled for the Chargebee customer, an underscore ( _ ) is inserted for the Salesforce contact.

Data Validation 

If you use picklists for fields in Salesforce then there are chances of sync errors if the Chargebee data flowing in, does not conform to the picklist options.

Example

Say a field country is a picklist in Salesforce with "United States" as an option. If the data coming in from the mapped Chargebee field happens to be "USA", it results in a sync error.

It is recommended that you:

  • either ensure the synced fields on the Salesforce side are text fields and not picklists.
  • or, if the Salesforce-side field is a picklist and the Chargebee-side field is a custom field, then see if the latter can be made into a dropdown custom field.

Record Type 

If Chargebee should set a Record Type for synced records into Salesforce, then contact Chargebee Support  specifying the value that should be set for the Record Type Name field.

Considerations when using Account Hierarchy 

  • Account Hierarchy as a feature exists separately in both Salesforce  and Chargebee. You can sync an account hierarchy relationship that's set in Salesforce over to Chargebee.
  • When a Chargebee invoice or credit note is synced to Salesforce, it is linked to the account that corresponds to the invoice owner in the Account Hierarchy in Chargebee. For example, if say, Acme-Asia is invoiced for all charges incurred by Acme-India, then though a subscription shows up as related to Acme-India, the invoice for it (and any credit notes) would be related to Acme-Asia.
  • Also see notes under the following Chargebee actions in Salesforce:

Was this article helpful?
Loading…