Skip to main content

Sync Orders for Easy Reorders and Billing

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe the business value of cross-channel order synchronization.
  • Explain how CPQ-originated orders are synced to B2B Commerce orders.
  • Describe the process of bringing a B2B Commerce order to a Salesforce Billing invoice.
  • Identify advantages and disadvantages of the two payment processing methods.
  • Describe key pricing and taxation considerations when implementing cross-cloud order sync.

Get Your Orders in Order

Ursa Major Solar is happy that the connector makes it easy to start a sale in one channel, then pass it off to the other on demand. However, starting a sale is only half the battle. Ideally, carts and quotes should eventually turn into orders, and for Ursa Major they do. The problem is that each channel has its own data model for managing orders.

Data Model for Orders and CC Order, along with related objects.

Until the two channels are connected, B2B Commerce has no idea when CPQ creates an order, and vice versa. This disconnect has a few consequences:

  • Orders that originate from a CPQ quote don’t appear in the My Orders page of the B2B Commerce storefront, so buyers can’t reorder them like they would with entirely self-service orders.
  • Invoicing and payments are handled independently, so self-service buyers can’t make use of sophisticated billing options such as recurring or usage-based billing. Also, ERP integrations don’t have a single source of truth for invoicing and payment details.

The CPQ and B2B Commerce connector solves these problems by synchronizing order data between channels. Regardless of how an order is originally created, the connector generates its twin in the opposite channel. Starting with a CPQ order and syncing to a B2B Commerce order is often called reorder sync. Going from a B2B Commerce order to a CPQ order is called new order sync. Each has their own considerations, but reorder sync is much simpler, so we’ll start there.

Note

These use cases assume that the company is already synchronizing its primary product and pricing data.

Sync a CPQ Order to a B2B Commerce Order

Buyers appreciate having a self-service channel so they can order and reorder quickly without engaging a sales rep. But as you learned, they can’t reorder an order that originates from a CPQ quote. What they need is a CC Order record. Thankfully, with the help of the connector it’s easy to generate a CC Order record from known CPQ order details.

When a sale reaches the ordered phase, typically the order is activated at some point. This is a good time to trigger automation to check the Sync to B2B Orders field on the order. The connector package adds the Sync to B2B Orders field to the CPQ Order object, but you need to develop the automation to best fit your sales process.

Swim lane diagram of CPQ Order to CC Order handoff.

As with other connector functions, the sync is logged as a CPQB2B Log record.

Sync a B2B Commerce Order to a CPQ Order

When Salesforce Billing is part of a multi-cloud solution, any order that’s generated from a CPQ quote is more than just a tool for tracking commitments. The order is the connection point between CPQ and Billing, and it’s the basis for invoice generation. Furthermore, Billing creates detailed transactional data to support revenue recognition, financial reporting, and back-office functions such as accounts receivable and payment adjustments. This data is often used as the centralized billing integration point to the ERP.

The problem Ursa Major must solve is that CC Order records generated in the self-service channel are not connected to Salesforce Billing in any way. That means B2B order data can’t be shared with the ERP through the centralized integration point of Billing, and self-service buyers can’t benefit from powerful recurring and usage-based billing options. The good news is that the connector can help bridge this gap by using known CC Order data to create a twin CPQ Order record, which then connects to Billing. We recommend using the CPQ Order record as the bridge between B2B Commerce and Billing, and not to integrate them directly through customization.

Let’s take a close look at what the connector does when a buyer checks out a cart from the self-service storefront.

Step 1: Buyer enters payment details in B2B Commerce

In this scenario the storefront experience of entering payment details is exactly the same as the normal B2B Commerce checkout process. In the background, custom Apex code synchronizes the payment details with the Billing Payment Method object in Salesforce Billing. This allows Billing to handle payments later in the process.

Step 2: The CC Order is created and Sync to CPQ is checked

After B2B Commerce authorizes the payment method, it creates the CC Order record. It’s at this point that we use the Sync to CPQ field to tell the connector to create a twin CPQ Order. Usually an automated process selects Sync to CPQ, depending on what’s best for the business.

Step 3: The connector creates CPQ-related objects

When Sync to CPQ is selected, the connector creates these records in Sales Cloud and Salesforce CPQ, in this order:

  • An Opportunity record. The name is derived from the CC Order name, and the close date is set to the CC Order close date.
  • A Quote record with associated Quote Lines. The quote is tied to the opportunity through a lookup, and the connector automatically checks the Ordered checkbox.
  • An Order with associated Order Products. The order is tied to the quote through a lookup, and is also tied to the CC Order through the B2B Source Order lookup.

Step 4: The order is activated and contracted

From this point forward, the order is processed just like any other sale. It is activated, either manually or through automation. At the same time, for contracted orders, CPQ generates Subscription and Asset records related to the account.

Step 5: An invoice is generated

Salesforce Billing uses the CPQ Order record to generate an invoice with invoice lines. Typically the regular invoice scheduler picks up activated orders as appropriate, but you can also use the Bill Now checkbox to manually kick off invoice generation.

Step 6: Invoices are posted, payment is processed

The Billing payment scheduler posts invoices that meet filtered criteria, such as billing dates. This may include invoices created due to the connector order sync. Since the payment method is already captured from the first step, the payment settlement can occur when the scheduler runs, separate from authorization.

Since Salesforce Billing handles invoicing, you should replace the native B2B Commerce component for displaying invoices under My Invoices with a custom Lightning component that surfaces the invoices from Billing. We recommend that you do not synchronize invoice and payment details from B2B Commerce to Billing records so that Billing remains the single source of truth for invoicing details.

My Orders page with custom invoice display.

From the perspective of the buyer, the checkout experience is exactly the same. In the back end, the connector allows Billing to generate all of the important transactional data to be integrated with the ERP.

Choose the Right Payment Integration

There are two methods of handling payment integration when using the connector. The first results in what’s described above, where the buyer supplies payment details using the normal storefront process, and a Billing record captures those details. The second method is to use the hosted payment page from the Billing managed package. Both methods have advantages and disadvantages.


Default B2B payment connector Salesforce Billing hosted payment page

Advantages

No changes needed to the out-of-the-box payment gateway connector.

Checkout flow remains the same, syncing is done in the back end.

Better PCI compliance since it directly captures and tokenizes electronic payment details.

Disadvantages

Requires customization to sync payment details to Billing payment method record.

Requires customization to embed payment page into an iframe.

Limited branding and styling options.

Authorization and settlement happen in a single action.

Requires read access to Account objects for Customer Community users since payments are handled at the account level.

For most situations the default B2B payment connector is the recommended solution. However, the Salesforce Billing hosted payment page is ideal for recurring and usage-based billing since the tokenized payment details can be used for future payments.

Pricing and Tax Considerations

The price a buyer agrees to on their B2B Storefront order must match exactly what they’re billed for later, obviously. That means it’s critical that prices match between the self-service order and the quote, order, and invoice generated by the connector and CPQ. To that end, there are a few guidelines to keep in mind.

  • Disable discount schedules, price rules, and Quote Calculator Plugin functions in CPQ when the quote is generated from the connector. The B2B Source lookup field can distinguish these quotes.
  • B2B Commerce is limited to two decimal places of precision, so set all other applications to two decimal places as well.
  • Subscriptions in the storefront should be set up with a service layer extension that replicates the CPQ proration calculation. We recommend that you use the Monthly + Daily Prorate Precision setting for CPQ. Technically you can use the CPQ Quote API to override pricing in the B2B Commerce cart, but doing so may cause noticeable delays in the buyer’s storefront experience.

Finally, taxes must be calculated consistently, even though each package continues to use its own tax integration. Extend the connector as needed to synchronize tax-related data between clouds so that each tax integration returns the same amounts.

Summary

When Sales Cloud, B2B Commerce, Revenue Cloud, and Manufacturing Cloud are connected, everyone in the B2B sales process benefits. Buyers get a consistent experience from cart to payment, even when a sales rep generates a personalized quote for them. Price managers get a single system for managing products and prices. The back office gets centralized billing integration with their ERP, as well as easy-to-maintain service agreements. With the help of the connector and some customization work to extend its functionality for the nuances of your customer, you can transform a multi-cloud suite of products into a true Einstein 1 solution.

Resources

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities