Read Quote API

The Read Quote API reads a quote from a CPQ quote ID.

Required Editions
Available in: Salesforce CPQ Summer ’16 and later
Formats

JSON, Apex

HTTP Method

GET

Authentication

Authorization: Bearer token

REQUEST

Parameter 1

Name: uid

Type: String

Required: Yes

Description: The ID of the quote to read

RESPONSE

Type

QuoteModel

Description

The representation of SBQQ__Quote__c data.

REST Examples 

1curl "https://YOURINSTANCE.salesforce.com/services/apexrest/SBQQ/
2ServiceRouter?reader=SBQQ.QuoteAPI.QuoteReader&uid=a0p610000040iumAAA" 
3-H "Content-Type: application/json" -H "Authorization: Bearer token" -X GET

An example response body after reading a quote. The actual response is a JSON formatted string.

1{
2    "record": {
3        "attributes": {
4            "type": "SBQQ__Quote__c", 
5            "url": "/services/data/v41.0/sobjects/SBQQ__Quote__c/a0p610000040iumAAA"
6        }, 
7        "Id": "a0p610000040iumAAA", 
8        "Name": "Q-00880"
9    }, 
10    "nextKey": 5, 
11    "netTotal": 300, 
12    "netNonSegmentTotal": 300, 
13    "lineItems": [
14        {
15            "record": {
16                "attributes": {
17                    "type": "SBQQ__QuoteLine__c", 
18                    "url": "/services/data/v41.0/sobjects/SBQQ__QuoteLine__c/a0l61000003u09UAAQ"
19                }, 
20                "Id": "a0l61000003u09UAAQ"
21            }
22        }
23    "lineItemGroups": [ ]
24}

Apex Examples 

Before saving the QuoteReader example class, make sure that the CPQ model classes are as individual Apex classes in your org.

1public with sharing class QuoteReader {
2    
3    public QuoteModel read(String quoteId) {
4        String quoteJSON = SBQQ.ServiceRouter.read('SBQQ.QuoteAPI.QuoteReader', quoteId);
5        return (QuoteModel) JSON.deserialize(quoteJSON, QuoteModel.class);
6    }
7}

For an example of the QuoteReader class, run the following code in anonymous Apex.

1QuoteReader reader = new QuoteReader();
2QuoteModel quote = reader.read('a0Wf100000J1vk1');
3System.debug(quote);