pfx-api:uploadProductImage
Upload a product image to Pricefx. The file name is read from the CamelFileName (Exchange.FILE_NAME) header on the exchange.
URI Format
pfx-api:uploadProductImage?typedId=123.P
Parameters
|
Parameter |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
|
String |
Yes |
-- |
The typedId of the product to which the image will be attached (e.g., |
Required Header:
|
Header |
Type |
Description |
|---|---|---|
|
|
String |
The file name for the uploaded image (e.g., |
Applicable Object Type: P (Product)
XML Route Examples
Upload a product image from a file endpoint:
<route>
<from uri="file:input/images?noop=true"/>
<to uri="pfx-api:uploadProductImage?typedId=123.P"/>
</route>
Upload a product image with a dynamically set file name:
<route>
<from uri="direct:uploadImage"/>
<setHeader name="CamelFileName">
<constant>product-photo.jpg</constant>
</setHeader>
<to uri="pfx-api:uploadProductImage?typedId=456.P"/>
</route>
Common Pitfalls
-
The
CamelFileNameheader must be set on the exchange before calling this endpoint. If it is missing, the upload may fail or use an unexpected file name. -
The exchange body must contain the image data (byte array or InputStream).
-
Ensure the
typedIdpoints to a valid, existing product.