API Troubleshooting

Use the table in this topic to diagnose problems that occur when executing the Digital Commerce APIs.

Problem Area

Possible solution

getOffers API returns null result.

  • Ensure that the ContextEligibilityGenerator and GetPrices jobs have been run.

getOffers API returns "attempt to dereference null object" error.

  • Ensure that all context rules are configured correctly.

  • Ensure that the Context dimension name and code are the same. (Only applicable for CME Fall '18 .)

getOfferDetails API returning "attempt to dereference null" error.

  • Ensure that all of the products in the hierarchy are active.

  • Ensure that the Product Hierarchy maintenance job has been run.

  • Ensure that the GetOffersHierarchyHelper and GetPrices jobs have been run.

getOfferDetails API not returning the PriceResult node.

  • Ensure that the GetPrices job has been run.

  • Ensure that the offer has both one-time and recurring prices defined.

getOfferDetails API fails with no error in response.

Ensure that virtual products do not have any attributes assigned. Assigning attributes to virtual products results in unpredictable results when calling the Digital Commerce APIs.

getOfferDetails API not returning the result node.

This error is likely caused by your product not having a price list entry or your catalog does not have a Price List defined in the vlocity_cmt_DefaultPriceListId_c field.

GetOfferDetails API returns "Invalid context input for context key"

This error is returned when the user passes an invalid context parameter in the URL, or when the context key of cartContext, eligibilityContext, or groupContext has expired in the cachedapiresponsec table.

The getOfferDetails batch job returns the following error: Too many SOQL queries.

Check the value of the batchSize parameter. Go to the Vlocity API Metadata tab, and select the record whose API name is GetOfferDetails. Ensure the value is set as follows:

{batchSize":1"}

ConfigureOffer API returning "attempt to dereference null" error.

Ensure that the CacheAPIFields custom setting has been set to true. CacheAPIFields is not required for CME 103.1.14 and later versions.

ConfigureOffer API returning "attempt to dereference null" error for a promotion.

Ensure that the CacheAPIPartialConfigure custom setting is set.

The API cache batch jobs are not creating any batch records.

Ensure that the following jobs have been run:

Interface Implementation Maintenance (Restore)

Interface Implementation Maintenance (Merge)

The above jobs are run by navigating to Vlocity CMT Administration > Maintenance Jobs.

The GetPrices batch job is not running any batch records.

Ensure that you have added a default price list to the catalog.

The Add To Basket API returns the following error: error: VLC-PPLAN-ERR-001 No custom setting value found for DefaultPricingPlan".

  • Check the Implementation for "PricingInterface."

  • If the Active Implementation is "PricingPlanService," then verify that "Default Pricing Plan" exists in EPC and that it is active. Check whether the CPQ Configuration custom setting Name = DefaultPricingPlan and Value = DEFAULT_PRICING_PLAN exist.

The Add To Basket API returns a time out error.

Run the following query:

SELECT count() FROM vlocity_cmtOrderPriceAdjustmentc where vlocity_cmtOrderItemIdc = null and vlocity_cmtSourcec = 'Agent';

The above query should not return any rows. If the query returns rows, it is invalid data. Please investigate why these records are generated and remove them.

The Add To Basket API fails withError: ‘null input to JSON parser’,

Or GetOfferDetails returns an empty response for a specific product.

Check and delete all attributes (JSONAttribute) from ‘Virtual Item’ products used as part of product hierarchies.

JSONAttribute is not supported for Virtual Items and should not be used.

The API cache batch jobs are not populating the cache or the Digital Commerce APIs are returning null results.

Ensure that the CachedAPIResponsec.Typec pick list values are up to date. See the lists below:

The following values are new for CME Fall '18 :

  • item

  • itemDetails

  • priceResult

  • catalogCtxEligibilityResult

  • cartContext

  • eligibilityContext

  • hierarchyResult

  • itemConfig

  • orderConfiguration

The following values currently exist in CME Winter '19:

  • item

  • itemDetails

  • priceResult

  • catalogCtxEligibilityResult

  • cartContext

  • eligibilityContext

  • hierarchyResult

  • itemConfig

  • orderConfiguration

The following values are new in CME Winter '19:

  • dataProfileResultItem

  • ruleSetCombinationResultItem

  • catalogCtxQualificationMap

The following values currently exist in the CME Summer '19:

  • item

  • itemDetails

  • priceResult

  • catalogCtxEligibilityResult

  • cartContext

  • eligibilityContext

  • hierarchyResult

  • itemConfig

  • orderConfiguration

  • dataProfileResultItem

  • ruleSetCombinationResultItem

  • catalogCtxQualificationMap

The following values are new in CME Summer '19:

  • groupContext

  • basketWrapper

  • assetReferenceKey

 

Digital Commerce APIs use the CachedAPIResponsec custom object to cache responses. Like other custom objects, CachedAPIResponse__c can store records until the org's data storage limit is reached.

Error Code: INVOKE-200, Unable to process basket operation

Ensure that you followed the Post Install Steps for CME Summer '19. Specifically, the section about adding the picklist values for the CachedAPIResponse object. For details, see Post-Upgrade Steps for Winter '19 to Summer '19 for ​Salesforce Industries Communications, Media, and Energy.

When the Vlocity API Metadata record or records return a null API Name field value and/or a null API Parameter field value, you will see a 500 response with an attempt to de-reference a null object in the response body.

Ensure that you check all the Vlocity API Metadata records, and delete the ones that have a null API Name or a null API Parameter name.