Get Product
AI-generatedOverview
The "Get Product" operation of the Salesforce OpenCommerce API (OCAPI) n8n node retrieves detailed information about a specific product from a Salesforce Commerce Cloud (SFCC) site. This node is useful for workflows that need to fetch product data for inventory management, synchronization with other systems, enrichment of product catalogs, or automated reporting.
Example scenarios:
- Fetching product details to update an external database.
- Retrieving product information for order processing or customer support.
- Enriching product listings in a marketing automation workflow.
Properties
| Name | Type | Meaning |
|---|---|---|
| Site ID | String | The SFCC site identifier (e.g., "SiteGenesis") where the product resides. |
| Product ID | String | The unique identifier of the product to retrieve. |
| Expand | Collection | Optional. Specifies additional related data to include (e.g., images, prices, categories). |
Expand Options
Within the Expand property, you can specify one of the following expansions:
- All
- Availability
- Images
- All Images
- Categories
- Options
- Prices
- Variations
- Sets
- Bundles
This allows you to tailor the response to include only the data you need.
Output
The output is a JSON object containing the product's details as returned by the Salesforce OCAPI. The structure will depend on the product and any expansions requested, but typically includes fields such as:
{
"id": "product123",
"name": "Sample Product",
"price": 29.99,
"images": [...],
"availability": {...},
// ...other fields depending on expand options
}
- If the Expand option is used, the output will include additional nested objects/arrays relevant to the selected expansion (e.g., images, prices, categories).
Dependencies
- External Service: Requires access to a Salesforce Commerce Cloud instance with OCAPI enabled.
- Credentials: Needs a configured n8n credential named
salesforceOcapiwith the following fields:clientIdclientSecrethostnameversion
- n8n Configuration: Ensure the credentials are set up in n8n under the node’s credential section.
Troubleshooting
Common Issues:
- Invalid Credentials: If the provided client ID, secret, or hostname are incorrect, authentication will fail.
- Missing Product: If the specified Product ID does not exist, the node may return an error or an empty result.
- Insufficient Permissions: The OCAPI user must have permission to access product data and any expanded resources.
- Malformed Expand Option: Providing an invalid value for the expand parameter may result in an error from the API.
Error Messages:
"Product not found": Check the Product ID and ensure it exists in the specified site."Authentication failed": Verify your OCAPI credentials."Invalid expand parameter": Ensure the expand type matches one of the allowed values.