# How does Salesforce CPQ (Configure, Price, Quote) integrate with Sales Cloud opportunities, products and pricebooks to streamline quoting?

**Topic:** Sales Cloud · **Difficulty:** Hard · **Asked at:** PwC, Capgemini, Slalom · **Tags:** Sales Cloud, CPQ, Quote-to-Cash

Read it on the site: https://www.forcechallenges.com/interview-questions/how-does-salesforce-cpq-configure-price-quote-integrate-with-sales-cloud-to-streamline-quoting

## Answer

**Salesforce CPQ** (Configure, Price, Quote) is a managed package (namespace `SBQQ`) that sits on top of Sales Cloud. It makes quoting faster, more accurate and consistent, using the same accounts, opportunities, products and pricebooks you already have.

**How it connects to Sales Cloud**
1. **Opportunity \u2192 Quote**: a rep creates a CPQ **Quote** (`SBQQ__Quote__c`) from an Opportunity. A deal can have several quotes, and one is marked **Primary**.
2. **Primary quote sync**: the primary quote is linked to the opportunity (`SBQQ__PrimaryQuote__c`), and its amount and, if enabled, its products sync back. This keeps pipeline and forecast reports based on real quote values.
3. **Product catalog**: CPQ uses standard **Product2** and **Pricebook** records, and adds **bundles**, **options**, **features**, and **product rules** so users only choose valid combinations.
4. **Pricing**: price rules, discount schedules, contracted prices and the quote calculation engine work out the net price automatically.
5. **Approvals**: discounts outside set limits can go through approval, using standard or Advanced Approvals.
6. **Documents**: quote templates generate a branded PDF to send to the customer.
7. **After the sale**: when the opportunity is marked **Contracted**, CPQ can create a **Contract** and **Subscriptions**, and an **Order**. It also supports **amendments** and **renewals**.

**Why it streamlines quoting**
- Less manual pricing, and fewer errors and invalid configurations.
- Consistent discount rules, with approvals only when needed.
- Faster quote turnaround, with all data kept in one system.
- Accurate pipeline and forecasts, and a clean handover to billing and renewals.

**Find the quotes for an opportunity**

```soql
SELECT Id, Name, SBQQ__Primary__c, SBQQ__NetAmount__c, SBQQ__Status__c
FROM SBQQ__Quote__c
WHERE SBQQ__Opportunity2__c = :opportunityId
ORDER BY CreatedDate DESC
```

**Custom pricing with the Quote Calculator Plugin (QCP)**
CPQ lets you add JavaScript hooks that run during calculation:

```javascript
export function onAfterCalculate(quote, lines, conn) {
    lines.forEach(line => {
        if (line.record['SBQQ__Quantity__c'] >= 100) {
            line.record['SBQQ__AdditionalDiscount__c'] = 5; // 5% volume discount
        }
    });
    return Promise.resolve();
}
```
Other hooks include `onInit`, `onBeforeCalculate`, `onBeforePriceRules` and `onAfterPriceRules`.

**Example:** a rep creates a quote for 150 licences plus a support bundle. Product rules add required items, price rules apply a partner discount, a volume discount is added by the plugin, and approval is requested because total discount is above 20%. After approval, the PDF is sent. When the customer accepts, the contract and subscriptions are created.

**Interview tip:** explain the flow *Opportunity \u2192 Quote \u2192 Primary sync \u2192 Order/Contract \u2192 Renewal*, and mention that product, price and approval rules are what make CPQ more than a quote form.

---
Source: ForceChallenges · last updated 2026-10-31
