pfx-api:uploadProductImage

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

typedId

String

Yes

--

The typedId of the product to which the image will be attached (e.g., 123.P).

Required Header:

Header

Type

Description

CamelFileName (Exchange.FILE_NAME)

String

The file name for the uploaded image (e.g., product-image.png).

Applicable Object Type: P (Product)


XML Route Examples

Upload a product image from a file endpoint:

XML
<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:

XML
<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 CamelFileName header 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 typedId points to a valid, existing product.