Download PDF
Download page Amending an Order using API.
Amending an Order using API
Make In-Flight order changes. Use this API to make the following changes to Order Line Items (OLI):
- Change the start date or end date of subscription on one or more order line items that are in "Pending", "In Fulfillment", or "Partially Fulfilled" status.
- Make subscription date changes on the standalone item, bundles, and multiple charge line items.
- Cancel order line items in "Pending," "In Fulfillment," or "Partially Fulfilled" status. This changes their status to "Pending Cancellation."
- Override the "Base Price" field.
- Change the Quantity.
- Change the Selling Term, Selling Frequency, and/or Selling Unit-of-Measure (Selling Uom).
- Modify Contract Numbers
- Change the Adjustment Type/Adjustment Amount.
The following changes to an order occur after it has been amended:
- The change in subscription start and/or end date recalculates the price for the line item or bundle after the changes are applied.
- The changes to the order line items are also reflected in the corresponding assets.
- Assets are only created on activation of the order line item.
- Creates a new version of the order to make and track changes and has reference to the previous version. The previous version of the order and order line items are "Superseded", once the work-in-progress (In Amendment) changes are confirmed on "Accept" of the "In Amendment" order.
- Cancelled order line items are assigned the "Pending Cancellation" status. The order must be accepted to confirm cancellation.
- Order line items that are added from catalog (line status = "New") or created through ABO actions (line status In "Amended", "Cancelled", "Renewed", "Upgraded") can be amended.
- Any order configured directly or generated from quote or eCommerce can be amended.
For more information on amending an order, refer to the topic "Managing In-Flight Changes and Cancellation" in the Order Management for Users.
API Details
API | Signature |
---|---|
amendOrder | webService static Conga_Config2.CPQStruct.AmendOrderResponseDO amendOrder(Apttus_Config2.CPQStruct.AmendOrderRequestDO) |
Parameters | |||
---|---|---|---|
Name | Type | Required? | Description |
request | Apttus_Config2.CPQStruct.AmendOrderRequestDO | Yes | The request data object. |
Request Data Object - Apttus_Config2.CPQStruct.AmendOrderRequestDO | |||
---|---|---|---|
Field | Type | Required? | Description |
OrderId | ID | Yes | Reference to the order. Order Id can be any one of the following:
|
OrderItems | List<Apttus_Config2__OrderLineItem__c> | No | List of order line items and changes to make:
|
API Response
Response Data Object - CPQStruct.AmendOrderResponeDO | ||
---|---|---|
Field | Type | Description |
AmendedOrderItems | List<Apttus_Config2__OrderLineItem__c> | List of amended order items |
AmendOrderSO | Standard Data Object <Apttus_Config2__Order__c> | The fields of the AmendOrder Object. |
Code Sample
The following code sample enables you to amend an order for a valid order with an Order Id.
Id orderId = 'a2n6C000000Dj0r';
List<Apttus_Config2__OrderLineItem__c> orderLinesToAmend = new List<Apttus_Config2__OrderLineItem__c>();
Apttus_Config2.CPQStruct.AmendOrderRequestDO request = new Apttus_Config2.CPQStruct.AmendOrderRequestDO();
for(Apttus_Config2__OrderLineItem__c orderLineSO : [SELECT Id
FROM Apttus_Config2__OrderLineItem__c
WHERE Apttus_Config2__OrderId__c = :orderId]) {
Apttus_Config2__OrderLineItem__c amendedOrderLine = new Apttus_Config2__OrderLineItem__c(Id = orderLineSO.Id,
Apttus_Config2__Quantity__c = 4);
orderLinesToAmend.add(amendedOrderLine);
}
request.OrderId = orderId;
request.OrderItems = orderLinesToAmend;
Apttus_Config2.CPQStruct.AmendOrderResponseDO response = Apttus_Config2.OrderWebService.amendOrder(request);
if(response != null) {
system.debug('Amended Order Details:'+response.AmendOrderSO);
system.debug('Amended Order LineItems:'+response.AmendedOrderItems);
}