Replacing an Item in a Promotion

When you use the Siebel REST API to replace an item in a promotion, the Siebel application replaces an old component of an existing promotion with another eligible component from the same product line or product class. This promotion could be the one you created in Applying a Promotion to a Quote or an Order, or, it could be an existing promotion that is being modified. Because mandatory components cannot be deleted, this API is used to replace a mandatory component using just one operation, instead of using the DELETE and ADD operations.

The following request replaces an item in a promotion:

  • URI: http://ServerName:port/siebel/v1.0/service/Workflow Process Manager/RunProcess

  • HTTP Method: POST

  • Content-Type: application/json

  • Authorization: Basic

  • Request body:
     {
    	"body": {
    		"ProcessName": "ISS Edit Promotion WS - Replace Item Process",
    		"PricingMode": "Y",
    		"EligibilityMode": "1",
    		"Siebel Operation Object Id": "88-1WMCXR",
    		"New Product Id": "88-231F2",
    		"Target Document": "Quote",
    		"Header Id": "88-1WMCWZ",
    		"Sync": "N"
    	}
    	}
    

For a description of the request message associated with this API, see the following table.

Name Description

Process Name

The following process is required:

  • ISS Edit Promotion WS - Replace Item Process

Header Id

Optional, depending on usage. However, this is required if SiebelMessage is not provided.

Quote ID or Order ID.

Siebel Operation Object Id

Required.

Row ID of either the quote item or order item that needs to be replaced.

Target Document

Required. The default value is Quote.

Quote or Order.

SiebelMessage

Optional, depending on usage. However, this is required if HeaderId is not provided.

PDS quote or PDS order.

Pricing Mode

Optional. The default value is Y.

If set to Y, then pricing is calculated for all the line items in the in-memory document.

Eligibility Mode

Optional. Valid values are 0, 1, or 2. The default value is 2.

  • If set to 0, then the procedure is not run.

  • If set to 1, then the procedure is run, and all ineligible products are displayed with messages.

  • If set to 2, then the procedure is run, and ineligible products are not included in the pricing calculations.

    Note:

    This behavior is different from how other APIs behave where EligibilityMode is set to 2.

New Product Id

Required.

ID of new product that replaces the previous product.

Sync

Optional. The default value is N.

If set to Y, then the order or quote is created or updated in the database.

Here are the response details for a successful request:

  • HTTP Code: 200

  • Content-Type: application/json

  • Response body:
        	            {
    	"Error Code": "",
    	"Siebel Operation Object Id": "88-1WMCXR",
    	"Process Instance Id": "88-1WMAA3",
    	"PricingMode": "Y",
    	"EligibilityMode": "1",
    	"Error Message": "",
    	"Object Id": "",
    	"SiebelMessage": {
    		"IntObjectFormat": "Siebel Hierarchical",
    		"MessageId": "",
    		"IntObjectName": "PDS Quote",
    		"MessageType": "Integration Object",
    		"Header": {
    			"Quote Type": "Quotation",
    			"Id": "88-1WMCWZ",
    			"Name": "NEW_QUOTE",
    			"Quote Number": "88-1WMCWZ",
    			"Line Item": [
    				{
    					"Product Structure Type": "None",
    					"Product Type Code": "Promotion",
    					"Product Id": "88-231M5",
    					"Name": "Millennium Max 200 Package",
    					"Action Code": "Add",
    					"Id": "88-1WMCX8"
    				},
    				{
    					"Id": "88-1WMAA8",
    					"Name": "Daytech 300",
    					"Product Id": "88-231F2",
    					"Product Structure Type": "Customizable",
    					"Action Code": "Add",
    					"Prod Prom Id": "88-231M5",
    					"Product Type Code": "Product",
    					"Line Item": [
    						{
    							"Id": "88-1WMAAA",
    							"Product Id": "88-231DT",
    							"Action Code": "Add",
    							"Product Type Code": "Product"
    						}
    					]
    				}
    			]
    		}
    	}
    }