Eligible Promotions List (POST)
Special Access Rules
You must have the Context Definitions and Context Rule Library settings enabled in your Salesforce org. To use this resource for Loyalty promotion limit enforcement, Global Promotions Management (GPM) must also be enabled, and the Track Member Progress for Engagement Trails Using Promotion Party Usage feature setting must be active so that PromotionPartyUsage.UsageCount is tracked for Loyalty Program Members.
When GPM is enabled with Loyalty, call this resource before processing a transaction journal to enforce promotion limits. The resource evaluates the PromotionPartyUsage record for the party (Account, Contact, or Loyalty Program Member) against the configured PromotionLimit. Promotions that have reached their limit are excluded from the response.
Pass the promotions returned by this resource as the appliedPromotions array in the Transaction Journals Execution request. This ensures only eligible promotions are applied to the transaction.
Promotion limits aren't enforced if appliedPromotions is omitted from the Transaction Journals Execution request.
- Resource
-
1/global-promotions-management/eligible-promotions - Resource example
-
1https://yourInstance.salesforce.com/services/data/v67.0/global-promotions-management/eligible-promotions - Available version
- 60.0
- HTTP methods
- POST
- 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/loyaltyProgramMemberId/accountId": "003xx000004WjzAAAS", 7 "transactionAmount": 499, 8 "currencyISOCode": "USD", 9 "engagementChannelId": "0eFxx0000000008EAA", 10 "sourceLocationId/sourceLocation": "0YQxx0000000001GAA", 11 "cartLineDetails": [ 12 { 13 "cartLineProduct": "Burger", 14 "cartLineProductCode": "testProductCode", 15 "cartLineProductStockKeepingUnit": "testSKU", 16 "cartLineProductCatalog" : "Food", 17 "cartLineItemQuantity": 1, 18 "cartLineItemAmount": 100, 19 "cartLineProductCategory":"test" 20 } 21 ] 22 } 23 ] 24 } 25}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 "contactId/loyaltyProgramMemberId/accountId": "003xx000004WjzAAAS" 7 "currencyISOCode":"INR", 8 "transactionAmount":499, 9 "membershipNumber":"Member-005", 10 "cartLineDetails":[ 11 { 12 "cartLineProductId":"01txx0000006iTsAAI", 13 "cartLineProductCode": "AnyProductCode", 14 "cartLineProductStockKeepingUnit": "AnySKU", 15 "cartLineItemQuantity":2, 16 "cartLineItemAmount":99, 17 "cartLineProductCatalogId:"0ZSSB0000002d8X4AQ" 18 }, 19 { 20 "cartLineProduct":"Coke", 21 "cartLineProductCode": "AnyProductCode", 22 "cartLineProductStockKeepingUnit": "AnySKU", 23 "cartLineItemQuantity":10, 24 "cartLineItemAmount":400, 25 "cartLineProductCatalog:"Beverages" 26 } 27 ] 28 } 29 ] 30 } 31}Here’s an example to fetch eligible loyalty program promotions for accounts:
1{ 2 "cart": { 3 "cartDetails": [ 4 { 5 "activityStartDate": "2024-10-16T22:45:19Z", 6 "accountId": "001xx000003H3NnAAK", 7 "transactionAmount": 40, 8 "currencyISOCode": "USD", 9 "cartLineDetails": [ 10 { 11 "cartLineProductCatalog": "Beverages", 12 "cartLineProductCategory": "Coffee Creations", 13 "cartLineProduct": "Caramel Latte", 14 "cartLineItemQuantity": 5 15 } 16 ] 17 } 18 ] 19 } 20 } - 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
- 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, the product catalog ID or name, the product code, and the product stock keeping unit.
Required 60.0 contextInstanceId String ID of the context instance. Optional 65.0
- Request parameters for POST
-
Parameter Name Type Description Required or Optional Available Version ruleLibraryApiName String 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. This parameter is required if there are multiple active rule libraries configured with the Usage Type as Global Promotion Management.
Optional 59.0 - Response body for POST
- Eligible Promotions List