Skip to main content

Salesforce B2C Commerce actions

The Salesforce B2C Commerce extension provides actions for retrieving product, category, and customer group data from Salesforce B2C Commerce within Workforce Flows. Use these actions to fetch individual records or search and browse content as part of your automated content processes.

The Salesforce B2C Commerce action extension can be installed from the Workforce integration marketplace.

See Salesforce B2C Commerce configuration for details of how to obtain the credentials you need to configure the Salesforce B2C Commerce action extension.

Tip

These action descriptions cover the most commonly used inputs and outputs. When designing flows, you may also notice additional input and output variables.

Shared inputs
Link copied!

Several actions support the following optional inputs.

InputTypeDescription
localestringLocale identifier (e.g. en-US) that determines the localized data returned
currencystringCurrency code in ISO 4217 format (e.g. USD) used to retrieve product pricing
expandstringComma-separated list of related resources to expand in the response (e.g. images, prices, availability, variations)
refinestringRefinement criteria used to filter results (e.g. category, price range, or attributes)
pagination.startstringStarting index for paginated results. Default: 0
pagination.maxstringMaximum number of results per page. Default: 20. Values above 20 are ignored
pagination.sortstringSorting rule applied to the results

Get product by ID
Link copied!

Retrieves full product data for a single product by its ID from Salesforce B2C Commerce.

Inputs

InputTypeRequiredDescription
idstringYesThe unique identifier of the product
localestringNoSee shared inputs
expandstringNoSee shared inputs
currencystringNoSee shared inputs
all_imagesbooleanNoWhen true, returns all product image groups regardless of variation selection. Default: false

Outputs

OutputTypeDescription
product.idstringProduct ID
product.currencystringCurrency
product.namestringProduct name
product.short_descriptionstringShort description
product.long_descriptionstringLong description
product.page_titlestringSEO page title
product.page_descriptionstringSEO page description
product.primary_category_idstringPrimary category ID
product.pricenumberProduct price
product.main_imagestringMain image URL
product.image_groupsarrayImage groups. See image group fields
product.recommendationsarrayRecommended products. See recommendation fields

Get basic product by ID
Link copied!

Retrieves a simplified set of product data for a single product by its ID from Salesforce B2C Commerce. Intended for use with commerce repositories.

Inputs

InputTypeRequiredDescription
idstringYesThe unique identifier of the product
localestringNoSee shared inputs
expandstringNoSee shared inputs
currencystringNoSee shared inputs

Outputs

OutputTypeDescription
product.idstringProduct ID
product.namestringProduct name
product.descriptionstringProduct description
product.imagesarrayList of image objects, each with a url field

Get basic products by optional keyword
Link copied!

Retrieves a cursor-paginated list of products matching an optional keyword from Salesforce B2C Commerce. Intended for use with commerce repositories.

Inputs

InputTypeRequiredDescription
keywordstringNoThe search phrase used to find matching products. If omitted, returns all products
beforestringNoA pagination cursor to retrieve the page of products before a given position. Use the startCursor value from a previous response
afterstringNoA pagination cursor to retrieve the page of products after a given position. Use the endCursor value from a previous response

Outputs

OutputTypeDescription
pageInfo.startCursorstringCursor for the first item in the current page
pageInfo.endCursorstringCursor for the last item in the current page
pageInfo.hasPreviousPagebooleanWhether a previous page exists
pageInfo.hasNextPagebooleanWhether a next page exists
productsarrayList of basic product objects, each with id, name, description, and images (array of objects with a url field)

Get products by search term
Link copied!

Retrieves a paginated list of products matching a search term from Salesforce B2C Commerce.

Inputs

InputTypeRequiredDescription
searchTermstringYesThe search query string used to find matching products
refinestringNoSee shared inputs
localestringNoSee shared inputs
expandstringNoSee shared inputs
currencystringNoSee shared inputs
pagination.startstringNoSee shared inputs
pagination.maxstringNoSee shared inputs
pagination.sortstringNoSee shared inputs

Outputs

OutputTypeDescription
totalnumberTotal number of matching products
startnumberStart index of the current page
endnumberEnd index of the current page
productsarrayList of product search result objects. See search result product fields below

Get products by category
Link copied!

Retrieves a paginated list of products belonging to a category from Salesforce B2C Commerce.

Inputs

InputTypeRequiredDescription
idstringYesThe unique identifier of the category
refinestringNoSee shared inputs
localestringNoSee shared inputs
expandstringNoSee shared inputs
currencystringNoSee shared inputs
pagination.startstringNoSee shared inputs
pagination.maxstringNoSee shared inputs
pagination.sortstringNoSee shared inputs

Outputs

OutputTypeDescription
totalnumberTotal number of matching products
startnumberStart index of the current page
endnumberEnd index of the current page
productsarrayList of product search result objects. See search result product fields below

Get category by ID
Link copied!

Retrieves a single category by its ID from Salesforce B2C Commerce, including an optional number of subcategory levels.

Inputs

InputTypeRequiredDescription
idstringYesThe unique identifier of the category
levelsstringNoThe number of subcategory levels to include in the response
localestringNoSee shared inputs

Outputs

OutputTypeDescription
category.idstringCategory ID
category.namestringCategory name
category.imagestringCategory image URL
category.page_titlestringSEO page title
category.page_descriptionstringSEO page description
category.page_keywordsstringSEO page keywords
category.parent_category_idstringParent category ID
category.categoriesarraySubcategory objects, each sharing the same fields as above

Get categories by search term
Link copied!

Retrieves a paginated list of categories matching a search term from Salesforce B2C Commerce.

Inputs

InputTypeRequiredDescription
searchTermstringYesThe search phrase used to find matching categories
levelsstringNoThe number of category hierarchy levels to include
pagination.startstringNoStarting index for paginated results. Default: 0
pagination.maxstringNoMaximum number of results. Default: 20. Values above 20 are ignored

Outputs

OutputTypeDescription
totalnumberTotal number of matching categories
startnumberStart index of the current page
endnumberEnd index of the current page
categoriesarrayList of category objects, each with id and name

Get customer group by ID
Link copied!

Retrieves a single customer group by its ID from Salesforce B2C Commerce.

Inputs

InputTypeRequiredDescription
idstringYesThe unique identifier of the customer group
selectstringNoSpecifies which fields should be returned in the response

Outputs

OutputTypeDescription
customerGroup.idstringCustomer group ID
customerGroup.descriptionstringDescription
customerGroup.typestringCustomer group type
customerGroup.creation_datestringCreation date
customerGroup.linkstringLink to the customer group resource
customerGroup.rule_descriptionstringRule description (for rule-based groups)

Get customer groups
Link copied!

Retrieves a paginated list of all customer groups from Salesforce B2C Commerce.

Inputs

InputTypeRequiredDescription
selectstringNoSpecifies which fields should be returned in the response
pagination.startstringNoStarting index for paginated results. Default: 0
pagination.maxstringNoMaximum number of results. Default: 20. Values above 20 are ignored

Outputs

OutputTypeDescription
totalnumberTotal number of customer groups
startnumberStart index of the current page
endnumberEnd index of the current page
customerGroupsarrayList of customer group objects, each with id, link, and description

Image group fields
Link copied!

Image groups are returned on the full product object and contain the following fields:

FieldTypeDescription
view_typestringThe view type for the image group (e.g. large, medium, small)
imagesarrayList of image objects, each with alt (alt text), link (image URL), and title (image title)

Recommendation fields
Link copied!

Recommendations are returned on the full product object and contain the following fields:

FieldTypeDescription
recommended_item_idstringID of the recommended product
recommended_item_linkstringLink to the recommended product
recommendation_type.display_valuestringDisplay label for the recommendation type
recommendation_type.valuenumberNumeric value for the recommendation type

Search result product fields
Link copied!

Products returned by the search and category listing actions contain the following fields:

FieldTypeDescription
product_idstringProduct ID
product_namestringProduct name
linkstringLink to the product
pricenumberProduct price
price_per_unitnumberPrice per unit
currencystringCurrency code
image.altstringImage alt text
image.linkstringImage URL
image.titlestringImage title

Adding actions to flows

Inputs, outputs and ports

Input field variables

Developing extensions