This API cancels an order. The status of the order and its line items changes to Pending Cancellation and a new version is created. The status of the previous order is set to Being Cancelled. Please note the following:

  • If you decide to revert (undo) the cancelled order, the new order version is deleted and the previous order version shows Pending status.
  • If you decide to cancel the order, you must accept the cancellation of the order. After accepting the cancellation, a new version is created showing with Cancelled status for the order as well as its line items. In this case, the previous version shows the Superseded status for the order and its line items. 
For more information on how an order and its line items are affected when you cancel an order, refer to the Order Management on Salesforce User Guide.

API Details

APISignature
cancelOrderwebService static Apttus_Config2.CPQStruct.CancelOrderResponseDO cancelOrder(Apttus_Config2.CPQStruct.CancelOrderRequestDO)



Parameters
NameTypeDescription
request

Apttus_Config2.CPQStruct.CancelOrderRequestDO

The request data object.



Request Data Object - Apttus_Config2.CPQStruct.CancelOrderRequestDO
FieldTypeRequired?Description
orderIdIDYesUnique identifier of the order to be cancelled.


API Response

Response Data Object - CPQStruct.CancelOrderResponseDO
FieldTypeDescription
cancelOrderSOStandard Data Object The fields of the Cancel Order Object.

Code Sample

The following code sample allows you to cancel an order.

ID Orderid = 'a2n4C0000007NFpQAM';
Apttus_Config2.CPQStruct.CancelOrderRequestDO CancelRequest = new Apttus_Config2.CPQStruct. CancelOrderRequestDO(); 
CancelRequest.orderid=Orderid; 
Apttus_Config2.CPQStruct.CancelOrderResponseDO Cancel_Response = Apttus_Config2.OrderWebService.cancelOrder(CancelRequest); 
system.debug('OrderID_New_Version - '+Cancel_Response.CancelOrderSO.id); /**This ID should be passed While Processing Undo Cancel request **/
CODE

Integration Details

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

API Prerequisites

None.

Request and Response XML

Example Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ord="http://soap.sforce.com/schemas/class/Apttus_Config2/OrderWebService" xmlns:cpq="http://soap.sforce.com/schemas/class/Apttus_Config2/CPQStruct">
   <soapenv:Header>
      <ord:SessionHeader>
         <ord:sessionId>00D7A0000009QII!ARUAQFmpeBOmsYS2JcADxYc4PxWoOkAHJP1JiNo5vtvnDBCEvfnWWWmO7pqbEXY7WadiCmm_Vib6MjhmgUbR8321tIO1NQRg</ord:sessionId>
      </ord:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <ord:cancelOrder>
         <ord:request>
          <cpq:OrderId>a2n7A0000002tviQAA</cpq:OrderId>
         </ord:request>
      </ord:cancelOrder>
   </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_Config2/OrderWebService" xmlns:CancelOrderResponseDO="http://soap.sforce.com/schemas/class/Apttus_Config2/CPQStruct" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <cancelOrderResponse>
         <result>
            <CancelOrderResponseDO:CancelOrderSO xsi:type="Apttus_Config2__Order__c">
               <Id>a2n7A0000002twXQAQ</Id>
               <Apttus_Config2__AutoActivateOrder__c>false</Apttus_Config2__AutoActivateOrder__c>
               <Apttus_Config2__BillToAccountId__c>0017A00000WW0pZQAT</Apttus_Config2__BillToAccountId__c>
               <Apttus_Config2__BillingPreferenceId__c>a2d2f0000000h0YAAQ</Apttus_Config2__BillingPreferenceId__c>
               <Apttus_Config2__ConfigurationSyncDate__c>2020-07-06T08:43:16.000Z</Apttus_Config2__ConfigurationSyncDate__c>
               <Apttus_Config2__IsTaskPending__c>false</Apttus_Config2__IsTaskPending__c>
               <Apttus_Config2__OrderAmount__c>300.00000</Apttus_Config2__OrderAmount__c>
               <Apttus_Config2__OrderDate__c>2020-07-06T06:33:53.000Z</Apttus_Config2__OrderDate__c>
               <Apttus_Config2__OriginalOrderNumber__c>O-00005958</Apttus_Config2__OriginalOrderNumber__c>
               <Apttus_Config2__PreviousVersion__c>a2n7A0000002tviQAA</Apttus_Config2__PreviousVersion__c>
               <Apttus_Config2__PriceListId__c>a173C000000fHFQQA2</Apttus_Config2__PriceListId__c>
               <Apttus_Config2__PricingDate__c>2020-07-06T06:33:53.000Z</Apttus_Config2__PricingDate__c>
               <Apttus_Config2__ReadyForWorkflow__c>false</Apttus_Config2__ReadyForWorkflow__c>
               <Apttus_Config2__ShipToAccountId__c>0017A00000WW0pZQAT</Apttus_Config2__ShipToAccountId__c>
               <Apttus_Config2__SoldToAccountId__c>0017A00000WW0pZQAT</Apttus_Config2__SoldToAccountId__c>
               <Apttus_Config2__SourceChannel__c>Direct</Apttus_Config2__SourceChannel__c>
               <Apttus_Config2__Source__c>Account</Apttus_Config2__Source__c>
               <Apttus_Config2__Status__c>Pending Cancellation</Apttus_Config2__Status__c>
               <Apttus_Config2__Type__c>New</Apttus_Config2__Type__c>
               <Apttus_Config2__VersionNumber__c>1</Apttus_Config2__VersionNumber__c>
               <CurrencyIsoCode>USD</CurrencyIsoCode>
            </CancelOrderResponseDO:CancelOrderSO>
         </result>
      </cancelOrderResponse>
   </soapenv:Body>
</soapenv:Envelope>
XML