The Salesforce Developers website will undergo maintenance on May 29, 2024 from 3:00 a.m. UTC to 10:00 a.m. UTC. The maintenance process may affect the availability of our documentation. Please plan accordingly.

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:

  1. Navigate to the All Tabs page by clicking the + icon.

  2. 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.

  3. To display the metadata fields, select All from the Select Views list.

    Vlocity API Metadata fields

  4. Click the GetOffers API Name then select the Edit icon next to API Params.

  5. 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:

  6. From the Vlocity CMT Administration screen, click Maintenance Jobs and then click Start next to Clear Managed Platform Cache.

  7. From the Vlocity CMT Administration screen, click Cacheable API Jobs, then click Start next to Delete Expired API Cache.

  8. From the Vlocity CMT Administration screen, click Cacheable API Jobs, click Start next to Populate API cache, and run all of the jobs.

  9. 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.