Context Eligibility API

The Context Eligibility API identifies context combinations of products and promotions that are eligible for each of the combinations. The API accepts cacheKey as the request body parameter for Context Eligibility. Context Eligibility is an output parameter consisting of generated context combinations.

For each context combination in the output of the Context Combinations API, there is one context eligibility in the API response that contains qualifying products and promotions for that context combination.

You can obtain the cacheKey required in the request body of this API from the cacheKey node in the response body of the Context Combinations API.

You must first run the Context Combinations API to obtain the cacheKey required in the request body of this API.

/services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/contexteligibility

POST

If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence.

ParameterExampleDefaultOptional/RequiredNotes
effectiveStartTime2001-07-04T12:08:56Current date and timeOptionaleffectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message.
expirationTime2001-07-04T12:08:56effectiveStartTime + TimeToLiveOptionalexpirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days.

Here is an example of how to pass the URI parameters:

ParameterData TypeDescriptionDefaultOptional/Required
cacheKeyStringCache key pointing to the record containing combinations for the context eligibility that needs populating. You can obtain the cacheKey required in the request body of this API from the cacheKey node in the response body of the Context Combinations API.N/ARequired

This is a sample request for a cacheKey.

This is an example of how you invoke the API using Apex:

You can process each contextCombinationResultItem in parallel. If there are 100 catalogs and each catalog links to 13 contextCombinationsResultItems, then all 1,300 contextCombinationResultItems can be run in parallel.

HeaderDescription
Content-Typeapplication/json

This example shows the context combinations of products and promotions that are eligible for each of the combinations.

CodeDescription
200OK
500Internal Server Error