DOWNLOADJSON & QUANTITYCHECK
DOWNLOADJSON
Class: OciDownloadJsonController
Purpose: Returns the complete product catalog as paginated JSON. The format follows the SAP Ariba catalog format (NEWITEM structure). Used to populate a procurement system's local catalog without an interactive punchout session.
Flow
- Read parameters (all optional with defaults)
- Load total product count:
OciProductService::getProductsTotalCount($dataFeedContext) - Calculate current page and clamp to
totalPages - Load product page:
OciProductService::getProductsPage($pageSize, $currentPage, $dataFeedContext) - Map each product to the
NEWITEMstructure - Clear session
- Return JSON response
Parameters
| Parameter | Default | Description |
|---|---|---|
pagesize | 50 | Number of products per page |
requestedpage | 1 | Requested page (1-based, clamped to totalPages) |
transactionid | Auto UUID | Transaction ID; auto-generated if not provided |
cti | "X" | Catalog Type Indicator (SAP convention) |
Response structure
{
"CTI": "X",
"CURRENTPAGE": 1,
"TOTALITEMS": 150,
"TOTALPAGES": 3,
"TRANSACTIONID": "a1b2c3d4...",
"Items": [
{
"NEWITEM": {
"ATTACHMENTS": [
{
"descriptions": [{ "description": "item image", "languageCode": "" }],
"fileName": "https://example.com/media/product.jpg",
"mimeType": "image/jpeg",
"type": "01"
}
],
"ATTRIBUTES": [],
"CATALOG_NAME": "Category name",
"CURRENCY": "EUR",
"DESCRIPTION": [{ "description": "Product name", "languageCode": "" }],
"EXT_PRODUCT_ID": "SW-1234",
"ITEM_TYPE": "product",
"LEADTIME": "",
"MINORDER_QTY": 1,
"PRICE": "9.99",
"PRICE_QUANTITY": 1,
"PRICE_SCALES": [{ "low": 1, "price": "9.99", "scaleType": "01" }],
"TAX": "19.00",
"UNIT": "PCE",
"VENDOR": "Manufacturer name",
"VENDOR_NAME": "Sales channel name"
}
}
]
}
Price logic
- If scale prices (
calculatedPrices) are present: the first scale price is used - Otherwise:
calculatedPrice.unitPrice - Format: 2 decimal places, dot as separator, no thousands separator
Error handling
If the controller throws an exception, it returns a JSON error response instead of an Items array:
{
"success": false,
"errorMessage": "..."
}
note
DOWNLOADJSON clears the ConnectorSession after the call. DataFields are not resolved for DOWNLOADJSON; fields are populated directly from SalesChannelProductEntity.
QUANTITYCHECK
Class: OciQuantityCheckController
Purpose: Returns the available stock for a single product. Used when the procurement system wants to check availability before placing an order.
Flow
- Check
productidparameter (required) - Load product by
productNumber($dataFeedContext) - Clear session
- Return JSON response with availability
Parameters
| Parameter | Required | Description |
|---|---|---|
productid | ✅ Yes | Product number |
Response (JSON)
{
"AVAILABLE_QUANTITY": 42,
"LEADTIME": ""
}
| Field | Source | Description |
|---|---|---|
AVAILABLE_QUANTITY | SalesChannelProductEntity::getAvailableStock() | Available stock |
LEADTIME | – | Always empty string (not implemented) |
Error behaviour
| Error | Exception |
|---|---|
productid missing | \RuntimeException: Parameter PRODUCTID is required and has not been provided. |
| Product not found | \RuntimeException: Product with product number "..." was not found. |