Newer Version Available

This content describes an older version of this product. View Latest

Eligible Promotions

Get eligible promotions and their associated rewards for a cart and its line items.

Ensure that the Context Definitions and Context Rule Library settings are enabled in your Salesforce org.

Note

Resource
1/global-promotions-management/eligible-promotions
Resource example
1https://yourInstance.salesforce.com/services/data/v62.0/global-promotions-management/eligible-promotions
Available version
60.0
HTTP methods
POST
Query Parameters
Name Type Description Required or Optional Available Version
ruleLibraryApiName String Enter the API Name of an active Rule Library with the Usage Type as Global Promotion Management. This parameter allows the API to check the eligibility of the cart against the Promotions associated with the specified Rule Library. Optional 62.0

This query parameter is required if there are multiple active rule libraries configured with the Usage Type as Global Promotion Management.

Note

Request body for POST
Root XML tag
CartInputMapRepresentation
JSON examples

Here’s an example of the details of a customer’s cart whose eligible promotions are to be fetched:

1{
2   "cart":{
3      "cartDetails":[
4         {
5            "activityStartDate":"2023-06-14T12:45:19Z",
6            "contactId":"003xx000004WjzAAAS",
7            "transactionAmount":499,
8            "currencyISOCode":"INR",
9            "cartLineDetails":[
10               {
11                  "cartLineProductId":"01txx0000006iTsAAI",
12                  "cartLineItemQuantity":3,
13                  "cartLineItemAmount":499,
14                  "cartLineProductCatalogId:"0ZSSB0000002d8X4AQ"
15               }
16            ]
17         }
18      ]
19   }
20}

Here’s an example of the details of a loyalty program member’s cart whose eligible loyalty program promotions are to be fetched:

1{
2   "cart":{
3      "cartDetails":[
4         {
5            "activityStartDate":"2023-06-14T12:45:19Z",
6            "currencyISOCode":"INR",
7            "transactionAmount":499,
8            "membershipNumber":"Member-005",
9            "cartLineDetails":[
10               {
11                  "cartLineProductId":"01txx0000006iTsAAI",
12                  "cartLineItemQuantity":2,
13                  "cartLineItemAmount":99,
14                  "cartLineProductCatalogId:"0ZSSB0000002d8X4AQ"
15               },
16               {
17                  "cartLineProduct":"Coke",
18                  "cartLineItemQuantity":10,
19                  "cartLineItemAmount":400,
20                  "cartLineProductCatalog:"Beverages"
21               }
22            ]
23         }
24      ]
25   }
26}
Properties
Name Type Description Required or Optional Available Version
cart Map<String, Object> Fields configured in the Cart and CartLine nodes of the CartDetailGetEligiblePromotion context service definition in your org. These fields represent the details of a cart and its line items whose eligible promotions are to be fetched.

To get eligible promotions associated with a loyalty program member’s cart, the required parameters are:

  • membershipNumber or loyaltyProgramMemberId
  • currencyISOCode
For other eligible promotions, the required parameters are:
  • contactId, contactLastName, or contactEmail
  • currencyISOCode

Along with the required parameters, provide specific details of a cart, such as the total transaction amount, and the cart line item details, such as the line item quantity and amount, the product ID or name, and the product catalog ID or name.

Required 60.0
Response body for POST
Eligible Promotions List