Overview
OCI 5.0 supports function calls: requests where the procurement system not only logs in, but wants to perform a specific action — for example, validate a product directly, navigate to search results, or download the catalog as JSON.
OciFunctionDispatcher
The OciFunctionDispatcher is the central entry point. It receives the function parameter, normalises it with strtoupper(), and routes it via match to the appropriate controller:
// OciFunctionDispatcher::dispatch()
return match (strtoupper($function)) {
'DETAIL' => $this->ociDetailController->handle(...),
'VALIDATE' => $this->ociValidateController->handle(...),
'SOURCING' => $this->ociSourcingController->handle(...),
'BACKGROUND_SEARCH' => $this->ociBackgroundSearchController->handle(...),
'DOWNLOADJSON' => $this->ociDownloadJsonController->handle(...),
'QUANTITYCHECK' => $this->ociQuantityCheckController->handle(...),
default => $this->ociUndefinedFunctionController->handle($function, $params),
};
The function parameter is case-insensitive: detail, Detail, and DETAIL all route to the same controller.
Two SalesChannelContexts
All function controllers receive two separate SalesChannelContexts:
| Parameter | Purpose |
|---|---|
$dataFeedContext | Product queries and DataField resolution; uses the data feed SalesChannel configured in the OCI system |
$cartContext | Cart operations (adding products); uses the SalesChannel of the logged-in buyer |
This separation allows, for example, different price groups: product data (and OCI field resolution) uses the data feed context, cart operations use the buyer context.
Supported functions
function value | Controller class | Required parameters | Response type |
|---|---|---|---|
DETAIL | OciDetailController | productid | Redirect to product detail page |
VALIDATE | OciValidateController | productid, quantity | OCI form HTML |
SOURCING | OciSourcingController | searchstring | Redirect to search results page |
BACKGROUND_SEARCH | OciBackgroundSearchController | searchstring | OCI form HTML |
DOWNLOADJSON | OciDownloadJsonController | – | JSON product catalog |
QUANTITYCHECK | OciQuantityCheckController | productid | JSON availability |
| (unknown) | OciUndefinedFunctionController | – | Flash message + redirect to home |
Fallback: unknown functions
Unknown function values land in OciUndefinedFunctionController. It adds a flash warning and redirects to the Shopware home page:
OCI function "UNKNOWN_FUNCTION" is not supported.
Session behaviour
Not all functions keep the ConnectorSession alive:
| Function | Session after call |
|---|---|
DETAIL | Active (buyer stays logged in) |
SOURCING | Active (buyer stays logged in) |
VALIDATE | Cleared |
BACKGROUND_SEARCH | Cleared |
DOWNLOADJSON | Cleared |
QUANTITYCHECK | Cleared |