AcceptOrder()

Finalize a draft order on customer confirmation. Accepting an order performs the following functions:

  • IF Auto Activate Order = False
    • Order and Order Line Item status is set to “Pending”.
    • Asset Line Items are created in “Pending” status.
    • If “Ready for Billing Date” is set, billing schedule generation is initiated.
  • IF Auto Activate Order = True
    • Order and Order Line Item status is set to “Activated”.
    • Asset Line Items are created in “Activated” status.
    • If “Ready for Billing Date” is set, the billing schedule generation is initiated.

API Details



Parameters
NameTypeDescription
RequestApttus_Config2.CPQStruct.AcceptOrderRequestDOThe request data object.



Request Data Object - 

Apttus_Config2.CPQStruct.AcceptOrderRequestDO

FieldTypeRequired?Description
OrderIdIDYesThe Id of the Order to be finalized.


API Response

Response Data Object - CPQStruct.AcceptOrderResponeDO
FieldTypeDescription
IsSuccessbooleanSpecifies whether the order is finalized successfully.
AssetLineItems

List<Apttus_Config2__AssetLineItem__c>

List of Asset Line Items


Code Sample

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

public void acceptOrder() {
    
        Apttus_Config2.CPQStruct.AcceptOrderRequestDO request = new Apttus_Config2.CPQStruct.AcceptOrderRequestDO();
        
        request.OrderId = orderId;
        
        Apttus_Config2.CPQStruct.AcceptOrderResponseDO response = Apttus_Config2.OrderWebService.acceptOrder(request);
        
        ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.info, 'acceptOrder :' + response.IsSuccess));
        ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.info, 'List of Assets :' + response.AssetItems));
        
    }
CODE