pfx-api Component

pfx-api Component

Summary: Complete reference of the pfx-api Camel component -- the primary interface for all Pricefx API operations (load, fetch, delete, integrate, truncate, flush, etc.).


1. URI Format

pfx-api:method?param1=value1&param2=value2

The component is producer-only (no consumer/polling support). The method path parameter is required and selects the API operation to perform. All other configuration is passed as URI query parameters, which map to the fields of PfxApiConfiguration.

Minimal example:

XML
<to uri="pfx-api:fetch?objectType=P&amp;filter=myFilter"/>

2. Available Methods

Method

Description

Key Parameters

loaddata

Bulk-load data into Pricefx objects

objectType, mapper, dsUniqueName, businessKeys

loaddataFile

Load data from a file (compressed/batched)

objectType, mapper, waitForCompletionStrategy

fetch

Fetch (export) data from any supported Pricefx object

objectType, filter, batchedMode, batchSize

fetchToCsv

Fetch data and write directly to a CSV file

objectType, filter, batchSize

fetchIterator

Continue a batched fetch iteration

(reads from exchange)

fetchFcs

Fetch a field collection structure

objectType, dsUniqueName

integrate

Upsert data using business-key matching

objectType, mapper, businessKeys

flush

Flush data from a data feed to a data source

dataFeedName, dataSourceName

truncate

Truncate a data feed, data source, or Datamart

objectType, targetName

refresh

Refresh a Datamart

targetName, incremental

delete

Delete records by filter or typedId

objectType, filter, typedId

calculate

Calculate/recalculate values

objectType, typedId, targetName

execute

Execute a Pricefx formula

sku, formulaName

update

Update a single record by typedId

objectType, typedId

save

Save (create or full-replace) a single record

objectType, typedId

massEdit

Mass-edit records matching a filter

objectType, filter, massEditFields

import

Server-side import using the Pricefx Import API

objectType, fileName

datamartImport

Import data into a Datamart via the DM Import API

targetName, fileName

datamartExport

Export data from a Datamart

objectType, dsUniqueName

internalCopy

Internal copy of a Pricefx entity

label

upsertPriceItems

Upsert price list or live price grid items

objectType, typedId, priceListId

See the full method reference in the source code for additional methods: cancel, resetColumn, addProducts, customers, products, importUsers, uploadProductImage, distributedCalculation, createNewRevision, duplicateCustomForm, changeStatusCustomForm, dataload, fetchRebateAgreementItemList, bdManagerUpload, getAssignedCustomers.


3. URI Parameters

All parameters are declared as @UriParam on PfxApiConfiguration. See the full parameter reference in the detailed documentation.

Key parameters:

Parameter

Type

Default

Description

objectType

ObjectType

--

Pricefx object type (P, C, PX, CX, LTV, MLTV, DM, DMDS, etc.)

connection

String

--

Name of the Pricefx connection bean

mapper

String

--

Mapper bean name for data transformation

filter

String

--

Filter bean name for fetch/delete/massEdit

dsUniqueName

String

--

Data Source unique name

businessKeys

String

--

Comma-separated business key field names

batchedMode

Boolean

false

Enable batched fetching

batchSize

Integer

5000

Rows per batch

dataFeedName

String

--

Source data feed name for flush

dataSourceName

String

--

Target data source name for flush

outputTarget

String

--

Where to store response: header, property, or body

outputTargetName

String

--

Name of header/property for outputTarget

async

Boolean

false

Run operation asynchronously

waitForCompletionStrategy

Enum

Never

Wait strategy for loaddataFile


4. Common Patterns

4.0 loaddataFile vs loaddata

Method

When to Use

How It Works

loaddataFile

Default for all CSV imports (P, PX, C, CX, LTV, MLTV2)

Streams file directly to server. Much faster for large files.

loaddata

When you need Groovy row-level transformations

IM parses and maps each record in memory. Slower but more flexible.

4.1 Load Data (Import into Pricefx)

Load products into Pricefx:

XML
<route>
    <from uri="direct:loadProducts"/>
    <to uri="pfx-api:loaddata?objectType=P&amp;mapper=productMapper&amp;businessKeys=sku"/>
</route>

Load data into a Data Source:

XML
<route>
    <from uri="direct:loadDataSource"/>
    <to uri="pfx-api:loaddata?objectType=DM&amp;dsUniqueName=MyDataSource&amp;mapper=dsMapper&amp;businessKeys=sku,region"/>
    <!-- Flush is required after loading to make data visible in analytics -->
    <to uri="pfx-api:flush?objectType=DM&amp;dsUniqueName=MyDataSource"/>
</route>

Important: Always call pfx-api:flush after loading data into a Data Source (DMDS/DMF). Without flush, loaded data is not visible in Pricefx analytics.

Load data from a file with batching and wait-for-completion:

XML
<route>
    <from uri="file:{{import.directory}}?{{archive.file}}&amp;{{read.lock}}"/>
    <to uri="pfx-api:loaddataFile?objectType=P&amp;mapper=productMapper&amp;businessKeys=sku&amp;waitForCompletionStrategy=Always"/>
</route>

4.2 Fetch (Export from Pricefx)

XML
<route>
    <from uri="direct:fetchProducts"/>
    <to uri="pfx-api:fetch?objectType=P&amp;filter=allProductsFilter"/>
</route>

4.3 Truncate

XML
<to uri="pfx-api:truncate?objectType=DS&amp;targetName=MyDataSource"/>

4.4 Delete

XML
<to uri="pfx-api:delete?objectType=P&amp;filter=deleteFilter"/>

4.5 Integrate (Upsert)

XML
<to uri="pfx-api:integrate?objectType=P&amp;mapper=productIntegrateMapper&amp;businessKeys=sku"/>

4.6 Flush

Flush data from a data feed to a data source:

XML
<to uri="pfx-api:flush?dataFeedName=MyFeed&amp;dataSourceName=MyDS"/>

4.7 Refresh Datamart

XML
<to uri="pfx-api:refresh?targetName=MyDatamart&amp;incremental=true"/>

4.8 Calculate

XML
<to uri="pfx-api:calculate?objectType=CFS&amp;label=MyCFS"/>

5. Commonly Used Object Types

Code

Description

P

Products

C

Customers

PX

Product Extensions

CX

Customer Extensions

LTV

Lookup Table Values

MLTV

Matrix Lookup Table Values

DM

Datamarts / Data Sources

DMDS

Datamart Data Sources

PL

Price Lists

PLI

Price List Items

Q

Quotes

CFS

Calculated Field Sets

CFO

Custom Forms

For the full list, see the ObjectType enum in the source code.