Retrieving Additional Product2 or Promotion Fields
To return additional Product2 or Promotion fields that are not returned by default, use the GetOffersByCatalog and GetOfferDetails APIs.
For the response to contain additional fields from the Product2 or Promotion objects, you must first specify the fields as part of the GetOffersByCatalog or GetOfferDetails API metadata. Once configured, rerun the API Response Batch jobs to populate the cache response.
To return additional Product2 or Promotion fields:
-
Navigate to the All Tabs page by clicking the + icon.
-
From the list of tabs, select Vlocity API Metadata. The list of API objects is displayed.
If the Vlocity API Metadata tab is not shown in the All Tabs list, see the Creating a Custom Object Tab topic in the Salesforce help.
-
To display the metadata fields, select All from the Select Views list.
-
Click the GetOffers API Name then select the Edit icon next to API Params.
-
In the API Params field, enter the Product2 or Promotions fields that you want to retrieve using the API call. For example, to return the fields IsActive and Family from the Product2 catalog enter the following in the API Params field:
You can return Promotion fields in a similar manner:
-
From the Vlocity CMT Administration screen, click Maintenance Jobs and then click Start next to Clear Managed Platform Cache.
-
From the Vlocity CMT Administration screen, click Cacheable API Jobs, then click Start next to Delete Expired API Cache.
-
From the Vlocity CMT Administration screen, click Cache Catalog Product Definition, and run
Generate Catalog Product Definitions
job. -
Run the GetOffersByCatalog or GetOfferDetails API. The additional fields are displayed in the JSON output.
Only fields that are populated in the catalog are displayed in the API results. The API does not return empty or undefined fields.
Do not run the Load API Metadata job. Doing so will overwrite the data you specified in the API metadata field.
The APIParms metadata returned by the GetOffers API overwrites the metadata returned by the Get Contains Products API. That is, if the APIParams field is configured with a specific value, and the GetOffers API is run, the metadata from GetOffers overwrites the metadata for the Get Contains Products API.