This API fetches the field values of the proposal object that are required to create a proposal from an opportunity. You can use the fetched values to create a new proposal. 

APISignature
createProposalFromOpportunitywebService static Apttus_Proposal__Proposal__c createProposalFromOpportunity(Id opptyId, Id recordTypeId)



Request Parameter
NameTypeDescription
opptyIDIDThe ID of the opportunity you need to retrieve values from.
recordTypeIdIDRecord Type of the proposal object



Response  - Apttus_Proposal__Proposal__c
FieldTypeDescription
RecordTypeIdIDRecord Type of the proposal object
Apttus_Proposal__Proposal_Name__cStringThe name of the proposal.
Apttus_Proposal__Account__cIDThe Id of the account associated with the proposal.
Apttus_Proposal__Opportunity__cIDThe Id of the opportunity associated with the proposal.
Apttus_Proposal__Primary_Contact__cIDThe primary contact associated with the proposal.
Apttus_Proposal__Description__cStringThe description of the proposal.
Apttus_Proposal__Primary__cBooleanIndicates whether the proposal is the primary quote to update the related opportunity.
Apttus_Proposal__ReadyToGenerate__cBooleanIndicates whether the proposal is ready for generation.
Apttus_Proposal__ReadyToPresent__cBooleanIndicates whether the proposal is ready for presentation.
OwnerIdIDThe ID of the proposal object.
CurrencyIsoCodeStringThe currency defined for the proposal.


Code Sample

The sample code below enables you to retrieve the proposal field values of the opportunity associated with the ID that you provide. You can use the standard createRecord API to create the proposal.


/**
 * The below method demonstrates how to fetch the values proposal field values from an existing opporutnity
 */
public static Apttus_Proposal__Proposal__c createProposal(Id opportunityID) {
Apttus_Proposal__Proposal__c newProposalSO = new Apttus_Proposal__Proposal__c();
ID proposalRecordTypeID = [select ID FROM recordType where sObjectType='Apttus_Proposal__Proposal__c' AND Name = ‘Proposal’ LIMIT 1].Id;
newProposalSO = Apttus_Proposal.ProposalWebService.createProposalFromOpportunity(opportunityID, proposalRecordTypeID);
   	return newProposalSO;
}
CODE

Integration Details

Use the following information in your integrations with CPQ Web Services API. Refer to Integrating Conga with External Systems for information on how to get started.

API Prerequisites

None.

Response/Request XML

Example Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:prop="http://soap.sforce.com/schemas/class/Apttus_Proposal/ProposalWebService">
   <soapenv:Header>
      <prop:SessionHeader>
         <prop:sessionId>00DZ000000NAEIA!ASAAQKosATSpsGeD7FUh4RDI18xnzIFPe80Mk89ejrAmDrCBY2lmyJKQjKvuwj3TvT71r6g_epvbo6FeqKUPfmSookHTttOu</prop:sessionId>
      </prop:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <prop:createProposalFromOpportunity>
         <prop:opptyId>006Z000000Gr9OD</prop:opptyId>
         <prop:recordTypeId>012i00000001ECb</prop:recordTypeId>
      </prop:createProposalFromOpportunity>
   </soapenv:Body>
</soapenv:Envelope>
XML

Example Response

<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns="http://soap.sforce.com/schemas/class/Apttus_Proposal/ProposalWebService"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <createProposalFromOpportunityResponse>
            <result xsi:type="Apttus_Proposal__Proposal__c">
                <Id xsi:nil="true"/>
                <Apttus_Proposal__Account__c>001Z000001V13ovIAB</Apttus_Proposal__Account__c>
                <Apttus_Proposal__Opportunity__c>006Z000000Gr9ODIAZ</Apttus_Proposal__Opportunity__c>
                <Apttus_Proposal__Primary__c>false</Apttus_Proposal__Primary__c>
                <Apttus_Proposal__Proposal_Name__c>Auto_API_Opportunity</Apttus_Proposal__Proposal_Name__c>
                <Apttus_Proposal__ReadyToGenerate__c>true</Apttus_Proposal__ReadyToGenerate__c>
                <Apttus_Proposal__ReadyToPresent__c>true</Apttus_Proposal__ReadyToPresent__c>
                <CurrencyIsoCode>USD</CurrencyIsoCode>
                <OwnerId>0050U000000r444QAA</OwnerId>
                <RecordTypeId>012i00000001ECbAAM</RecordTypeId>
            </result>
        </createProposalFromOpportunityResponse>
    </soapenv:Body>
</soapenv:Envelope>
XML

Create Proposal

Use data from the Response to create the proposal. The following example uses the createRecord() method to create the Proposal object.

Example Request

<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:urn="urn:enterprise.soap.sforce.com"
    xmlns:urn1="urn:sobject.enterprise.soap.sforce.com"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <urn:SessionHeader>
            <urn:sessionId>00DZ000000NAEIA!ASAAQKosATSpsGeD7FUh4RDI18xnzIFPe80Mk89ejrAmDrCBY2lmyJKQjKvuwj3TvT71r6g_epvbo6FeqKUPfmSookHTttOu</urn:sessionId>
        </urn:SessionHeader>
    </soapenv:Header>
    <soapenv:Body>
        <urn:create>
            <urn:sObjects xsi:type="urn1:Apttus_Proposal__Proposal__c">
                <urn1:Apttus_Proposal__Proposal_Name__c>Auto_API_Opportunity</urn1:Apttus_Proposal__Proposal_Name__c>
                <urn1:Apttus_Proposal__Account__c>001Z000001V13ovIAB</urn1:Apttus_Proposal__Account__c>
                <urn1:Apttus_Proposal__Primary__c>false</urn1:Apttus_Proposal__Primary__c>
                <urn1:Apttus_Proposal__ReadyToGenerate__c>true</urn1:Apttus_Proposal__ReadyToGenerate__c>
                <urn1:Apttus_Proposal__ReadyToPresent__c>true</urn1:Apttus_Proposal__ReadyToPresent__c>
                <urn1:CurrencyIsoCode>USD</urn1:CurrencyIsoCode>
                <urn1:Apttus_Proposal__Opportunity__c>006Z000000Gr9OD</urn1:Apttus_Proposal__Opportunity__c>
                <urn1:Apttus_QPConfig__PriceListId__c>a1De0000001yPXQ</urn1:Apttus_QPConfig__PriceListId__c>
            </urn:sObjects>
        </urn:create>
    </soapenv:Body>
</soapenv:Envelope>

XML

Example Response

<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns="http://soap.sforce.com/schemas/class/Apttus_Proposal/ProposalWebService"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <createProposalFromOpportunityResponse>
            <result xsi:type="Apttus_Proposal__Proposal__c">
                <Id xsi:nil="true"/>
                <Apttus_Proposal__Account__c>001Z000001V13ovIAB</Apttus_Proposal__Account__c>
                <Apttus_Proposal__Primary__c>false</Apttus_Proposal__Primary__c>
                <Apttus_Proposal__Proposal_Name__c>Auto_API_Account</Apttus_Proposal__Proposal_Name__c>
                <Apttus_Proposal__ReadyToGenerate__c>true</Apttus_Proposal__ReadyToGenerate__c>
                <Apttus_Proposal__ReadyToPresent__c>true</Apttus_Proposal__ReadyToPresent__c>
                <CurrencyIsoCode>USD</CurrencyIsoCode>
                <OwnerId>0050U000000r444QAA</OwnerId>
            </result>
        </createProposalFromOpportunityResponse>
    </soapenv:Body>
</soapenv:Envelope>
XML