This page is for a legacy version of the integration that maps Chargebee customers to contacts in Salesforce. The version was deprecated on 6th Jan 2020. If you haven't migrated to the latest version (with account-based mapping), please contact [email protected] .
Chargebee for Salesforce offers an elaborate configuration for how opportunities in Salesforce interact with subscriptions in Chargebee. For the purpose of this integration, opportunities in Salesforce can be for creating a new subscription in Chargebee, changing (upgrading or downgrading) an existing one or renewing the term for a subscription that has a finite billing period. It follows that a subscription can have more than one opportunity mapped against it over time, whereas an opportunity can be mapped to only one subscription.
The configuration for how opportunities and subscriptions work together has been designed keeping in mind that you may have a two kinds of workflows or a mix of both: a sales-driven approach or the self-serve approach.
The former involves your sales team creating opportunities in Salesforce after converting leads or for existing account. Upon winning these opportunities, customer records and subscription would be created in Chargebee. In other words, the customer life-cycle is initiated in Salesforce before moving into Chargebee. The configurations under Setting 1 are intended for such scenarios.
Your business may involve your customers signing up for your products and services themselves. This way, their life-cycle with your business is not initiated in a CRM like Salesforce and customer records and subscriptions are created directly in Chargebee. The configuration options under Setting 2 go along with such self-serve situations.
Of course, you may also have a hybrid approach where your customers have the option to manage their accounts themselves and are also engaged by your sales or customer success teams for upgrades etc.
To configure the settings, go to Settings > Third-party Integrations > Sales > Salesforce > Manage preferences > Sync Rules for Opportunities. The following settings would be available.
These settings are also shown when the integration is connected for the first time.
The settings seen here were updated on Nov 1, 2019. If your Salesforce integration was setup prior to that, then before making any changes to these new settings, contact Chargebee Support to take stock of any backend configurations that you may already have set up with us.
The settings in this section are intended for a sales-driven workflow. In other words, they apply to such subscriptions that are created/changed from a Salesforce opportunity. These include:
(disabled by default)
If you send checkout links to your customers then you may want Chargebee to automatically update the stage of the opportunity once the customer has subscribed. Enable this setting to make that happen. The opportunity stage set here is determined by setting 3.
(disabled by default)
Use this setting to update the opportunity products and price book to reflect the items in the subscription. Note that the opportunity products and price book are updated strictly as described here.
(disabled by default)
This option automatically creates (when the opportunity is for a new subscription) or updates (when the opportunity is for an existing subscription) subscriptions in Chargebee when opportunities are "won" in Salesforce.
So long as this setting is enabled, a subscription creation or update operation is triggered in Chargebee for any opportunity as soon as all of the following conditions are met for the opportunity:
Let's look at the mechanics of how — under this setting — the create/change subscription operation works:
Creating a subscription
A new subscription is created for opportunities for which products were added using Manage CB Products and choosing New Subscription under Manage Products for.
Before a new subscription can be created by this feature, among the contacts associated with the account, exactly one should have been synced with Chargebee. The subscription will be created against the Chargebee customer mapped to that contact.
A new subscription is created with the plan and addons that correspond to the opportunity products. It is recommended that the payment method be updated for the customer before attempting this operation or the operation will fail if the option to invoice immediately is chosen and auto-collection is on.
Updating a subscription
An existing subscription is updated for opportunities for which products were added using Manage CB Products and choosing Existing Subscription under Manage Products for.
The existing subscription status must be active, non-renewing or in-trial or this operation is not carried out.
The products of the subscription are replaced — via a change subscription operation — by those in the opportunity.
Updating a subscription from renewal opportunity
The existing subscription status must be active, non-renewing or this operation is not carried out.
A "renewal opportunity" is one that is created as described under setting 4.1 on this page. For such opportunities, the subscription is updated as follows:
1.3.1 Choose how you'd like to handle charges for subscriptions
This sub-setting determines whether the charges raised for the above action are invoiced immediately in Chargebee or added to unbilled charges.
The above operation for creating or updating subscriptions could fail, say due to the following reasons:
Such failures are logged as a record in the CB Logs object in Salesforce with the opportunity ID and a description of the failure. Retries are not automatically attempted in case of failures so you must use the Create/Change Subscription operation to complete the failed actions manually.
If your customers sign-up for subscriptions themselves, without your intervention, subscriptions would be created in Chargebee by other means and not via Salesforce. Such subscriptions would have no opportunity mapped to them when they are created. The settings in this section apply to such subscriptions.
These settings also apply for those subscriptions that are created from an account or contact without choosing an opportunity.
2.1.1 Always create a new opportunity (default)
A new opportunity is created and linked to the account mapped to the customer. The new opportunity is updated as follows:
2.1.2 Update an existing opportunity
Under the account mapped to the customer, Chargebee looks for open opportunities that are not already mapped to a subscription. It then updates the last created of such opportunities as follows:
18.104.22.168 If there are no open opportunities
This setting appears only when option 2.1.2, is chosen. So under option 2.1.2, if no opportunities are found, you have the choice to either Create a new opportunity (as described above in 2.1.1) or Do nothing.
2.1.3 Sync subscription without opportunity lookup
Neither creates nor updates opportunities when a subscription syncs to Salesforce for the first time.
(disabled by default)
When enabled, the option chosen for setting 2.1 is also applied for subscriptions that are in-trial, including cancelled subscriptions that have been reactivated with a trial period. The opportunity stage for in-trial subscriptions is chosen via setting 3.2.
You can decide what happens to opportunities when subscriptions are upgraded in Chargebee. A subscription is said to be upgraded when one or more of the following occur:
Though this setting is not applicable for subscriptions upgraded via Salesforce, the only exception is for those upgraded using the Change Subscription action in Salesforce. This setting does apply to such subscriptions.
The following options are available under this setting:
Create a new opportunity (default)
A new opportunity, linked to the same account as the customer, is created in Salesforce. Its opportunity products and price book are set as described here. The stage is set as per setting 3. You would use this option when you want to track every upgrade done in Chargebee as a full value opportunity in Salesforce.
Update existing opportunity
The opportunity to which the reference is found on the subscription is updated as described here and its stage is set as per setting 3. If no opportunity is linked to the subscription then nothing happens.
No changes are made to the linked opportunity and neither is any new opportunity created.
Set the opportunity stage for when opportunities in Salesforce are created/updated from subscriptions in Chargebee. This applies only when subscriptions are in active, non-renewing or paused status.
This is only applicable when setting 2.2 is enabled.
You may want the opportunities for in-trial subscriptions to be set to a different intermediate stage than the stage set for when they activate. Eg. you may have self-serve purchases where the subscription is in-trial when created in Chargebee. These customers may eventually update their payment method and their subscriptions will turn active. Chargebee in these cases can create an opportunity and keep it in an intermediate stage (say "Needs Analysis"). When the subscription turns active, it can move the opportunity to say, "Closed-Won".
Subscriptions can be termed. In other words, they can run for a finite number of billing cycles. When such subscriptions are near the end of their final billing cycle, your renewal sales teams would want to reach out to the customer for renewing the terms. Enable this feature to have Chargebee assist the renewal sales teams by creating renewal opportunities for such subscriptions.
After enabling this feature, you must contact Support to help schedule the Salesforce Apex job to make this feature work.
Once the feature has been enabled and you have scheduled the Apex job to make it work, renewal opportunities are created in Salesforce for all active and non-renewing subscriptions that meet all of the following criteria:
The opportunity products and price book for the above opportunities are updated as described here.
Performing a renewal
Once renewal opportunities have been created, you can open such an opportunity and carry out the renewal in two ways:
You can have the subscription contract renew itself automatically when the renewal opportunity is won. This is done via setting 1.3.
On the opportunity, click on Create/Change Subscription and replace the No. Of Billing Cycles field with the appropriate value (change the value as: current value + the number of billing cycles for the renewed term).
Once the renewal is completed, the opportunity reference is updated in the CB Subscription record.
Update existing opportunity (default)
Updates the stage of the opportunity referenced by the CB Subscription record, to the setting specified. Nothing happens if no opportunity is referenced by the subscription.
Do not perform any actions on opportunities when a subscription is cancelled.
Whenever Chargebee updates an opportunity from its related subscription, the following actions are performed:
Consider that the subscription has the following products:
At this point, if a linked opportunity is updated from the subscription, the opportunity would have the following opportunity products after the update: