Search Products
AI-generatedOverview
The "Search Products" operation of the Salesforce OpenCommerce API (OCAPI) n8n node allows users to search for products within a specified Salesforce Commerce Cloud (SFCC) site. This is useful for retrieving product listings based on various criteria, integrating product data into workflows, or automating catalog management tasks.
Common scenarios:
- Syncing product catalogs between SFCC and other systems.
- Automating product data exports for reporting or analytics.
- Building custom dashboards that display product information from SFCC.
Practical example:
A retailer wants to automatically fetch all products matching certain criteria from their SFCC store and update an external inventory system.
Properties
| Name | Type | Meaning |
|---|---|---|
| Site ID | String | The SFCC site ID (e.g. SiteGenesis). Identifies which storefront to use. |
Output
- The output consists of an array of objects, each with a
jsonfield containing a single product's data as returned by the OCAPIsearchProductsmethod. - The structure of each
jsonobject depends on the OCAPI response for product searches, typically including fields such as product ID, name, price, availability, etc.
Example output:
[
{
"json": {
"product_id": "12345",
"name": "Sample Product",
"price": 19.99,
"availability": "inStock"
// ...other product fields
}
},
...
]
Dependencies
- External Service: Requires access to Salesforce Commerce Cloud (SFCC) with OCAPI enabled.
- Credentials: Needs valid
salesforceOcapicredentials in n8n, including:- Client ID
- Client Secret
- Hostname
- API version
- n8n Configuration: The node must be configured with the correct credentials and the target SFCC site ID.
Troubleshooting
Common issues:
- Invalid Credentials: If the provided client ID/secret or hostname are incorrect, authentication will fail.
- Incorrect Site ID: Using a non-existent or misspelled site ID will result in errors or empty results.
- API Permissions: The OCAPI user must have permissions to perform product searches.
Error messages and resolutions:
"Authentication failed": Check your OCAPI credentials and ensure they are correct."Site not found": Verify the Site ID matches your SFCC instance."Unexpected token"(when parsing query): Ensure any JSON input (such as filters) is properly formatted.