Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

Show Page Sections

download

Cloning an Order using SOAP API

This API performs a deep clone of an order. Creates a new copy of the order along with its related objects rather than creating a new version. Deep clone can only be performed for orders where all order line items have the status "New." Any order with ABO (Asset-Based Ordering) line items cannot be cloned in this way.

The following applies when the CloneOrder() API is invoked:

  • Cloning an existing order sets the status of the order header and order line items to "Draft".
  • Cloning an existing order resets the following fields: Asset Line Item, Ready for Activation Date, and Ready for Billing Date.
  • Clones the corresponding cart and cart line items. Cart line items can then be configured and change similar to new draft order.

API Details

API

Signature

cloneOrder

webService static Apttus_Config2.CPQStruct.CloneOrderResponseDO cloneOrder(Apttus_Config2.CPQStruct.CloneOrderRequestDO)

Parameters

Name

Type

Description

request

Apttus_Config2.CPQStruct.CloneOrderRequestDO

The request data object.

Request Data Object -

Apttus_Config2.CPQStruct.CloneOrderRequestDO

Field

Type

Required?

Description

OrderId

ID

Yes

The order Id to clone. This is the order number that remains constant from version to version and is referred by the customer.

API Response

Response Data Object - CPQStruct.CloneOrderResponeDO

Field

Type

Description

OrderItems

List

List of cloned order items.

CloneOrderSO

Object

The fields of the Clone Order object.

Code Sample

The following code sample enables you to clone an order for a valid order with an Order Id.

/******* Clone an order *********************/
Id orderid = 'a2n3C000000CfAC';
Apttus_Config2.CPQStruct.CloneOrderRequestDO request = new Apttus_Config2.CPQStruct.CloneOrderRequestDO();
request.OrderId = orderid;
 

Apttus_Config2.CPQStruct.CloneOrderResponseDO response =Apttus_Config2.OrderWebService.cloneOrder (request);

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:cloneOrder>
         <ord:request>
          <cpq:OrderId>a2n7A0000002tviQAA</cpq:OrderId>
         </ord:request>
      </ord:cloneOrder>
   </soapenv:Body>
</soapenv:Envelope>

Example Response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/schemas/class/Apttus_Config2/OrderWebService" xmlns:CloneOrderResponseDO="http://soap.sforce.com/schemas/class/Apttus_Config2/CPQStruct" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <cloneOrderResponse>
         <result>
            <CloneOrderResponseDO:CloneOrderSO xsi:type="Apttus_Config2__Order__c">
               <Id>a2n7A0000002tvsQAA</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-06T07:29:47.000Z</Apttus_Config2__ConfigurationSyncDate__c>
               <Apttus_Config2__IsTaskPending__c>false</Apttus_Config2__IsTaskPending__c>
               <Apttus_Config2__OrderDate__c>2020-07-06T06:33:53.000Z</Apttus_Config2__OrderDate__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>Draft</Apttus_Config2__Status__c>
               <Apttus_Config2__Type__c>New</Apttus_Config2__Type__c>
               <CurrencyIsoCode>USD</CurrencyIsoCode>
            </CloneOrderResponseDO:CloneOrderSO>
         </result>
      </cloneOrderResponse>
   </soapenv:Body>
</soapenv:Envelope>