New Quote From SalesForce - Input Parameters

TagData TypeDescriptionRequiredComments
domainNameString (50)Name of the domain.Yes
sessionIdString (100)SalesForce session Id.Yes
sfAPIUrlString(100)SalesForce API Url. This parameter is actually the apiPartnerURL parameter that is sent in the SAP CPQ IFRAME URL when users are directed from SFDCSalesforce.com to SAP CPQ during new quote creation. Step by step instructions how to obtain this parameters are added below this table. Yes
newQuoteXMLString(8000)Cart XML document.YesXML needs to arrive HTML encoded. Otherwise bad request message would be returned

Obtaining sfAPIUrl (apiPartnerURL) parameter

Log into your SFDC account. Edit the existing SAP CPQ quote or click on “Add New” to create the new one. You are brought to the SFDC screen that loads SAP CPQ IFRAME. On that screen, right click the Salesforce header and choose “view source” as shown on the image below:

Figure 1 - View page source to find apiPartnerURL


In the source code window that will open, press ctrl+F to find the following string: “<iframe” (without quotes). There may be more than one IFRAME in the page source, look for the one that has a SAP CPQ URL in the “src” attribute, as shown on the image below (first highlighted row of text):

Figure 2 - Find an iframe


When you locate the SAP CPQ IFRAME, you will also see the apiPartnerURL parameter (second highlighted line of text in the screen above.). Copy it properly! The whole SRC of the IFRAME will look like below. You can extract two parameters from this src as we did.

<iframe  frameborder="0" height="1000" id="j_id1" name="j_id1" src="https://sandbox.webcomcpq.com/salesforce/SfLogin.aspx?sfauthUserID=nzagorac@calliduscloud.com&amp;apiPartnerURL=https://c.na9.visual.force.com/services/Soap/u/16.0/00DE0000000c5Vk&amp;apiSessionID=00DE0000000c5Vk!AQ4AQIN69C4Hl3Wmr1lVb313gCWBYDS9pEhRqYVokbi_D6joZyfcx7P0KtAFrmK4ydsXCirYoPQwMenHsh2JyYquls7BQqeK&amp;domain_name=CRM&amp;apiPass=Password&amp;action=New&amp;sfqpOpportunityID=006E000000DCfyc" title="Content" width="100%"></iframe>


Sample parameters:
apiPartnerUrl: https://c.na9.visual.force.com/services/Soap/u/16.0/00DE0000000c5Vk
apiSessionID: 00DE0000000c5Vk!AQ4AQIN69C4Hl3Wmr1lVb313gCWBYDS9pEhRqYVokbi_D6joZyfcx7P0KtAFrmK4ydsXCirYoPQwMenHsh2JyYquls7BQqeK


You can also find the apiSessionID in the same IFRAME src, look for the another portion of bolded text in the above example.
You will also notice that NewQuoteFromSF API method does not require username and password - just the domain. The username will be determined based on SF session ID provided. (So you need to log in to SFDC and perform the above steps to establish SF session, which will drive SAP CPQ user - this means that you need to use a SF login that does have a mapped SAP CPQ user in place.)
The rest of the API flow is just as if you called regular new quote API. The only difference is that you use salesforce for login, and that SAP CPQ will have SF session available in case it needs to talk to SAP CPQ during the new quote creation process.

if using new quote from SF, the created quote owner will be the very same user that is used to log in to SAP CPQ (user mapped from SFDC whose session ID you took).

Data Definition for New Quote From SalesForce input XML

Field NameDescriptionSample DataTypeSize
MarketCodeCode of the MarketUSDText25
ShippingMethodName of the Shipping methodFedEx International PriorityText100
ShippingPricePrice for the shipping method125Text10
TaxExemptTax Exempt. 1Boolean3
Possible values: True, False, 1, 0
CartCommentCart Comment Text1000
PromoCodePromo code Text50
CRM/[ApplyMappings]“1” for “Yes/True”TRUEUnsigned Byte
0 for “No/False” (Default if omitted)
CRM/OpportunityIdCRM Opportunity id892ADE6756HIXText50
CRM/OpportunityNameCRM Opportunity name“TEST OPPORTUNITY”Text250
QuantityItem Quantity1Text5
CatalogueCodeCatalog CodeA2223BText50
ItemPricePrice per one item100Text10
Attribute/NameAttribute nameSerialNumberText50
Attribute/ValueAttribute valueSN1234Text50
Property/NameProperty nameProject CodeText50
Property/ValueProperty Value555Text100
CustomerRoleType1 for Bill to1Unsigned Byte
2 for Ship to
3 for End user
IdID from SAP CPQ12345Text20
ExternalIdExternal ID (not from SAP CPQ)1Text20
FirstNameFirst NameHarryText100
LastNameLast NameBruceText100
CompanyCompany NameWebcomText100
Address1The first address8601 RR 2222 Text 100
Address2The second addressxxxText100
CityCityAustin Text100
StateAbbrevState (2 chars)TXText2
ZipCodeZip Code78730Text10
CountryAbbrevCountry (3 chars)USAText3
TerritoryNameTerritory NameNorth AmericaText100
BusinessPhonePhone Number Text100
BusinessFaxFax Number Text100
EMailEmail address Text100
CRMAccountIdCRM Contact ID Text100
CRMContactIdCRM Account ID Text100
Cart → PREVENT_EMPTY_QUOTEAttribute to prevent empty quote. This attribute is optional. Text100

Input XML Example

<?xml version="1.0" encoding="utf-8"?>
<Cart PREVENT_EMPTY_QUOTE="1">
  <MarketCode>USD</MarketCode>
  <ShippingMethod></ShippingMethod>
  <ShippingPrice>1</ShippingPrice>
  <TaxExempt>0</TaxExempt>
  <CartComment></CartComment>
  <PromoCode>A223344</PromoCode>
  <Crm ApplyMappings="1">
    <OpportunityId>892ADE6756HIX</OpportunityId>
    <OpportunityName>Test opportunity</OpportunityName>
  </Crm>
  <Items>
    <Item>
      <Quantity>1</Quantity>
      <CatalogueCode>A2223B</CatalogueCode>
      <ItemPrice>100</ItemPrice>
      <Attributes>
        <Attribute>
          <Name>ExampleName</Name>
          <Value>100</Value>
          <Value>101</Value>
        </Attribute>
      </Attributes>
    </Item>
    <Item>
      <Quantity>2</Quantity>
      <CatalogueCode>A4541V</CatalogueCode>
      <ItemPrice>120</ItemPrice>
      <Attributes>
        <Attribute>
          <Name>ExampleName</Name>
          <Value>100</Value>
        </Attribute>
        <Attribute>
          <Name>OtherExampleName</Name>
          <Value>161</Value>
        </Attribute>
      </Attributes>
    </Item>
  </Items>
  <Properties>
    <Property>
      <Name>GP Order Number</Name>
      <Value></Value>
    </Property>
    <Property>
      <Name>Project Code</Name>
      <Value></Value>
    </Property>
  </Properties>
  <Customers>
    <Customer CustomerRoleType="1">
      <Id></Id>
      <ExternalId></ExternalId>
      <FirstName>Harry</FirstName>
      <LastName>Bruce</LastName>
      <Company>Procter &amp; Gamble Company, The</Company>
      <Address1>Procter &amp; Gamble Plaza</Address1>
      <Address2></Address2>
      <City>Cincinnati</City>
      <StateAbbrev>OH</StateAbbrev>
      <ZipCode>45402</ZipCode>
      <CountryAbbrev>US</CountryAbbrev>
      <TerritoryName></TerritoryName>
      <BusinessPhone>(513) 698-6421</BusinessPhone>
      <BusinessFax>(513) 983-4381</BusinessFax>
      <EMail></EMail>
      <CRMAccountId>0036000000Kq8eU</CRMAccountId>
      <CRMContactId>0016000000F0qvQ</CRMContactId>
    </Customer>
    <Customer CustomerRoleType="2">
      <Id></Id>
      <ExternalId></ExternalId>
      <FirstName>Harry</FirstName>
      <LastName>Bruce</LastName>
      <Company>Procter &amp; Gamble Company, The</Company>
      <Address1>Procter &amp; Gamble Plaza</Address1>
      <Address2></Address2>
      <City>Cincinnati</City>
      <StateAbbrev>OH</StateAbbrev>
      <ZipCode>45402</ZipCode>
      <CountryAbbrev>US</CountryAbbrev>
      <TerritoryName></TerritoryName>
      <BusinessPhone>(513) 698-6421</BusinessPhone>
      <BusinessFax>(513) 983-4381</BusinessFax>
      <EMail></EMail>
      <CRMAccountId>0036000000Kq8eU</CRMAccountId>
      <CRMContactId>0016000000F0qvQ</CRMContactId>
    </Customer>
    <Customer CustomerRoleType="3">
      <Id></Id>
      <ExternalId></ExternalId>
      <FirstName>Harry</FirstName>
      <LastName>Bruce</LastName>
      <Company>Procter &amp; Gamble Company, The</Company>
      <Address1>Procter &amp; Gamble Plaza</Address1>
      <Address2></Address2>
      <City>Cincinnati</City>
      <StateAbbrev>OH</StateAbbrev>
      <ZipCode>45402</ZipCode>
      <CountryAbbrev>US</CountryAbbrev>
      <TerritoryName></TerritoryName>
      <BusinessPhone>(513) 698-6421</BusinessPhone>
      <BusinessFax>(513) 983-4381</BusinessFax>
      <EMail></EMail>
      <CRMAccountId>0036000000Kq8eU</CRMAccountId>
      <CRMContactId>0016000000F0qvQ</CRMContactId>
    </Customer>
  </Customers>
</Cart>
You are here: SAP Sales Cloud CPQ Online HelpSAP CPQ APINew Quote From SalesForce Web MethodNew Quote From SalesForce - Input Parameters