Create Promotion Items

Create promotion items in Vlocity Product Console by specifying them in the request body.

POST /v2/epc/promotions/items

Remote Method

addPromotionItem

REST Handler

APIPromotionItemRestHandler

Apex Remote Service

PCAppHandler

Package

Communication (vlocity_cmt)

API Parameters and Response Format

For API parameter names and descriptions, see the Swagger (OpenAPI) reference documentation for Industries EPC REST APIs.

Resource Information

Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/epc/promotions/items

Example Request

POST v2/epc/promotions/items

{
  "epcRequest": {
    "entity": {
      "vlocity_cmt__PromotionId__c": "a3K3h0000006Aj3EAE",
      "vlocity_cmt__Description__c": "",
      "vlocity_cmt__ProductId__c": "01t3h000002TMciAAG",
      "vlocity_cmt__IsActive__c": true,
      "vlocity_cmt__ActionType__c": "Add",
      "vlocity_cmt__MaxQuantity__c": 10,
      "vlocity_cmt__MinQuantity__c": 1,
      "vlocity_cmt__Quantity__c": 1,
      "vlocity_cmt__UpdateScope__c": "Update Item Only",
      "vlocity_cmt__ContextProductId__c": ""
    }
  }
}

Example Result

{
    "epcResponse": {
        "entities": [
            {
                "entity": {
                    "attributes": {
                        "type": "vlocity_cmt__PromotionItem__c",
                        "url": "/services/data/v52.0/sobjects/vlocity_cmt__PromotionItem__c/a3J3h000000I4KKEA0"
                    },
                    "Id": "a3J3h000000I4KKEA0",
                    "IsDeleted": false,
                    "Name": "a3J3h000000I4KK",
                    "CurrencyIsoCode": "USD",
                    "CreatedDate": "2021-09-07T06:36:09.000+0000",
                    "CreatedById": "0053h000002UGCUAA4",
                    "LastModifiedDate": "2021-09-07T06:36:09.000+0000",
                    "LastModifiedById": "0053h000002UGCUAA4",
                    "SystemModstamp": "2021-09-07T06:36:09.000+0000",
                    "vlocity_cmt__PromotionId__c": "a3K3h0000006Aj3EAE",
                    "vlocity_cmt__ActionType__c": "Add",
                    "vlocity_cmt__IsActive__c": true,
                    "vlocity_cmt__IsUndoable__c": false,
                    "vlocity_cmt__MaxQuantity__c": 10.00,
                    "vlocity_cmt__MinQuantity__c": 1.00,
                    "vlocity_cmt__ProductHierarchyGlobalKeyPath__c": "20b3380d-5c42-f7db-4508-beff916feee1",
                    "vlocity_cmt__ProductHierarchyGroupKeyPath__c": "f4a0d9e2-d6cd-59f8-8c20-c14298a2f4f2",
                    "vlocity_cmt__ProductHierarchyPath__c": "01t3h000002TMciAAG",
                    "vlocity_cmt__ProductId__c": "01t3h000002TMciAAG",
                    "vlocity_cmt__Quantity__c": 1.00,
                    "vlocity_cmt__UpdateScope__c": "Update Item Only",
                    "vlocity_cmt__GlobalGroupKey__c": "4c1abba7-2ab2-872a-26dc-93bfba985894",
                    "vlocity_cmt__ProductId__r": {
                        "attributes": {
                            "type": "Product2",
                            "url": "/services/data/v52.0/sobjects/Product2/01t3h000002TMciAAG"
                        },
                        "Id": "01t3h000002TMciAAG",
                        "Name": "India V1.1",
                        "ProductCode": "India V1.1",
                        "vlocity_cmt__VersionLabel__c": "Version - V1.1"
                    },
                    "vlocity_cmt__PromotionId__r": {
                        "attributes": {
                            "type": "vlocity_cmt__Promotion__c",
                            "url": "/services/data/v52.0/sobjects/vlocity_cmt__Promotion__c/a3K3h0000006Aj3EAE"
                        },
                        "Id": "a3K3h0000006Aj3EAE",
                        "Name": "Promotion-Example",
                        "vlocity_cmt__PriceListId__c": "a343h000001ACXFAA4",
                        "vlocity_cmt__PriceListId__r": {
                            "attributes": {
                                "type": "vlocity_cmt__PriceList__c",
                                "url": "/services/data/v52.0/sobjects/vlocity_cmt__PriceList__c/a343h000001ACXFAA4"
                            },
                            "Id": "a343h000001ACXFAA4",
                            "Name": "ShamPriceList"
                        }
                    }
                }
            }
        ],
        "overallResult": "success"
    }
}