---
language: "en"
---
# 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

The following methods are registered in `PfxApiProducer` and dispatched by the `method` path parameter.  

|             Method             |    Aliases     |                                                                         Description                                                                         |                                                                               Key Parameters                                                                               |                  Typical Object Types                  |
|--------------------------------|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|
| `loaddata`                     | --             | Bulk-load data into Pricefx objects (products, customers, pricing parameters, data sources, datamarts, etc.)                                                | `objectType`, `mapper`, `dsUniqueName`, `businessKeys`                                                                                                                     | P, C, PX, CX, LTV, MLTV, DMDS, and all extension types |
| `loaddataFile`                 | --             | Load data from a file (compressed/batched). With `async=true` each batch is submitted to `/loaddata.file/{TypeCode}/async` and tracked through its JST job. | `objectType`, `mapper`, `dsUniqueName`, `waitForCompletionStrategy`, `async`, `asyncTimeout`, `asyncRetry`                                                                 | Same as `loaddata`                                     |
| `fetch`                        | --             | Fetch (export) data from any supported Pricefx object. Supports batched mode for large data sets.                                                           | `objectType`, `filter`, `startRow`, `endRow`, `batchedMode`, `batchSize`, `resultFields`, `valueFields`, `output`                                                          | All object types                                       |
| `fetchToCsv`                   | --             | Fetch data and write directly to a CSV file. Sets statistics headers on the exchange.                                                                       | `objectType`, `filter`, `batchSize`                                                                                                                                        | All object types                                       |
| `fetchIterator`                | --             | Continue a batched fetch iteration (used internally with `batchedMode`).                                                                                    | *(reads from exchange)*                                                                                                                                                    | --                                                     |
| `fetchFcs`                     | --             | Fetch a field collection structure. If `dsUniqueName` is not set, fetches all objects of the given `objectType`.                                            | `objectType`, `dsUniqueName`                                                                                                                                               | CFS and related                                        |
| `integrate`                    | --             | Upsert data into Pricefx using business-key matching. Existing records are updated; new records are inserted.                                               | `objectType`, `mapper`, `businessKeys`, `condition`                                                                                                                        | P, C, PX, CX, LTV, MLTV, PR, RR, and extension types   |
| `flush`                        | --             | Flush data from a Datamart data feed to a data source.                                                                                                      | `dataFeedName`, `dataSourceName`, `incrementalDate`                                                                                                                        | DM/DMDS                                                |
| `truncate`                     | --             | Truncate a data feed, data source, or Datamart.                                                                                                             | `objectType`, `targetName`, `typedId`, `dtoFilter`, `incrementalDate`                                                                                                      | DF, DS, DM                                             |
| `refresh`                      | --             | Refresh a Datamart. Available from v1.1.15.                                                                                                                 | `targetName`, `incrementalDate`, `incremental`                                                                                                                             | DM                                                     |
| `delete`                       | --             | Delete records by filter or typedId. Supports async mode.                                                                                                   | `objectType`, `filter`, `typedId`, `typedIdList`, `async`, `asyncTimeout`, `asyncRetry`                                                                                    | All object types                                       |
| `calculate`                    | --             | Calculate (recalculate) values -- Datamart derived columns, CFS, Price Lists, etc.                                                                          | `objectType`, `typedId`, `targetName`, `incrementalDate`, `label`, `fullListRecalculate`, `recalcTainted`                                                                  | DM, CFS, PL, PG                                        |
| `execute`                      | --             | Execute a Pricefx formula.                                                                                                                                  | `sku`, `formulaName`, `mapper`                                                                                                                                             | F (Formula)                                            |
| `update`                       | --             | Update a single record by typedId. Body must be the data map.                                                                                               | `objectType`, `typedId`                                                                                                                                                    | All object types                                       |
| `save`                         | --             | Save (create or full-replace) a single record. Body must be the data map with `typedId`.                                                                    | `objectType`, `typedId`, `mapper`                                                                                                                                          | All object types                                       |
| `massEdit`                     | `massedit`     | Mass-edit records matching a filter.                                                                                                                        | `objectType`, `filter`, `massEditFields`                                                                                                                                   | All object types                                       |
| `getAssignedCustomers`         | --             | Fetch customers assigned to a customer group.                                                                                                               | `typedId`, `resultFields`                                                                                                                                                  | C (Customer)                                           |
| `customers`                    | --             | Trigger customer Datamart load.                                                                                                                             | `incrementalDate`                                                                                                                                                          | C (Customer)                                           |
| `products`                     | --             | Trigger product Datamart load.                                                                                                                              | `incrementalDate`                                                                                                                                                          | P (Product)                                            |
| `cancel`                       | --             | Cancel an ongoing operation by typedId.                                                                                                                     | `typedId`                                                                                                                                                                  | --                                                     |
| `resetColumn`                  | `resetcolumn`  | Reset a column on a given object.                                                                                                                           | `objectType`, `resetColumnName`                                                                                                                                            | --                                                     |
| `internalCopy`                 | `internalcopy` | Internal copy of a Pricefx entity (e.g., duplicate a price list).                                                                                           | `label`                                                                                                                                                                    | --                                                     |
| `addProducts`                  | `addproducts`  | Add products to a Quote.                                                                                                                                    | `quoteUniqueName`, `quoteSkuList`, `parent`                                                                                                                                | Q (Quote)                                              |
| `import`                       | --             | Server-side import using the Pricefx Import API. Reads CSV/file from body or staging.                                                                       | `objectType`, `fileName`, `stagingFile`, `truncate`, `deDuplicate`, `skipIndexing`, `jst`, `delimiter`, `quoteCharacter`, `escapeCharacter`, `nullValue`, `eol`, `headers` | All loadable types                                     |
| `datamartImport`               | --             | Import data into a Datamart via the DM Import API. Body is the data.                                                                                        | `targetName`, `fileName`, `truncate`, `deDuplicate`, `skipIndexing`, `jst`                                                                                                 | DM, DMDS                                               |
| `datamartExport`               | --             | Export data from a Datamart.                                                                                                                                | `objectType`, `dsUniqueName`, `maxRows`, `suffix`                                                                                                                          | DM, DMDS                                               |
| `upsertPriceItems`             | `updateLPG`    | Upsert price list or live price grid items.                                                                                                                 | `objectType`, `typedId`, `priceListId`, `performRecalculation`                                                                                                             | PLI, LPG, XPLI                                         |
| `importUsers`                  | --             | Import users into Pricefx. Can also be triggered via `loaddata` with `objectType=U`.                                                                        | `keepExistingPermissions`                                                                                                                                                  | U (User)                                               |
| `uploadProductImage`           | --             | Upload a product image. File name is read from `Exchange.FILE_NAME` header.                                                                                 | `typedId`                                                                                                                                                                  | P (Product)                                            |
| `distributedCalculation`       | --             | Trigger a distributed calculation job.                                                                                                                      | `objectType`, `typedId`                                                                                                                                                    | DM                                                     |
| `createNewRevision`            | --             | Create a new revision of a Pricefx entity (e.g., Price List, Quote).                                                                                        | `objectType`, `typedId`                                                                                                                                                    | PL, Q, RBA                                             |
| `duplicateCustomForm`          | --             | Duplicate a Custom Form.                                                                                                                                    | `objectType`, `typedId`                                                                                                                                                    | CFO                                                    |
| `changeStatusCustomForm`       | --             | Change the workflow status of a Custom Form.                                                                                                                | `objectType`, `typedId`, `cfoStatusOperation`                                                                                                                              | CFO                                                    |
| `dataload`                     | --             | Trigger a named dataload job on Pricefx.                                                                                                                    | `dataloadType`, `label`                                                                                                                                                    | --                                                     |
| `fetchRebateAgreementItemList` | --             | Fetch rebate agreement line items. Exchange body is used as the input data object.                                                                          | *(body as input)*                                                                                                                                                          | RBA                                                    |
| `bdManagerUpload`              | --             | Upload binary data via the BD Manager.                                                                                                                      | `fileName`, `typedId`                                                                                                                                                      | BD                                                     |

*** ** * ** ***

## 3. URI Parameters

All parameters below are declared as `@UriParam` on `PfxApiConfiguration` and can be set in the endpoint URI or injected via Camel property placeholders.  

|           Parameter            |                        Type                        |    Default     |                                                                                                                                                                                                                                                                Description                                                                                                                                                                                                                                                                |
|--------------------------------|----------------------------------------------------|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `objectType`                   | `ObjectType` (enum)                                | --             | The Pricefx object type (e.g., `P`, `C`, `PX`, `CX`, `LTV`, `MLTV`, `DM`, `DMDS`, `PLI`, `Q`, `CFO`, etc.). See the full `ObjectType` enum for all values.                                                                                                                                                                                                                                                                                                                                                                                |
| `connection`                   | `String`                                           | --             | Name of the Pricefx connection bean. Optional -- if omitted the Spring bean named `pricefx` is used.                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `mapper`                       | `String`                                           | --             | Name of the mapper bean (or header/property reference) used to transform data before sending to Pricefx.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `filter`                       | `String`                                           | --             | Name of the filter bean used by `fetch`, `delete`, or `massEdit`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `sql`                          | `String`                                           | --             | SQL-like syntax as an alternative to `filter`. Example: `SELECT a WHERE b < 1 OR a <= 3 AND x > 1 ORDER BY a ASC`. The FROM clause is omitted.                                                                                                                                                                                                                                                                                                                                                                                            |
| `customFilterExpression`       | `String`                                           | --             | Advanced custom filter expression for comparing columns instead of values.                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `typedId`                      | `String`                                           | --             | The `typedId` of a Pricefx entity (e.g., `12.P`, `45.PL`).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `typedIdList`                  | `String`                                           | --             | Comma-separated list of typedIds. Used by `delete`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `dsUniqueName`                 | `String`                                           | --             | Unique name of a Data Source or Datamart. Resolves to `typedId` internally.                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `quoteUniqueName`              | `String`                                           | --             | Unique name for the Quote API. Resolves to `typedId`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `dcrUniqueName`                | `String`                                           | --             | Unique name for Data Change Request API. Resolves to `typedId`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `pricingParameterId`           | `String`                                           | --             | Pricing parameter ID (for Lookup Tables / Matrix tables).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `pricingParameterName`         | `String`                                           | --             | Pricing parameter name (for Lookup Table values).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `conditionRecordSetId`         | `String`                                           | --             | Condition Record Set ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `conditionRecordSetName`       | `String`                                           | --             | Condition Record Set name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `businessKeys`                 | `String`                                           | --             | Comma-separated business key field names for `loaddata`/`integrate`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `businessKeysMaxLengths`       | `String`                                           | --             | Comma-separated max lengths for business key fields.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `detectJoinFields`             | `Boolean`                                          | `true`         | Whether join field definitions should be auto-detected from the server.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `joinFieldsStrategy`           | `JoinFieldsStrategy`                               | `Legacy`       | Strategy for join fields. Values: `Legacy`, `SetDefaultIfAbsent`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `startRow`                     | `Integer`                                          | --             | Start row for `fetch` (pagination).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `endRow`                       | `Integer`                                          | --             | End row for `fetch` (pagination).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `countOnly`                    | `Boolean`                                          | --             | If `true`, `fetch` returns only the row count, not data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `batchedMode`                  | `Boolean`                                          | `false`        | Enable batched fetching for large data sets.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `batchSize`                    | `Integer`                                          | `5000`         | Number of rows per batch when `batchedMode` is enabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `resultFields`                 | `String`                                           | --             | Comma-separated field names to include in the result. All fields are fetched from DB; filtering happens in the response. Result is a Map.                                                                                                                                                                                                                                                                                                                                                                                                 |
| `valueFields`                  | `String`                                           | --             | Comma-separated field names to fetch from the database (server-side projection for better performance). Result is a list of field values, not a Map.                                                                                                                                                                                                                                                                                                                                                                                      |
| `sortBy`                       | `String`                                           | --             | Sort-by clause. Overrides any `sortBy` from the filter definition.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `enableNullFields`             | `Boolean`                                          | `false`        | Whether null fields should be returned via the REST API.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `distinctResults`              | `Boolean`                                          | `false`        | Add a DISTINCT clause to the search query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `output`                       | `OutputType` (enum)                                | --             | Output format for `fetch`. Values: `JSON`, `CSV`, `EXCEL`, `PDF`, `JSON_DETAIL`, `PDF_DETAIL`, `EXCEL_DETAIL`.                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `useColumnNames`               | `Boolean`                                          | `false`        | Use human-readable column names (e.g., "Attribute 1") instead of attribute codes in CSV output.                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `dataSourceName`               | `String`                                           | --             | Target data source name for `flush`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `dataFeedName`                 | `String`                                           | --             | Source data feed name for `flush`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `incrementalDate`              | `String`                                           | --             | Incremental date for `flush`, `truncate`, `refresh`, `customers`, `products`.                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `incremental`                  | `Boolean`                                          | --             | Incremental flag for `refresh`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `direct2ds`                    | `Boolean`                                          | `false`        | If `true`, data goes directly to the data source, skipping the data feed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `replaceSoftDeleted`           | `Boolean`                                          | `false`        | Used by `loaddata` on the general `/loaddata/{typecode}` path only (not LTV/MLTV/DM object types or `loaddataFile`, which use different endpoints). If `true`, soft-deleted rows are replaced instead of being revived with their old attribute values; requires join fields and conflicts with `undelete=true`.                                                                                                                                                                                                                          |
| `targetName`                   | `String`                                           | --             | Target name for `truncate` and `refresh`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `dtoFilter`                    | `String`                                           | --             | Filter expression on the target, used by `truncate`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `condition`                    | `String`                                           | --             | Condition for `integrate`: existing records that don't match this condition are not updated.                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `label`                        | `String`                                           | --             | Label for the target object. Used by `calculate` (CFS), `dataload`, and `internalCopy`.                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `sku`                          | `String`                                           | --             | SKU for `execute` (formula). Optional -- either `formulaName` or `sku` must be provided.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `formulaName`                  | `String`                                           | --             | Formula name for `execute`. Optional -- either `formulaName` or `sku` must be provided.                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `priceListId`                  | `String`                                           | --             | Price List ID for fetch/upsert operations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `priceListItemId`              | `String`                                           | --             | Price List Item ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `outputTarget`                 | `String`                                           | --             | Where to store the API response in the exchange. Values: `header`, `property`, or `body` (default).                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `outputTargetName`             | `String`                                           | --             | Name of the exchange header or property when `outputTarget` is `header` or `property`.                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `converterStrategyType`        | `MapperConverterStrategyType`                      | --             | Data auto-conversion strategy. Values: `MANUAL`, `AUTO`. When `AUTO`, field types are inferred from partition metadata.                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `massEditFields`               | `String`                                           | --             | Field definitions for the `massEdit` method. Syntax: `FIELD;value,FIELD2;value2`. An empty value (`FIELD;`, which is also what Camel URI substitution produces from `${headers.x}` when the header is a Java `null` or `""`) clears the column --- the request carries an explicit `"fieldValue":null`, same shape as the Pricefx massedit UI. The Pricefx API has no "set to empty string" mode for this method, so use a `mapper=` with a non-empty constant if you really need to store an empty string.                               |
| `resetColumnName`              | `String`                                           | --             | Column name for the `resetColumn` method.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `fileName`                     | `String`                                           | --             | File name for `import` / `bdManagerUpload`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `stagingFile`                  | `String`                                           | --             | Staging file reference for `import`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `deleteStagingFileAfterImport` | `Boolean`                                          | `true`         | Whether the staging file should be deleted after import completes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `truncate`                     | `Boolean`                                          | `false`        | Whether to truncate the target before importing. Used by `import`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `deDuplicate`                  | `Boolean`                                          | `true`         | Whether to de-duplicate records during import.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `skipIndexing`                 | `Boolean`                                          | `false`        | Whether to skip indexing during import.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `jst`                          | `Boolean`                                          | `false`        | Whether the datamart import runs with `useJST=true`: the partition executes it as a dedicated IMPORT dataload whose JobStatusTracker survives FE pod restarts. The `import` command then polls that JST (instead of `datamart.getactionstatus`) until completion; `datamartImport` only sends `useJST=true` and returns the dataload object (with `jstId`) without polling. The IM dataload templates enable it explicitly. Note: JST mode adds dataload-pod startup overhead, so very small frequent imports become slower but reliable. |
| `maxRows`                      | `Integer`                                          | `50000`        | Maximum rows for `datamartExport`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `suffix`                       | `String`                                           | `customsuffix` | Suffix for `datamartExport`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `async`                        | `Boolean`                                          | `false`        | Run the operation asynchronously. Supported on `delete` and `loaddataFile`. For `loaddataFile` each batch is posted to `/loaddata.file/{TypeCode}/async` and returns immediately with a JST job id.                                                                                                                                                                                                                                                                                                                                       |
| `asyncTimeout`                 | `Integer`                                          | `30000`        | Timeout (ms) for async operations. For `loaddataFile` it bounds the whole JST wait. Size it to the expected duration of the load; the 30 s default is too low for real dataloads.                                                                                                                                                                                                                                                                                                                                                         |
| `asyncRetry`                   | `Integer`                                          | `10000`        | Poll interval (ms) between JST status checks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `waitForCompletionStrategy`    | `WaitForCompletionStrategy`                        | `Never`        | How IM waits for the async JST jobs of `loaddataFile` (only with `async=true`). `Never` (default): do not wait. `Always` (recommended for dataloads): wait for all jobs; a failed job or a timeout fails the route. `AlwaysAndIgnoreFailures`: wait for all jobs; job failures do not fail the route. See section 4.1.                                                                                                                                                                                                                    |
| `quoteSkuList`                 | `String`                                           | --             | Comma-separated SKUs for `addProducts`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `parent`                       | `String`                                           | --             | Parent property for `addProducts`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `delimiter`                    | `char`                                             | `,`            | CSV delimiter for `import`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `quoteCharacter`               | `char`                                             | `'`            | Quote character for `import`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `escapeCharacter`              | `char`                                             | `"`            | Escape character for `import`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `nullValue`                    | `String`                                           | `""`           | String representing null in import input.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `eol`                          | `String`                                           | \`\\r          |
| \|                             | ecord separator (end of line) for import input. \| |
| `headers`                      | `String`                                           | --             | Comma-separated column headers for `import` input.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `keepExistingPermissions`      | `Boolean`                                          | --             | For `importUsers`: keep existing permissions for users that already exist.                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `cfoStatusOperation`           | `CustomFormStatusOperation`                        | --             | Operation for `changeStatusCustomForm`. Values: `SUBMIT`, `REVOKE`, `WITHDRAW`.                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `dmtName`                      | `String`                                           | --             | Model Table name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `moName`                       | `String`                                           | --             | Parent Model name for a Model Table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `dataloadType`                 | `String`                                           | --             | Type of dataload to run (used with `label`).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `performRecalculation`         | `Boolean`                                          | `true`         | Whether `upsertPriceItems` should recalculate after update.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `fullListRecalculate`          | `Boolean`                                          | `false`        | Whether `calculate` should recalculate the entire Price List.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `recalcTainted`                | `Boolean`                                          | `false`        | Whether `calculate` should only recalculate changed (tainted) items.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

*** ** * ** ***

## 4. Common Patterns

### 4.0 loaddataFile vs loaddata

Choose the import method based on your use case:  

|     Method     |                                When to Use                                 |                                                     How It Works                                                      |
|----------------|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| `loaddataFile` | **Default for all CSV imports** (P, PX, C, CX, LTV, MLTV2)                 | Streams the file directly to the Pricefx server. The server handles batching internally. Much faster for large files. |
| `loaddata`     | When you need Groovy row-level transformations or complex logic per record | IM parses and maps each record in memory, then sends via JSON API. Slower but more flexible.                          |

**Batch size guidance for** `loaddataFile` (based on number of fields per record):  

| Fields per Row | Recommended batchSize |
|----------------|-----------------------|
| \< 10 fields   | `500000`              |
| 10--20 fields  | `100000`--`200000`    |
| 20+ fields     | `50000` or less       |

More fields per row = more memory per batch. Default for `loaddata`: `5000`.

**PX / CX: table name in mapper, not in URI**

There is no `extensionName` parameter on `loaddata` or `loaddataFile`. For Product Extension (PX) and Customer Extension (CX) imports, the table name is set as a `<constant>` element in the mapper:
XML

    <loadMapper id="my-px-import.mapper">
        <constant expression="Prices" out="name"/>  <!-- Table name --- required for PX/CX -->
        <body in="sku" out="sku"/>
        <body in="price" out="attribute1" converterExpression="stringToDecimal"/>
    </loadMapper>

This `<constant ... out="name"/>` element is mandatory for PX and CX. Its position in the mapper does not matter.

### 4.1 Load Data (Import into Pricefx)

Load products into Pricefx using a mapper to transform the incoming data:
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"/>
        <onCompletion onCompleteOnly="true">
            <to uri="pfx-api:flush?objectType=DM&amp;dsUniqueName=MyDataSource"/>
        </onCompletion>
    </route>

Load data from a file asynchronously (JST-tracked) and wait for the result. `waitForCompletionStrategy` has an effect only together with `async=true`; size `asyncTimeout` to the expected duration of the load:
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;async=true&amp;waitForCompletionStrategy=Always&amp;asyncTimeout=3600000&amp;asyncRetry=5000"/>
    </route>

#### waitForCompletionStrategy - how IM waits for the async load

The strategy applies only to `loaddataFile` with `async=true`. Each async batch creates a JST job on the partition, and the submission itself returns immediately. The strategy tells IM what to do after it submits the batches:  

|           Value           |                                  Does IM wait for the jobs?                                   |                                         Does a failed job fail the route?                                          |                                         Use when                                          |
|---------------------------|-----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| `Never` (default)         | No. The route continues immediately.                                                          | No. Job results are never checked.                                                                                 | Something else checks the jobs. Do not use in a normal dataload route.                    |
| `Always` (recommended)    | Yes. IM polls every `asyncRetry` ms until every JST is `FINISHED`, at most `asyncTimeout` ms. | Yes. `FAILED`, `CANCELLED` or `INTERRUPTED` fails the route with the job messages. A timeout also fails the route. | The route result must reflect the load result. This is the correct setting for dataloads. |
| `AlwaysAndIgnoreFailures` | Yes. Same polling as `Always`.                                                                | No. Failed jobs count as completed. Only a timeout fails the route.                                                | Partial loads are acceptable. The route only needs to know that the load has ended.       |

Rules of thumb:

* The default (`Never`) does NOT wait. The route reports success even when the load fails. Set the strategy explicitly whenever the data must be in Pricefx before the route continues.

* Set `Always` when a later step depends on the loaded data - a flush, a delete-after, a completion event, or the removal of the source file.

* Size `asyncTimeout` to the expected duration of the load. The 30 s default is too low for real dataloads.

### 4.2 Fetch (Export from Pricefx)

Fetch all products using a filter:
XML

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

Fetch with SQL-like filter syntax and pagination:
XML

    <route>
        <from uri="direct:fetchFiltered"/>
        <to uri="pfx-api:fetch?objectType=P&amp;sql=SELECT sku, attribute1 WHERE attribute2 > 100 ORDER BY sku ASC&amp;startRow=0&amp;endRow=1000"/>
    </route>

Fetch in batched mode for large data sets:
XML

    <route>
        <from uri="direct:fetchBatched"/>
        <to uri="pfx-api:fetch?objectType=DMDS&amp;dsUniqueName=MyDS&amp;filter=myFilter&amp;batchedMode=true&amp;batchSize=10000"/>
    </route>

Fetch with CSV output:
XML

    <route>
        <from uri="direct:fetchCsv"/>
        <to uri="pfx-api:fetch?objectType=P&amp;filter=myFilter&amp;output=CSV&amp;useColumnNames=true"/>
    </route>

Fetch to CSV file (fetchToCsv method):
XML

    <route>
        <from uri="direct:fetchToCsvFile"/>
        <to uri="pfx-api:fetchToCsv?objectType=P&amp;filter=myFilter&amp;batchSize=5000"/>
    </route>

### 4.3 Truncate

Truncate a Data Source:
XML

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

Truncate a Data Feed with a filter:
XML

    <route>
        <from uri="direct:truncateDF"/>
        <to uri="pfx-api:truncate?objectType=DF&amp;targetName=MyDataFeed&amp;dtoFilter=myTruncateFilter"/>
    </route>

### 4.4 Delete

Delete records by filter:
XML

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

Delete by typedId (async):
XML

    <route>
        <from uri="direct:deleteById"/>
        <to uri="pfx-api:delete?objectType=PL&amp;typedId=123.PL&amp;async=true&amp;asyncTimeout=60000"/>
    </route>

### 4.5 Integrate (Upsert)

Integrate (upsert) data using an integrate mapper:
XML

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

Integrate with a condition (only update records matching the condition):
XML

    <route>
        <from uri="direct:conditionalIntegrate"/>
        <to uri="pfx-api:integrate?objectType=P&amp;mapper=productIntegrateMapper&amp;businessKeys=sku&amp;condition=myConditionFilter"/>
    </route>

### 4.6 Internal Copy

Copy (duplicate) a Price List:
XML

    <route>
        <from uri="direct:copyPriceList"/>
        <to uri="pfx-api:internalCopy?objectType=PL&amp;label=CopiedPriceList"/>
    </route>

### 4.7 Flush

Flush data from a data feed to a data source:
XML

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

Incremental flush:
XML

    <route>
        <from uri="direct:flushIncremental"/>
        <to uri="pfx-api:flush?dataFeedName=MyFeed&amp;dataSourceName=MyDS&amp;incrementalDate=2026-01-01"/>
    </route>

### 4.8 Refresh Datamart

XML

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

### 4.9 Calculate

Calculate a CFS by label:
XML

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

Calculate Datamart derived columns:
XML

    <route>
        <from uri="direct:calculateDM"/>
        <to uri="pfx-api:calculate?objectType=DM&amp;typedId=5.DM&amp;targetName=MyTarget"/>
    </route>

### 4.10 Execute Formula

XML

    <route>
        <from uri="direct:executeFormula"/>
        <to uri="pfx-api:execute?formulaName=MyFormula"/>
    </route>

### 4.11 Import (Server-Side)

Server-side import using the Pricefx Import API. The method automatically routes to V1 or V2:

* **V1** (delegates to `loaddata`) --- for all non-Datamart object types (P, C, LTV, etc.)

* **V2** (compressed staging upload) --- for Datamart types: DMF, DMDS, DM, DMSIM, DMM

XML

    <route>
        <from uri="direct:serverImport"/>
        <to uri="pfx-api:import?objectType=P&amp;fileName=products.csv&amp;truncate=false&amp;deDuplicate=true&amp;delimiter=,"/>
    </route>

### 4.12 Upsert Price Items

XML

    <route>
        <from uri="direct:upsertPLI"/>
        <to uri="pfx-api:upsertPriceItems?objectType=PLI&amp;priceListId=42.PL&amp;performRecalculation=true"/>
    </route>

### 4.13 Custom Form Operations

Change status:
XML

    <route>
        <from uri="direct:submitCFO"/>
        <to uri="pfx-api:changeStatusCustomForm?objectType=CFO&amp;typedId=99.CFO&amp;cfoStatusOperation=SUBMIT"/>
    </route>

Duplicate:
XML

    <route>
        <from uri="direct:duplicateCFO"/>
        <to uri="pfx-api:duplicateCustomForm?objectType=CFO&amp;typedId=99.CFO"/>
    </route>

*** ** * ** ***

## 5. Headers

### 5.1 Headers Consumed by the Component

The following Camel message headers are read by pfx-api commands and can be used to override or supplement URI parameters at runtime:  

|                 Header                 |       Type        |                 Used By                 |                             Description                              |
|----------------------------------------|-------------------|-----------------------------------------|----------------------------------------------------------------------|
| `loadDataMapperPfx`                    | `LoaddataMapper`  | `loaddata`                              | Overrides the mapper for loaddata when set on the incoming message.  |
| `integrateMapperPfx`                   | `IntegrateMapper` | `integrate`                             | Overrides the mapper for integrate when set on the incoming message. |
| `pfxBusinessKeys`                      | `String`          | `loaddata`                              | Overrides the `businessKeys` parameter.                              |
| `pfxBusinessKeysMaxLengths`            | `String`          | `loaddata`                              | Overrides the `businessKeysMaxLengths` parameter.                    |
| `Exchange.FILE_NAME` (`CamelFileName`) | `String`          | `uploadProductImage`, `bdManagerUpload` | The file name used when uploading product images or binary data.     |
| `CamelAwsS3Key`                        | `String`          | `import` (S3 input)                     | S3 object key, used as file name when importing from S3.             |

### 5.2 Headers Set by the Component

The following headers are set on the outgoing exchange message after a pfx-api operation completes:  

|               Header               |   Type    |          Set By          |                                                          Description                                                          |
|------------------------------------|-----------|--------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| `totalRows`                        | `Integer` | `fetch`, `fetchToCsv`    | Total number of rows returned by the server for the query (before pagination). Set on the exchange for use in batching logic. |
| `PfxInputRecordsCount`             | `Integer` | `loaddata`, `import`     | Number of input records in the current batch.                                                                                 |
| `PfxTotalInputRecordsCount`        | `Integer` | `loaddataFile`, `import` | Total number of input records processed across all batches.                                                                   |
| `PfxTotalFailedInputRecordsCount`  | `Integer` | `loaddataFile`, `import` | Total number of failed input records.                                                                                         |
| `PfxFailedBatchesCount`            | `Integer` | `loaddataFile`           | Number of failed batches.                                                                                                     |
| `PfxApiFetchToCsvOutputFile`       | `String`  | `fetchToCsv`             | Path to the output CSV file.                                                                                                  |
| `PfxApiFetchToCsvBatchSize`        | `Integer` | `fetchToCsv`             | Batch size used during the fetch.                                                                                             |
| `PfxApiFetchToCsvBatchCount`       | `Integer` | `fetchToCsv`             | Number of batches fetched.                                                                                                    |
| `PfxApiFetchToCsvRecordsCount`     | `Integer` | `fetchToCsv`             | Total number of records fetched.                                                                                              |
| `PfxApiFetchToCsvApiCallsDuration` | `Long`    | `fetchToCsv`             | Total time (ms) spent on API calls.                                                                                           |
| `PfxApiFetchToCsvFileSaveDuration` | `Long`    | `fetchToCsv`             | Total time (ms) spent writing to the file.                                                                                    |
| `FilePreviewResultAsBase64`        | `Boolean` | `fetch` (preview)        | Signals that the fetch preview result is Base64-encoded.                                                                      |

*** ** * ** ***

## 6. Commonly Used Object Types (Quick Reference)

|  Code  |         Label          |                      Description                       |
|--------|------------------------|--------------------------------------------------------|
| `P`    | Product                | Products master data                                   |
| `C`    | Customer               | Customers master data                                  |
| `PX`   | ProductExtension       | Product extension tables (PX3..PX50)                   |
| `CX`   | CustomerExtension      | Customer extension tables (CX3..CX50)                  |
| `LTV`  | LookupTableValue       | Simple lookup table values                             |
| `MLTV` | MatrixLookupTableValue | Matrix lookup table values (MLTV..MLTV6 for multi-key) |
| `PL`   | Pricelist              | Price Lists                                            |
| `PLI`  | PricelistItem          | Price List items                                       |
| `PG`   | PriceGrid              | Price Grids                                            |
| `PGI`  | PriceGridItem          | Price Grid items                                       |
| `LPG`  | LIVEPRICEGRID          | Live Price Grid                                        |
| `Q`    | Quote                  | Quotes                                                 |
| `QLI`  | QuoteLineItem          | Quote line items                                       |
| `DM`   | DMDatamart             | Datamarts                                              |
| `DMDS` | DMDataSource           | Datamart Data Sources                                  |
| `DMT`  | Model                  | Model Tables                                           |
| `DS`   | *(data source)*        | Data Source (for truncate/flush)                       |
| `DF`   | *(data feed)*          | Data Feed (for truncate/flush)                         |
| `CFS`  | CalculatedFieldSet     | Calculated Field Sets                                  |
| `PR`   | PriceRecord            | Price Records                                          |
| `RBA`  | RebateAgreement        | Rebate Agreements                                      |
| `RR`   | RebateRecord           | Rebate Records                                         |
| `CFO`  | CustomForm             | Custom Forms                                           |
| `U`    | User                   | Users                                                  |
| `SIM`  | Simulation             | Simulations                                            |
| `DCR`  | DataChangeRequest      | Data Change Requests                                   |

For the full list, see the `ObjectType` enum in `pricefx-client/src/main/java/net/pricefx/integration/api/ObjectType.java`.

*** ** * ** ***

## 7. Filter Definition (XSD Reference)

Filters are defined in dedicated filter XML files (under `filters/`) using the `<filters>` wrapper. The filter structure supports `and`, `or`, and `not` logical operators with `criterion` leaf nodes.
XML

    <filters>
        <filter id="myFilter" resultFields="sku,attribute1" sortBy="sku">
            <and>
                <criterion fieldName="attribute1" operator="greaterThan" value="100"/>
                <criterion fieldName="attribute2" operator="notNull"/>
            </and>
        </filter>
    </filters>

### Supported Filter Operators

|     Operator     |              Description               |
|------------------|----------------------------------------|
| `equals`         | Equals                                 |
| `notEqual`       | Not equal                              |
| `greaterThan`    | Greater than                           |
| `lessThan`       | Less than                              |
| `greaterOrEqual` | Greater than or equal                  |
| `lessOrEqual`    | Less than or equal                     |
| `contains`       | Contains (case-sensitive)              |
| `startsWith`     | Starts with (case-sensitive)           |
| `endsWith`       | Ends with (case-sensitive)             |
| `iContains`      | Contains (case-insensitive)            |
| `iStartsWith`    | Starts with (case-insensitive)         |
| `iEndsWith`      | Ends with (case-insensitive)           |
| `notContains`    | Does not contain                       |
| `notStartsWith`  | Does not start with                    |
| `notEndsWith`    | Does not end with                      |
| `iNotContains`   | Does not contain (case-insensitive)    |
| `iNotStartsWith` | Does not start with (case-insensitive) |
| `iNotEndsWith`   | Does not end with (case-insensitive)   |
| `isNull`         | Is null                                |
| `notNull`        | Is not null                            |
| `inSet`          | In set (comma-separated values)        |
| `notInSet`       | Not in set                             |
| `custom`         | Custom SQL expression                  |