API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the...

197
API Reference Manual Documentation of the interface of the Price f(x) backend service API revision: 2.8 (“Long Island Iced Tea”) Last update: August 2015

Transcript of API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the...

Page 1: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

API Reference Manual

Documentation of the interface of the Price f(x) backend service

API revision: 2.8 (“Long Island Iced Tea”)

Last update: August 2015

Page 2: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 2

Table of Content

1 Preface ......................................................................................................................................................... 10

1.1 Purpose of the document ...................................................................................................... 10

1.2 Intended audience................................................................................................................. 10

1.3 Document conventions ......................................................................................................... 10

2 General interface considerations ................................................................................................................. 10

2.1 Transport protocol ................................................................................................................ 10

2.2 Data format ........................................................................................................................... 10

2.3 API Versions ........................................................................................................................... 10

2.4 Authentication ....................................................................................................................... 11

2.4.1 API Protocol – Version 1 ................................................................................................ 11

2.4.2 API Protocol – Version 2 ................................................................................................ 11

2.5 Batching ................................................................................................................................. 12

2.6 Compression .......................................................................................................................... 13

2.7 Status codes .......................................................................................................................... 13

3 Commands reference ................................................................................................................................... 14

3.1 Authentication ....................................................................................................................... 14

3.1.1 Login (v1 only) ............................................................................................................... 14

3.1.2 Logout (v1 only) ............................................................................................................. 15

3.1.3 Token (v2 only) .............................................................................................................. 15

3.1.4 Locker (v2 only) ............................................................................................................. 16

3.2 Datasource operations .......................................................................................................... 19

3.2.1 Fetch .............................................................................................................................. 19

3.2.2 Update ........................................................................................................................... 21

3.2.3 Add ................................................................................................................................ 23

3.2.4 Delete ............................................................................................................................ 24

3.2.5 Reset Column ................................................................................................................ 25

3.2.6 Mass Edit ....................................................................................................................... 25

3.2.7 Integrate ........................................................................................................................ 26

3.2.8 Loaddata ........................................................................................................................ 27

3.3 Formula Manager .................................................................................................................. 28

Page 3: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 3

3.3.1 Check ............................................................................................................................. 28

3.3.2 Copy ............................................................................................................................... 29

3.3.3 Delete ............................................................................................................................ 30

3.3.4 Execute .......................................................................................................................... 30

3.3.5 Execute Formula ............................................................................................................ 31

3.3.6 Fetch .............................................................................................................................. 32

3.3.7 GetDefault ..................................................................................................................... 34

3.3.8 GetNames ...................................................................................................................... 35

3.3.9 GetElementNames ........................................................................................................ 35

3.3.10 Params ........................................................................................................................... 36

3.3.11 Set Default ..................................................................................................................... 36

3.3.12 Library Methods ............................................................................................................ 37

3.3.13 Test Execute .................................................................................................................. 37

3.3.14 Test Params ................................................................................................................... 41

3.3.15 Update ........................................................................................................................... 43

3.4 Calculated Field Set Manager ................................................................................................ 45

3.4.1 Calculate ........................................................................................................................ 45

3.4.2 Cancel ............................................................................................................................ 45

3.5 Pricelist Manager ................................................................................................................... 46

3.5.1 Add ................................................................................................................................ 46

3.5.2 Submit ........................................................................................................................... 49

3.5.3 Preview .......................................................................................................................... 50

3.5.4 Delete ............................................................................................................................ 51

3.5.5 Fetch .............................................................................................................................. 51

3.5.6 Fetch for SKU ................................................................................................................. 53

3.5.7 Fetch XLS........................................................................................................................ 54

3.5.8 Params ........................................................................................................................... 54

3.5.9 ParamValues .................................................................................................................. 56

3.5.10 Update ........................................................................................................................... 57

3.5.11 Cancel ............................................................................................................................ 58

3.5.12 Summarize ..................................................................................................................... 59

3.6 Manual Pricelist Manager ..................................................................................................... 61

3.6.1 Add ................................................................................................................................ 61

3.6.2 Delete ............................................................................................................................ 61

3.6.3 Fetch .............................................................................................................................. 62

Page 4: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 4

3.6.4 Update ........................................................................................................................... 62

3.6.5 Copy ............................................................................................................................... 64

3.6.6 Mass Edit ....................................................................................................................... 65

3.6.7 Reset Column ................................................................................................................ 65

3.6.8 Integrate ........................................................................................................................ 65

3.6.9 Calculate ........................................................................................................................ 66

3.7 Lookuptable Manager ........................................................................................................... 66

3.7.1 Add ................................................................................................................................ 66

3.7.2 Copy ............................................................................................................................... 68

3.7.3 Delete ............................................................................................................................ 68

3.7.4 Fetch .............................................................................................................................. 69

3.7.5 Update ........................................................................................................................... 70

3.7.6 Mass Edit ....................................................................................................................... 72

3.7.7 Reset Column ................................................................................................................ 72

3.7.8 Find references .............................................................................................................. 73

3.7.9 Integrate ........................................................................................................................ 73

3.8 Tree Manager ........................................................................................................................ 74

3.8.1 Add tree node ................................................................................................................ 74

3.8.2 Fetch tree ...................................................................................................................... 75

3.8.3 Update tree node .......................................................................................................... 76

3.8.4 Delete tree node ........................................................................................................... 77

3.9 Account Manager .................................................................................................................. 77

3.9.1 Fetching roles or user groups ........................................................................................ 77

3.9.2 Assigning roles or user groups....................................................................................... 78

3.9.3 Delete ............................................................................................................................ 79

3.9.4 Change Password .......................................................................................................... 79

3.9.5 Copy User ...................................................................................................................... 80

3.10 Preferences Manager ............................................................................................................ 80

3.10.1 Fetch .............................................................................................................................. 80

3.10.2 Update ........................................................................................................................... 81

3.11 Partition Manager ................................................................................................................. 83

3.11.1 Add ................................................................................................................................ 83

3.11.2 Delete ............................................................................................................................ 84

3.11.3 Update ........................................................................................................................... 84

3.11.4 Fetch global configuration ............................................................................................. 85

Page 5: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 5

3.12 Product manager ................................................................................................................... 85

3.12.1 Fetch .............................................................................................................................. 85

3.12.2 BoM References ............................................................................................................ 87

3.12.3 BoM Tree ....................................................................................................................... 88

3.12.4 Roll Up BoM ................................................................................................................... 90

3.12.5 Fetch Products ............................................................................................................... 91

3.12.6 Fetch PXAM, Product References, Competition, BoM .................................................. 92

3.13 Customer manager ................................................................................................................ 92

3.13.1 Fetch .............................................................................................................................. 92

3.13.2 Assign ............................................................................................................................. 93

3.13.3 Fetch Assignments ......................................................................................................... 94

3.13.4 Fetch Customers ............................................................................................................ 94

3.13.5 Fetch CXAM ................................................................................................................... 95

3.14 Quote Manager ..................................................................................................................... 96

3.14.1 Add Products ................................................................................................................. 96

3.14.2 Convert .......................................................................................................................... 98

3.14.3 Copy ............................................................................................................................... 98

3.14.4 Fetch .............................................................................................................................. 99

3.14.5 FetchXls ....................................................................................................................... 100

3.14.6 Preview ........................................................................................................................ 100

3.14.7 Price ............................................................................................................................. 101

3.14.8 Save ............................................................................................................................. 102

3.14.9 Submit ......................................................................................................................... 102

3.15 Download Manager ............................................................................................................. 103

3.15.1 Download .................................................................................................................... 103

3.16 Upload Manager .................................................................................................................. 103

3.16.1 New Upload Slot .......................................................................................................... 103

3.16.2 Progress ....................................................................................................................... 104

3.16.3 Delete Slot ................................................................................................................... 105

3.16.4 Upload Cancel .............................................................................................................. 105

3.17 Datamart ............................................................................................................................. 106

3.17.1 New Schema ................................................................................................................ 106

3.17.2 Get Schema ................................................................................................................. 108

3.17.3 SaveSchema ................................................................................................................. 109

3.17.4 Delete Schema ............................................................................................................. 111

Page 6: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 6

3.17.5 Copy Schema ............................................................................................................... 111

3.17.6 Revert Schema ............................................................................................................. 112

3.17.7 Update Schema ........................................................................................................... 112

3.17.8 Load Data ..................................................................................................................... 113

3.17.9 Flush ............................................................................................................................ 114

3.17.10 Get Data Chunk ....................................................................................................... 115

3.17.11 Truncate .................................................................................................................. 115

3.17.12 Reload ...................................................................................................................... 116

3.17.13 Get Status ................................................................................................................ 117

3.17.14 CRUD Commands .................................................................................................... 118

3.17.15 Get Data Source ....................................................................................................... 119

3.17.16 Query ....................................................................................................................... 120

3.17.17 Get Datamart ........................................................................................................... 121

3.17.18 Calculate .................................................................................................................. 122

3.17.19 Formula Params ....................................................................................................... 123

3.17.20 Export ...................................................................................................................... 124

3.17.21 Import ...................................................................................................................... 125

3.18 Configuration Manager ....................................................................................................... 125

3.18.1 Get ............................................................................................................................... 125

3.18.2 Set ................................................................................................................................ 126

3.18.3 Delete .......................................................................................................................... 127

3.18.4 Get Default .................................................................................................................. 127

3.18.5 Upload Template ......................................................................................................... 128

3.18.6 Check Template Present .............................................................................................. 128

3.18.7 Get Template URL........................................................................................................ 129

3.18.8 Delete Template .......................................................................................................... 129

3.18.9 Get global extensions .................................................................................................. 130

3.19 Simulation Manager ............................................................................................................ 131

3.19.1 Delete .......................................................................................................................... 131

3.19.2 Fetch ............................................................................................................................ 131

3.19.3 Fetch XLS...................................................................................................................... 133

3.19.4 Update ......................................................................................................................... 134

3.19.5 Summarize ................................................................................................................... 137

3.19.6 Convert to Pricelist ...................................................................................................... 139

3.19.7 Details .......................................................................................................................... 140

Page 7: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 7

3.19.8 Cancel .......................................................................................................................... 141

3.19.9 Calculate ...................................................................................................................... 141

3.20 Price Grid Manager .............................................................................................................. 142

3.20.1 Delete .......................................................................................................................... 142

3.20.2 Fetch ............................................................................................................................ 143

3.20.3 Update ......................................................................................................................... 144

3.20.4 Summarize ................................................................................................................... 146

3.20.5 Convert to Pricelist ...................................................................................................... 148

3.20.6 Params ......................................................................................................................... 148

3.20.7 Add .............................................................................................................................. 151

3.20.8 Accept .......................................................................................................................... 152

3.20.9 Reject ........................................................................................................................... 153

3.20.10 Preview .................................................................................................................... 154

3.20.11 Cancel ...................................................................................................................... 154

3.20.12 Calculate .................................................................................................................. 155

3.20.13 Mass Edit ................................................................................................................. 156

3.20.14 Copy ......................................................................................................................... 156

3.21 Data Change Request Manager ........................................................................................... 157

3.21.1 Delete .......................................................................................................................... 157

3.21.2 Fetch ............................................................................................................................ 158

3.21.3 Update ......................................................................................................................... 159

3.21.4 Add .............................................................................................................................. 159

3.21.5 Submit ......................................................................................................................... 160

3.22 Dashboards .......................................................................................................................... 160

3.22.1 Fetch ............................................................................................................................ 160

3.22.2 Execute ........................................................................................................................ 161

3.22.3 AddPortlets .................................................................................................................. 161

3.23 Help Manager ...................................................................................................................... 162

3.23.1 Fetch ............................................................................................................................ 162

3.23.2 Update ......................................................................................................................... 163

3.24 ToDo Item Manager ............................................................................................................ 163

3.24.1 Fetch ............................................................................................................................ 163

3.24.2 Update ......................................................................................................................... 164

3.25 System commands .............................................................................................................. 165

3.25.1 Host Info ...................................................................................................................... 165

Page 8: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 8

3.25.2 View Log ...................................................................................................................... 166

3.25.3 Log Level ...................................................................................................................... 166

3.26 Workflow Manager ............................................................................................................. 167

3.26.1 Approve ....................................................................................................................... 167

3.26.2 Deny ............................................................................................................................. 169

3.26.3 Withdraw ..................................................................................................................... 170

3.26.4 Fetch ............................................................................................................................ 171

3.26.5 Fetch Details ................................................................................................................ 173

3.26.6 Fetch Details Via Approvable ...................................................................................... 174

3.27 Workflow Builder Manager ................................................................................................. 176

3.27.1 Check ........................................................................................................................... 176

3.27.2 Copy ............................................................................................................................. 176

3.27.3 Delete .......................................................................................................................... 177

3.27.4 Fetch ............................................................................................................................ 178

3.27.5 Test Execute ................................................................................................................ 179

3.27.6 Update ......................................................................................................................... 181

3.28 I18N manager ...................................................................................................................... 183

3.28.1 Fetch ............................................................................................................................ 183

3.28.2 Save ............................................................................................................................. 184

3.29 Contract Manager ............................................................................................................... 184

3.29.1 Add Items .................................................................................................................... 184

3.29.2 Copy ............................................................................................................................. 187

3.29.3 Fetch ............................................................................................................................ 188

3.29.4 FetchXls ....................................................................................................................... 189

3.29.5 Preview ........................................................................................................................ 189

3.29.6 Calculate ...................................................................................................................... 190

3.29.7 Save ............................................................................................................................. 191

3.29.8 Submit ......................................................................................................................... 191

3.30 Other commands ................................................................................................................. 192

3.30.1 Direct Action ................................................................................................................ 192

4 Outbound events ........................................................................................................................................ 192

4.1 Types of events .................................................................................................................... 192

4.2 Event message ..................................................................................................................... 193

5 Field reference for major objects ............................................................................................................... 194

5.1 Abstract field sets ................................................................................................................ 194

Page 9: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 9

5.1.1 General Fields .............................................................................................................. 194

5.1.2 Named object fields..................................................................................................... 194

5.1.3 Timed object fields ...................................................................................................... 194

5.2 Actual objects ...................................................................................................................... 194

5.2.1 Product ........................................................................................................................ 194

5.2.2 Product Competition ................................................................................................... 194

5.2.3 Customer ..................................................................................................................... 195

5.2.4 Lookup Table ............................................................................................................... 195

5.2.5 Lookup Table Value ..................................................................................................... 195

5.2.6 Price Lists ..................................................................................................................... 196

5.2.7 Price List Item .............................................................................................................. 196

Page 10: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 10

1 Preface

1.1 Purpose of the document

This document describes the JSON-based API of the Price f(x) backend service (“the backend”) to

retrieve and manipulate objects as well as to execute methods. In short, all functionality that the

backend offers is exposed by this API.

The default web UI is using this interface as it’s only communication path to the backend as well as

the provided Excel Client.

This document should enable anyone with advanced development skills to write a custom client

application – e.g. for integration purposes to a custom system.

1.2 Intended audience

The intended audiences for this document are developers that intend to write a custom Price f(x)

client. Advanced development skills in web technologies and protocols (esp. Java and

JavaScript/JSON) are recommended.

1.3 Document conventions

Text in Courier New font is considered code.

2 General interface considerations

2.1 Transport protocol

The only available transport protocol of the Price f(x) backend is HTTP(S). Standard HTTP headers and

return codes as defined in RFC 2616 are used.

The Price f(x) API entirely relies on a defined URL scheme and additional data as part of a standard

HTTP POST request.

2.2 Data format

The payload of the HTTP requests and responses are formatted in JSON by default. JSON is described

in RFC 4627 and on json.org.

Note that JSON request should be properly identified by HTTP Header ‘Content-Type’ set to

‘application/json’.

2.3 API Versions

Beginning with the release “Long Island Iced Tea” in summer 2015 the API can be called in two

versions. Version 1 references the way it was from day 1 of the API. Version 2 denominates the

protocol version introduced in summer 2015.

The vast majority of commands of the API does not differ in both versions and are also available in

both versions. The main difference of the two API versions are so far in the area of authentication

and auth-session management which is more robust and secure in v2. Future extensions of the API

may require a higher (than v1) protocol version. If not otherwise stated the commands in this

document are available with both API versions.

Page 11: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 11

To enable v2 protocol a new HTTP header needs to be sent along every request:

Pricefx-Key: <UUID here>

Right now already the existence of such a header enables protocol v2. However in future different

keys (UUID values) may indicate an even higher protocol version. The value of the UUID is not fixed,

but is configurable and tied to a client version. Hence it can be controlled to allow/deny access of

certain client types or versions.

2.4 Authentication

The backend operates per-se in a stateless manner. This means that no request depends on any

other data outside the request itself or any previous requests. The server does not store any vital

information in the server-side session. This means that every request must contain authentication

information. The form depends on the API version you are using.

2.4.1 API Protocol – Version 1

In Version 1 authentication can be done by a standard HTTP auth header or as session cookie. In

order to ease some implementation details the backend also supports session cookies that any

command call will generate if it is not present before. So calling the login command is not really a

requirement. The cookie is effectively an authentication token if the user’s credentials cannot or

should not be sent with every request.

The authentication per request utilizes the standard HTTP-AuthHeader mechanism. So this header

should be added to the request:

"Authorization":"Basic <base64 encoded credentials>"

The base64 encoded credentials have this format: <partition>/<username>:<password>

2.4.2 API Protocol – Version 2

The main driver behind the v2 protocol was a better security in the area of authentication. Hence it

differs massively from v1 in this area. Authentication by standard HTTP basic auth-headers or session

cookies is banned. Authetication is strictly done by means of so called “Auth-Tokens” that have a

limited lifetime (which is not auto-extended as for session cookies). To get such an auth token (and

an accompanying refresh token) a login procedure needs to be followed. This login then also may

carry the need for custom request payload encryption to prevent man-in-the-middle attacks with

spoofed CA certificates. In general this scheme follows the OAuth principles.

In general there are two ways of login procedure in v2: With or without device registration. The

choice is not on the discretion of the client but bound to the Pricefx-Key that is used.

2.4.2.1 Without registration

1) Login: POST /pricefx/<partition>/token

2) Refresh token: POST /pricefx/<partition>/token/refresh

3) Logout: DELETE /pricefx/<partition>/token

Specific request details are described in the individual requests in chapter 3.

Page 12: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 12

Step 1 will return an access-token, an access-token-type and a refresh-token. The access-token will

have a defined non-auto-prolonging lifetime and can be renewed by the refresh-token and Step 2.

The refresh-token does not have a lifetime, but is tied to the access-token.

The authentication of subsequent requests is done by adding the access-token to every request:

Authorization: {access-token-type} {access-token}

2.4.2.2 With device registration

If a Pricefx-Key requires a device registration the login procedure looks slightly different. The end

result (an access-token and access-token-type) for the subsequent call is the same though.

1) Create device registration POST /pricefx/<partition>/locker

2) Refresh token POST /pricefx/<partition>/token/refresh

3) Unlock device POST /pricefx/<partition>/locker/unlock

4) Change registration POST /pricefx/<partition>/locker/change

5) Delete registration DELETE /pricefx/<partition>/locker

In order to authenticate a device needs to be registered. Once the device is registered the

authorization is then tied to the device by a device fingerprint and protected by device specific

secure storage. Sensitive information though is *not* stored on the device. Step 1 results in the same

access-token (next to other information) that then can be used for authenticating further requests.

This access-token can be refreshed with Step 2. Once the device is locked or goes to standby the user

can unlock the device by device specific means (gesture, PIN, etc) and then subsequently call the

unlock command of Step 3. This will also generate a new access-token/refresh-token pair for

subsequent requests.

All requests to this endpoint include a mandatory in-request encryption.

2.5 Batching

In order to reduce the number of API calls for mass updates the system allows to batch requests into

a single HTTP call. To make this work some pre-requisites have to be met:

• As the URL query string is the same for all contained requests, the URL needs to be a valid

URL for every contained request. In other words: Only objects of the same type and the same

operation can be batched together.

• The batched request body needs to be valid JSON. So batching simply means that the request

bodies of individual requests are placed into a wrapping array in full (see example below)

• The responses will equally be batched (i.e. an array of response bodies)

• Every request is processed individually. I.e. one can fail while another one can succeed. There

is no “all or nothing” or transactional logic across requests.

Example (batching elements in red, request 1 in blue, request 2 in green):

[

Page 13: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 13

{

"operationType":"update",

"data":{

"typedId":"148.P",

"label":"Test2"

},

"oldValues":{

"currency":"EUR",

"lastUpdateDate":"2011-05-03",

"label":"Test",

"sku":"001",

"unitOfMeasure":"EA",

"version":0,

"typedId":"148.P"

}

}

,

{

"operationType":"update",

"data":{

"typedId":"148.P",

"label":"Test2"

},

"oldValues":{

"currency":"EUR",

"lastUpdateDate":"2011-05-03",

"label":"Test",

"sku":"001",

"unitOfMeasure":"EA",

"version":0,

"typedId":"148.P"

}

}

]

2.6 Compression

In order to speed up data transfer from client to server (upload), the server accepts LZF compressed

request bodies. That means that the generated JSON is compressed client-side using the LZF

algorithm. To make the server aware of this fact, the content type of the HTTP request has to be set

to "application/x-lzfcompress".

References:

http://en.wikipedia.org/wiki/Lempel_Ziv

https://github.com/ning/compress

The responses of the server are gzip compressed by default according to the standard HTTP

mechanisms (if the client signals support for it).

2.7 Status codes

There are two types of status codes: Standard HTTP status codes and application specific codes in the

response structure. Both codes are used. Typically a non-200 HTTP status code indicates a more

severe error condition. Standard meanings of the HTTP codes are used.

The app specific codes are used to provide a more fine grained status messaging between client and

backend. These codes are mainly derived from SmartGWT’s status code structure:

Page 14: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 14

STATUS_FAILURE(-1),

STATUS_LOGIN_INCORRECT(-5),

STATUS_LOGIN_REQUIRED(-7),

STATUS_LOGIN_SUCCESS(-8),

STATUS_MAX_LOGIN_ATTEMPTS_EXCEEDED(-6),

STATUS_SERVER_TIMEOUT(-100),

STATUS_TRANSPORT_ERROR(-90),

STATUS_VALIDATION_ERROR(-4),

STATUS_SUCCESS(0),

STATUS_SYNTAX_FAILURE(100),

STATUS_LICENSE_FAILURE(101),

Obsolete: STATUS_PL_APPROVAL_FAILURE(102),

STATUS_PL_CREATE_FAILURE(103),

STATUS_CALCULATION_FAILURE(104),

STATUS_PA_DATALOAD_ERROR(200),

STATUS_PA_QUERY_ERROR(201),

STATUS_PA_SCHEMA_ERROR(202),

STATUS_PA_ASYNC_CONTINUATION(203);

The convention within SGWT is that codes less than 0 are failures (although -8 is also a success code).

Custom Price f(x) codes are introduced as codes including and above 100.

3 Commands reference

3.1 Authentication

3.1.1 Login (v1 only)

As the backend operates internally stateless, the login command is not required as such if any

request contains standard HTTP authentication credentials. As some clients (the Price f(x) web UI for

example) however can be implemented more easily in a session mode we provide a login method.

The method as such is a non-operation as every command would create a session (if authentication

succeeds). It returns the logged-in user’s details – including all roles and permissions - as response.

URL Syntax /pricefx/<partition>/login

/pricefx/<partition>/login/extended

URL Parameters None

Request Parameters None. HTTP Basic auth request headers should be filled.

Remarks Returns HTTP 200 & Status = -8 in case of success and HTTP 401 in case of

wrong credentials. When the “extended” URL parameter is added more

details of the user are returned

Sample Request Empty body

Sample Response {

"response":{

"status":-8,

"data":[

Page 15: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 15

{

"email":"[email protected]",

"firstName":"",

"lastName":"",

"systemUser":false,

"roleNames":[

"ADMIN",

"PRICESHOP",

"PB_CUSTOMERS",

"PB_PRODUCTS",

"PB_FORMULAS",

"PB_FEEDS",

"PB_PRICELISTS",

"PB_PARAMETERS"

],

"activated":true,

"lastLogin":"2011-04-28",

"firstLogin":false,

"loginName":"admin",

"version":493,

"typedId":"2.U"

}

]

}

}

3.1.2 Logout (v1 only)

As counterpart to the login command, logout invalidates the session

URL Syntax /pricefx/<partition>/logout

URL Parameters None

Request Parameters None

Remarks HTTP 200

Sample Request N/A

Sample Response {

"response":{

"status":0,

"data": null

}

}

3.1.3 Token (v2 only)

To obtain an access token and a refresh-token

URL Syntax /pricefx/<partition>/token

HTTP Method POST

Remarks Only available if configuration of Pricefx-Key does NOT enforce device

registration

Sample Request {

"username" : "admin",

"partition" : "meatball",

"password" : "my secret pass"

}

Page 16: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 16

Sample Response {

"access-token" : "<some UUID>", // MANDATORY

"token-type" : "Bearer", // MANDARORY

"expires-in" : 3600, // OPTIONAL, SECONDS

"refresh-token" : "<some UUID>" // OPTIONAL

}

To refresh an access-token:

URL Syntax /pricefx/<partition>/token/refresh

HTTP Method POST

Remarks The (expired) access-token must be present in the HTTP header

Sample Request {

"refresh-token" : "<some UUID>"

}

Sample Response {

"access-token" : "<some UUID>", // MANDATORY

"token-type" : "Bearer", // MANDARORY

"expires-in" : 3600, // OPTIONAL, SECONDS

"refresh-token" : "<some UUID>" // OPTIONAL

}

To invalidate an access-token (logout):

URL Syntax /pricefx/<partition>/token

HTTP Method DELETE

Remarks The access-token must be present in the HTTP header

Sample Request Empty body

Sample Response Empty body (HTTP 204 response code)

3.1.4 Locker (v2 only)

3.1.4.1 Custom request encryption

All requests to these endpoints require a custom in-request encryption. The starting point for this to

work is a RSA public key that must be bundled with the client and that is specific to the Pricefx-Key

used in the header. This public key is used to encrypt a random AES key that is used to encrypt the

request’s payload. So the request consists of two parts:

Page 17: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 17

{

"key" : $aes_key_encrypted_b64,

"data" : $json_data_encrypted_b64

}

The “key” value contains the encrypted random AES key in Base64 encoding. The “data” value

contains the actual request (which is also JSON) that has been encrypted with the AES key of “key”,

also in Base64 encoding.

The server then decrypts the value of “key” with its private RSA key for that Pricefx-Key header value.

It has then the AES key, which is then used to decrypt the “data” value that holds the actual request.

After processing the request the server encrypts the response payload then again with the random

AES key that was used in the request and base64-encodes it:

{

"data" : $response_json_data_encrypted_b64

}

3.1.4.2 Endpoints

Note: All request/response samples show the payload after custom encryption (i.e. in clear text).

To register a device and retrieve initial access-token:

URL Syntax /pricefx/<partition>/locker

HTTP Method POST

Sample Request {

"username" : "admin",

"password" : "plain-text-password",

"partition" : "meatball",

"device-finger-print" : "AAA-BBB-CCC", // UUID v4

"device-label" : "Robert's iPad ...",

"unlock-token" : "whatever string"

}

Sample Response {

"registration-id" : "<some UUID>",

"encryption-key" : "base64encoded aes 256 bit key",

"access-token" : "<some UUID>",

"refresh-token" : "<some UUID>",

"token-type" : "Bearer"

}

Remark registration-id - unique registration identifier, which is generated

by the backend during registration.

device-finger-print - unique device fingerprint, which is

generated by the client and must be included in all registration related

requests. Usually client stores it in keychain, so, same value is reused

if registration is deleted and client is going to register again on the

same device.

device-label - device name, device type, ... string provided by the

Page 18: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 18

client so user can identify the device somehow.

encryption-key - 256 bit AES key, which is generated by the

backend during registration process. This is key generated once per

registration and must not be changed, because client uses it for

encryption / decryption of sensitive data stored locally on device. This

must be stored in a way that backend can provide it back in plaintext

(base64 encoded), so, client can decrypt data.

unlock-token - this is kind of 2nd password. This unlock-token is

provided by the client during registration and stores it as a password.

Sensitive, but it must be comparable, because this token is used for

unlocking.

To unlock a device (and obtain a new access-token):

URL Syntax /pricefx/<partition>/locker/unlock

HTTP Method POST

Sample Request {

"registration-id" : "<some UUID>",

"device-finger-print" : "AAA-BBB-CCC",

"unlock-token" : "whatever string"

}

Sample Response {

"encryption-key" : "base64encoded aes 256 bit key",

"access-token" : "<some UUID>",

"refresh-token" : "<some UUID>",

"token-type" : "Bearer"

}

Or in case of wrong credentials:

{

"remaining-attempts" : 4

}

Remark Once the remaining attemps are 0, the entire device registration is deleted.

To change an unlock token (e.g. as the user changed his device gesture or PIN)

URL Syntax /pricefx/<partition>/locker/change

HTTP Method POST

Sample Request {

"registration-id" : "registration-id",

"device-finger-print" : "AAA-BBB-CCC",

"unlock-token" : "whatever string",

"new-unlock-token" : "new whatever string"

}

Page 19: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 19

Sample Response Empty body

3.2 Datasource operations

3.2.1 Fetch

The Fetch command retrieves arbitrary objects from the backend. A number of options define filters,

sort orders and paging. However some object types are restricted from the general fetch command

as they should be retrieved via special managers fetch operations due to specifics of those objects.

If called without parameters the command returns a list of all known type codes.

URL Syntax /pricefx/<partition>/fetch/<object type code>/<object id>

Example: /pricefx/test/fetch/P/12001

URL Parameters Object type code (optional): Specifies the object type to retrieve. If no

other parameters (filtering / paging) are passed in all object instances are

returned.

Object id (optional): Only the single object identified by type and id is

returned

Request Parameters textMatchStyle: either substring or startsWith. If not specified it will

default to exact matching

startRow: Specifies the intended starting row number of the result set as an

integer. Used for paging

endRow: Specifies the intended ending row number of the result set as an

integer. Used for paging

sortBy: Array of strings that specify one or more fields to sort on (in that

order). Field names are prefixed by a minus symbol in case of descending

sort order

resultFields: Array of strings that specify one or more fields that should be

returned. If omitted, all fields are returned

operationType: Must be fetch or null or omitted

oldValues: typically null

distinctResults: Optional Boolean value that specifies if a DISTINCT clause

should be added to the search

data: Contains the search criteria (filters). There are two types of filters:

Page 20: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 20

basic and advanced. In a single request both types cannot be mixed.

In case of basic filters, the filter expressions are just added as a field-value

pair (textMatchStyle applies):

"data":{

"name":"V-1",

"value":10

}

In the above example the field “name” would be searched for “V-1” (plus

wildcards based on textMatchStyle setting) and the field “value” on “10”.

Both filters would be ANDed.

In case of advanced filter expressions, filters of arbitrary complexity can be

specified:

"data":{

"operator":"and",

"criteria":[

{

"fieldName":"sku",

"operator":"iContains",

"value":"SKU-12"

},

{

"fieldName":"attribute1",

"operator":"iContains",

"value":"John"

}

]

}

An advanced filter always consists of three fields: operator and criteria.

The field operator can be either and or or. The criteria field is an array of

either field criterias or advanced (sub) filters.

Field criteria have again three defined fields: fieldName, operator, value.

The operator in this case can be one of many supported operators:

equals, notEqual, greaterThan, lessThan, greaterOrEqual, lessOrEqual,

contains, startsWith, endsWith, isNull, notNull, inset, notInSet,

iContains, iStartsWith, iEndsWith, iNotContains, iNotStartsWith,

iNotEndsWith, notContains, notStartsWith, notEndsWith

Remarks

Sample Request {

"operationType":"fetch",

"startRow":0,

"endRow":75,

"textMatchStyle":"substring",

"data":{

"operator":"and"

"criteria":[

{

"fieldName":"sku",

"operator":"iContains",

"value":"SKU-12"

},

{

Page 21: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 21

"fieldName":"attribute1",

"operator":"iContains",

"value":"John"

}

]

},

"oldValues":null

}

Sample Response {

"response":{

"endRow":75,

"totalRows":222,

"status":0,

"startRow":0,

"data":[

{

"currency":"EUR",

"lastUpdateDate":"2011-03-28",

"sku":"SKU-12001",

"unitOfMeasure":"EA",

"attribute1":"Johnny",

"attribute2":3600.3,

"version":0,

"typedId":"12001.P"

},

{

"currency":"EUR",

"lastUpdateDate":"2011-03-28",

"sku":"SKU-12006",

"unitOfMeasure":"EA",

"attribute1":"Johnny",

"attribute2":3601.8,

"version":0,

"typedId":"12006.P"

},

… Many more …

{

"currency":"EUR",

"lastUpdateDate":"2011-03-28",

"sku":"SKU-12011",

"unitOfMeasure":"EA",

"attribute1":"Johnny",

"attribute2":3603.3,

"version":0,

"typedId":"12011.P"

}

]

}

}

3.2.2 Update

The update command updates arbitrary objects in the backend. Only one object can be updated per

request (unless batched). The update request contains all old values (especially the typedId and the

version) and all changed values.

Some object types may be blocked from being updated by the update command as special

processing is done by a dedicated manager update command.

Page 22: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 22

URL Syntax /pricefx/<partition>/update/<object type code>/<returnolddata>

Example: /pricefx/test/update/P

URL Parameters Object type code (mandatory): Specifies the object type to update.

Return old data (optional): Specifies if the command should also return the

previous data of the object to facilitate field change detection. This feature

is activated by the exisitence of the returnolddata URL path

component. The entire oject is then returned in a JSON structure named

oldData in parallel to the data structure of the response

Request Parameters oldValues: The values of the object before the update. Especially important

are typedId (to identify the object to update) and version (to detect out of

date exceptions)

data: Contains the new field values in a fieldname=value fashion. Multiple

field values at a time are supported.

operationType: Must be update or null or omitted

Remarks Apart from the version checks, additional integrity checks are performed.

E.g. if fields that are or are part of the business key are changed, it is

checked that no other object already is defined with those key(s).

Sample Request {

"operationType":"update",

"data":{

"typedId":"148.P",

"label":"Test2"

},

"oldValues":{

"currency":"EUR",

"lastUpdateDate":"2011-05-03",

"label":"Test",

"sku":"001",

"unitOfMeasure":"EA",

"formulaName":null,

"attribute1":null,

"attribute2":null,

"attribute3":null,

"attribute4":null,

"attribute5":null,

"attribute6":null,

"attribute7":null,

"attribute8":null,

"attribute9":null,

"attribute10":null,

"attribute11":null,

"attribute12":null,

"attribute13":null,

"attribute14":null,

"attribute15":null,

"version":0,

"typedId":"148.P"

}

}

Page 23: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 23

Sample Response {

"response":{

"status":0,

"data": null

}

}

3.2.3 Add

The add command creates arbitrary objects in the backend. Only one object can be added per

request (unless batched).

Some object types may be blocked from being added by the update command as special processing

is done by a dedicated manager command.

URL Syntax /pricefx/<partition>/add/<object type code>

Example: /pricefx/test/add/P

URL Parameters Object type code (mandatory): Specifies the object type to create.

Request Parameters data: The initial values of the object. The request needs to contain all fields

that are part of the business key for that object and all non-nullable fields.

operationType: Must be add or null or omitted

Remarks The response contains (in case of successful object creation) the full object

details, especially the auto-generated fields like typedId

Sample Request {

"operationType":"add",

"data":{

"sku":"001",

"label":"Test",

"unitOfMeasure":"EA",

"currency":"EUR"

},

"oldValues":null

}

Sample Response {

"response":{

"status":0,

"data":[

{

"currency":"EUR",

"lastUpdateDate":"2011-05-03",

"label":"Test",

"sku":"001",

"unitOfMeasure":"EA",

"formulaName":null,

"attribute1":null,

"attribute2":null,

"attribute3":null,

"attribute4":null,

"attribute5":null,

"attribute6":null,

"attribute7":null,

"attribute8":null,

"attribute9":null,

Page 24: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 24

"attribute10":null,

"attribute11":null,

"attribute12":null,

"attribute13":null,

"attribute14":null,

"attribute15":null,

"version":0,

"typedId":"148.P"

}

]

}

}

3.2.4 Delete

The delete command deletes arbitrary objects in the backend. Only one object can be deleted per

request (unless batched).

Some object types may be blocked from being deleted by the update command as special processing

is done by a dedicated manager command. Note: Some object types are only soft-deleted, some are

hard-deleted in the database. This behavior cannot be influenced by the client.

URL Syntax /pricefx/<partition>/delete/<object type code>

Example: /pricefx/test/delete/P

URL Parameters Object type code (mandatory): Specifies the object type to delete.

Request Parameters data: The typedId of the object to delete or all business key fields of that

object type

operationType: Must be remove or null or omitted

Remarks The response contains (in case of successful object deletion) the full object

details of the deleted object.

Sample Request {

"operationType":"remove",

"data":{

"typedId":"148.P"

},

"oldValues":null

}

Sample Response { "response":{

"status":0,

"data":[

{

"currency":"EUR",

"lastUpdateDate":"2011-05-03",

"label":"Test2",

"sku":"001",

"unitOfMeasure":"EA",

"formulaName":null,

"attribute1":null,

"attribute2":null,

"attribute3":null,

"attribute4":null,

"attribute5":null,

"attribute6":null,

"attribute7":null,

Page 25: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 25

"attribute8":null,

"attribute9":null,

"attribute10":null,

"attribute11":null,

"attribute12":null,

"attribute13":null,

"attribute14":null,

"attribute15":null,

"version":1,

"typedId":"148.P"

}

]

}

}

3.2.5 Reset Column

This command resets (=wipes all column data) of a given object. Requester needs delete permission.

URL Syntax /pricefx/<partition>/resetcolumn/<object type code>/<column name>

Example:

/pricefx/test/resetcolumn/P/attribute1

URL Parameters Object type code (mandatory): Specifies the object type to delete the

column data.

Column name (mandatory): The base name of the column/attribute to

wipe

Request Parameters See 3.2.2

Remarks Request body remains empty

Sample Request N/A

Sample Response {"response":{"status":0,"data":null}}

3.2.6 Mass Edit

The mass edit command performs a mass update operation of selected backend objects. This

operation is not available for all types of objects.

Typically a filter expression is passed along the request to restrict the scope of the mass edit

operation. The response contains the number of actually updated records. This number can be

different from what the client UI initially thinks as the server takes edit restrictions into account.

URL Syntax /pricefx/<partition>/massedit/<object type code>

Example: /pricefx/test/massedit/P

URL Parameters Object type code (mandatory): Specifies the object type to mass edit.

Request Parameters filterCriteria (Optional) : Standard filtercriteria to restrict the edit scope

Page 26: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 26

fieldName (Mandatory): Name of the object’s field to update

fieldValue (Optional): New field value. If omitted the field is set to null

massEditOperator (Optional): Can be either one of these valid operators:

+ - *

If omitted the provided value is set (= operator). Otherwise the specified

operation is applied.

Remarks The response contains (in case of successful object deletion) the full object

details of the deleted object.

Sample Request {

"data":{

"filterCriteria":{

"operator":"and"

"criteria":[

{

"fieldName":"sku",

"operator":"iContains",

"value":"A"

}

]

},

"fieldName":"attribute2",

"fieldValue":"NewValue"

}

}

Sample Response {"response":{"status":0,"data":["4"]}}

3.2.7 Integrate

The integrate command performs an upsert operation of selected backend objects. This operation is

not available for all types of objects.

This command is particularly useful in a situation where the caller does not (and should not) know

about typed IDs and other “internal” data fields, i.e. typically in an integration scenario. The only

mandatory pre-requisite for this command is, that the object’s defined business key fields (vary per

object type) are present in every request. No typed ID or version fields are required. This also means

that no version checking is performed, thus the request will overwrite existing data of that record

regardless of other changes.

URL Syntax /pricefx/<partition>/integrate/<object type code>/<returnolddata>

Example: /pricefx/test/integrate/P

URL Parameters Object type code (mandatory): Specifies the object type to integrate (i.e.

update or add).

Return old data (optional): Specifies if the command should also return the

previous data of the object to facilitate field change detection. This feature

is activated by the exisitence of the returnolddata URL path

component. The entire oject is then returned in a JSON structure named

Page 27: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 27

oldData in parallel to the data structure of the response

Request Parameters data: All values of the object. The request needs to contain all fields that

are part of the business key for that object and all non-nullable fields.

operationType: Must be integrate or null or omitted

searchFields: Optional. Used in cases where there is no defined unique

business key per se. Via this parameter the request can define an ad-hoc

business key. The request must contain all search fields in the data section

and the search must return a single row.

Remarks The response contains the full object details of the updated object.

Sample Request {

"operationType":"integrate",

"data":{

"sku":"001",

"label":"Test",

"unitOfMeasure":"EA",

"currency":"EUR"

},

"oldValues":null

}

Sample Response {

"response":{

"status":0,

"data":[

{

"currency":"EUR",

"lastUpdateDate":"2011-05-03",

"label":"Test",

"sku":"001",

"unitOfMeasure":"EA",

"formulaName":null,

"attribute1":null,

"attribute2":null,

"attribute3":null,

"attribute4":null,

"attribute5":null,

"attribute6":null,

"attribute7":null,

"attribute8":null,

"attribute9":null,

"attribute10":null,

"attribute11":null,

"attribute12":null,

"attribute13":null,

"attribute14":null,

"attribute15":null,

"version":0,

"typedId":"148.P"

}

]

}

}

3.2.8 Loaddata

The loaddata command is a very efficient and quick way to load bulk data. The main benefit is it’s

vastly greater speed to load thousands of rows (compared to e.g. integrate). The main drawback is

Page 28: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 28

that it will always work on entire rows. That means with loaddata it is not possible to update just

some columns. The source data must always contain the entire row’s content. This command only

works on selected data types (type codes).

URL Syntax /pricefx/<partition>/loaddata/<object type code>

Example: /pricefx/test/loaddata/P

URL Parameters Object type code (mandatory): Specifies the object type to load.

Request Parameters header: A list of the fields (in the same order) as they appear in the data

section

joinFields (optional): These fields are used to determine if rows should be

updated or a new row should be created. This can be seen as a “business

key on the fly” and is particularly useful for obejyt types that do not have a

built-in business key (e.g. PX or CX)

data: A list of lists (rows) with the actual values. Order of field values must

adhere to order of fields as defined in header.

Remarks The response contains the number of rows loaded only in case joinFields is

NOT set.

Sample Request "data":{

"header":["sku","label","attribute1","attribute2","attribute3"],

"joinFields"": ["sku", "attribute1"],

"data":[

["CN1000","DE","Address 1","Berlin","PC001"],

["CN1001","FR","Address 2","Paris","PC002"],

...

]

}

}

3.3 Formula Manager

3.3.1 Check

This command performs a syntax check for the provided formula fragment. As formula fragments

(i.e. calculation schema entries or formula elements) can also reference previous formula element

results, the parameter knownElements is available to declare a number of “names” as valid for the

purpose of the syntax check.

URL Syntax /pricefx/<partition>/formulamanager.check

URL Parameters N/A

Request Parameters data.formulaExpression (mandatory): The expression string of the

fragment.

data.knownElements (optional): An array of strings with valid element

names (which could be referenced in the expression)

Page 29: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 29

Remarks In case of invalid syntax a syntax check result message with HTTP 200 and

status 100 is sent back. In case of valid syntax an empty response is

returned.

Sample Request {

"data":{

"formulaExpression":"COGS * 2",

"knownElements":[

"COGS",

"Margin"

]

}

}

Sample Response Success:

{"response":{"status":0,"data":null}}

Failure:

{

"response":{

"status":100,

"data":[

{

"message":"ERROR(@11): Undefinierte Variable A",

"startPosition":11,

"endPosition":12

}

]

}

}

3.3.2 Copy

This command creates a copy of the specified formula. The validAfter value is set to today, all other

values and sub-elements are exact copies.

URL Syntax /pricefx/<partition>/formulamanager.copy/<formula id>

Example:

/pricefx/test/formulamanager.copy/4

URL Parameters Formula id (mandatory): Id of formula to copy (source object)

Request Parameters N/A

Remarks Response contains details of the copied object (destination object)

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"validAfter":"2011-05-03",

"label":null,

"uniqueName":"DefaultFormula",

"version":0,

Page 30: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 30

"typedId":"5.F"

}

]

}

}

3.3.3 Delete

This command deletes a formula and all related sub-elements

URL Syntax /pricefx/<partition>/formulamanager.delete/<formula id>

Example:

/pricefx/test/formulamanager.delete/5

URL Parameters Formula id (mandatory): Id of formula to delete

Request Parameters N/A

Remarks Response contains details of the deleted object

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"validAfter":"2011-05-03",

"label":null,

"uniqueName":"DefaultFormula",

"version":0,

"typedId":"5.F"

}

]

}

}

3.3.4 Execute

This command executes a formula for a given product and calculates the result. The result content is

defined partially by the visibility flags that are part of the formula master data.

URL Syntax /pricefx/<partition>/formulamanager.execute/<product id>/<formula

name>

Example:

/pricefx/test/formulamanager.execute/123.P

URL Parameters Product id (optional): TypedId or encoded SKU of product to calculate. If

parameter is not set in URL it must be present in the request body

Formula name (optional): If omitted the formula as specified in the

product’s master is used, otherwise the provided formula is used for

Page 31: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 31

calculation

Request Parameters data.targetDate (optional): Specifies the validity date of all objects used

(e.g formula, lookups, etc)

data.productSKU (optional): If no SKU is specified in the URL, then this

parameter becomes mandatory. Here the SKU does not need to be

encoded.

data.<formula parameter name> (optional): Formulas can have a number

of parameters that are user selectable. Every parameter in the data

structure that is not targetDate is passed on into the formula engine for

evaluation

Remarks N/A

Sample Request {

"data":{

"Customer":"Cust-1",

"Geography":"111.LTV",

"quantity":1,

"targetDate":”2013-04-20”

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"result":1.5,

"warnings":[

],

"displayType":"BOTH",

"alertMessage":null,

"alertType":null,

"resultName":"ListPrice"

},

{

"result":0.825,

"warnings":[

],

"displayType":"BOTH",

"alertMessage":null,

"alertType":null,

"resultName":"RegionalPrice"

}

]

}

}

3.3.5 Execute Formula

This command executes a named formula calculates the result. The result content is defined partially

by the visibility flags that are part of the formula master data. The main difference between this

command and the other execute command is, that in this command no product context is assumed

or required.

Page 32: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 32

URL Syntax /pricefx/<partition>/formulamanager.executeformula/<formula name>

Example:

/pricefx/test/formulamanager.execute/SomeFormula

URL Parameters Formula name (mandatory): The provided formula is used for calculation

Request Parameters data.targetDate (optional): Specifies the validity date of all objects used

(e.g formula, lookups, etc)

data.<formula parameter name> (optional): Formulas can have a number

of parameters that are user selectable. Every parameter in the data

structure that is not targetDate is passed on into the formula engine for

evaluation

Remarks N/A

Sample Request {

"data":{

"Customer":"Cust-1",

"Geography":"111.LTV",

"quantity":1,

"targetDate":”2013-04-20”

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"result":1.5,

"warnings":[

],

"displayType":"BOTH",

"alertMessage":null,

"alertType":null,

"resultName":"ListPrice"

},

{

"result":0.825,

"warnings":[

],

"displayType":"BOTH",

"alertMessage":null,

"alertType":null,

"resultName":"RegionalPrice"

}

]

}

}

3.3.6 Fetch

This command retrieves a specific formula from the backend. A special command is used instead the

generic one, as this command also returns the full data of the contained sub-elements.

Page 33: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 33

URL Syntax /pricefx/<partition>/formulamanager.fetch/<formula id>

Example:

/pricefx/test/formulamanager.fetch/4

URL Parameters Formula id: Id of formula to retrieve

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"elements":[

{

"formulaExpression":"Product(\"Cost\")",

"elementName":"COGS",

"elementLabel":null,

"displayElement":false,

"displayType":"HIDDEN",

"combinationType":"ADD",

"redAlert":null,

"yellowAlert":null,

"version":0,

"typedId":"45.FE"

},

{

"formulaExpression":"Context(\"COGS\") * 2",

"elementName":"Margin",

"elementLabel":null,

"displayElement":false,

"displayType":"HIDDEN",

"combinationType":"ADD",

"redAlert":null,

"yellowAlert":null,

"version":0,

"typedId":"46.FE"

},

{

"formulaExpression":null,

"elementName":"ListPrice",

"elementLabel":null,

"displayElement":true,

"displayType":"BOTH",

"combinationType":"RESULT",

"redAlert":null,

"yellowAlert":null,

"version":0,

"typedId":"48.FE"

},

{

"formulaExpression":"Context(\"ListPrice\") * VLooku

p(\"CustomerDiscount\",Customer(\"Customer Type\"))",

"elementName":"CustomerDiscount",

"elementLabel":null,

"displayElement":false,

"displayType":"HIDDEN",

"combinationType":"SUBTRACT",

"redAlert":null,

Page 34: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 34

"yellowAlert":null,

"version":0,

"typedId":"49.FE"

},

{

"formulaExpression":"Context(\"ListPrice\") * VLooku

p(\"Geography\")",

"elementName":"GeographyDiscount",

"elementLabel":null,

"displayElement":false,

"displayType":"HIDDEN",

"combinationType":"SUBTRACT",

"redAlert":null,

"yellowAlert":null,

"version":0,

"typedId":"50.FE"

},

{

"formulaExpression":null,

"elementName":"RegionalPrice",

"elementLabel":null,

"displayElement":true,

"displayType":"BOTH",

"combinationType":"RESULT",

"redAlert":null,

"yellowAlert":null,

"version":0,

"typedId":"51.FE"

}

],

"validAfter":"2010-01-01",

"label":null,

"uniqueName":"DefaultFormula",

"version":1,

"typedId":"4.F"

}

]

}

}

3.3.7 GetDefault

This command retrieves the configured default formula unique name.

URL Syntax /pricefx/<partition>/formulamanager.getdefault

URL Parameters N/A

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"uniqueName":"DefaultFormula"

}

]

}

Page 35: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 35

}

3.3.8 GetNames

This command retrieves a list of distinct formula names configured in this partition.

URL Syntax /pricefx/<partition>/formulamanager.getnames

URL Parameters N/A

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"uniqueName":"DefaultFormula"

},

{

"uniqueName":null

}

]

}

}

3.3.9 GetElementNames

This command returns all visible formula element names

URL Syntax /pricefx/<partition>/formulamanager.getelementnames/<formula unique

name>

URL Parameters Formula unique name (mandatory): URL-encoded unique name of formula

Request Parameters targetDate (optional): Validity date of formula

Remarks N/A

Sample Request {

"data":{

"targetDate":"2014-09-30"

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"TestOverridePrice":"TestOverridePrice",

"NextOverridePrice":"NextOverridePrice"

}

]

}

}

Page 36: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 36

3.3.10 Params

This command retrieves a list of parameters and their nature for a given formula.

URL Syntax /pricefx/<partition>/formulamanager.params/<formula name>

URL Parameters Formula name (optional): If omitted the formula as specified in the

product’s master is used, otherwise the passed formula is used

Request Parameters data.targetDate (optional): Specifies the validity date of the formula

data.productSKU (optional): Pass this parameter if you want to get the

parameters of the configured formula for a specific product. Not strictly

mandatory parameter, but typically set.

Remarks N/A

Sample Request {"data":{"targetDate":1304426982403}}

Sample Response {

"response":{

"status":0,

"data":[

{

"name":"ProductSKU",

"url":null,

"type":"PRODUCT",

"label":"ProductSKU"

},

{

"name":"Customer",

"url":"/fetch/C/",

"type":"CUSTOMER",

"label":"Kunde"

},

{

"name":"Geography",

"url":"/lookuptablemanager.fetch/17",

"type":"LOOKUP",

"label":"Geography Discount"

}

]

}

}

3.3.11 Set Default

This command sets (or clears) a default formula for a partition.

URL Syntax /pricefx/<partition>/formulamanager.setdefault/<formula name>

URL Parameters Formula name (optional): If omitted the default formula is cleared,

otherwise the formula specified is the new default formula

Page 37: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 37

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"uniqueName":"DefaultFormula"

}

]

}

}

3.3.12 Library Methods

This command retrieves available methods in the currently active groovy library.

URL Syntax /pricefx/<partition>/formulamanager.librarymethods

URL Parameters N/A

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"Calculation":[

{

"methodName":"returnAString",

"sample":"Calculation.returnAString()",

"description":"Returns a string value"

}

]

}

]

}

}

3.3.13 Test Execute

This command executes a draft formula for a given product and calculates the result. This command

is used to test a formula during editing.

URL Syntax /pricefx/<partition>/formulamanager.testexec

URL Parameters N/A

Page 38: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 38

Request Parameters data.targetDate (optional): Specifies the validity date of all objects used

(e.g formula, lookups, etc)

data.productSKU (mandatory): SKU of the product to use for testing the

formula

data.testFormula (mandatory): JSON that represents the whole draft

formula (same format as used for update command).

data.<formula parameter name> (optional): Formulas can have a number

of parameters that are user selectable. Every parameter in the data

structure that is not a named parameter from above is passed on into the

formula engine for evaluation

Remarks The response is a debug-style representation of the formula result. I.e. it

contains a full trace of all elements and does not only contain the elements

that are marked as visible like in the normal execute command.

Sample Request {

"data":{

"Customer":"Cust-1",

"Geography":"111.LTV",

"targetDate":1304428400631,

"productSKU":"SKU-1",

"testFormula":{

"elements":[

{

"combinationType":"ADD",

"elementName":"COGS",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"Product(\"Cost\")",

"typedId":"45.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"ADD",

"elementName":"Margin",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"Context(\"COGS\") * 2",

"typedId":"46.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"ADD",

"elementName":"Margin2",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"COGS * 2",

"typedId":"47.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"RESULT",

"elementName":"ListPrice",

Page 39: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 39

"elementLabel":null,

"displayType":"BOTH",

"formulaExpression":null,

"typedId":"48.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"SUBTRACT",

"elementName":"CustomerDiscount",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"Context(\"ListPrice\") * VLookup(\

"CustomerDiscount\",Customer(\"Customer Type\"))",

"typedId":"49.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"SUBTRACT",

"elementName":"GeographyDiscount",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"Context(\"ListPrice\") * VLookup(\

"Geography\")",

"typedId":"50.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"RESULT",

"elementName":"RegionalPrice",

"elementLabel":null,

"displayType":"BOTH",

"formulaExpression":null,

"typedId":"51.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

}

],

"validAfter":"2010-01-01",

"label":null,

"uniqueName":"DefaultFormula",

"version":1,

"typedId":"4.F"

}

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"warnings":null,

"elementName":"COGS",

"displayType":"HIDDEN",

"displayResult":false,

"elementResult":0.3,

"auditTrace":"[Product(Cost) = 0.3]",

"alertMessage":null,

"alertType":null

},

{

Page 40: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 40

"warnings":null,

"elementName":"Margin",

"displayType":"HIDDEN",

"displayResult":false,

"elementResult":0.6,

"auditTrace":"[Context() = 0.3]",

"alertMessage":null,

"alertType":null

},

{

"warnings":null,

"elementName":"Margin2",

"displayType":"HIDDEN",

"displayResult":false,

"elementResult":0.6,

"auditTrace":"[]",

"alertMessage":null,

"alertType":null

},

{

"warnings":null,

"elementName":"ListPrice",

"displayType":"BOTH",

"displayResult":true,

"elementResult":1.5,

"auditTrace":null,

"alertMessage":null,

"alertType":null

},

{

"warnings":null,

"elementName":"CustomerDiscount",

"displayType":"HIDDEN",

"displayResult":false,

"elementResult":0.225,

"auditTrace":"[Context() = 1.5, Customer(Customer Type) =

B, VLookup(CustomerDiscount, B) = 0.15]",

"alertMessage":null,

"alertType":null

},

{

"warnings":null,

"elementName":"GeographyDiscount",

"displayType":"HIDDEN",

"displayResult":false,

"elementResult":0.45,

"auditTrace":"[Context() = 1.5, VLookup(Geography, 111.LTV

) = 0.3]",

"alertMessage":null,

"alertType":null

},

{

"warnings":null,

"elementName":"RegionalPrice",

"displayType":"BOTH",

"displayResult":true,

"elementResult":0.825,

"auditTrace":null,

"alertMessage":null,

"alertType":null

}

]

}

}

Page 41: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 41

3.3.14 Test Params

This command executes a draft formula for a given product and calculates the result. This command

is used to test a formula during editing.

URL Syntax /pricefx/<partition>/formulamanager.testparams

URL Parameters N/A

Request Parameters data.targetDate (optional): Specifies the validity date of all objects used

(e.g formula, lookups, etc)

data.productSKU (mandatory): SKU of the product to use for testing the

formula

data.testFormula (mandatory): JSON that represents the whole draft

formula (same format as used for update command).

Remarks N/A

Sample Request {

"data":{

"targetDate":1304428385575,

"productSKU":"SKU-1",

"testFormula":{

"elements":[

{

"combinationType":"ADD",

"elementName":"COGS",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"Product(\"Cost\")",

"typedId":"45.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"ADD",

"elementName":"Margin",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"Context(\"COGS\") * 2",

"typedId":"46.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"ADD",

"elementName":"Margin2",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"COGS * 2",

"typedId":"47.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"RESULT",

"elementName":"ListPrice",

"elementLabel":null,

Page 42: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 42

"displayType":"BOTH",

"formulaExpression":null,

"typedId":"48.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"SUBTRACT",

"elementName":"CustomerDiscount",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"Context(\"ListPrice\") * VLookup(\

"CustomerDiscount\",Customer(\"Customer Type\"))",

"typedId":"49.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"SUBTRACT",

"elementName":"GeographyDiscount",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"Context(\"ListPrice\") * VLookup(\

"Geography\")",

"typedId":"50.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"RESULT",

"elementName":"RegionalPrice",

"elementLabel":null,

"displayType":"BOTH",

"formulaExpression":null,

"typedId":"51.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

}

],

"validAfter":"2010-01-01",

"label":null,

"uniqueName":"DefaultFormula",

"version":1,

"typedId":"4.F"

}

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"name":"Customer",

"url":"/fetch/C/",

"type":"CUSTOMER",

"label":"Kunde"

},

{

"name":"Geography",

"url":"/lookuptablemanager.fetch/17",

"type":"LOOKUP",

"label":"Geography Discount"

}

Page 43: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 43

]

}

}

3.3.15 Update

This command updates the given formula and the contained sub-elements.

URL Syntax /pricefx/<partition>/formulamanager.update/<formula id>

Example:

/pricefx/test/formulamanager.update/4

URL Parameters Formula id (mandatory): Id of formula to update

Request Parameters data: Contains all necessary fields of the formula object. Especially the

elements field that contains a collection of all sub-elements and alert sub-

objects.

Remarks N/A

Sample Request {

"data":{

"elements":[

{

"combinationType":"ADD",

"elementName":"COGS",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"Product(\"Cost\")",

"typedId":"45.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"ADD",

"elementName":"Margin",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"Context(\"COGS\") * 2",

"typedId":"46.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"ADD",

"elementName":"Margin2",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"COGS * 2",

"typedId":"47.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"RESULT",

"elementName":"ListPrice",

"elementLabel":null,

"displayType":"BOTH",

Page 44: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 44

"formulaExpression":null,

"typedId":"48.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"SUBTRACT",

"elementName":"CustomerDiscount",

"elementLabel":null,

"displayType":"BOTH",

"formulaExpression":"Context(\"ListPrice\") * VLookup(\"Cu

stomerDiscount\",Customer(\"Customer Type\"))",

"typedId":"49.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"SUBTRACT",

"elementName":"GeographyDiscount",

"elementLabel":null,

"displayType":"HIDDEN",

"formulaExpression":"Context(\"ListPrice\") * VLookup(\"Ge

ography\")",

"typedId":"50.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

},

{

"combinationType":"RESULT",

"elementName":"RegionalPrice",

"elementLabel":null,

"displayType":"BOTH",

"formulaExpression":null,

"typedId":"51.FE",

"version":0,

"redAlert":null,

"yellowAlert":null

}

],

"validAfter":"2010-01-01",

"label":null,

"uniqueName":"DefaultFormula",

"version":1,

"typedId":"4.F"

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"validAfter":"2010-01-01",

"label":null,

"uniqueName":"DefaultFormula",

"version":3,

"typedId":"4.F"

}

]

}

}

Page 45: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 45

3.4 Calculated Field Set Manager

3.4.1 Calculate

This command starts a calculation of the field set.

URL Syntax /pricefx/<partition>/cfsmanager.calculate/<cfs id>

Example:

/pricefx/test/cfsmanager.calculate/4

URL Parameters Cfs id: Id of field set that should be calculated

Request Parameters None

Remarks Request body remains empty

Sample Request Empty body.

Sample Response {

"response":{

"status":0,

"data" : [{

"version" : 0,

"processingNode" : null,

"threadId" : null,

"threadUUID" : null,

"status" : "WAITING_FOR_DISPATCH",

"trackerType" : "CFS",

"targetObject" : "343.CFS",

"concurrencyKey" : "343.CFS",

"progress" : null,

"cancelRequested" : false,

"priority" : 0,

"messages" : null,

"typedId" : "4049.JST",

"createDate" : "2015-03-17T15:59:00",

"lastUpdateDate" : "2015-03-17T15:59:00",

"processingStart" : null,

"processingEnd" : null

} } }

3.4.2 Cancel

This command cancels running computation of the field set.

URL Syntax /pricefx/<partition>/cfsmanager.cancel/<cfs id>

Example:

/pricefx/test/cfsmanager.cancel/4

URL Parameters Cfs id: Id of field set that is being cancelled

Request Parameters None

Page 46: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 46

Remarks Request body remains empty

Sample Request Empty body.

Sample Response {

"response":{

"status":0,

"data":[ ]

}

}

3.5 Pricelist Manager

3.5.1 Add

This command adds a Pricelist definition to the queue for further computation. There are three

distinct Pricelist definitions:

• new pricelist (referenced further as NP)

• pricelist revision (referenced further as RP)

• addition of products to existing pricelist (referenced further as AP)

URL Syntax /pricefx/<partition>/pricelistmanager.add/<previous pricelist id>

Example:

/pricefx/test/ pricelistmanager.add /20

URL Parameters Previous Pricelist ID (optional): If provided, the command is treated to

operate on existing pricelist I.e. the add command will add product to

existing pricelist or create pricelist revision depending on the request

parameters.

Request Parameters data.targetDate (mandatory for all): Specifies the validity date of price list

data.override(mandatory for adding products to PL): values(true, false). If

true, adds products from products selection criteria to pricelist and will

override existing results if present. If false, adds products, but won’t

override results. If this value is null, then a revision of the entire PL is

triggered!

data.priceListName (mandatory for all): Specifies parameter names and

values used for formula computation

data.useFilter (optional; for RP only): Specifies if the original product filter

criteria (if still available/applicable) should be used, or the current set of

skus in the base pricelist

data.keepManualOverrides (optional; for RP only): Flag to indicate if

manual overrides should be preserved in a revision

Page 47: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 47

data.writeOnlyChangedItems (optional; for RP only): Flag to indicate if

only items with price changes should be written to a revision

data.configuration.productFilterCriteria (mandatory for all, except RP

where useFilter = null or false): See search filters 3.2.3 - used for

restriction of number of pricelist products. If no restriction is applied, e.g.

all products are included then the filter has to be empty.

data.configuration.formulaParameters (mandatory for all): Specifies

parameter names and values used for formula computation

data.configuration.elementNames(mandatory for all): Specifies list of

elements of computation the user is interested in. Their results will be

included in computed pricelist items.

data.configuration.resultElementName(mandatory for all): Element name

of the formula, whose calculation result is copied into the resultPrice field.

data.configuration.maxIncrease(RP): Percentage of max increase. If the

same product if found, check against old price is made and if the price is

above the threshold an alert is raised on computed pricelist item

data.configuration.maxDecrease(RP): Percentage of max increase. If the

same product if found, check against old price is made and if the price is

above the threshold an alert is raised on computed pricelist item

data.configuration.shotgunModeEnabled(all): Flag that indicates if

distributed calculation is possible

Remarks N/A

Sample Request For a new pricelist

"data" : {

"writeOnlyChangedItems" : null,

"override" : null,

"useFilter" : null,

"targetDate" : "2014-10-09",

"priceListName" : "Price List 2014",

"configuration" : {

"productFilterCriteria" : {

"operator" : "and",

"_constructor" : "AdvancedCriteria",

"criteria" : [{

"fieldName" : "sku",

"operator" : "iContainsPattern",

"value" : "51",

"_constructor" : "AdvancedCriteria"

}

]

},

"elementNames" : ["Total_TO", "List_Price", "Invoice”],

"hiddenElementNames" : [],

"formulaParameters" : {

"Discount in %" : null,

"Region" : null,

"Volume" : null

Page 48: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 48

},

"resultElementName" : "List_Price",

"shotgunModeEnabled" : false

},

"keepManualOverrides" : null,

"errorMode" : "ABORT"

}

For a pricelist revision

"data" : {

"writeOnlyChangedItems" : null,

"override" : null,

"useFilter" : null,

"targetDate" : "2014-10-09",

"priceListName" : "Price List 2014",

"configuration" : {

"productFilterCriteria" : {

"operator" : "and",

"_constructor" : "AdvancedCriteria",

"criteria" : [{

"fieldName" : "sku",

"operator" : "iContains",

"value" : "MB",

"_constructor" : "AdvancedCriteria"

}

]

},

"elementNames" : ["Cost", "List_Price", "Invoice"],

"hiddenElementNames" : [],

"formulaParameters" : {

"Discount in %" : null,

"Region" : null,

"Volume" : null

},

"resultElementName" : "List_Price",

"shotgunModeEnabled" : false,

"maxIncreasePct" : "2.0",

"maxDecreasePct" : "3.0"

},

"keepManualOverrides" : true,

"errorMode" : "ABORT"

}

For a addition of products to pricelist

"data" : {

"writeOnlyChangedItems" : null,

"override" : false,

"useFilter" : null,

"targetDate" : "2014-10-09",

"priceListName" : "Price List 2014",

"configuration" : {

"productFilterCriteria" : {

"operator" : "and",

"_constructor" : "AdvancedCriteria",

"criteria" : [{

"fieldName" : "sku",

"operator" : "iContains",

"value" : "MB",

"_constructor" : "AdvancedCriteria"

}

]

},

"elementNames" : ["Cost", "List_Price", "Invoice"],

"hiddenElementNames" : [],

"formulaParameters" : {

"Discount in %" : null,

"Region" : null,

Page 49: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 49

"Volume" : null

},

"resultElementName" : "List_Price",

"shotgunModeEnabled" : false

},

"keepManualOverrides" : true,

"errorMode" : "ABORT"

}

Sample Response For all: empty body

3.5.2 Submit

This command submits a pricelist for workflow.

URL Syntax /pricefx/<partition>/pricelistmanager.submit/<pricelist id>

Example:

/pricefx/test/pricelistmanager.submit/3

URL Parameters Pricelist id (mandatory): Pricelist to submit

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"version":6,

"createDate":"2014-09-19T12:52:59",

"lastUpdateDate":"2014-09-30T14:00:40",

"status":"READY",

"calculationDate":"2014-09-19T12:54:17",

"targetDate":"2014-09-19",

"label":"New Price List",

"locale":"en",

"calculationMessages":"[]",

"numberOfItems":102,

"keepManualOverrides":false,

"writeOnlyChangedItems":false,

"calculationStartDate":"2014-09-19T12:54:16",

"configuration":"{\"productFilterCriteria\":{},\"elementNa

mes\":[\"NextOverridePrice\",\"TestOverridePrice\"],\"hiddenElementNam

es\":[],\"formulaParameters\":{},\"defaultFormulaOverride\":\"BoschTes

t\",\"resultElementName\":\"NextOverridePrice\",\"shotgunModeEnabled\"

:false}",

"errorMode":"ABORT",

"pricelistType":"SIMPLE",

"nodeId":null,

"previousPricelistId":null,

"expiryDate":null,

"approvalState":"NOT_APPROVED",

"approvalDate":null,

"description":null,

"userGroupEdit":null,

"userGroupViewDetails":null,

Page 50: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 50

"workflowStatus":"SUBMITTED",

"submittedByName":"admin",

"approvedByName":null,

"integrationStatus":null,

"updatedBy":4,

"updateDate":"2014-09-30",

"typedId":"3.PL",

"id":3

}

]

}

}

3.5.3 Preview

This command generates a workflow preview.

URL Syntax /pricefx/<partition>/pricelistmanager.preview/<pricelist typed id>

Example:

/pricefx/test/pricelistmanager.preview/3.PL

URL Parameters Pricelist typed id (mandatory): Pricelist to preview

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"workflow":{

"id":"dc40dddd-7529-48f9-8940-000de41fae37",

"workflowStatus":"DRAFT",

"approvableTypedId":"13976.PL",

"submitterTypedId":null,

"steps":[

{

"executionStatus":"INITIALIZED",

"id":"fbcc6a9b-5137-4e8e-9d1f-b983a4233537",

"isUserApprover":"true",

"reason":null,

"userGroupTypedId":null,

"userGroupName":null,

"userTypedId":"4.U",

"userName":"admin",

"lastAccess":"2014-09-30T14:12:14",

"comment":null,

"type":"ApprovalWorkflowStep",

"uniqueName":"Marketing Director Group Approval"

}

],

"type":"pricelist",

"submitterUserName":null,

"currentStepId":"fbcc6a9b-5137-4e8e-9d1f-b983a4233537"

}

}

]

}

}

Page 51: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 51

3.5.4 Delete

Deletes pricelist

URL Syntax /pricefx/<partition>/pricelistmanager.delete

Example:

/pricefx/test/pricelistmanager.delete

URL Parameters N/A

Request Parameters data.typedId(mandatory): Id of the pricelist to be deleted

Remarks N/A

Sample Request {

"data":{

"typedId":"3.PL"

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"status":"READY",

"locale":"en",

"label":"New Price List Name",

"localizedStatus":"Ready",

"numberOfItems":99,

"calculationDate":1304918348000,

"productFilterCriteria":"{\"criteria\":[{\"value\":\"SKU\"

,\"fieldName\":\"sku\",\"operator\":\"iContains\"}],\"operator\":\"and

\"}",

"targetDate":1304917558000,

"formulaParameters":"{\"Customer\":\"Cust-

1\",\"decreaseTreshold\":\"1.5\",\"resultPrice\":\"CustomerDiscount\",

\"Geography\":\"B\",\"increaseTreshold\":\"1.5\"}",

"elementNames":"[\"RegionalPrice\",\"ListPrice\"]",

"previousPricelistId":2,

"resultElementName":"CustomerDiscount",

"maxIncreasePct":1.50,

"maxDecreasePct":1.50,

"approvalState":"NOT_APPROVED",

"localizedApprovalState":"Not Approved",

"approvalDate":null,

"updatedBy":2,

"updateDate":1304918348000,

"version":8,

"typedId":"3.PL"

}

]

}

}

3.5.5 Fetch

Fetches pricelist items of selected pricelist

Page 52: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 52

URL Syntax /pricefx/<partition>/pricelistmanager.fetch/<pricelist id>

Example:

/pricefx/test/pricelistmanager.fetch/2

URL Parameters Pricelist id: Id of the pricelist whose items will be fetched

Request Parameters See 3.2.3

Remarks N/A

Sample Request {

"operationType":"fetch",

"startRow":0,

"endRow":75,

"textMatchStyle":"exact",

"data":{

},

"oldValues":null

}

Sample Response {

"response":{

"endRow":75,

"totalRows":110,

"status":0,

"startRow":0,

"data":[

{

"currency":"EUR",

"approvalState":"APPROVED",

"localizedApprovalState":"Approved",

"approvalDate":1304892000000,

"updatedBy":4,

"updateDate":1304892000000,

"sku":"SKU-1",

"unitOfMeasure":"EA",

"pricelistId":2,

"alerts":"{}",

"warnings":"{}",

"resultPrice":0.23,

"calculatedResultPrice":0.23,

"attribute1":1.5,

"attribute2":1.050,

"version":1,

"typedId":"12.PLI"

},

{

"currency":"EUR",

"approvalState":"APPROVED",

"localizedApprovalState":"Approved",

"approvalDate":1304892000000,

"updatedBy":4,

"updateDate":1304892000000,

"sku":"SKU-10",

"unitOfMeasure":"EA",

"pricelistId":2,

"alerts":"{}",

"warnings":"{}",

"resultPrice":2.25,

"calculatedResultPrice":2.25,

Page 53: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 53

"attribute1":15.0,

"attribute2":10.500,

"version":1,

"typedId":"13.PLI"

} ]

}

}

3.5.6 Fetch for SKU

Fetches all pricelist records that refer to a given SKU

URL Syntax /pricefx/<partition>/pricelistmanager.fetchforsku/<encoded

SKU>/<pricelist id>

Example:

/pricefx/test/pricelistmanager.fetchforsku/SKU-11/2

URL Parameters Encoded SKU (mandatory): The product sku of the product in scope

Pricelist id (optional): Id of the pricelist whose items will be fetched only

(for further details)

Request Parameters See 3.2.3

Remarks N/A

Sample Request {

"operationType":"fetch",

"startRow":0,

"endRow":75,

"textMatchStyle":"exact",

"data":{

},

"oldValues":null

}

Sample Response {

"response":{

"endRow":75,

"totalRows":110,

"status":0,

"startRow":0,

"data":[

{

"currency":"EUR",

"approvalState":"APPROVED",

"localizedApprovalState":"Approved",

"approvalDate":1304892000000,

"updatedBy":4,

"updateDate":1304892000000,

"sku":"SKU-1",

"unitOfMeasure":"EA",

"pricelistId":2,

"alerts":"{}",

"warnings":"{}",

"resultPrice":0.23,

"calculatedResultPrice":0.23,

"attribute1":1.5,

Page 54: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 54

"attribute2":1.050,

"version":1,

"typedId":"12.PLI"

},

{

"currency":"EUR",

"approvalState":"APPROVED",

"localizedApprovalState":"Approved",

"approvalDate":1304892000000,

"updatedBy":4,

"updateDate":1304892000000,

"sku":"SKU-10",

"unitOfMeasure":"EA",

"pricelistId":2,

"alerts":"{}",

"warnings":"{}",

"resultPrice":2.25,

"calculatedResultPrice":2.25,

"attribute1":15.0,

"attribute2":10.500,

"version":1,

"typedId":"13.PLI"

} ]

}

}

3.5.7 Fetch XLS

This command downloads pricelist items as Excel file. Items from multiple lists can be downloaded

into one single file as separate sheets.

URL Syntax /pricefx/<partition>/pricelistmanager.fetchxls/<pricelist id>/<pricelist

id>/<pricelist id>

Example:

/pricefx/test/pricelistmanager.fetchxls/11/12

URL Parameters Pricelist id (minimum once): Id of the pricelist whose items will be fetched

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response Binary response (the XLS document)

3.5.8 Params

This command returns parameters that are used for computation of pricelist items alongside with

fetching URLs if available.

URL Syntax /pricefx/<partition>/pricelistmanager.params

Example:

/pricefx/test/pricelistmanager.params

Page 55: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 55

URL Parameters N/A

Request Parameters

data.targetDate: Specifies the validity date of the formulas that are

derived from products selected in filter criteria

data.filterCriteria: See search filters 3.2.3 - used for restriction of number

of pricelist products. If no restriction is applied, e.g. all products are

included then the filter has to be empty.

Remarks N/A

Sample Request {

"data":{

"targetDate":1304921035261,

"filterCriteria":{

}

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"contextParameters":[

{

"name":"ProductSKU",

"url":null,

"type":"PRODUCT",

"label":"ProductSKU"

},

{

"name":"Customer",

"url":"/fetch/C/",

"type":"CUSTOMER",

"label":"Customer"

},

{

"name":"Geography",

"url":"/lookuptablemanager.fetch/2",

"type":"LOOKUP",

"label":"Geography Discount"

}

],

"formulaParameterReference":[

{

"elementName":"CustomerDiscount",

"displayElement":false

},

{

"elementName":"RegionalPrice",

"displayElement":true

},

{

"elementName":"Margin2",

"displayElement":false

},

{

"elementName":"ListPrice",

"displayElement":true

},

Page 56: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 56

{

"elementName":"GeographyDiscount",

"displayElement":false

},

{

"elementName":"COGS",

"displayElement":false

},

{

"elementName":"Margin",

"displayElement":false

}

]

}

]

}

}

3.5.9 ParamValues

Returns values of pricelist calculation parameters

URL Syntax /pricefx/<partition>/pricelistmanager.paramvalues

Example:

/pricefx/test/pricelistmanager.paramvalues

URL Parameters N/A

Request Parameters data.parameterValues: List of TypedIds of parameters whose values we

want to retrieve

Remarks N/A

Sample Request {

"data":{

"parameterValues":[

"2.LTV"

]

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"value":"B",

"typedId":"2.LTV"

}

]

}

}

Page 57: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 57

3.5.10 Update

This command updates existing pricelist item. Semantic is same is in general update mechanism

Update. Update is customized because it is not plain update, but involves computation of pricelist

item.

URL Syntax /pricefx/<partition>/pricelistmanager.update/<pricelist id>

Example:

/pricefx/test/pricelistmanager.update/4

URL Parameters Pricelist id: Pricelist id the updated pricelist item belongs to

Request Parameters See 3.2.2

Remarks N/A

Sample Request { "operationType":"update",

"data":{

"typedId":"210.PLI",

"manualResultPrice":10

},

"oldValues":{

"currency":"EUR",

"approvalState":"NOT_APPROVED",

"localizedApprovalState":"Not Approved",

"updateDate":"1304921887000",

"sku":"SKU-1",

"unitOfMeasure":"EA",

"pricelistId":4,

"alerts":"{}",

"warnings":"{\"CustomerDiscount\":[\"Customer not set\",\"Lookup

key 0 not found in table CustomerDiscount\"],\"GeographyDiscount\":[\

"VLookup \\\"Geography\\\" called without key\"]}",

"resultPrice":0,

"calculatedResultPrice":0,

"attribute1":1.5,

"attribute2":1.5,

"version":0,

"typedId":"210.PLI",

"label":null,

"manualResultPrice":null,

"previousPrice":null,

"priceChange":null,

"priceChangePct":null,

"attribute3":null,

"attribute4":null,

"attribute5":null,

"attribute6":null,

"attribute7":null,

"attribute8":null,

"attribute9":null,

"attribute10":null,

"attribute11":null,

"attribute12":null,

"attribute13":null,

"attribute14":null,

"attribute15":null,

"approvalDate":null,

"updatedBy":null

}

}

Page 58: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 58

Sample Response {

"response":{

"status":0,

"data":[

{

"label":null,

"currency":"EUR",

"approvalState":"NOT_APPROVED",

"localizedApprovalState":"Not Approved",

"approvalDate":null,

"updatedBy":4,

"updateDate":1304922458682,

"sku":"SKU-1",

"unitOfMeasure":"EA",

"pricelistId":4,

"alerts":"{}",

"warnings":"{\"GeographyDiscount\":[\"VLookup \\\"Geograph

y\\\" called without key\"]}",

"resultPrice":10,

"manualResultPrice":10,

"calculatedResultPrice":10,

"previousPrice":null,

"priceChange":null,

"priceChangePct":null,

"attribute1":1.5,

"attribute2":-8.5,

"attribute3":null,

"attribute4":null,

"attribute5":null,

"attribute6":null,

"attribute7":null,

"attribute8":null,

"attribute9":null,

"attribute10":null,

"attribute11":null,

"attribute12":null,

"attribute13":null,

"attribute14":null,

"attribute15":null,

"version":1,

"typedId":"210.PLI"

}

]

}

}

3.5.11 Cancel

This command cancels running computation of the pricelist. Pricelist is moved to draft status after

successful cancelation.

URL Syntax /pricefx/<partition>/pricelistmanager.cancel/<pricelist id>

Example:

/pricefx/test/pricelistmanager.cancel/4

URL Parameters Pricelist id: Id of pricelist that is being cancelled

Request Parameters None

Page 59: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 59

Remarks Request body remains empty

Sample Request Empty body.

Sample Response {

"response":{

"status":0,

"data":[

"Pricelist cancel request is queued"

]

}

}

3.5.12 Summarize

This command is used to generate a summary report over one or multiple pricelists. The request

contains a more complex query structure that defines the desired results and the aggregation

mechanisms.

URL Syntax /pricefx/<partition>/pricelistmanager.summarize

Example:

/pricefx/test/pricelistmanager.summarize

URL Parameters N/A

Request Parameters A summary query structure.

Example:

{

"data":{

"query":{

"projections":[

{

"weight":null,

"aggregationMode":"AVG",

"fieldName":"Margin"

},

{

"weight":"RegionalPrice",

"aggregationMode":"SUM",

"fieldName":"ListPrice"

}

],

"objects":[

"3.PL",

"4.PL"

],

"productGroupBy":"attribute3",

"itemGroupBy":null,

"count":true

}

}

}

There is exactly one query element inside the general data element. This

Page 60: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 60

query element holds two name/value pairs for grouping:

productGroupBy and itemGroupBy. Both are optional and specify

additional grouping options of the results.

The element objects specifies the pricelists (as typed id) that the query

should run on. At a minimum one object is required.

The element projections specifies the desired result columns and the way

to calculate them. aggregationMode is either SUM or AVG. weight is

optional, fieldName is mandatory. The specified values are the fieldnames

as they appear in the grid (i.e. the labels of the AttributeMeta) rather than

the internal column name (e.g. attribute1), as the same field could be

stored in different columns in two different pricelists. The field count is a

Boolean that specifies if the group count should be calculated and

displayed.

Remarks N/A

Sample Request See above.

Sample Response {

"response":{

"endRow":3,

"totalRows":3,

"status":0,

"startRow":0,

"data":[

{

"avg_margin_":928.0560919235061,

"changePct_avg_margin_":0.0,

"sum_listprice_regionalprice":4.1406710118035995E10,

"groupKey":null,

"changeAbs_sum_listprice_regionalprice":0.0,

"changePct_sum_listprice_regionalprice":0.0,

"oldVal_avg_margin_":928.0560919235061,

"changeAbs_avg_margin_":0.0,

"totalWeight_avg_margin_":218.0,

"totalWeight_sum_listprice_regionalprice":0.0,

"oldVal_sum_listprice_regionalprice":4.1406710118035995E10

},

{

"avg_margin_":100.215003982186,

"changePct_avg_margin_":0.0,

"sum_listprice_regionalprice":8253193.8571608,

"groupKey":"XXX",

"changeAbs_sum_listprice_regionalprice":0.0,

"changePct_sum_listprice_regionalprice":0.0,

"oldVal_avg_margin_":100.215003982186,

"changeAbs_avg_margin_":0.0,

"totalWeight_avg_margin_":4.0,

"totalWeight_sum_listprice_regionalprice":0.0,

"oldVal_sum_listprice_regionalprice":8253193.8571608

},

{

"avg_margin_":913.1400362849237,

"changePct_avg_margin_":0.0,

"sum_listprice_regionalprice":4.141496331189316E10,

"groupKey":"TOTAL",

"changeAbs_sum_listprice_regionalprice":0.0,

"changePct_sum_listprice_regionalprice":0.0,

Page 61: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 61

"oldVal_avg_margin_":913.1400362849237,

"changeAbs_avg_margin_":0.0,

"totalWeight_avg_margin_":222.0,

"totalWeight_sum_listprice_regionalprice":0.0,

"oldVal_sum_listprice_regionalprice":4.141496331189316E10

}

]

}

}

3.6 Manual Pricelist Manager

3.6.1 Add

This command adds a ManualPricelistItem to a manual pricelist.

URL Syntax /pricefx/<partition>/manualpricelistmanager.add/<manual pricelist id>

Example:

/pricefx/test/manualpricelistmanager.add /20

URL Parameters Manual Pricelist ID (mandatory): The add command will add product to

that existing manual pricelist.

Request Parameters

Remarks N/A

Sample Request {

"operationType":"add",

"data":{

"sku":"MB-0026",

"currency":"EUR",

"unitOfMeasure":"EA",

"label":"Meatball MM Beef+Cheese"

},

"oldValues":null

}

Sample Response {

"response" : {

"status" : 0,

"data" : [{

"version" : 0,

"sku" : "MB-0026",

"label" : "Meatball MM Beef+Cheese",

"unitOfMeasure" : "EA",

"currency" : "EUR",

"comment" : null,

"pricelistId" : 16,

"typedId" : "124.MPLI",

}

]

}

}

3.6.2 Delete

Deletes an entire manual pricelist (including items) or a single manual list item

Page 62: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 62

URL Syntax /pricefx/<partition>/manualpricelistmanager.delete

Example:

/pricefx/test/manualpricelistmanager.delete

URL Parameters N/A

Request Parameters data.typedId(mandatory): Id of the pricelist or the item to be deleted

Remarks N/A

Sample Request See corresponding command for normal pricelists

Sample Response See corresponding command for normal pricelists

3.6.3 Fetch

Fetches pricelist items of selected manual pricelist

URL Syntax /pricefx/<partition>/manualpricelistmanager.fetch/<pricelist id>

Example:

/pricefx/test/manualpricelistmanager.fetch/2

URL Parameters Pricelist id: Id of the pricelist whose items will be fetched

Request Parameters See 3.2.3

Remarks N/A

Sample Request See corresponding command for normal pricelists

Sample Response See corresponding command for normal pricelists

3.6.4 Update

This command updates existing manual pricelist item. Semantic is same is in general update

mechanism Update.

URL Syntax /pricefx/<partition>/manualpricelistmanager.update/<pricelist

id>/<recalculate>

Example:

/pricefx/test/manualpricelistmanager.update/16

URL Parameters Pricelist id: Pricelist id the updated pricelist item belongs to

Recalculate (optional): If the URL is appended by the keyword “recalculate”

and the MPL is linked to a CFS this update also triggers a recalculation of

Page 63: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 63

the updated rows

Request Parameters See 3.2.2

Remarks N/A

Sample Request {

"operationType":"update",

"data":{

"typedId":"124.MPLI",

"comment":"Test"

},

"oldValues":{

"version":0,

"sku":"MB-0026",

"label":"Meatball MM Beef+Cheese",

"unitOfMeasure":"EA",

"currency":"EUR",

"comment":null,

"pricelistId":"16",

"typedId":"124.MPLI",

"attribute1":null,

"attribute2":null,

"attribute3":null,

"attribute4":null,

"attribute5":null,

"attribute6":null,

"attribute7":null,

"attribute8":null,

"attribute9":null,

"attribute10":null,

"attribute11":null,

"attribute12":null,

"attribute13":null,

"attribute14":null,

"attribute15":null,

"attribute16":null,

"attribute17":null,

"attribute18":null,

"attribute19":null,

"attribute20":null,

"attribute21":null,

"attribute22":null,

"attribute23":null,

"attribute24":null,

"attribute25":null,

"attribute26":null,

"attribute27":null,

"attribute28":null,

"attribute29":null,

"attribute30":null

}

}

Sample Response {

"response" : {

"status" : 0,

"data" : [{

"version" : 1,

"sku" : "MB-0026",

"label" : "Meatball MM Beef+Cheese",

"unitOfMeasure" : "EA",

"currency" : "EUR",

"comment" : "Test",

"pricelistId" : 16,

"typedId" : "124.MPLI",

"attribute1" : null,

Page 64: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 64

"attribute2" : null,

"attribute3" : null,

"attribute4" : null,

"attribute5" : null,

"attribute6" : null,

"attribute7" : null,

"attribute8" : null,

"attribute9" : null,

"attribute10" : null,

"attribute11" : null,

"attribute12" : null,

"attribute13" : null,

"attribute14" : null,

"attribute15" : null,

"attribute16" : null,

"attribute17" : null,

"attribute18" : null,

"attribute19" : null,

"attribute20" : null,

"attribute21" : null,

"attribute22" : null,

"attribute23" : null,

"attribute24" : null,

"attribute25" : null,

"attribute26" : null,

"attribute27" : null,

"attribute28" : null,

"attribute29" : null,

"attribute30" : null

}

]

}

}

3.6.5 Copy

This command copies a manual pricelist including items and meta data.

URL Syntax /pricefx/<partition>/manualpricelistmanager.copy/<pricelist id>

Example:

/pricefx/test/manualpricelistmanager.copy/4

URL Parameters Pricelist id: Id of pricelist that is being copied

Request Parameters None

Remarks Request body remains empty

Sample Request Empty body.

Sample Response {

"response" : {

"status" : 0,

"data" : [{

"version" : 0,

"uniqueName" : "Special Prices Re",

"label" : "Special Prices Restaurant",

"validAfter" : "2013-12-05",

"status" : "INACTIVE",

"simulationSet" : null,

"nodeId" : null,

Page 65: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 65

"userGroupEdit" : null,

"userGroupViewDetails" : null,

"typedId" : "17.MPL"

}

]

}

}

3.6.6 Mass Edit

This command performs a mass edit operation on a manual pricelist.

URL Syntax /pricefx/<partition>/manualpricelistmanager.massedit/<pricelist id>

Example:

/pricefx/test/manualpricelistmanager.massedit/4

URL Parameters Pricelist id: Id of pricelist that should be worked on

Request Parameters None

Remarks N/A

Sample Request See mass edit command of lookup table manager

Sample Response See mass edit command of lookup table manager

3.6.7 Reset Column

This command resets (=wipes all column data) of a given manual pricelist.

URL Syntax /pricefx/<partition>/manualpricelistmanager.resetcolumn/<pricelist id>

Example:

/pricefx/test/manualpricelistmanager. resetcolumn /4

URL Parameters Pricelist id: Id of pricelist that should be worked on

Request Parameters None

Remarks N/A

Sample Request See reset column command of lookup table manager

Sample Response See reset column command of lookup table manager

3.6.8 Integrate

Similar to the regular datasource integrate command, this command performs an upsert operation

on manual pricelists. The semantics are the same as for the datasource integrate.

Page 66: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 66

URL Syntax /pricefx/<partition>/manualpricelistmanager.integrate/<pricelist id>

Example:

/pricefx/test/manualpricelistmanager.integrate/4

URL Parameters Pricelist id: Id of pricelist that should be worked on

Request Parameters None

Remarks N/A

Sample Request See integrate command of lookup table manager

Sample Response See integrate command of lookup table manager

3.6.9 Calculate

Manual pricelists can be linked to a Calculated Field Set (CFS). The CFS’ definition specifies how and if

certain fields of a manual pricelist item are updated by calculation logic. This command can be used

to trigger a recalculation of the entire manual pricelist to update all items.

URL Syntax /pricefx/<partition>/manualpricelistmanager.calculate/<pricelist id>

Example:

/pricefx/test/manualpricelistmanager.calculate/4

URL Parameters Pricelist id: Id of pricelist that should be recalculated

Request Parameters None

Remarks N/A

Sample Request Empty body

Sample Response See calculate command of CFS manager

3.7 Lookuptable Manager

3.7.1 Add

This command creates either a new lookup table or a new item inside an existing lookup table.

URL Syntax /pricefx/<partition>/lookuptablemanager.add/<table id>

Example:

/pricefx/test/lookuptablemanager.add/20

URL Parameters Table id (optional): If provided, the command is treated to operate on that

table. I.e. the add command will add an item for that table. If left out, the

add command will create a new table.

Page 67: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 67

Request Parameters See 3.2.3

Remarks N/A

Sample Request For a table-level add:

{

"operationType":"add",

"data":{

"uniqueName":"Test",

"label":"Test",

"validAfter":"2011-05-04",

"type":"SIMPLE",

"valueType":"REAL"

},

"oldValues":null

}

For a item-level add:

{

"operationType":"add",

"data":{

"name":"Test",

"value":1

},

"oldValues":null

}

Sample Response For a table-level add:

{

"response":{

"status":0,

"data":[

{

"type":"SIMPLE",

"valueType":"REAL",

"validAfter":"2011-05-04",

"label":"Test",

"uniqueName":"Test",

"version":0,

"typedId":"20.LT"

}

]

}

}

For a item-level add:

{

"response":{

"status":0,

"data":[

{

"name":"Test",

"value":1,

"type":"SIMPLE",

"valueType":"REAL",

"rawValue":"1",

"lowerBound":null,

"upperBound":null,

"version":0,

"typedId":"10114.LTV"

}

Page 68: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 68

]

}

}

3.7.2 Copy

This command copies an existing lookup table including items.

URL Syntax /pricefx/<partition>/lookuptablemanager.copy/<table id>

Example:

/pricefx/test/lookuptablemanager.copy/20

URL Parameters Table id (mandatory): Id of table to copy.

Request Parameters N/A

Remarks Returns details of new (copied) table

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"type":"SIMPLE",

"valueType":"REAL",

"validAfter":"2011-05-05",

"label":"Test",

"uniqueName":"Test",

"version":0,

"typedId":"21.LT"

}

]

}

}

3.7.3 Delete

This command deletes entire tables (including items) or individual items.

URL Syntax /pricefx/<partition>/lookuptablemanager.delete

URL Parameters N/A

Request Parameters See 3.2.4

Remarks Returns details of deleted item or table. In case a table is deleted all items

that belong to that table are deleted as well. The type of object to work on

(table or item) is determined by the typedId.

Sample Request {

"operationType":"remove",

"data":{

"typedId":"10114.LTV"

},

"oldValues":null

Page 69: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 69

}

Sample Response {

"response":{

"status":0,

"data":[

{

"name":"TestX",

"value":1,

"type":"SIMPLE",

"valueType":"REAL",

"rawValue":"1",

"lowerBound":null,

"upperBound":null,

"version":1,

"typedId":"10114.LTV"

}

]

}

}

3.7.4 Fetch

This command copies an existing lookup table including items.

URL Syntax /pricefx/<partition>/lookuptablemanager.fetch/<table id>

Example:

/pricefx/test/lookuptablemanager.fetch/20

URL Parameters Table id (optional): Id of table whose items to fetch. If omitted table header

data is fetched.

Request Parameters See 3.2.1

Remarks N/A

Sample Request {

"operationType":"fetch",

"startRow":0,

"endRow":75,

"textMatchStyle":"substring",

"data":{

},

"oldValues":null

}

Sample Response {

"response":{

"endRow":4,

"totalRows":4,

"status":0,

"startRow":0,

"data":[

{

"type":"SIMPLE",

"valueType":"REAL",

"validAfter":"2010-01-01",

"label":"Customer Type Discount",

"uniqueName":"CustomerDiscount",

Page 70: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 70

"version":0,

"typedId":"16.LT"

},

{

"type":"SIMPLE",

"valueType":"REAL",

"validAfter":"2010-01-01",

"label":"Geography Discount",

"uniqueName":"Geography",

"version":0,

"typedId":"17.LT"

},

{

"type":"RANGE",

"valueType":"REAL",

"validAfter":"2010-01-01",

"label":"Quantity Breaks",

"uniqueName":"Quantity",

"version":0,

"typedId":"18.LT"

},

{

"type":"SIMPLE",

"valueType":"REAL",

"validAfter":"2010-01-01",

"label":"Special Discount",

"uniqueName":"SpecialDiscount",

"version":0,

"typedId":"19.LT"

}

]

}

}

3.7.5 Update

This command updates lookup table header data as well as individual items.

URL Syntax /pricefx/<partition>/lookuptablemanager.update/<table id>

Example:

/pricefx/test/lookuptablemanager.update/20

URL Parameters Table id (optional): Id of table to work on. Mandatory if items should be

updated.

Request Parameters See 3.2.2

Remarks Returns details of updated table / item.

Sample Request {

"operationType":"update",

"data":{

"typedId":"10114.LTV",

"name":"TestX"

},

"oldValues":{

"name":"Test",

"value":1,

"type":"SIMPLE",

"valueType":"REAL",

"rawValue":"1",

"lowerBound":null,

Page 71: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 71

"upperBound":null,

"version":0,

"typedId":"10114.LTV"

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"name":"TestX",

"value":1,

"type":"SIMPLE",

"valueType":"REAL",

"rawValue":"1",

"lowerBound":null,

"upperBound":null,

"version":1,

"typedId":"10114.LTV"

}

]

}

}

Sample Response {

"response":{

"endRow":4,

"totalRows":4,

"status":0,

"startRow":0,

"data":[

{

"type":"SIMPLE",

"valueType":"REAL",

"validAfter":"2010-01-01",

"label":"Customer Type Discount",

"uniqueName":"CustomerDiscount",

"version":0,

"typedId":"16.LT"

},

{

"type":"SIMPLE",

"valueType":"REAL",

"validAfter":"2010-01-01",

"label":"Geography Discount",

"uniqueName":"Geography",

"version":0,

"typedId":"17.LT"

},

{

"type":"RANGE",

"valueType":"REAL",

"validAfter":"2010-01-01",

"label":"Quantity Breaks",

"uniqueName":"Quantity",

"version":0,

"typedId":"18.LT"

},

{

"type":"SIMPLE",

"valueType":"REAL",

"validAfter":"2010-01-01",

"label":"Special Discount",

"uniqueName":"SpecialDiscount",

"version":0,

"typedId":"19.LT"

}

Page 72: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 72

]

}

}

3.7.6 Mass Edit

The mass edit command performs a mass update operation of a price parameter value.

Typically a filter expression is passed along the request to restrict the scope of the mass edit

operation. The response contains the number of actually updated records. This number can be

different from what the client UI initially thinks as the server takes edit restrictions into account. The

semantics of this command are the same as for the regular datasource mass edit command.

URL Syntax /pricefx/<partition>/lookuptablemanager.massedit/<table id>

Example: /pricefx/test/ lookuptablemanager.massedit/20

URL Parameters Table id (mandatory): Id of table to mass edit.

Request Parameters filterCriteria (Optional) : Standard filtercriteria to restrict the edit scope

fieldName (Mandatory): Name of the object’s field to update

fieldValue (Optional): New field value. If omitted the field is set to null

Remarks The response contains (in case of successful object deletion) the full object

details of the deleted object.

Sample Request {

"data":{

"filterCriteria":{

"operator":"and"

"criteria":[

{

"fieldName":"sku",

"operator":"iContains",

"value":"A"

}

]

},

"fieldName":"attribute2",

"fieldValue":"NewValue"

}

}

Sample Response {"response":{"status":0,"data":["4"]}}

3.7.7 Reset Column

This command resets (=wipes all column data) of a given lookup table. Currently only for tables of

type MATRIX

URL Syntax /pricefx/<partition>/lookuptablemanager.resetcolumn/<table id>/<column

name>

Example:

/pricefx/test/lookuptablemanager.resetcolumn/20/attribute1

Page 73: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 73

URL Parameters Table id (mandatory): Id of table to work on.

Column name (mandatory): The base name of the column/attribute to

wipe

Request Parameters None

Remarks Request body remains empty

Sample Request N/A

Sample Response {"response":{"status":0,"data":null}}

3.7.8 Find references

This command finds all formula references to a given lookup table. This is used to display a warning

before renaming or deleting a lookup table as this action would then cause a non-working formula.

The response contains then an array of references to formula elements that contain a reference to

this lookup table.

URL Syntax /pricefx/<partition>/lookuptablemanager.findref/<table id>

Example:

/pricefx/test/lookuptablemanager.findref/20

URL Parameters Table id (mandatory): Id of table to search for references.

Request Parameters None

Remarks Request body remains empty

Sample Request N/A

Sample Response {"response":{"status":0,"data":[{"formulaName":"Test","elementName":"P

etr","displayElement":false,"formulaDate":"2011-01-01"}]}}

3.7.9 Integrate

Similar to the regular datasource integrate command, this command performs an upsert operation

on lookup tables. The semantics are the same as for the datasource integrate.

URL Syntax /pricefx/<partition>/lookuptablemanager.integrate/<table id>

Example: /pricefx/test/ lookuptablemanager.integrate/20

URL Parameters Table id (mandatory): Id of table to perform data update/insert.

Request Parameters data: All values of the object. The request needs to contain all fields that

are part of the business key for that object and all non-nullable fields.

operationType: Must be integrate or null or omitted

Remarks The response contains the full object details of the updated object.

Page 74: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 74

Sample Request {

"operationType":"integrate",

"data":{

"key1":"001",

"key2":"AAA",

"attribute1":"EA",

"attribute2":"EUR"

},

"oldValues":null

}

Sample Response {

"response":{

"status":0,

"data":[

{

"key1":"001",

"key2":"AAA",

"attribute1":"EA",

"attribute2":"EUR"

"attribute1":null,

"attribute2":null,

"attribute3":null,

"attribute4":null,

"attribute5":null,

"attribute6":null,

"attribute7":null,

"attribute8":null,

"attribute9":null,

"attribute10":null,

"attribute11":null,

"attribute12":null,

"attribute13":null,

"attribute14":null,

"attribute15":null,

"version":0,

"typedId":"148.MLTV2"

}

]

}

}

3.8 Tree Manager

3.8.1 Add tree node

This command adds a tree node to the lookup table tree structure.

URL Syntax /pricefx/<partition>/treemanager.addtreenode/<type code>

Example:

/pricefx/test/treemanager.addtreenode/LTT

URL Parameters Type code: Type code of tree object

Request Parameters data.parentId (Optional) : Id of the node that the new node should be

placed under. If not present the new node will be added under the root

node.

Remarks

Page 75: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 75

Sample Request {

"operationType":"add",

"data":{

"parentId":0

},

"oldValues":null

}

Sample Response {

"response":{

"status":0,

"data":[

{

"isFolder":true,

"label":null,

"parentId":0,

"nodeId":9,

"version":0,

"typedId":"9.LTT"

}

]

}

}

3.8.2 Fetch tree

This command fetches the tree node structure of the lookup table tree. It returns ALL nodes (thus

ignoring filter settings)

URL Syntax /pricefx/<partition>/treemanager.fetchtree/<type code>

Example:

/pricefx/test/treemanager.fetchtree/LTT

URL Parameters Type code: Type code of tree object

Request Parameters None

Remarks

Sample Request N/A

Sample Response {

"response":{

"totalRows":3,

"status":0,

"data":[

{

"isFolder":true,

"label":"Alle Parameter",

"parentId":null,

"nodeId":0,

"version":null,

"typedId":"0.LTT"

},

{

"isFolder":true,

"label":"X1",

"parentId":0,

"nodeId":7,

"version":1,

"typedId":"7.LTT"

Page 76: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 76

},

{

"isFolder":true,

"label":"X2",

"parentId":7,

"nodeId":8,

"version":1,

"typedId":"8.LTT"

}

]

}

}

3.8.3 Update tree node

This command updates a tree node of the lookup table tree structure. This action commonly happens

when the node is renamed or reparented.

URL Syntax /pricefx/<partition>/treemanager.updatetreenode/<type code>

Example:

/pricefx/test/treemanager.updatetreenode/LTT

URL Parameters Type code: Type code of tree object

Request Parameters See 3.2.2

Remarks Returns details of updated tree node

Sample Request {

"operationType":"update",

"data":{

"nodeId":9,

"label":"Test"

},

"oldValues":{

"isFolder":true,

"label":null,

"parentId":0,

"nodeId":9,

"version":0,

"typedId":"9.LTT"

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"isFolder":true,

"label":"Test",

"parentId":0,

"nodeId":9,

"version":1,

"typedId":"9.LTT"

}

]

}

}

Page 77: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 77

3.8.4 Delete tree node

This command deletes a tree node of the lookup table tree structure. If this node has children, they

are reparented.

URL Syntax /pricefx/<partition>/treemanager.deletetreenode/<type code>

Example:

/pricefx/test/treemanager.deletetreenode/LTT

URL Parameters Type code: Type code of tree object

Request Parameters See 3.2.2

Remarks Returns details of deleted tree node

Sample Request {

"operationType":"remove",

"data":{

"nodeId":9

},

"oldValues":null

}

Sample Response {

"response":{

"status":0,

"data":[

{

"isFolder":true,

"label":"Test",

"parentId":0,

"nodeId":9,

"version":1,

"typedId":"9.LTT"

}

]

}

}

3.9 Account Manager

3.9.1 Fetching roles or user groups

Obtains all roles or user groups that this particular user is assigned to

URL Syntax /pricefx/<partition>/accountmanager.fetchroles/<user id>

/pricefx/<partition>/accountmanager.fetchgroups/<user id>

Example:

/pricefx/test/rolemanager.fetchroles /4

URL Parameters User id: Id of the user whose assignable roles or groups will be fetched

Request Parameters N/A

Page 78: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 78

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"label":"General Admin",

"uniqueName":"ADMIN",

"module":"ADMIN",

"version":0,

"typedId":"1.R"

},

{ "label":"Priceshop",

"uniqueName":"PRICESHOP",

"module":"PRICESHOP",

"version":0,

"typedId":"2.R"

}

]

}

}

3.9.2 Assigning roles or user groups

This command assigns a role or user group to a user.

URL Syntax /pricefx/<partition>/accountmanager.assignrole/<user id>

/pricefx/<partition>/accountmanager.assigngroup/<user id>

Example:

/pricefx/test/rolemanager.assignrole/4

URL Parameters User id: Id of the user to whom the role/user group will be assigned or

taken away

Request Parameters data.assign: If true the role is assigned to the user, otherwise the role is

taken away.

data.typedId: Id of the role or user group we are manipulating on

Remarks N/A

Sample Request {

"data":{

"assign":true,

"typedId":"2.R"

}

}

Sample Response Empty body

Page 79: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 79

3.9.3 Delete

This command deletes a user group. The default datasource delete operation should NOT be used for

this object as this special command also performs a cleanup of related objects (objects that have this

user group assigned as editability constraint and user to group assignments).

URL Syntax /pricefx/<partition>/accountmanager.deletegroup

Example:

/pricefx/test/rolemanager.deletegroup

URL Parameters N/A

Request Parameters See 3.2.2

Remarks

Sample Request {

"operationType":"remove",

"data":{

"typedId":"4.UG"

},

"oldValues":null

}

Sample Response {

"response":{

"status":0,

"data":[

{

"uniqueName":"TestGroup",

"label":"Testing",

"version":0,

"typedId":"4.UG"

}

]

}

}

3.9.4 Change Password

Changes password for selected user

URL Syntax /pricefx/<partition>/accountmanager.changepassword/<user id>

Example:

/pricefx/test/accountmanager.changepassword/4

URL Parameters User id: Id of the user whose password will be changed

Request Parameters data.newPassword: new password

Remarks N/A

Sample Request {

"data":{

"newPassword":"admin"

Page 80: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 80

}

}

Sample Response Empty body

3.9.5 Copy User

This command creates a copy of a selected user (including role and user group assignments). First

name, last name, email and password are NOT copied as they typically are different anyway.

URL Syntax /pricefx/<partition>/accountmanager.copyuser/<user id>

Example:

/pricefx/test/accountmanager.copyuser/4

URL Parameters User id: Id of the user to copy

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response Empty body

3.10 Preferences Manager

3.10.1 Fetch

This command fetches preferences for user interface grid settings or other preferences for the

logged in user. Preferences consist of proprietary values that define the states of the grid(column

names, widths etc…) or other elements.

URL Syntax /pricefx/<partition>/preferencesmanager.fetch/<Preference Type>

Example:

/pricefx/test/preferencesmanager.fetch/Products

URL Parameters Preference Type: Type of the preference

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

Page 81: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 81

"data":[

{

"version":4,

"preferenceType":"Products",

"preferenceName":"Preference 1",

"areDefault":false,

"viewState":"({selected:\"[]\",field:\"[{name:\\\"sku\\\",

width:null,autoFitWidth:null},{name:\\\"label\\\",width:null,autoFitWi

dth:null},{name:\\\"unitOfMeasure\\\",width:null,autoFitWidth:null},{n

ame:\\\"currency\\\",width:null,autoFitWidth:null},{name:\\\"lastUpdat

eDate\\\",width:80,autoFitWidth:null},{name:\\\"formulaName\\\",width:

null,autoFitWidth:null},{name:\\\"attribute1\\\",width:null,autoFitWid

th:null},{name:\\\"attribute2\\\",width:null,autoFitWidth:null},{name:

\\\"attribute3\\\",width:null,autoFitWidth:null},{name:\\\"attribute4\

\\",width:null,autoFitWidth:null},{name:\\\"attribute5\\\",width:null,

autoFitWidth:null},{name:\\\"attribute6\\\",visible:false,width:null,a

utoFitWidth:null},{name:\\\"attribute7\\\",visible:false,width:null,au

toFitWidth:null},{name:\\\"attribute8\\\",visible:false,width:null,aut

oFitWidth:null},{name:\\\"attribute9\\\",visible:false,width:null,auto

FitWidth:null},{name:\\\"attribute10\\\",visible:false,width:null,auto

FitWidth:null},{name:\\\"attribute11\\\",width:null,autoFitWidth:null}

,{name:\\\"attribute12\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute13\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute14\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute15\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute16\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute17\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute18\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute19\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute20\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute21\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute22\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute23\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute24\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute25\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute26\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute27\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute28\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute29\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute30\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"userGroupEdit\\\",width:null,autoFitWidth:null},{name:\\\"u

serGroupViewDetails\\\",width:null,autoFitWidth:null}]\",sort:\"({fiel

dName:\\\"attribute2\\\",sortDir:\\\"ascending\\\",sortSpecifiers:[{pr

operty:\\\"attribute2\\\",direction:\\\"ascending\\\"}]})\",hilite:nul

l,group:\"\"})",

"filter":"{}",

"columnLabels":null,

"typedId":"19.PREF"

}

]

}

}

3.10.2 Update

Updates or creates preferences for UI Grid

URL Syntax /pricefx/<partition>/preferencesmanager.update/<Preference Type >

Example:

/pricefx/test/preferencesmanager.update/Products

Page 82: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 82

URL Parameters Grid Name: Id of the grid

Request Parameters data.preferenceType: Type of the preference

data.preferenceName: (User defined) Name of the preference

data.viewState: Smartgwt’s proprietary state of the UI Grid

Remarks N/A

Sample Request {

"data":{

"preferenceType":"Products",

"preferenceName":" Preference 1",

"viewState":"({selected:\"[]\",field:\"[{name:\\\"_checkboxField

\\\",width:28},{name:\\\"version\\\",width:null},{name:\\\"label\\\",w

idth:null},{name:\\\"sku\\\",width:null},{name:\\\"unitOfMeasure\\\",w

idth:null},{name:\\\"currency\\\",width:null},{name:\\\"lastUpdateDate

\\\",width:80},{name:\\\"formulaName\\\",width:null},{name:\\\"attribu

te1\\\",width:null},{name:\\\"attribute2\\\",width:null},{name:\\\"att

ribute3\\\",width:null},{name:\\\"attribute4\\\",width:null},{name:\\\

"attribute5\\\",width:null},{name:\\\"attribute6\\\",width:null},{name

:\\\"attribute7\\\",width:null},{name:\\\"attribute8\\\",width:null},{

name:\\\"attribute9\\\",width:null},{name:\\\"attribute10\\\",width:nu

ll},{name:\\\"attribute11\\\",width:null},{name:\\\"attribute12\\\",wi

dth:null},{name:\\\"attribute13\\\",width:null},{name:\\\"attribute14\

\\",width:null},{name:\\\"attribute15\\\",width:null}]\",sort:\"({fiel

dName:null,sortDir:true})\"})"

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"version":4,

"preferenceType":"Products",

"preferenceName":"Preference 1",

"areDefault":false,

"viewState":"({selected:\"[]\",field:\"[{name:\\\"sku\\\",

width:null,autoFitWidth:null},{name:\\\"label\\\",width:null,autoFitWi

dth:null},{name:\\\"unitOfMeasure\\\",width:null,autoFitWidth:null},{n

ame:\\\"currency\\\",width:null,autoFitWidth:null},{name:\\\"lastUpdat

eDate\\\",width:80,autoFitWidth:null},{name:\\\"formulaName\\\",width:

null,autoFitWidth:null},{name:\\\"attribute1\\\",width:null,autoFitWid

th:null},{name:\\\"attribute2\\\",width:null,autoFitWidth:null},{name:

\\\"attribute3\\\",width:null,autoFitWidth:null},{name:\\\"attribute4\

\\",width:null,autoFitWidth:null},{name:\\\"attribute5\\\",width:null,

autoFitWidth:null},{name:\\\"attribute6\\\",visible:false,width:null,a

utoFitWidth:null},{name:\\\"attribute7\\\",visible:false,width:null,au

toFitWidth:null},{name:\\\"attribute8\\\",visible:false,width:null,aut

oFitWidth:null},{name:\\\"attribute9\\\",visible:false,width:null,auto

FitWidth:null},{name:\\\"attribute10\\\",visible:false,width:null,auto

FitWidth:null},{name:\\\"attribute11\\\",width:null,autoFitWidth:null}

,{name:\\\"attribute12\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute13\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute14\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute15\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute16\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute17\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute18\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute19\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute20\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute21\\\",visible:false,width:null,autoFitWidth:null}

Page 83: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 83

,{name:\\\"attribute22\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute23\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute24\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute25\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute26\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute27\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute28\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute29\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"attribute30\\\",visible:false,width:null,autoFitWidth:null}

,{name:\\\"userGroupEdit\\\",width:null,autoFitWidth:null},{name:\\\"u

serGroupViewDetails\\\",width:null,autoFitWidth:null}]\",sort:\"({fiel

dName:\\\"attribute2\\\",sortDir:\\\"ascending\\\",sortSpecifiers:[{pr

operty:\\\"attribute2\\\",direction:\\\"ascending\\\"}]})\",hilite:nul

l,group:\"\"})",

"filter":"{}",

"columnLabels":null,

"typedId":"19.PREF"

}

]

}

}

3.11 Partition Manager

3.11.1 Add

This command creates a new partition. Note: Only available in system partition.

URL Syntax /pricefx/system/system$partitionmanager.add

URL Parameters N/A

Request Parameters See 3.2.3

Remarks Returns details of created partition.

Sample Request {

"operationType":"add",

"data":{

"uniqueName":"testpart",

"label":"Documentation",

"maxAdminUsers":2,

"maxPriceBuilderUsers":10,

"maxPriceShopUsers":10,

"adminUserName":"admin",

"adminUserPass":"admin"

},

"oldValues":null

}

Sample Response {

"response":{

"status":0,

"data":[

{

"label":"Documentation",

"uniqueName":"testpart",

"maxPriceBuilderUsers":10,

"maxPriceShopUsers":10,

"maxAdminUsers":2,

"version":0,

"typedId":"6.PT"

}

Page 84: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 84

]

}

}

3.11.2 Delete

This command marks partitions as deleted. Note: Only available in system partition.

URL Syntax /pricefx/system/system$partitionmanager.delete

URL Parameters N/A

Request Parameters See 3.2.4

Remarks Returns details of deleted partition.

Sample Request {

"operationType":"remove",

"data":{

"typedId":"6.PT"

},

"oldValues":null

}

Sample Response {

"response":{

"status":0,

"data":[

{

"label":"Documentation 2",

"uniqueName":"testpart",

"maxPriceBuilderUsers":10,

"maxPriceShopUsers":10,

"maxAdminUsers":2,

"maxAnalyticsUsers":null,

"version":2,

"typedId":"6.PT"

}

]

}

}

3.11.3 Update

This command updates a partition’s master data. Note: Only available in system partition.

URL Syntax /pricefx/system/system$partitionmanager.update

URL Parameters N/A

Request Parameters See 3.2.2

Remarks Returns details of updated partition object.

Sample Request {

"operationType":"update",

"data":{

"typedId":"6.PT",

"label":"Documentation 2"

},

"oldValues":{

"label":"Documentation",

Page 85: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 85

"uniqueName":"testpart",

"maxPriceBuilderUsers":10,

"maxPriceShopUsers":10,

"maxAdminUsers":2,

"maxAnalyticsUsers":null,

"version":0,

"typedId":"6.PT",

"adminUserName":null,

"adminUserPass":null

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"label":"Documentation 2",

"uniqueName":"testpart",

"maxPriceBuilderUsers":10,

"maxPriceShopUsers":10,

"maxAdminUsers":2,

"maxAnalyticsUsers":null,

"version":2,

"typedId":"6.PT"

}

]

}

}

3.11.4 Fetch global configuration

This command fetches information about global object types (which types are global)

URL Syntax /pricefx/<partition>/ partitionmanager.fetchglobalconfiguration

URL Parameters N/A

Request Parameters See 3.2.4

Remarks N/A

Sample Request Empty body

Sample Response {"response":{"status":0,"data":[{"types":"PDESC,PXREF"}]}}

3.12 Product manager

3.12.1 Fetch

Fetches all sorts of product related additional data

URL Syntax /pricefx/<partition>/productmanager.fetch/<encoded SKU>/<object type

code>/<object specific further details>

Example:

/pricefx/test/productmanager.fetch/SKU-11/PBOME

Page 86: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 86

URL Parameters encoded SKU (mandatory for all): Specifies the SKU of product. The fetch

command will fetch related info of this SKU only. The encoding is necessary

to handle characters of SKU strings that would be invalid for a URL.

Object type code: Type code of the desired subcategory. E.g. PBOME,

PCOMP,PDESC,PX,PXREF

Request Parameters See 3.2.1

Remarks N/A

Sample Request {

"operationType":"fetch",

"startRow":0,

"endRow":75,

"textMatchStyle":"substring",

"data":{

},

"oldValues":null

}

Sample Response For BoM:

{

"response":{

"endRow":1,

"totalRows":1,

"status":0,

"startRow":0,

"data":[

{

"validAfter":"2011-01-01",

"label":"Standard",

"uniqueName":"A-1",

"version":0,

"typedId":"1.PBOM"

}

]

}

}

For BoME:

{

"response":{

"endRow":7,

"totalRows":7,

"status":0,

"startRow":0,

"data":[

{

"type":"SUBCOMPONENT",

"bomId":1,

"quantity":2.00,

"rawMaterial":null,

"subComponentSku":"A-1.1",

"category":null,

"version":1,

"typedId":"1.PBOME"

},

{

Page 87: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 87

"type":"SUBCOMPONENT",

"bomId":1,

"quantity":2.00,

"rawMaterial":null,

"subComponentSku":"A-1.2",

"category":null,

"version":1,

"typedId":"2.PBOME"

},

{

"type":"RAWMATERIAL",

"bomId":1,

"quantity":3.00,

"rawMaterial":"KWh",

"subComponentSku":null,

"category":null,

"version":0,

"typedId":"3.PBOME"

},

{

"type":"RAWMATERIAL",

"bomId":1,

"quantity":4.00,

"rawMaterial":"Arbeitsstunden",

"subComponentSku":null,

"category":"Zusammenbau",

"version":1,

"typedId":"7.PBOME"

},

{

"type":"SUBCOMPONENT",

"bomId":1,

"quantity":1.00,

"rawMaterial":null,

"subComponentSku":"A-1.1.1",

"category":"",

"version":0,

"typedId":"8.PBOME"

},

{

"type":"RAWMATERIAL",

"bomId":1,

"quantity":2.00,

"rawMaterial":"fdgbdfs",

"subComponentSku":null,

"category":null,

"version":0,

"typedId":"10.PBOME"

},

{

"type":"SUBCOMPONENT",

"bomId":1,

"quantity":1.20,

"rawMaterial":null,

"subComponentSku":"A-1.1",

"category":null,

"version":1,

"typedId":"11.PBOME"

}

]

}

}

3.12.2 BoM References

Finds direct references to the product sku and bom id

Page 88: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 88

URL Syntax /pricefx/<partition>/ productmanager.bomreferences/<product sku>/<bom

id>

Examples:

/pricefx/test/productmanager.bomreferences/SKU-11/9

URL Parameters Produkt SKU (mandatory): Specifies the SKU of product

BoM id(mandatory) BoM record for which the references will be found

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"startRow":0,

"data":[

]

}

}

3.12.3 BoM Tree

Finds and returns Tree of BoMs starting in root BoM specified in request url

URL Syntax /pricefx/<partition>/productmanager.bomtree/<product sku>/<bom id>

Examples:

/pricefx/test/productmanager.bomtree/SKU-11/9

URL Parameters Produkt SKU (mandatory): Specifies the SKU of product

BoM id(mandatory) BoM record for which the tree will be build up

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"id":1,

"parentId":0,

"label":"A-1.1",

"quantity":2.00,

"category":null,

"type":"SUBCOMPONENT"

Page 89: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 89

},

{

"id":2,

"parentId":1,

"label":"A-1.1.1",

"quantity":2.00,

"category":null,

"type":"SUBCOMPONENT"

},

{

"id":3,

"parentId":1,

"label":"KWh",

"quantity":3.00,

"category":null,

"type":"RAWMATERIAL"

},

{

"id":4,

"parentId":1,

"label":"Arbeitsstunden",

"quantity":3.00,

"category":"Herstellung",

"type":"RAWMATERIAL"

},

{

"id":5,

"parentId":0,

"label":"A-1.2",

"quantity":2.00,

"category":null,

"type":"SUBCOMPONENT"

},

{

"id":6,

"parentId":5,

"label":"Wasser (cbm)",

"quantity":2.00,

"category":null,

"type":"RAWMATERIAL"

},

{

"id":7,

"parentId":0,

"label":"KWh",

"quantity":3.00,

"category":null,

"type":"RAWMATERIAL"

},

{

"id":8,

"parentId":0,

"label":"Arbeitsstunden",

"quantity":4.00,

"category":"Zusammenbau",

"type":"RAWMATERIAL"

},

{

"id":9,

"parentId":0,

"label":"A-1.1.1",

"quantity":1.00,

"category":"",

"type":"SUBCOMPONENT"

},

{

"id":10,

"parentId":0,

Page 90: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 90

"label":"fdgbdfs",

"quantity":2.00,

"category":null,

"type":"RAWMATERIAL"

},

{

"id":11,

"parentId":0,

"label":"A-1.1",

"quantity":1.20,

"category":null,

"type":"SUBCOMPONENT"

},

{

"id":12,

"parentId":11,

"label":"A-1.1.1",

"quantity":2.00,

"category":null,

"type":"SUBCOMPONENT"

},

{

"id":13,

"parentId":11,

"label":"KWh",

"quantity":3.00,

"category":null,

"type":"RAWMATERIAL"

},

{

"id":14,

"parentId":11,

"label":"Arbeitsstunden",

"quantity":3.00,

"category":"Herstellung",

"type":"RAWMATERIAL"

}

]

}

}

3.12.4 Roll Up BoM

Used for quantity synopsis

URL Syntax /pricefx/<partition>/ productmanager.rollupbom/<product sku>/<bom id>

Examples:

/pricefx/test/ productmanager.rollupbom/SKU-11/9

URL Parameters Product SKU (mandatory): Specifies the SKU of product

BoM id(mandatory) BoM record for which the rollup will be performed

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Page 91: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 91

Sample Response {

"response":{

"status":0,

"data":[

{

"category":"Zusammenbau",

"rawMaterial":"Arbeitsstunden",

"quantity":4.00

},

{

"category":null,

"rawMaterial":"Wasser (cbm)",

"quantity":4.0000

},

{

"category":null,

"rawMaterial":"A-1.1.1",

"quantity":11.000000

},

{

"category":null,

"rawMaterial":"fdgbdfs",

"quantity":2.00

},

{

"category":null,

"rawMaterial":"KWh",

"quantity":19.800000

},

{

"category":"Herstellung",

"rawMaterial":"Arbeitsstunden",

"quantity":13.200000

}

]

}

}

3.12.5 Fetch Products

This is an extended fetch command to retrieve product records. Additionally to the regular fetch/P

command, this command supports filtering by extension values. The filters are provided as normal

with the filter property (the field name) having the form <PX name>__<PX field>.

URL Syntax /pricefx/<partition>/productrmanager.fetchcustomers

Example:

/pricefx/test/productmanager.fetchproducts

URL Parameters N/A

Request Parameters See 3.2.1

Remarks N/A

Sample Request {

"operationType":"fetch",

"startRow":0,

"endRow":300,

"sortBy":[

"attribute2"

],

Page 92: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 92

"textMatchStyle":"substring",

"data":{

"_constructor":"AdvancedCriteria",

"operator":"and",

"criteria":[

{

"fieldName":"TestNew__attribute1",

"operator":"equals",

"value":"A",

"_constructor":"AdvancedCriteria"

}

]

},

"oldValues":null

}

Sample Response See any regular datasource response (like regular fetch command)

3.12.6 Fetch PXAM, Product References, Competition, BoM

These commands are an extended fetch command to retrieve product related data and metadata.

Additionally to the regular fetch/<object type> command, these commands support (i.e.

transparently handle) also global data as configured. This means that if for example product

competition data is configured to come from the global partition, this command will retrieve it from

there. The normal fetch commands will always only return data for the local partition.

URL Syntax /pricefx/<partition>/productmanager.fetchpxam

/pricefx/<partition>/productmanager.fetchproductxref

/pricefx/<partition>/productmanager.fetchproductcompetition

/pricefx/<partition>/productmanager.fetchproductbom

URL Parameters N/A

Request Parameters See 3.2.1

Remarks N/A

Sample Request See 3.2.1

Sample Response See 3.2.1

3.13 Customer manager

3.13.1 Fetch

Fetches all sorts of customer related additional data

URL Syntax /pricefx/<partition>/customermanager.fetch/<encoded

customerID>/<object type code>/<object specific further details>

Example:

/pricefx/test/customermanager.fetch/Cust-11/CX

Page 93: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 93

URL Parameters encoded customerID (mandatory for all): Specifies the customer. The fetch

command will fetch related info of this customer only. The encoding is

necessary to handle characters of id strings that would be invalid for a URL.

Object type code: Type code of the desired subcategory. E.g. CX, Q, PR,

CDESC

Request Parameters See 3.2.1

Remarks N/A

3.13.2 Assign

Creates or updates a customer assignment to a pricelist, a manual pricelist or a price grid.

URL Syntax /pricefx/<partition>/customermanager.assign

Example:

/pricefx/test/customermanager.assign

URL Parameters None

Request Parameters See 3.2.2

Remarks N/A

Sample Request {

"operationType":"add",

"data":{

"assignment":"4846.PL",

"customerGroup":{

"customerFieldName":"customerId",

"customerFieldLabel":"Customer Id",

"customerFieldValue":"CD-00013"

},

"priority":2

},

"oldValues":null

}

Sample Response {

"response" : {

"status" : 0,

"data" : [{

"version" : 0,

"customerGroup" : {

"label" : null,

"customerFieldName" : "customerId",

"customerFieldLabel" : "Customer Id",

"customerFieldValue" : "CD-00013",

"customerFilterCriteria" : null

},

"priority" : 2,

"assignment" : "4846.PL",

"typedId" : "26.CA"

}

]

}

}

Page 94: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 94

3.13.3 Fetch Assignments

Fetches all assigned lists for a customer or fetches all assignments for a given list

URL Syntax /pricefx/<partition>/customermanager.fetchassignments/<source>

Example:

/pricefx/test/customermanager.fetchassignments/1234.PL

URL Parameters Source: The typedID of a list (pricelist, etc..) or a customerID. Depending on

the source the point of view for the returned data is adjusted

Request Parameters See 3.2.1

Remarks N/A

Sample Request {

"operationType":"fetch",

"startRow":0,

"endRow":75,

"textMatchStyle":"exact",

"data":{

},

"oldValues":null

}

Sample Response {

"response" : {

"endRow" : 1,

"totalRows" : 1,

"status" : 0,

"startRow" : 0,

"data" : [{

"version" : 0,

"customerGroup" : {

"label" : null,

"customerFieldName" : "attribute2",

"customerFieldLabel" : "Customer Class",

"customerFieldValue" : "C",

"customerFilterCriteria" : null

},

"priority" : 1,

"assignment" : "4846.PL",

"typedId" : "15.CA"

}

]

}

}

3.13.4 Fetch Customers

This is an extended fetch command to retrieve customer records. Additionally to the regular fetch/C

command, this command supports filtering by extension values. The filters are provided as normal

with the filter property (the field name) having the form <CX name>__<CX field>.

URL Syntax /pricefx/<partition>/customermanager.fetchcustomers

Example:

/pricefx/test/customermanager.fetchcustomers

Page 95: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 95

URL Parameters N/A

Request Parameters See 3.2.1

Remarks N/A

Sample Request {

"operationType":"fetch",

"startRow":0,

"endRow":300,

"sortBy":[

"attribute2"

],

"textMatchStyle":"substring",

"data":{

"_constructor":"AdvancedCriteria",

"operator":"and",

"criteria":[

{

"fieldName":"TestNew__attribute1",

"operator":"equals",

"value":"A",

"_constructor":"AdvancedCriteria"

}

]

},

"oldValues":null

}

Sample Response See any regular datasource response (like regular fetch command)

3.13.5 Fetch CXAM

This is an extended fetch command to retrieve customer extension metadata. Additionally to the

regular fetch/CXAM command, this command supports (i.e. transparently handles) also global CX.

The normal fetch/CXAM will always only return data for local partition extensions.

URL Syntax /pricefx/<partition>/customermanager.fetchcxam

Example:

/pricefx/test/customermanager.fetchcxam

URL Parameters N/A

Request Parameters See 3.2.1

Remarks N/A

Sample Request See 3.2.1

Sample Response See 3.2.1

Page 96: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 96

3.14 Quote Manager

3.14.1 Add Products

This command extends a quote by a number of additional products. In the backend the products are

added and the quote is recalculated.

URL Syntax /pricefx/<partition>/quotemanager.addproducts /

Examples:

/pricefx/test/quotemanager.addproducts

URL Parameters N/A

Request Parameters quote (mandatory): A complex data structure that describes the current

content of the quote. The command will return the updated structure of

that quote in the same format in the data block.

skus (mandatory): A JSON array of Strings of the part numbers of the

products to add. If parts aren’t found they will be ignored.

parent (optional): A node id of the part tree within the quote object. The

skus will be added in the specified subfolder

Remarks N/A

Sample Request {

"data":{

"quote":{

"inputs":[

{

"name":"Customer",

"label":"Kunde",

"type":"CUSTOMER",

"url":"/fetch/C/"

}

],

"outputs":[

],

"lineItems":[

],

"label":"New Quote",

"nodeId":0,

"externalRef":null,

"expiryDate":"2013-02-18",

"targetDate":"2013-02-18",

"dirty":true

},

"skus":[

"A-1"

],

"parent":"QUOTEROOT"

}

}

Sample Response {

"response" : {

"status" : 0,

"data" : [{

"version" : null,

"lastUpdateDate" : null,

"uniqueName" : null,

"label" : "New Quote",

"lineItems" : [{

"version" : null,

"inputs" : [{

"name" : "test",

Page 97: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 97

"label" : "test",

"lookupTableId" : null,

"url" : null,

"type" : "USERENTRY",

"value" : null,

"valueHint" : null,

"valueOptions" : null

}, {

"name" : "test2",

"label" : "test2",

"lookupTableId" : null,

"url" : null,

"type" : "USERENTRY",

"value" : null,

"valueHint" : null,

"valueOptions" : null

}

],

"outputs" : [{

"resultName" : "d",

"resultLabel" : "d",

"result" : null,

"warnings" : [],

"alertMessage" : null,

"alertType" : null,

"displayType" : "PS_AND_PL",

"formatType" : "NUMERIC",

"suffix" : "eu",

"resultType" : "SIMPLE",

"cssProperties" : null,

"userGroup" : null

}, {

"resultName" : "dd",

"resultLabel" : "dd",

"result" : null,

"warnings" : [],

"alertMessage" : null,

"alertType" : null,

"displayType" : "PS_AND_PL",

"formatType" : "NUMERIC",

"suffix" : "eu",

"resultType" : "SIMPLE",

"cssProperties" : null,

"userGroup" : null

}, {

"resultName" : "result",

"resultLabel" : "result",

"result" : 0,

"warnings" : null,

"alertMessage" : null,

"alertType" : null,

"displayType" : "PS_AND_PL",

"formatType" : "NUMERIC",

"suffix" : "eu",

"resultType" : "SIMPLE",

"cssProperties" : null,

"userGroup" : null

}, {

"resultName" : "rrrrr",

"resultLabel" : "rrrrr",

"result" : null,

"warnings" : null,

"alertMessage" : null,

"alertType" : null,

"displayType" : "PS_AND_PL",

"formatType" : "NUMERIC",

"suffix" : "eu",

"resultType" : "SIMPLE",

"cssProperties" : null,

"userGroup" : null

}

],

"dirty" : false,

"lineId" : "JMv0FEIPsvEIQVB",

"parentId" : null,

"calculationStatus" : 2,

"sku" : "A-1",

"label" : "Test",

Page 98: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 98

"typedId" : "null.QLI"

}

],

"workflowStatus" : null,

"expiryDate" : "2013-02-18",

"targetDate" : "2013-02-18",

"externalRef" : null,

"inputs" : [{

"name" : "Customer",

"label" : "Kunde",

"lookupTableId" : null,

"url" : "/fetch/C/",

"type" : "CUSTOMER",

"value" : null,

"valueHint" : null,

"valueOptions" : null

}

],

"quoteViewState" : null,

"outputs" : [],

"customerId" : null,

"customerName" : null,

"lastUpdateByName" : null,

"createdByName" : null,

"quoteStatus" : "DRAFT",

"calculationStatus" : 2,

"dirty" : true,

"nodeId" : 0,

"serverMessages" : ["Angebot berechnet"],

"typedId" : "null.Q"

}

]

}

}

3.14.2 Convert

This command converts an approved quote into price records. One quote item will be converted into

on price record.

URL Syntax /pricefx/<partition>/quotemanager. convert/<quote uniqueName>

Examples:

/pricefx/test/quotemanager.convert/P-23

URL Parameters Quote UniqueName (mandatory): The uniqueName of the quote to

convert

Request Parameters N/A

Remarks Only approved quotes are processed

Sample Request Empty request body

Sample Response N/A

3.14.3 Copy

Copy an existing quote and put the copy into draft status. Returns the header info of the copy.

URL Syntax /pricefx/<partition>/quotemanager.copy/<quote uniqueName>

Page 99: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 99

Examples:

/pricefx/test/quotemanager.copy/P-17

URL Parameters Quote UniqueName (mandatory): The uniqueName of the quote to copy

Request Parameters N/A

Remarks

Sample Request Empty request body

Sample Response {

"response" : {

"status" : 0,

"data" : [{

"version" : 1,

"lastUpdateDate" : "2013-02-18",

"uniqueName" : "P-18",

"label" : "New Quote",

"workflowStatus" : null,

"expiryDate" : "2013-02-18",

"targetDate" : "2013-02-18",

"externalRef" : null,

"customerId" : null,

"customerName" : null,

"lastUpdateByName" : "admin",

"createdByName" : "admin",

"quoteStatus" : "DRAFT",

"calculationStatus" : 2,

"dirty" : true,

"nodeId" : 0,

"serverMessages" : null,

"typedId" : "18.Q"

}

]

}

}

3.14.4 Fetch

Fetches the details of the specified quote.

URL Syntax /pricefx/<partition>/quotemanager. fetch/<quote uniqueName>

Examples:

/pricefx/test/quotemanager.fetch/P-17

URL Parameters Quote UniqueName (mandatory): The uniqueName of the quote to fetch

Request Parameters N/A

Remarks

Sample Request Empty request body

Page 100: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 100

Sample Response See response of addproducts command

3.14.5 FetchXls

This command returns the specified quote in Excel format. It uses an existing partition-defined Excel

template (or an empty Excel sheet if no template is defined)and just adds the quote data.

URL Syntax /pricefx/<partition>/quotemanager. fetchxls/

Examples:

/pricefx/test/quotemanager.fetchxls

URL Parameters Quote UniqueName (mandatory): The uniqueName of the quote to fetch

Request Parameters N/A

Remarks

Sample Request Empty request body

Sample Response The binary Excel file

3.14.6 Preview

Returns the to-be workflow based on the current quote.

URL Syntax /pricefx/<partition>/quotemanager. preview/

Examples:

/pricefx/test/quotemanager.preview

URL Parameters N/A

Request Parameters quote (mandatory): A complex data structure that describes the current

content of the quote.

Remarks The workflow displayed is just a temporary snapshot. The effective

workflow will be generated as part of the submit command

Sample Request See request of addproducts command

Sample Response {

"response":{

"status":0,

"data":[

{

"workflow":{

"id":"c04af1ef-4122-4733-b2cf-d7e8ae2b3110",

"workflowStatus":"DRAFT",

"approvableTypedId":"null.Q",

"submitterTypedId":null,

"steps":[

Page 101: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 101

{

"executionStatus":"INITIALIZED",

"id":"1cdf0e4a-456f-41eb-9fba-d2eb6be83b1b",

"reason":"Too costly",

"userTypedId":"6.U",

"userName":"Martin Wricke",

"lastAccess":"2013-04-03T22:26:40",

"comment":null,

"uniqueName":"fistApproval"

},

{

"executionStatus":"INITIALIZED",

"id":"e2f63ad8-2529-409f-a435-25239c0a206e",

"reason":"Head approval",

"userTypedId":"53.U",

"userName":"dusan skopik",

"lastAccess":"2013-04-03T22:26:40",

"comment":null,

"uniqueName":"secondApproval"

},

{

"executionStatus":"INITIALIZED",

"id":"60a2690b-8c91-45fb-8f53-bb4427b05e18",

"reason":"Admin approval",

"userTypedId":"5.U",

"userName":"admin",

"lastAccess":"2013-04-03T22:26:40",

"comment":null,

"uniqueName":"thirdApproval"

}

],

"type":"quote",

"currentStepId":"1cdf0e4a-456f-41eb-9fba-d2eb6be83b1b"

},

"resultType":"WORKFLOW"

}

]

}

}

3.14.7 Price

Recalculate the entire quote. This is a on-the-fly recalculation. No data is persisted.

URL Syntax /pricefx/<partition>/quotemanager. price/

Examples:

/pricefx/test/quotemanager.price

URL Parameters N/A

Request Parameters quote (mandatory): A complex data structure that describes the current

content of the quote. The command will return the updated structure of

that quote in the same format in the data block.

Remarks

Sample Request See request of addproducts command

Page 102: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 102

Sample Response See response of addproducts command

3.14.8 Save

Saves (create or update) the quote to the database. If it is a new quote a new uniqueName will be

assigned.

URL Syntax /pricefx/<partition>/quotemanager. save/

Examples:

/pricefx/test/quotemanager.save

URL Parameters N/A

Request Parameters quote (mandatory): A complex data structure that describes the current

content of the quote. The command will return the updated structure of

that quote in the same format in the data block.

Remarks

Sample Request See request of addproducts command

Sample Response See response of addproducts command

3.14.9 Submit

Submit the quote into the workflow process. The quote will be recalculated and saved. A workflow

will be calculated based on the latest quote configuration and the workflow process is started.

URL Syntax /pricefx/<partition>/quotemanager. submit/

Examples:

/pricefx/test/quotemanager.submit

URL Parameters N/A

Request Parameters quote (mandatory): A complex data structure that describes the current

content of the quote. The command will return the updated structure of

that quote in the same format in the data block.

Remarks

Sample Request See request of addproducts command

Sample Response See response of addproducts command

Page 103: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 103

3.15 Download Manager

3.15.1 Download

Download file from server and after successful download deletes it on server

URL Syntax /pricefx/<partition>/

downloadmanager.download/<Id>?output=file<&delete=true>

Examples:

/pricefx/test/ downloadmanager.download/2?output=file

/pricefx/test/ downloadmanager.download/2?output=file&delete=true

URL Parameters Id : Id of the file to download

delete=true: if specified the file gets deleted after successful download

Request Parameters N/A

Remarks See Fehler! Verweisquelle konnte nicht gefunden werden. for example of

the service that generates files for download

Content of the response will be streamed file content therefore it is

recommended to open that URL in new window.

Also note that convention is that the url is generated by some other service

on server, therefore it is not recommended to construct the URL directly on

client.

Sample Request Empty body

Sample Response Binary content

3.16 Upload Manager

General supporting functionality for uploading whole files to the server.

3.16.1 New Upload Slot

Reserves new upload slot on server.

URL Syntax /pricefx/<partition>/ uploadmanager.newuploadslot

Examples:

/pricefx/test/ uploadmanager.newuploadslot

URL Parameters N/A

Page 104: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 104

Request Parameters N/A

Remarks Response contains slot id that can be used further for cancellation, polling

for progress of file upload, deletion etc.

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"id":"153"

}

]

}

}

3.16.2 Progress

Gets progress of the file upload

URL Syntax /pricefx/<partition>/uploadmanager. progress/<upload slot id>

Examples:

/pricefx/test/uploadmanager. progress/153

URL Parameters Upload Slot Id: Id of the slot that is used to upload file to server

Request Parameters N/A

Remarks None

Sample Request Empty body

Sample Response contentLength: file length

status: enum: STARTED,DONE, INPROGRESS, ERROR, CANCELLED

percentage: how much of the file has been uploaded so far

totalBytesRead: mow much bytes of the file has been uploaded so far

{

"response":{

"status":0,

"data":[

{

"contentLength":160990,

"status":"DONE",

"totalBytesRead":160768,

"percentage":99,

"version":3,

"typedId":"153.US"

}

]

}

Page 105: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 105

}

3.16.3 Delete Slot

Deletes slot from server.

URL Syntax /pricefx/<partition>/uploadmanager. deleteslot/<upload slot id>

Examples:

/pricefx/test/uploadmanager. deleteslot/153",

URL Parameters Upload Slot Id: Id of the slot to delete

Request Parameters N/A

Remarks Request for slot deletion should be made only after the Progress command

returns in its response “status:” DONE or CANCELLED or ERROR

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"contentLength":160990,

"status":"DONE",

"totalBytesRead":160768,

"percentage":99,

"version":4,

"typedId":"153.US"

}

]

}

3.16.4 Upload Cancel

Cancels upload of the file.

URL Syntax /pricefx/<partition>/uploadmanager. uploadcancel/<upload slot id>

Examples:

/pricefx/test/uploadmanager.uploadcancel/156",

URL Parameters Upload Slot Id: Id of upload slot for which the file upload will be cancelled

Request Parameters N/A

Remarks

Sample Request Empty body

Sample Response {

"response":{

Page 106: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 106

"status":0,

"data":null

}

3.17 Datamart

Price f(x) has APIs for schema management, data loads and data querying.

3.17.1 New Schema

Creates and returns a new regular or simulation schema. If this is the first regular schema, then it is

automatically marked as the main (draft) schema, labeled ‘Data Sources’. Secondary schemas are

initialized with one (empty) DM, with the same label as the schema.

A partition should have at least one main schema (the first one created in the partition), and can

have any number of additional, or secondary, schemas. The main schema defines all of the

DataSources. Datamarts are defined in secondary schemas. A secondary schema defines exactly one

Datamart, constructed from the DataSources defines in the main schema. Only draft schemas can be

created from scratch. On deployment of a draft schema, a corresponding production schema is

created, which is not editable. Only a production schema has (a) physical data tables(s) associated

with its DataSources or Datamart. After deployment, the draft schema can still be modified – to

reflect any changes in the available data sources, or datamarts – but these changes are not reflected

in the tables until they are deployed into the corresponding production schema.

A further distinction is made between ordinary schemas (those reflecting the available data sources,

and derived datamarts), and ‘simulation’ schemas.

A schema contains DataSourcse or Datamart definitions, all so called FieldCollections. A DataSource

defines the structure of the data that a client intends to upload to Price f(x) for analysis. A schema

can contain any number of DataSources, with fields of “type”

- TEXT (up to 255 characters)

- NUMBER

- DATE

- DATETIME

- MONEY

- CURRENCY

- QUANTITY

- UOM

- LOB (text of more than 255 characters)

- BOOELAN

A DataSource must have at least one KEY field (“key” : true), and must have no more than one

CURRENCY field. It must also not have more than one UOM field. If a DataSource has a

CURRENCY field than all its MONEY fields are assumed to be denominated in that currency.

Similarly, if there is a UOM field than all QUANTITY fields in the DataSource are deemed to be in

that unit of measure.

Page 107: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 107

A DataSource can have multiple key fields, the combination of which uniquely defines a data row

within it. Key field values must never be null (i.e. missing). In addition to the standard key field,

there are the following special key field types (specified by the “functionalType” attribute on field

level):

- ALT-KEY: allows for optional matching to rows in a Datamart fed from this DataSource. The

datamart loader will load rows with matching standard KEY fields (zero or more) + one ALT-

KEY field (the one with the lowest rank first). Then it will replace this ALT-KEY field with the

one with the next lowest rank (if one exists); and so on.

- LEVEL: allows for hierarchical matching of rows: the datamart loader will load DataSource

rows for which all standard key fields + all LEVEL key fields match exactly, or if no such exact

match exist it will try to find rows where as many LEVEL fields match (from lowest to higher

ranks) and the remainder are set to the wildcard character “*”.

Notes:

- the rank is specified by the “rank” attribute on field level

- please see the SaveSchema section for details on how Datamart fields are sourced from the

various DaaSources within a Schema.

Two DataSources are always present in a schema, and cannot be removed, nor can their

definition be changed:

- Currency (“uniqueName”:”ccy”)

- Unit of Measure (“uniqueName”:”uom”)

The former provides the, time dependent, currency exchange rates that allow for conversion

money amounts to the base and reporting currencies. The latter allows for conversion of

quantities of units to the base unit of measure. The base currency and base UOM are set at the

Partition level, through the Partition-Admin UI.

Also within a Datamart, fields can be marked as having a “functionalType”:

- One QUANTITY field can be marked as “PERUNITBASIS” field, which allows Price f(x) to

generate per-unit versions of MONEY fields.

- One MONEY field can be marked “PERCENTBASIS” – see the calculated fields paragraph

below.

- One DATE field can be marked as “PRICINGDATE”, which serves as the lookup date for

currency conversions within the datamart.

URL Syntax /pricefx/<partition>/ datamart.newschema[/sim]

URL Parameters None

Request Parameters The initial schema header field values, currently only the label, in the same

format as specified in the datamart.updateschema request.

Page 108: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 108

Sample Response The newly created schema

3.17.2 Get Schema

This command retrieves a named schema (by uniqueName).

To facilitate the retrieval of the main draft or production schema, the reserved ‘draft’ and ‘prod’ key

works can be used as alias for the schema uniquename. To retrieve a simulation schema the ‘/sim’

postfix is added to the URL (see the URL syntax section).

URL Syntax /pricefx/<partition>/ datamart.getschema/<schema.uniqueName>[/sim]

URL Parameters Schema.uniqueName, or ‘draft’ | ‘prod’

Request Parameters None

Remarks

Sample Request See parameters section

Sample Response /pricefx/test/datamart.getschema/draft

Page 109: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 109

3.17.3 SaveSchema

A schema definition is validated, and saved upon successful validation, by issuing a save schema

request. Optionally, the schema is deployed after saving. On deployment, all necessary database

entities are created and/or modified to be able to store DataSources data and populate Datamarts

from those DataSources. When, in comparison to the previous version of the production schema,

fields, DataSources or Datamarts are dropped, the corresponding DB entities are also dropped and

cannot be restored. This is also the case when a DataSource’s key field(s) are modified. Once

deployed, DataSource data can be uploaded to the production tables.

In case of validation errors, these are returned to the client. Schema validation rules are as follows:

Page 110: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 110

1. Stale version check: the version of the schema object passed in with the client request is

checked to match the version of the current draft schema. If not equal the schema will not

be saved. This is to prevent a client saving a stale (i.e. out of date) schema.

2. Schema, DataSource unique names, as well as Field names need to adhere to the following

regular expression: ‘[a-zA-Z]+\\w*’

3. No two DataSource fields in the schema must have the same name, if these fields are

determined to belong to the same Datamart. A datamart is constructed from all the fields in

its primary DataSource (DS), and all the fields in other DataSources that are functionally

dependent on the primary DS. If two fields with the same name are found to be functionally

dependent on the primary DS, the schema is deemed invalid.

A few notes on how Price f(x) identifies relationships between schema fields:

a) Within one and the same DS there is a relationship between the key fields and the non-key

fields (i.e. the key fields tuple functionally defines all of the non-key fields).

b) Relationships between fields in two different DataSources, or so called foreign key

relationships, are derived from the fact that one or more key fields in one DS are non-key

fields (with the same fieldname) in another DS.

4. Same name fields need to have the same “type” across all DataSources

5. UOM and Currency field validation: please see the GetSchema section above.

6. If two FieldCollections have the same unique name, or if two fields within the same

FieldCollection are given the same name, then the resulting schema when saved is

nondeterministic. This situation must be avoided by the client that submits the schema to

Price f(x).

Datamart

A Datamart consists of the key fields of what is deemed the primary DataSource to the Datamart (ex.

the Transaction DM is to contain all the invoice lines loaded in the Transaction DS), and any

additional fields from this primary DS, and/or fields from other, secondary, DataSources which are

functionally defined by fields already in the DM. A field is functionally defined by a DS if foreign key

relationships exist between all of its key fields and the primary DS key fields (see the paragraph on

field relationships above).

Draft vs. Prod

Only the ‘draft’ schema can be saved (“uniqueName”=”draft”). The deploy action (see below) is used

to promote the saved draft schema; the production schema cannot be directly edited and saved. It is

the product schema that is used when loading and querying data.

URL Syntax /pricefx/<partition>/datamart.saveschema[/sim]

/pricefx/<partition>/datamart.saveschema[/deploy]

/pricefx/<partition>/datamart.saveschema[/deploy/sim]

Example:

/pricefx/test/datamart.saveschema

Page 111: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 111

URL Parameters None

Request Parameters Schema object . The schema unique name must refer to a draft schema.

Remarks A schema is saved as one all-containing data structure

Sample Request See GetSchema for example

Sample Response The saved schema if validation was successful (see GetSchema response)

A list of error messagef if not:

3.17.4 Delete Schema

Deletes the schema with the given unique name. This can be a draft or production schema. Note: if

a production schema is deleted, then on subsequent deployment of the corresponding ‘draft

schema, all PA data (Datamart and DataSource) will be deleted.

URL Syntax /pricefx/<partition>/ datamart.deleteschema/<schema.uniqueName>[/sim]

Example:

/pricefx/test/datamart.deleteschema/S000123

URL Parameters schema.uniqueName: ‘draft’

Request Parameters None

Remarks

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":null

}

3.17.5 Copy Schema

Copies an existing regular or simulation draft or production schema. The copy is always a draft

schema. The copy is returned in the response body.

Page 112: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 112

URL Syntax /pricefx/<partition>/ datamart.copyschema/<schema.uniqueName>[/sim]

Example:

/pricefx/test/datamart,copyschema/S000123

URL Parameters schema.uniqueName: unique name of the schema to copy

Request Parameters None

Remarks

Sample Request Empty body

Sample Response Schema copy

3.17.6 Revert Schema

Reverts a draft schema back to the state it was when last deployed. Once reverted the draft schema

will hence be identical in structure to the corresponding production schema. The reverted draft

schema is returned in the response body

URL Syntax /pricefx/<partition>/ datamart.revertschema/<schema.uniqueName>

Example:

/pricefx/test/datamart.revertschema/S000123

URL Parameters schema.uniqueName: unique name of the production schema to revert

Request Parameters None

Remarks

Sample Request Empty body

Sample Response Reverted draft schema

3.17.7 Update Schema

Updates only header level attributes of the schema – attributes which do not affect the structure of

its DataSources or Datamart. The field name/value pairs are to be specified in the standard

datasource protocol manner in the request body, as a JSON object. Currently only the schema label

can be modified in this way.

URL Syntax /pricefx/<partition>/ datamart.updateschema

URL Parameters None

Request Parameters Schema field name / value pairs

Page 113: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 113

Remarks

Sample Request

Sample Response OK

3.17.8 Load Data

Upload a chunk (batch) of data from a client resource to the storage reserved for a particular

DataSource in the Price f(x) backend. An upload request must specify

- the DataSource unique name

- an optional client-side resource identifier. If not resource ID is provided it is defaulted to the

current DateTime

- an optional chunk number, defaulted to 1 if missing

- an optional message digest. By providing a message digest it becomes possible to verify

whether a data chunk has previously been uploaded (see GetDataChunk).

The data is to be presented in the JSON format, separately specifying header (array of field names

matching the datamart data source), and data fields (array of array of field values, each inner array

representing one row of data in header field order)

URL Syntax /pricefx/<partition>/

datamart.loaddata/<datasource.uniqueName>[/<client resource ID> [/

<chunkNumber>] [/<digest>]

Examples:

/pricefx/test/datamart.loaddata/transaction/tx20111131/1

URL Parameters datasource.uniqueName

clientResourceID: unique identifier for the specific instance of the client

resource that contains/produces the data to upload. Parameter is optional.

chunkNumber: sequence (integer) number of the chunk of data being

uploaded. Parameter is optional.

digest: URL-safe encoded message digest

Request Parameters JSON formatted data, adhering to the following format:

"data":{

"header":["CustomerID","Country","Address","City","PostCode"],

"data":[

["CN1000","DE","Addres 1","Berlin","PC001"],

["CN1001","FR","Address 2","Paris","PC002"],

...

]

}

}

Page 114: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 114

Remarks

Sample Request See parameters section

Sample Response

Data is uploaded in chunks in order to minimize the amount of data to be resent in the event that the

transfer from client to server is interrupted. The combination of DataSource, client resource ID and

chunk number uniquely identifies each data chunk.

The uploaded data is not immediately persisted to the DS’s DB table. Instead it is held (‘buffered’) in

a staging area, up until an explicit ‘’flush’ command is issues (see next section), or a DM dependent

on the DS’s data is refreshed.

3.17.9 Flush

Flushes the up until that point buffered data into a DataSource’s DB table (see the ‘Load Data’. Only

then will the data be available to DM reloads and queries.

URL Syntax /pricefx/<partition>/ datamart.util/flush/<fieldCollection.typedId>

URL Parameters fieldCollection.typedId: typed ID (ex. 101.DS) of a datamart or datasource

in the production schema.

Request Parameters None

Remarks

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":null

}

Page 115: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 115

3.17.10 Get Data Chunk

The GetDataChunk request can be used to determine whether a batch of data has previously been

uploaded, and whether it was loaded successfully or that an error occurred. A DataChunk object is

returned if one exists for the given DataSource, client resource ID, chunk number and message

digest. An empty response (see sample), but no error, is returned if a DataChunk with the given

identifiers does not exist.

URL Syntax /pricefx/<partition>/

datamart.getdatachunk/<datasource.uniqueName>/<clientResourceID>/<c

hunkNumber>/<digest>

Example:

/datamart.getdatachunk/customer/customer20111131/1/NJbGdbxeV-

RjbQo94Bb17P4rm1U

URL Parameters datasource.uniqueName

clientResourceID: identifies the local resource of the uploaded data

chunkkNumber: batch sequence number, starting from 1

digest: a URL-safe encoded message digest

Request Parameters None

Remarks

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":null

}

3.17.11 Truncate

Deletes all the data for a given datamart or datasource.

URL Syntax /pricefx/<partition>/ datamart.util/truncate/<fieldCollection.typedId>

URL Parameters fieldCollection.typedId: typed ID (ex. 12.DS) of a datamart or datasource in

the production schema.

Request Parameters None

Remarks

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":null

Page 116: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 116

}

3.17.12 Reload

Requests a refresh of a Datamart, or a reload a DataSource (replication from PB data, or generation

of the default Calendar).

If TargetFC represents a DM, and only the DM typed ID is specified, then that DM will be updated

with all ‘dirty’ data from its constituent DataSources (i.e. any recently loaded data). If an additional

DS typed ID is specified, then all of this DataSource’s data is reloaded into the Datamart. The latter is

for instance useful after modifying currency or UOM conversion rates.

If TargetFC represents a DS, then it is expected that this DS represents any of the following:

- Product

- Customer

- PriceRecord

- RebateRecord

- Calendar

In all but the calendar DS case, a reload triggers the replication to the PA DS of data from the

corresponding PB table. It is important to note that the replication does not delete any data in the

PA DS, which at one point existed (and was replicated) but was later removed in the PB table. This is

to accommodate a common case where, for example, historic transactions loaded in PA refer to

products, customers etc. which are no longer active.

When the Calendar DS is reloaded, default calendar data is generated and merged into the calendar

DS. The pricefx-config xml provides two parameters to tweak this process:

- datamart.yearsBackward (default=5)

- datamart.yearsForward (default=2)

Quite understandably, these determine the number of years to include in the generated calendar,

going back and forward from the day that the reload is triggered.

Calendar data can be uploaded also from an external source, thus allowing a completely custom

(perhaps fiscal calendar), or one tweaked from the default generated one. The default calendar

follows this pattern:

Date Week Month Quarter Year

2014-01-01 2014-W01 2014-M01 2014-Q1 2014

where week is calculated from Java’s Calendar. WEEK_OF_YEAR; month from MONTH+1; quarter

from MONTH)/3+1 and year from Calendar.YEAR.

Page 117: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 117

URL Syntax /pricefx/<partition>/ datamart.reload/<TargetFC.typedId>[/DS.typedId]

Example:

/datamart.reload/1.DM/12.DS

URL Parameters DM.typedId/DS.typedID: the typed ID of the DM to refresh / DS to reload

from.

Request Parameters None

Remarks

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":null

}

3.17.13 Get Status

Returns the data load status of a DataSource or Datamart. Possible statuses are

- PENDING: A reload has been requested but has not yet been picked up by the background

scheduler.

- SCHEDULED: The DS or DM is in line to be refreshed/reloaded. Data loads are executed in

sequence in the backend in order to distribute the load over time.

- PROCESSING: Data load is in progress. For a DM this means it is being refreshed with data

from its feeding data sources. For a DS the this indicates that the datamarts that depend on

this DS are being refreshed with this DS’s data.

- ERROR: The data load resulted in an error. It is now possible to restart the (request a new )

data load.

- READY: The previous data load has completed without errors, or the given DM or DS has not

previously been loaded.

In the response only the “status”, “calcuationDate”, “calculationMessages” (verbose data load

messages) and “sourceUniqueName” (the last DS loaded in case of a DM status request) should be of

interest.

URL Syntax /pricefx/<partition>/ datamart.status[/<FC.typedID>]

Example:

/datamart.status/datamart_transaction

URL Parameters FC.typedID: the typed ID of the DS or DM for which the status is requested.

Page 118: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 118

Request Parameters None

Remarks

Sample Request Empty body

Sample Response

3.17.14 CRUD Commands

DataSource data can be created, retrieved, updated and deleted with CRUD request that follow the

standard GWT Data Source protocol. The corresponding command verbs are:

- datamart.add

- datamart.fetch

- datamart.update

- datamart.delete

- datamart.massedit

Please the’ DataSource Operations’ section (3.1.3) for more details. Within that section, the Object

Type Code corresponds to the object Typed ID of the datasource or datamart on which to perform

Page 119: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 119

the CRUD operations. Note that the data in a datamart in the production schema is not directly

editable (modifications are the result of changes to the underlying datasources’ data only). In

contrast, a workbook datamart ‘s data is editable, while its datasources are no – see section on

Workbooks further down).

URL Syntax /pricefx/<partition>/ datamart.<crud-op>/<datamart.typedId>

Example:

/datamart.update/DS.1

URL Parameters crud-op: ‘add’, ‘fetch’, ‘update’ or ‘delete’

datamart.typedId: typed ID of the datasource to operate on, as can be

found in the schema definition (see LoadSchema).

Request Parameters See section 3.1.3

Remarks

Sample Request See section 3.1.3

Sample Response See section 3.1.3

3.17.15 Get Data Source

Retrieve the list of DataSource uniquenames in the production schema, if not uniquename is

specified. Else, returns a deep object graph of the datasource matching the given uniquename.

URL Syntax /pricefx/<partition>/ datamart.getdatasource[/<FC.uniqueName>]

URL Parameters FC.uniqueName: unique name of the DS of which the structure is

requested. By definition, this DS needs to be defined in the main

production schema.

Request Parameters None

Remarks

Sample Request http://localhost:8000/pricefx/martin/datamart.getdatasource

Page 120: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 120

Sample Response

3.17.16 Query

Executes a query on a datamart, and returns the result set as a list of (field name, value) pair maps.

A client request optionally specifies start (0 being the first row) and end row (inclusive). The

data.query section contains the source (“datamart” - mandatory), a list of projections (mandatory),

optional sort-by clause and optional simple or advanced filter criteria. A projection can have the

simple form of “<expression> : alias”, or the advanced notation that allows for the specification of

additional attributes as well as an expression template with parameter list. Finally, the ‘options’

section allows for requesting conversion into a specific currency (currency to be defined in the

production schema).

The return data lists start and endRow (might be different to the requested value if less rows are

available), and totalRows. This is the total number of rows that the query would return if not for the

request’s start/endRow and server side maximum rows limitation. The actual data takes the form of

a list of field/value maps, with the field name being the projection alias.

URL Syntax /pricefx/<partition>/ datamart.query

URL Parameters

Request Parameters data.query{

datamart: <datamart or datasource uniquename>

projections: { <map of simple/advanced projections> }

filter: <simple or advanced filter criteria to apply on row level>

aggregateFilter: <simple or advanced filter criteria to apply after rollup>

options: { currency : <ccy code from schema > }

Remarks

Sample Request {

"operationType":"fetch",

"startRow":0,

Page 121: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 121

"endRow":99,

"sortBy":[

"x"

],

"textMatchStyle":"exact",

"componentId":"isc_ListGrid_1",

"data":{

"query":{

"filter":null,

"datamart":"datamart_transaction",

"aggregateFilter":null,

"projections":{

"x":"CustomerType",

"y":{

"alias":"y",

"label":"Sum of ListPrice",

"formatString":"Sum of ListPrice",

"expr":"SUM({field})",

"parameters":{

"field":"ListPrice"

}

}

},

"options":{

"currency":"EUR"

}

}

},

}

Sample Response {"response":

{"endRow":2,"totalRows":3,"status":0,"startRow":0,

"data":[

{"x":"Enduser","y":34029.3799},

{"x":"Industry","y":27753.0691},

{"x":"Restaurant","y":16814.3474}

]}}

3.17.17 Get Datamart

Command to retrieve Datamart definitions. If ‘draft’ DMs are requested, then all DMs in draft

(regular) schemas are returned. Otherwise all the DMs, in both regular and simulation production

schemas are retuned;

URL Syntax pricefx/test/datamart.getdatamart[/draft]

URL Parameters

Request Parameters None

Remarks

Sample Request http://qa.pricefx.eu/pricefx/martin/datamart.getdatamart/

Page 122: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 122

Sample Response

3.17.18 Calculate

Triggers a calculation on a DM. The calculation parameters is in the request body specify i.a. the

target DM and optional data filters to limit the scope of the data to be processed. The calculation

paramaters also define the formula to execute and its input parameters and selected outputs

(matching those DM field names the calciulation is meant to update). The formula inputs and

outputs definitions are typically retrieved by the datamart.formulaparams command.

URL Syntax /pricefx/<partition>/ datamart.calculate

URL Parameters None

Request Parameters

{"data":{

"targetName":"prod.datamart_transaction",

"dtoFilter":{

"_constructor":"AdvancedCriteria",

"operator":"and",

"criteria":[

]

},

"sortBy":null,

"calculationConfig":{

"formulaName":"DMCalcSample",

"targetDate":"2014-10-09",

"targetDateField":"InvoiceDate",

"inputParams":[

{

"name":"ProductID",

"label":"ProductID",

"lookupTableId":null,

Page 123: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 123

"url":null,

"type":"STRINGUSERENTRY",

"value":null,

"valueHint":null,

"valueOptions":null,

"filter":null,

"parameterGroup":null,

"parameterConfig":{

"dataType":"text"

}

}

],

"mappingParams":[

{

"name":"ProductID",

"label":"ProductID"

}

],

"outputElements":[

{

"elementName":"CustomerClass",

"elementLabel":"DM output as FE name matches DM field

name (and 'Row' group is set, and FE is visible)",

"formulaName":"DMCalcSample",

"formulaDate":null,

"elementGroups":[

"row"

],

"displayedInPriceShop":false,

"selected":true

}

],

}

}}

3.17.19 Formula Params

Retreives formula input parameters, and all visible outputs, based on the contained formula name,

target date and product field mapping (similar to the PriceList params command).

URL Syntax /pricefx/<partition>/ datamart.formulaparams

URL Parameters None

Request Parameters

Sample Response

{

"data":{

"typedId":"3.DM",

"targetDate":"2014-10-09",

"simulationSet":null,

"skuField":null,

"formulaName":"DMCalcSample"

}

}

{

"response": {

"status": 0,

"data": [

{

"contextParameters": [

{

"name": "ProductID",

"label": "ProductID",

"lookupTableId": null,

Page 124: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 124

"url": null,

"type": "STRINGUSERENTRY",

"value": null,

"valueHint": null,

"valueOptions": null,

"filter": null,

"parameterGroup": null,

"parameterConfig": {

"dataType": "text"

}

}

],

"formulaParameterReference": [

{

"elementName": "CustomerClass",

"elementLabel": "DM output as FE name matches DM field

name (and 'Row' group is set, and FE is visible)",

"formulaName": "DMCalcSample",

"formulaDate": null,

"elementGroups": [

"row"

],

"displayedInPriceShop": false

}

]

}

]

}

}

3.17.20 Export

Performs a logical data export. The data files (.csv) are created under <pfx-root>/backup, in a

separate directory for each partition. There is one csv file per exported table. The column names

correspond to the DS/DM field names. The path to the back folder is set in the node’s pricefx-

config.xml file.

The naming convention for the exported csv files is:

- ds_<DS.uniqueName>.csv for DataSources

- dm_<DM.label>.csv for Datamarts, wherein spaces are replaced with underscores

URL Syntax /pricefx/ system/system$datamartexport

URL Parameters None

Request Parameters None

Remarks

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":null

}

Page 125: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 125

3.17.21 Import

Performs a logical data import from csv files in the <pfx-root>/backup folder. The import inserts

rows in the target DS/DM table. See the export file name convention for how files are matched to

the corresponding DS/DM. It is important to note that the import INSERTS data into the existing

tables. If data is imported into an existing DB it is therefore common to first truncate the tables or

drop the tables altogether. The command takes an optional storage initialization parameter:

- dropTables: drops the existing tables, and recreates them based on the currently deployed

main production schema

- updateTables: updates the tables to be in line with the current deployed main production

schema , and creates tables if they don’t exist yet.

URL Syntax /pricefx/ system/system$datamartimport/[dropTables|updateTables]

URL Parameters None

Request Parameters None

Remarks

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":null

}

3.18 Configuration Manager

These commands support storage, retrieval and deletion of the settings under specified ID. Setting

format is completely up to the client. Semantic is not checked by server. Only limitation is that the

setting must be in a form of a <String>

3.18.1 Get

This command retrieves a setting from the server.

URL Syntax /pricefx/<partition>/ configurationmanager.get/<settingname>

Examples:

/pricefx/test/ configurationmanager.get/waterfall

Page 126: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 126

URL Parameters Settingname – unique name that identifies the setting

Request Parameters N/A

Remarks Returns setting definition or <null> if there is no such setting on the server

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

"{\r \"options\":\"{\\r \\\"title\\\":\\\"\\\", \\r

\\\"subtitle\\\":\\\"\\\"\\r}\", \r \"series\":[\r \"{\\r

\\\"datamart\\\":\\\"datamart_transaction\\\", \\r \\\"filterToolt

ip\\\":\\\"\\\", \\r \\\"reportingCurrency\\\":null, \\r \\\"cur

rency\\\":null, \\r \\\"calculationMode\\\":\\\"$\\\", \\r \\\"r

ecords\\\":[\\r {\\r \\\"name\\\":null, \\r

\\\"type\\\":\\\"RESULT\\\", \\r \\\"value\\\":\\\"Curre

ncyToReportingCurrencyRate\\\"\\r }\\r ]\\r}\"\r ], \r

\"auxLines\":[\r ]\r}"

]

}

}

3.18.2 Set

Saves a setting to the server under specified setting name

URL Syntax /pricefx/<partition>/ configurationmanager.set/<settingname>

Examples:

/pricefx/test/ configurationmanager.set/waterfall

URL Parameters Settingname – unique name that identifies the setting to be saved

Request Parameters content - <String> form that represents the setting

Remarks Set new setting under SettingId or overrides already existing one

Sample Request {

"data":{

"content":"{\r \"options\":\"{\\r \\\"title\\\":\\\"\\\",

\\r \\\"subtitle\\\":\\\"\\\"\\r}\", \r \"series\":[\r \"

{\\r \\\"datamart\\\":\\\"datamart_transaction\\\", \\r \\\"filt

erTooltip\\\":\\\"\\\", \\r \\\"reportingCurrency\\\":null, \\r

\\\"currency\\\":null, \\r \\\"calculationMode\\\":\\\"$\\\", \\r

\\\"records\\\":[\\r {\\r \\\"name\\\":null, \\r

\\\"type\\\":\\\"RESULT\\\", \\r \\\"value\\\":\\

\"CurrencyToReportingCurrencyRate\\\"\\r }\\r ]\\r}\"\r ]

, \r \"auxLines\":[\r ]\r}"

}

}

Sample Response Empty body

Page 127: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 127

3.18.3 Delete

Delete a setting from the server.

URL Syntax /pricefx/<partition>/configurationmanager.delete/<settingname>

Examples:

/pricefx/test/configurationmanager.delete/waterfall

URL Parameters Settingname – unique name that identifies the setting to be deleted

Request Parameters N/A

Remarks

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

"{\r \"options\":\"{\\r \\\"title\\\":\\\"\\\", \\r

\\\"subtitle\\\":\\\"\\\"\\r}\", \r \"series\":[\r \"{\\r

\\\"datamart\\\":\\\"datamart_transaction\\\", \\r \\\"filterToolt

ip\\\":\\\"\\\", \\r \\\"reportingCurrency\\\":null, \\r \\\"cur

rency\\\":null, \\r \\\"calculationMode\\\":\\\"$\\\", \\r \\\"r

ecords\\\":[\\r {\\r \\\"name\\\":null, \\r

\\\"type\\\":\\\"RESULT\\\", \\r \\\"value\\\":\\\"Curre

ncyToReportingCurrencyRate\\\"\\r }\\r ]\\r}\"\r ], \r

\"auxLines\":[\r ]\r}"

]

}

}

3.18.4 Get Default

This command retrieves a default setting from the server if a default is available.

URL Syntax /pricefx/<partition>/configurationmanager.getdefault/<settingname>

Examples:

/pricefx/test/configurationmanager.getdefault/waterfall

URL Parameters Settingname – unique name that identifies the setting

Request Parameters N/A

Remarks Returns default setting definition or <null> if there is no such setting on the

server

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

"{\r \"options\":\"{\\r \\\"title\\\":\\\"\\\", \\r

Page 128: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 128

\\\"subtitle\\\":\\\"\\\"\\r}\", \r \"series\":[\r \"{\\r

\\\"datamart\\\":\\\"datamart_transaction\\\", \\r \\\"filterToolt

ip\\\":\\\"\\\", \\r \\\"reportingCurrency\\\":null, \\r \\\"cur

rency\\\":null, \\r \\\"calculationMode\\\":\\\"$\\\", \\r \\\"r

ecords\\\":[\\r {\\r \\\"name\\\":null, \\r

\\\"type\\\":\\\"RESULT\\\", \\r \\\"value\\\":\\\"Curre

ncyToReportingCurrencyRate\\\"\\r }\\r ]\\r}\"\r ], \r

\"auxLines\":[\r ]\r}"

]

}

}

3.18.5 Upload Template

Uploads excel template for Price Shop and other areas to the server. Tracking of the process of

upload and cancellation mechanism is supported via UploadManager. There is one

URL Syntax /pricefx/<partition>/ priceshopmanager.uploadtemplate

Examples:

/pricefx/test/ priceshopmanager.uploadtemplate

URL Parameters N/A

Request Parameters N/A

Remarks Classic multi-part upload via html form

Sample Request N/A

Sample Response Empty body. Response is of HTML type.

3.18.6 Check Template Present

This command checks whether the template is uploaded or not. Template is used for Excel

generation of PS’s Quote offers and other exports.

URL Syntax /pricefx/<partition>/configurationmanager.checktemplatepresent/<type

code>

Examples:

/pricefx/test/configurationmanager.checktemplatepresent/Q

URL Parameters type code – the type code the template is used for

Request Parameters N/A

Remarks There is one template per partition and type code.

Sample Request Empty body.

Page 129: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 129

Sample Response Note that if the id attribute is in the response then the template is present

{

"response":{

"status":0,

"data":[

{

"id":"99"

}

]

}

}

3.18.7 Get Template URL

This command retrieves the URL that can be then used to download template for Price Shop Excel

generation.

URL Syntax /pricefx/<partition>/configurationmanager.gettemplatedownloadurl/<type

code>

Examples:

/pricefx/test/configurationmanager.gettemplatedownloadurl/Q

URL Parameters type code – the type code the template is used for

Request Parameters N/A

Remarks There is one template per partition and type code.

Sample Request Empty body.

Sample Response {

"response":{

"status":0,

"data":[

{

"url":"/downloadmanager.download/99?output=file"

}

]

}

}

3.18.8 Delete Template

Deletes template for Excel generation from server

URL Syntax /pricefx/<partition>/configurationmanager.deletetemplate/<type code>

Examples:

/pricefx/test/configurationmanager.deletepstemplate/Q

Page 130: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 130

URL Parameters type code – the type code the template is used for

Request Parameters N/A

Remarks There is one template per partition and type code.

Sample Request Empty body.

Sample Response {

"response":{

"status":0,

"data":[

{

"value":"99",

"label":null,

"uniqueName":"priceShopExcelTemplate",

"version":0,

"typedId":"11.AP"

}

]

}

}

3.18.9 Get global extensions

Retrieves a list of global extensions (product or customer) that are active for this partition

URL Syntax /pricefx/<partition>/configurationmanager.getglobalextensions/<type

code>

Examples:

/pricefx/test/configurationmanager. getglobalextensions/PX

URL Parameters type code – either PX or CX

Request Parameters N/A

Remarks There is one template per partition and type code.

Sample Request Empty body.

Sample Response {

"response":{

"status":0,

"data":[

"{\"GLOBAL.GlobalExtensionA\":{\"label\":\"Global Extension A

\",\"userGroupEdit\":null,\"userGroupViewDetails\":null,\"allowSearch\

":false},\"GLOBAL.GlobalExtensionB\":{\"label\":\"Global Extension B\"

,\"userGroupEdit\":null,\"userGroupViewDetails\":null,\"allowSearch\":

false}}"

]

}

}

Page 131: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 131

3.19 Simulation Manager

3.19.1 Delete

This command deletes a simulation together with its simulation items.

URL Syntax /pricefx/<partition>/simulationmanager.delete

Example:

/pricefx/test/simulationmanager.delete

URL Parameters N/A

Request Parameters data.typedId(mandatory): Id of the simulation to be deleted

Remarks N/A

Sample Request {

"data":{

"typedId":"18.SIM"

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"version":7,

"status":"ERROR",

"calculationDate":null,

"targetDate":"2012-01-01",

"label":"Test1",

"locale":null,

"numberOfItems":null,

"calculationMessages":"[\"Cannot find Base Pricelist with

id 74\"]",

"basePricelistId":74,

"simulationSet":null,

"localizedStatus":"Error",

"typedId":"18.SIM"

}

]

}

}

3.19.2 Fetch

Fetches simulation items of selected simulation

URL Syntax /pricefx/<partition>/simulationmanager.fetch/<simulation id>

Example:

/pricefx/test/simulationmanager.fetch/2

URL Parameters Simulation id: Id of the simulation whose items will be fetched

Page 132: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 132

Request Parameters See 3.2.1

Remarks N/A

Sample Request {

"operationType":"fetch",

"startRow":0,

"endRow":75,

"textMatchStyle":"exact",

"data":{

},

"oldValues":null

}

Sample Response {

"response":{

"endRow":10,

"totalRows":10,

"status":0,

"startRow":0,

"data":[

{

"version":0,

"sku":"00041",

"label":"Poly 1",

"unitOfMeasure":"kg",

"currency":"EUR",

"resultPrice":89.99900,

"previousPrice":89.99900,

"priceChange":0.00000,

"priceChangePct":0.00,

"alerts":"{}",

"warnings":"{\"Regional_Adj\":[\"Customer not set\",\"Look

up key not found in table Region\"]}",

"simulationId":17,

"changeAbs_attribute1":0.00000,

"changeAbs_attribute2":0.00000,

"changeAbs_attribute3":0.00000,

"changeAbs_attribute4":0.00000,

"changeAbs_attribute5":0.00000,

"changeAbs_attribute6":0.00000,

"changePct_attribute1":0.00,

"changePct_attribute2":0.00,

"changePct_attribute3":0.00,

"changePct_attribute4":0.00,

"changePct_attribute5":0.00,

"changePct_attribute6":0.00,

"oldVal_attribute1":"89.9990000000000",

"oldVal_attribute2":"89.9990000000000",

"oldVal_attribute3":"89.9990000000000",

"oldVal_attribute4":"89.9990000000000",

"oldVal_attribute5":"0.1304347826",

"oldVal_attribute6":"78.26000000000",

"typedId":"384.SIMI",

"attribute1":89.9990000000000,

"attribute2":89.9990000000000,

"attribute3":89.9990000000000,

"attribute4":89.9990000000000,

"attribute5":0.1304347826,

"attribute6":78.26000000000,

"attribute9":78.26000000000,

"attribute10":11.7390000000000,

"attribute11":0E-13,

Page 133: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 133

"attribute12":0E-13,

"attribute13":0E-13,

"attribute14":0E-13,

"attribute15":89.9990000000000

},

{

"version":0,

"sku":"00042",

"label":"Poly 2",

"unitOfMeasure":"kg",

"currency":"EUR",

"resultPrice":37.67820,

"previousPrice":37.67820,

"priceChange":0.00000,

"priceChangePct":0.00,

"alerts":"{}",

"warnings":"{\"Regional_Adj\":[\"Customer not set\",\"Look

up key not found in table Region\"]}",

"simulationId":17,

"changeAbs_attribute1":0.00000,

"changeAbs_attribute2":0.00000,

"changeAbs_attribute3":0.00000,

"changeAbs_attribute4":0.00000,

"changeAbs_attribute5":0.00000,

"changeAbs_attribute6":0.00000,

"changePct_attribute1":0.00,

"changePct_attribute2":0.00,

"changePct_attribute3":0.00,

"changePct_attribute4":0.00,

"changePct_attribute5":0.00,

"changePct_attribute6":0.00,

"oldVal_attribute1":"37.6782000000000000000000000000000000

",

"oldVal_attribute2":"37.6782000000000000000000000000000000

",

"oldVal_attribute3":"37.6782000000000000000000000000000000

",

"oldVal_attribute4":"37.6782000000000000000000000000000000

",

"oldVal_attribute5":"0.2000000000",

"oldVal_attribute6":"30.14256000000000000000000000000000",

"typedId":"385.SIMI",

"attribute1":37.6782000000000000000000000000000000,

"attribute2":37.6782000000000000000000000000000000,

"attribute3":37.6782000000000000000000000000000000,

"attribute4":37.6782000000000000000000000000000000,

"attribute5":0.2000000000,

"attribute6":30.14256000000000000000000000000000,

"attribute9":30.14256000000000000000000000000000,

"attribute10":7.5356400000000000000000000000000000,

"attribute11":0E-34,

"attribute12":0E-34,

"attribute13":0E-34,

"attribute14":0E-34,

"attribute15":37.6782000000000000000000000000000000

}

]

}

}

3.19.3 Fetch XLS

This command downloads simulation items as Excel file. Items from multiple lists can be downloaded

into one single file as separate sheets.

Page 134: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 134

URL Syntax /pricefx/<partition>/simulationmanager.fetchxls/< simulation id>/<

simulation id>/< simulation id>

Example:

/pricefx/test/simulationmanager.fetchxls/11/12

URL Parameters Simulation id (minimum once): Id of the simulation whose items will be

fetched

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response Binary response (the XLS document)

3.19.4 Update

The update command is used to update a manual price override for individual simulation items.

URL Syntax /pricefx/<partition>/simulationmanager.update/<simulation id>

Example:

/pricefx/test/simulationmanager.update/20

URL Parameters Simulation id: Id of the simulation that contains the item

Request Parameters See 3.2.2

Remarks N/A

Sample Request {

"operationType":"update",

"data":{

"typedId":"4435.SIMI",

"manualResultPrice":150

},

"oldValues":{

"version":0,

"sku":"SKU-111",

"unitOfMeasure":"EA",

"currency":"EUR",

"resultPrice":143.19,

"previousPrice":143.19,

"priceChange":0,

"priceChangePct":0,

"alerts":"{}",

"warnings":"",

"calculatedResultPrice":143.19,

"simulationId":4,

"changeAbs_attribute1":0,

"changeAbs_attribute2":0,

"changeAbs_attribute4":0,

"changeAbs_attribute5":0,

"changeAbs_attribute6":0,

"changeAbs_attribute7":0,

"changePct_attribute1":0,

Page 135: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 135

"changePct_attribute2":0,

"changePct_attribute4":0,

"changePct_attribute7":0,

"oldVal_attribute1":33.3,

"oldVal_attribute2":9.990000396966934,

"oldVal_attribute4":143.19000039696692,

"oldVal_attribute5":0,

"oldVal_attribute6":0,

"oldVal_attribute7":143.19000039696692,

"typedId":"4435.SIMI",

"attribute1":33.3,

"attribute2":9.990000396966934,

"attribute4":143.19000039696692,

"attribute5":0,

"attribute6":0,

"attribute7":143.19000039696692,

"attribute8":99.9,

"label":null,

"manualResultPrice":null,

"attribute3":null,

"oldVal_attribute3":null,

"changeAbs_attribute3":null,

"changePct_attribute3":null,

"changePct_attribute5":null,

"changePct_attribute6":null,

"oldVal_attribute8":null,

"changeAbs_attribute8":null,

"changePct_attribute8":null,

"attribute9":null,

"oldVal_attribute9":null,

"changeAbs_attribute9":null,

"changePct_attribute9":null

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"version":1,

"sku":"SKU-111",

"label":null,

"unitOfMeasure":"EA",

"currency":"EUR",

"resultPrice":150,

"previousPrice":143.19000,

"priceChange":6.81000,

"priceChangePct":4.7600,

"alerts":"{}",

"warnings":"{\"CustomerDiscount\":[\"Customer not set\",\"

VLookup - CustomerDiscount -

called without key\"],\"Null_Test\":[\"Product attribute Restricted A

_D not found \"],\"Lp\":[\"No approved product price found in priceli

st\"],\"GeographyDiscount\":[\"Lookup key not found in table Geograph

y\"]}",

"manualResultPrice":150,

"calculatedResultPrice":150,

"simulationId":4,

"changeAbs_attribute1":0.0,

"changeAbs_attribute2":0E-18,

"changeAbs_attribute3":null,

"changeAbs_attribute4":0E-18,

"changeAbs_attribute5":0E-18,

"changeAbs_attribute6":0E-18,

"changeAbs_attribute7":6.809999603033065632,

"changeAbs_attribute8":null,

"changeAbs_attribute9":null,

Page 136: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 136

"changeAbs_attribute10":null,

"changeAbs_attribute11":null,

"changeAbs_attribute12":null,

"changeAbs_attribute13":null,

"changeAbs_attribute14":null,

"changeAbs_attribute15":null,

"changeAbs_attribute16":null,

"changeAbs_attribute17":null,

"changeAbs_attribute18":null,

"changeAbs_attribute19":null,

"changeAbs_attribute20":null,

"changeAbs_attribute21":null,

"changeAbs_attribute22":null,

"changeAbs_attribute23":null,

"changeAbs_attribute24":null,

"changeAbs_attribute25":null,

"changeAbs_attribute26":null,

"changeAbs_attribute27":null,

"changeAbs_attribute28":null,

"changeAbs_attribute29":null,

"changeAbs_attribute30":null,

"changePct_attribute1":0.0000,

"changePct_attribute2":0.0000,

"changePct_attribute3":null,

"changePct_attribute4":0.0000,

"changePct_attribute5":null,

"changePct_attribute6":null,

"changePct_attribute7":0.0476,

"changePct_attribute8":null,

"changePct_attribute9":null,

"changePct_attribute10":null,

"changePct_attribute11":null,

"changePct_attribute12":null,

"changePct_attribute13":null,

"changePct_attribute14":null,

"changePct_attribute15":null,

"changePct_attribute16":null,

"changePct_attribute17":null,

"changePct_attribute18":null,

"changePct_attribute19":null,

"changePct_attribute20":null,

"changePct_attribute21":null,

"changePct_attribute22":null,

"changePct_attribute23":null,

"changePct_attribute24":null,

"changePct_attribute25":null,

"changePct_attribute26":null,

"changePct_attribute27":null,

"changePct_attribute28":null,

"changePct_attribute29":null,

"changePct_attribute30":null,

"oldVal_attribute1":"33.3",

"oldVal_attribute2":"9.990000396966934368",

"oldVal_attribute3":null,

"oldVal_attribute4":"143.190000396966934368",

"oldVal_attribute5":"0E-18",

"oldVal_attribute6":"0E-18",

"oldVal_attribute7":"143.190000396966934368",

"oldVal_attribute8":null,

"oldVal_attribute9":null,

"oldVal_attribute10":null,

"oldVal_attribute11":null,

"oldVal_attribute12":null,

"oldVal_attribute13":null,

"oldVal_attribute14":null,

"oldVal_attribute15":null,

"oldVal_attribute16":null,

"oldVal_attribute17":null,

Page 137: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 137

"oldVal_attribute18":null,

"oldVal_attribute19":null,

"oldVal_attribute20":null,

"oldVal_attribute21":null,

"oldVal_attribute22":null,

"oldVal_attribute23":null,

"oldVal_attribute24":null,

"oldVal_attribute25":null,

"oldVal_attribute26":null,

"oldVal_attribute27":null,

"oldVal_attribute28":null,

"oldVal_attribute29":null,

"oldVal_attribute30":null,

"typedId":"4435.SIMI",

"attribute1":33.3,

"attribute2":9.990000396966934368,

"attribute3":null,

"attribute4":143.190000396966934368,

"attribute5":0E-18,

"attribute6":0E-18,

"attribute7":150,

"attribute8":99.9,

"attribute9":null,

"attribute10":null,

"attribute11":null,

"attribute12":null,

"attribute13":null,

"attribute14":null,

"attribute15":null,

"attribute16":null,

"attribute17":null,

"attribute18":null,

"attribute19":null,

"attribute20":null,

"attribute21":null,

"attribute22":null,

"attribute23":null,

"attribute24":null,

"attribute25":null,

"attribute26":null,

"attribute27":null,

"attribute28":null,

"attribute29":null,

"attribute30":null

}

]

}

}

3.19.5 Summarize

This command is used to generate a summary report over one or multiple simulations. The request

contains a more complex query structure that defines the desired results and the aggregation

mechanisms.

URL Syntax /pricefx/<partition>/simulationmanager.summarize

Example:

/pricefx/test/simulationmanager.summarize

URL Parameters N/A

Page 138: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 138

Request Parameters A summary query structure.

Example:

{

"data":{

"query":{

"projections":[

{

"weight":null,

"aggregationMode":"AVG",

"fieldName":"Margin"

},

{

"weight":"RegionalPrice",

"aggregationMode":"SUM",

"fieldName":"ListPrice"

}

],

"objects":[

"3.SIM",

"4.SIM"

],

"productGroupBy":"attribute3",

"itemGroupBy":null,

"count":true

}

}

}

There is exactly one query element inside the general data element. This

query element holds two name/value pairs for grouping:

productGroupBy and itemGroupBy. Both are optional and specify

additional grouping options of the results.

The element objects specifies the simulations (as typed id) that the query

should run on. At a minimum one simulation is required.

The element projections specifies the desired result columns and the way

to calculate them. aggregationMode is either SUM or AVG. weight is

optional, fieldName is mandatory. The specified values are the fieldnames

as they appear in the grid (i.e. the labels of the AttributeMeta) rather than

the internal column name (e.g. attribute1), as the same field could be

stored in different columns in two different simulations. The field count is a

Boolean that specifies if the group count should be calculated and

Page 139: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 139

displayed.

Remarks N/A

Sample Request See above.

Sample Response {

"response":{

"endRow":3,

"totalRows":3,

"status":0,

"startRow":0,

"data":[

{

"avg_margin_":928.0560919235061,

"changePct_avg_margin_":0.0,

"sum_listprice_regionalprice":4.1406710118035995E10,

"groupKey":null,

"changeAbs_sum_listprice_regionalprice":0.0,

"changePct_sum_listprice_regionalprice":0.0,

"oldVal_avg_margin_":928.0560919235061,

"changeAbs_avg_margin_":0.0,

"totalWeight_avg_margin_":218.0,

"totalWeight_sum_listprice_regionalprice":0.0,

"oldVal_sum_listprice_regionalprice":4.1406710118035995E10

},

{

"avg_margin_":100.215003982186,

"changePct_avg_margin_":0.0,

"sum_listprice_regionalprice":8253193.8571608,

"groupKey":"XXX",

"changeAbs_sum_listprice_regionalprice":0.0,

"changePct_sum_listprice_regionalprice":0.0,

"oldVal_avg_margin_":100.215003982186,

"changeAbs_avg_margin_":0.0,

"totalWeight_avg_margin_":4.0,

"totalWeight_sum_listprice_regionalprice":0.0,

"oldVal_sum_listprice_regionalprice":8253193.8571608

},

{

"avg_margin_":913.1400362849237,

"changePct_avg_margin_":0.0,

"sum_listprice_regionalprice":4.141496331189316E10,

"groupKey":"TOTAL",

"changeAbs_sum_listprice_regionalprice":0.0,

"changePct_sum_listprice_regionalprice":0.0,

"oldVal_avg_margin_":913.1400362849237,

"changeAbs_avg_margin_":0.0,

"totalWeight_avg_margin_":222.0,

"totalWeight_sum_listprice_regionalprice":0.0,

"oldVal_sum_listprice_regionalprice":4.141496331189316E10

}

]

}

}

3.19.6 Convert to Pricelist

This command converts a simulation and its items into a pricelist by copying and adjusting the items.

URL Syntax /pricefx/<partition>/simulationmanager.convert2pl/<simulation id>

Page 140: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 140

Example:

/pricefx/test/simulationmanager.convert2pl /2

URL Parameters Simulation id: Id of the simulation that should be converted

Request Parameters convertObjects: true or false. If true then the related simulation objects

(those returned by the details command) are moved from status

“simulation only” to “active” while doing the pricelist conversion. If false,

those objects are not touched.

Remarks N/A

Sample Request {"data":{"convertObjects":false}}

Sample Response {"response":{"status":0,"data":null}}

3.19.7 Details

This command gathers detail information about the “simulation-only” objects (formulas, lookup

tables) that were used while calculating this particular simulation.

URL Syntax /pricefx/<partition>/simulationmanager.details/<simulation id>

Example:

/pricefx/test/simulationmanager.details/2

URL Parameters Simulation id: Id of the simulation whose details will be fetched

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"endRow":0,

"totalRows":1,

"status":0,

"startRow":0,

"data":[

{

"typedId":"2.LT",

"uniqueName":"Geography",

"label":"(SIM) Geography Discount",

"status":"SIMULATIONONLY",

"validAfter":"2011-01-01",

"simulationSet":null

}

]

}

}

Page 141: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 141

3.19.8 Cancel

This command cancels running computation of the simulation. Simulation is moved to draft status

after successful cancelation.

URL Syntax /pricefx/<partition>/simulationmanager.cancel/<simulation id>

Example:

/pricefx/test/simulationmanager.cancel/4

URL Parameters Simulation id: Id of simulation that is being cancelled

Request Parameters None

Remarks Request body remains empty

Sample Request Empty body.

Sample Response {

"response":{

"status":0,

"data":[

"Simulation cancel request is queued"

]

}

}

3.19.9 Calculate

This command starts a calculation of the simulation.

URL Syntax /pricefx/<partition>/ simulationmanager.calculate/< simulation id>

Example:

/pricefx/test/ simulationmanager.calculate/4

URL Parameters Simulation id: Id of simulation that should be calculated

Request Parameters None

Remarks Request body remains empty

Sample Request Empty body.

Sample Response {

"response":{

"status":0,

"data" : [{

"version" : 0,

"processingNode" : null,

"threadId" : null,

"threadUUID" : null,

"status" : "WAITING_FOR_DISPATCH",

"trackerType" : "SIMULATION",

"targetObject" : "343.SIM",

"concurrencyKey" : "343.SIM",

"progress" : null,

Page 142: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 142

"cancelRequested" : false,

"priority" : 0,

"messages" : null,

"typedId" : "4049.JST",

"createDate" : "2015-03-17T15:59:00",

"lastUpdateDate" : "2015-03-17T15:59:00",

"processingStart" : null,

"processingEnd" : null

} }

}

3.20 Price Grid Manager

3.20.1 Delete

This command deletes a price grid together with its items and meta information or items contained

in a specific grid.

URL Syntax /pricefx/<partition>/pricegridmanager.delete/<pg id>

Example:

/pricefx/test/ pricegridmanager.delete/6

URL Parameters pg id: Id of the price grid. Mandatory if items in the grid should be deleted.

Must be missing in case the entire grid should be deleted

Request Parameters data.typedId(mandatory): Id of the price grid or the price grid item to be

deleted

Remarks N/A

Sample Request {

"data":{

"typedId":"18.PG"

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"version":7,

"status":"ERROR",

"calculationDate":null,

"targetDate":"2012-01-01",

"label":"Test1",

"locale":null,

"numberOfItems":null,

"calculationMessages":"[\"Cannot find Base Pricelist with

id 74\"]",

"basePricelistId":74,

"localizedStatus":"Error",

"typedId":"18.PG"

}

]

}

}

Page 143: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 143

3.20.2 Fetch

Fetches simulation items of selected price grid

URL Syntax /pricefx/<partition>/pricegridmanager.fetch/<pg id>

Example:

/pricefx/test/pricegridmanager.fetch/2

URL Parameters Pg id: Id of the grid whose items will be fetched

Request Parameters See 3.2.1

Remarks N/A

Sample Request {

"operationType":"fetch",

"startRow":0,

"endRow":75,

"textMatchStyle":"exact",

"data":{

},

"oldValues":null

}

Sample Response {

"response":{

"endRow":10,

"totalRows":10,

"status":0,

"startRow":0,

"data":[

{

"version":0,

"sku":"00041",

"label":"Poly 1",

"unitOfMeasure":"kg",

"currency":"EUR",

"resultPrice":89.99900,

"previousPrice":89.99900,

"priceChange":0.00000,

"priceChangePct":0.00,

"alerts":"{}",

"warnings":"{\"Regional_Adj\":[\"Customer not set\",\"Look

up key not found in table Region\"]}",

"priceGridId":17,

"typedId":"384.PGI",

"attribute1":89.9990000000000,

"attribute2":89.9990000000000,

"attribute3":89.9990000000000,

"attribute4":89.9990000000000,

"attribute5":0.1304347826,

"attribute6":78.26000000000,

"attribute9":78.26000000000,

"attribute10":11.7390000000000,

"attribute11":0E-13,

"attribute12":0E-13,

"attribute13":0E-13,

"attribute14":0E-13,

Page 144: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 144

"attribute15":89.9990000000000

},

{

"version":0,

"sku":"00042",

"label":"Poly 2",

"unitOfMeasure":"kg",

"currency":"EUR",

"resultPrice":37.67820,

"previousPrice":37.67820,

"priceChange":0.00000,

"priceChangePct":0.00,

"alerts":"{}",

"warnings":"{\"Regional_Adj\":[\"Customer not set\",\"Look

up key not found in table Region\"]}",

"priceGridId":17,

"typedId":"385.PGI",

"attribute1":37.6782000000000000000000000000000000,

"attribute2":37.6782000000000000000000000000000000,

"attribute3":37.6782000000000000000000000000000000,

"attribute4":37.6782000000000000000000000000000000,

"attribute5":0.2000000000,

"attribute6":30.14256000000000000000000000000000,

"attribute9":30.14256000000000000000000000000000,

"attribute10":7.5356400000000000000000000000000000,

"attribute11":0E-34,

"attribute12":0E-34,

"attribute13":0E-34,

"attribute14":0E-34,

"attribute15":37.6782000000000000000000000000000000

}

]

}

}

3.20.3 Update

The update command is used to update a manual price override for individual price grid items.

URL Syntax /pricefx/<partition>/pricegridmanager.update/<pg id>

Example:

/pricefx/test/pricegridmanager.update/20

URL Parameters Pg id: Id of the grid that contains the item

Request Parameters See 3.2.2

Remarks N/A

Sample Request {

"operationType":"update",

"data":{

"typedId":"10.PGI",

"manualResultPrice":11

},

"oldValues":{

"version":5,

"lastUpdateDate":"2013-06-06T11:23:20",

"sku":"C-1",

Page 145: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 145

"unitOfMeasure":"EA",

"currency":"EUR",

"resultPrice":10,

"alerts":"{}",

"warnings":"{\"Petr\":[\"Customer not set\",\"VLookup -

TestSimple - called without key\"]}",

"allowedOverrides":"",

"calculatedResultPrice":10,

"priceGridId":4,

"approvalState":"APPROVED",

"approvalDate":"2013-06-06T11:23:20",

"activePrice":10,

"manualEditVersion":0,

"workflowStatus":"NO_APPROVAL_REQUIRED",

"typedId":"10.PGI",

"completeResultsAvailable":true,

"attribute1":10,

"label":null,

"comment":null,

"manualOverrides":null,

"previousPrice":null,

"previousPriceDate":null,

"priceChange_ActivePrev":null,

"priceChangePct_ActivePrev":null,

"activePriceDate":null,

"priceChange":null,

"priceChangePct":null,

"manualResultPrice":null

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"version":6,

"lastUpdateDate":"2013-06-18T10:34:24",

"sku":"C-1",

"label":null,

"unitOfMeasure":"EA",

"currency":"EUR",

"comment":null,

"resultPrice":11,

"previousPrice":null,

"priceChange":1.00000,

"priceChangePct":0.1000,

"alerts":"{}",

"warnings":"{\"Petr\":[\"Kunde nicht gesetzt\",\"VLookup -

TestSimple - ohne Schlüssel aufgerufen\"]}",

"allowedOverrides":"",

"manualOverrides":null,

"manualResultPrice":11,

"calculatedResultPrice":11,

"priceGridId":4,

"approvalState":"NOT_APPROVED",

"approvalDate":null,

"previousPriceDate":null,

"activePrice":10.00000,

"activePriceDate":null,

"priceChange_ActivePrev":null,

"priceChangePct_ActivePrev":null,

"manualEditVersion":0,

"manualPriceDate":"2013-06-18T10:34:24",

"workflowStatus":null,

"typedId":"10.PGI",

"completeResultsAvailable":true,

"attribute1":10.00000 }

Page 146: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 146

]

}

}

3.20.4 Summarize

This command is used to generate a summary report over one or multiple price grids. The request

contains a more complex query structure that defines the desired results and the aggregation

mechanisms.

URL Syntax /pricefx/<partition>/pricegridmanager.summarize

Example:

/pricefx/test/pricegridmanager.summarize

URL Parameters N/A

Request Parameters A summary query structure.

Example:

{

"data":{

"query":{

"projections":[

{

"weight":null,

"aggregationMode":"AVG",

"fieldName":"Margin"

},

{

"weight":"RegionalPrice",

"aggregationMode":"SUM",

"fieldName":"ListPrice"

}

],

"objects":[

"3.SIM",

"4.SIM"

],

"productGroupBy":"attribute3",

"itemGroupBy":null,

"count":true

}

}

}

There is exactly one query element inside the general data element. This

query element holds two name/value pairs for grouping:

productGroupBy and itemGroupBy. Both are optional and specify

additional grouping options of the results.

The element objects specifies the simulations (as typed id) that the query

should run on. At a minimum one simulation is required.

The element projections specifies the desired result columns and the way

Page 147: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 147

to calculate them. aggregationMode is either SUM or AVG. weight is

optional, fieldName is mandatory. The specified values are the fieldnames

as they appear in the grid (i.e. the labels of the AttributeMeta) rather than

the internal column name (e.g. attribute1), as the same field could be

stored in different columns in two different simulations. The field count is a

Boolean that specifies if the group count should be calculated and

displayed.

Remarks N/A

Sample Request See above.

Sample Response {

"response":{

"endRow":3,

"totalRows":3,

"status":0,

"startRow":0,

"data":[

{

"avg_margin_":928.0560919235061,

"changePct_avg_margin_":0.0,

"sum_listprice_regionalprice":4.1406710118035995E10,

"groupKey":null,

"changeAbs_sum_listprice_regionalprice":0.0,

"changePct_sum_listprice_regionalprice":0.0,

"oldVal_avg_margin_":928.0560919235061,

"changeAbs_avg_margin_":0.0,

"totalWeight_avg_margin_":218.0,

"totalWeight_sum_listprice_regionalprice":0.0,

"oldVal_sum_listprice_regionalprice":4.1406710118035995E10

},

{

"avg_margin_":100.215003982186,

"changePct_avg_margin_":0.0,

"sum_listprice_regionalprice":8253193.8571608,

"groupKey":"XXX",

"changeAbs_sum_listprice_regionalprice":0.0,

"changePct_sum_listprice_regionalprice":0.0,

"oldVal_avg_margin_":100.215003982186,

"changeAbs_avg_margin_":0.0,

"totalWeight_avg_margin_":4.0,

"totalWeight_sum_listprice_regionalprice":0.0,

"oldVal_sum_listprice_regionalprice":8253193.8571608

},

{

"avg_margin_":913.1400362849237,

"changePct_avg_margin_":0.0,

"sum_listprice_regionalprice":4.141496331189316E10,

"groupKey":"TOTAL",

"changeAbs_sum_listprice_regionalprice":0.0,

"changePct_sum_listprice_regionalprice":0.0,

"oldVal_avg_margin_":913.1400362849237,

"changeAbs_avg_margin_":0.0,

"totalWeight_avg_margin_":222.0,

"totalWeight_sum_listprice_regionalprice":0.0,

"oldVal_sum_listprice_regionalprice":4.141496331189316E10

}

]

}

}

Page 148: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 148

3.20.5 Convert to Pricelist

This command converts a price grid and its items into a pricelist by copying and adjusting the items.

URL Syntax /pricefx/<partition>/pricegridmanager.convert2pl/<pg id>

Example:

/pricefx/test/pricegridmanager.convert2pl /2

URL Parameters Pg id: Id of the grid that should be converted

Request Parameters Empty

Remarks N/A

Sample Request N/A

Sample Response {"response":{"status":0,"data":null}}

3.20.6 Params

This command gathers possible formula input parameters based on the contained products and their

formula setup (including the default formula override configuration of the grid).

URL Syntax /pricefx/<partition>/pricegridmanager.params/<pg id>

Example:

/pricefx/test/pricegridmanager.params/2

URL Parameters Pg id: Id of the grid

Request Parameters The current calculation configuration of the price grid

Remarks N/A

Sample Request {

"data":{

"configuration":{

"resultElementName":"Listprice",

"inputs":[

{

"name":"test",

"label":"test",

"lookupTableId":null,

"url":null,

"type":"USERENTRY",

"value":null,

"valueHint":null,

"valueOptions":null

},

{

"name":"test2",

"label":"test2",

"lookupTableId":null,

"url":null,

"type":"USERENTRY",

"value":null,

Page 149: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 149

"valueHint":null,

"valueOptions":null

},

{

"name":"Customer",

"label":"Kunde",

"lookupTableId":null,

"url":"/fetch/C/",

"type":"CUSTOMER",

"value":null,

"valueHint":null,

"valueOptions":null

},

{

"name":"NewMatrix",

"label":null,

"lookupTableId":"36",

"url":"/lookuptablemanager.fetch/36",

"type":"LOOKUP",

"value":null,

"valueHint":null,

"valueOptions":null

}

],

"elementNames":[

"result",

"UVP"

]

}

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"contextParameters":[

{

"name":"test",

"label":"test",

"lookupTableId":null,

"url":null,

"type":"USERENTRY",

"value":null,

"valueHint":null,

"valueOptions":null

},

{

"name":"test2",

"label":"test2",

"lookupTableId":null,

"url":null,

"type":"USERENTRY",

"value":null,

"valueHint":null,

"valueOptions":null

},

{

"name":"Customer",

"label":"Kunde",

"lookupTableId":null,

"url":"/fetch/C/",

"type":"CUSTOMER",

"value":null,

"valueHint":null,

"valueOptions":null

},

Page 150: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 150

{

"name":"NewMatrix",

"label":null,

"lookupTableId":"36",

"url":"/lookuptablemanager.fetch/36",

"type":"LOOKUP",

"value":null,

"valueHint":null,

"valueOptions":null

}

],

"formulaParameterReference":[

{

"elementName":"Marktpreis",

"elementLabel":null,

"formulaName":"Test",

"formulaDate":null,

"displayedInPriceShop":false

},

{

"elementName":"result",

"elementLabel":null,

"formulaName":"DFormula",

"formulaDate":null,

"displayedInPriceShop":true

},

{

"elementName":"UVP",

"elementLabel":null,

"formulaName":"Test",

"formulaDate":null,

"displayedInPriceShop":true

},

{

"elementName":"Petr",

"elementLabel":null,

"formulaName":"Test",

"formulaDate":null,

"displayedInPriceShop":false

},

{

"elementName":"Another",

"elementLabel":null,

"formulaName":"Test",

"formulaDate":null,

"displayedInPriceShop":false

},

{

"elementName":"rrrrr",

"elementLabel":null,

"formulaName":"DFormula",

"formulaDate":null,

"displayedInPriceShop":true

},

{

"elementName":"d",

"elementLabel":null,

"formulaName":"DFormula",

"formulaDate":null,

"displayedInPriceShop":true

},

{

"elementName":"Listprice",

"elementLabel":null,

"formulaName":"Test",

"formulaDate":null,

"displayedInPriceShop":true

},

Page 151: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 151

{

"elementName":"Preisfolge",

"elementLabel":null,

"formulaName":"Test",

"formulaDate":null,

"displayedInPriceShop":false

},

{

"elementName":"dd",

"elementLabel":null,

"formulaName":"DFormula",

"formulaDate":null,

"displayedInPriceShop":true

}

]

}

]

}

}

3.20.7 Add

This command adds products to the price grid. This can be done via a filter or by a list of individual

SKUs. In both cases only products that do not yet live inside the grid are added. All other are ignored.

URL Syntax /pricefx/<partition>/pricegridmanager.add/<pg id>

Example:

/pricefx/test/pricegridmanager.add/2

URL Parameters Pg id: Id of the grid

Request Parameters filterCriteria: Contains filter definition when parts are added by filter

skus: Array of skus when parts are added by name

Remarks N/A

Sample Request For individual named skus:

{"data":{"skus":["A-1.2","C-1"]}}

For a group of skus specified as filter:

{

"data":{

"filterCriteria":{

"operator":"and"

"criteria":[

{

"fieldName":"sku",

"operator":"iContains",

"value":"A"

}

]

}

}

}

Page 152: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 152

Sample Response {"response":{"status":0,"data":null}}

3.20.8 Accept

This command acts as the same way as a “submit”. I.e. the items are sent through workflow

URL Syntax /pricefx/<partition>/pricegridmanager.accept/<pg id>

Example:

/pricefx/test/pricegridmanager.accept/2

URL Parameters Pg id: Id of the grid

Request Parameters ids: An array of items (typed ids) to accept/submit.

Remarks In case more than one item is passed in the request, the body will not

contain data. Only in case of exactly one item, the new object details of that

item are returned.

Sample Request {"data":{"ids":["12.PGI"]}}

Sample Response {

"response":{

"status":0,

"data":[

{

"version":5,

"lastUpdateDate":"2013-06-18T10:54:02",

"sku":"N-1",

"label":null,

"unitOfMeasure":"EA",

"currency":"EUR",

"comment":null,

"resultPrice":0.00000,

"previousPrice":null,

"priceChange":null,

"priceChangePct":null,

"alerts":"{}",

"warnings":"{\"Petr\":[\"Context parameter Marktpreis not

found\",\"Customer not set\",\"VLookup - TestSimple -

called without key\"]}",

"allowedOverrides":"",

"manualOverrides":null,

"manualResultPrice":null,

"calculatedResultPrice":0.00000,

"priceGridId":4,

"approvalState":"APPROVED",

"approvalDate":"2013-06-18T10:54:02",

"previousPriceDate":null,

"activePrice":0.00000,

"activePriceDate":"2013-06-18T10:54:02",

"priceChange_ActivePrev":null,

"priceChangePct_ActivePrev":null,

"manualEditVersion":0,

"manualPriceDate":null,

"workflowStatus":"NO_APPROVAL_REQUIRED",

"typedId":"12.PGI",

"completeResultsAvailable":true,

}

]

Page 153: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 153

}

}

3.20.9 Reject

This command is the counterpart of the accept command. It marks the item(s) as “denied”.

URL Syntax /pricefx/<partition>/pricegridmanager.reject/<pg id>

Example:

/pricefx/test/pricegridmanager.reject/2

URL Parameters Pg id: Id of the grid

Request Parameters ids: An array of items (typed ids) to reject.

Remarks In case more than one item is passed in the request, the body will not

contain data. Only in case of exactly one item, the new object details of that

item are returned.

Sample Request {"data":{"ids":["12.PGI"]}}

Sample Response {

"response":{

"status":0,

"data":[

{

"version":5,

"lastUpdateDate":"2013-06-18T10:54:02",

"sku":"N-1",

"label":null,

"unitOfMeasure":"EA",

"currency":"EUR",

"comment":null,

"resultPrice":0.00000,

"previousPrice":null,

"priceChange":null,

"priceChangePct":null,

"alerts":"{}",

"warnings":"{\"Petr\":[\"Context parameter Marktpreis not

found\",\"Customer not set\",\"VLookup - TestSimple -

called without key\"]}",

"allowedOverrides":"",

"manualOverrides":null,

"manualResultPrice":null,

"calculatedResultPrice":0.00000,

"priceGridId":4,

"approvalState":"DENIED",

"approvalDate":"2013-06-18T10:54:02",

"previousPriceDate":null,

"activePrice":0.00000,

"activePriceDate":"2013-06-18T10:54:02",

"priceChange_ActivePrev":null,

"priceChangePct_ActivePrev":null,

"manualEditVersion":0,

"manualPriceDate":null,

"workflowStatus":"NO_APPROVAL_REQUIRED",

"typedId":"12.PGI",

"completeResultsAvailable":true,

}

Page 154: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 154

]

}

}

3.20.10 Preview

This command generates a preview of the to-be workflow for that item

URL Syntax /pricefx/<partition>/pricegridmanager.details/<pg id>/item typedid>

Example:

/pricefx/test/pricegridmanager.details/2/18.PGI

URL Parameters Pg id: Id of the grid

Item typed id: Typed id of the item to preview.

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"errors":{

"Meldung":{

"errorMessage":"Keine Genehmigung erforderlich"

},

"Status":{

"errorMessage":"-1"

},

"HTTPCode":{

"errorMessage":"200"

},

"Aktion":{

"errorMessage":null

},

"Zeitstempel":{

"errorMessage":"Tue Jun 18 11:00:02 UTC 2013"

}

},

"status":-1,

"data":"Keine Genehmigung erforderlich"

}

}

3.20.11 Cancel

This command cancels running computation of the price grid.

URL Syntax /pricefx/<partition>/pricegridmanager.cancel/<pg id>

Example:

/pricefx/test/pricegridmanager.cancel/4

Page 155: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 155

URL Parameters Pg id: Id of grid that is being cancelled

Request Parameters None

Remarks Request body remains empty

Sample Request Empty body.

Sample Response {

"response":{

"status":0,

"data":[ ]

}

}

3.20.12 Calculate

This command starts a calculation of the entire price grid.

URL Syntax /pricefx/<partition>/pricegridmanager.calculate/< pg id>

Example:

/pricefx/test/pricegridmanager.calculate/4

URL Parameters Pg id: Id of grid that should be calculated

Request Parameters None

Remarks Request body remains empty

Sample Request Empty body.

Sample Response {

"response":{

"status":0,

"data" : [{

"version" : 0,

"processingNode" : null,

"threadId" : null,

"threadUUID" : null,

"status" : "WAITING_FOR_DISPATCH",

"trackerType" : "PRICEGRID",

"targetObject" : "343.PG",

"concurrencyKey" : "343.PG",

"progress" : null,

"cancelRequested" : false,

"priority" : 0,

"messages" : null,

"typedId" : "4049.JST",

"createDate" : "2015-03-17T15:59:00",

"lastUpdateDate" : "2015-03-17T15:59:00",

"processingStart" : null,

"processingEnd" : null

} } }

Page 156: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 156

3.20.13 Mass Edit

The mass edit command performs a mass update operation of on a set of price grid items.

Typically a filter expression is passed along the request to restrict the scope of the mass edit

operation. The response contains the number of actually updated records. This number can be

different from what the client UI initially thinks as the server takes edit restrictions into account. The

semantics of this command are the same as for the regular datasource mass edit command.

URL Syntax /pricefx/<partition>/ pricegridmanager.massedit/<pg id>

Example:

/pricefx/test pricegridmanager.massedit/20

URL Parameters Pg id (mandatory): Id of grid to mass edit.

Request Parameters filterCriteria (Optional) : Standard filtercriteria to restrict the edit scope

fieldName (Mandatory): Name of the object’s field to update

fieldValue (Optional): New field value. If omitted the field is set to null

Remarks The response contains usually null as the mass edit task in this case is a

background process whose results are not yet available in at the response

time

Sample Request {

"data":{

"filterCriteria":{

"operator":"and"

"criteria":[

{

"fieldName":"sku",

"operator":"iContains",

"value":"A"

}

]

},

"fieldName":"attribute2",

"fieldValue":"NewValue"

}

}

Sample Response {"response":{"status":0,"data":null}}

3.20.14 Copy

This command copies a price grid including items and meta data.

URL Syntax /pricefx/<partition>/ pricegridmanager.copy/<pg id>

Example:

/pricefx/test/pricegridmanager.copy/4

URL Parameters Pg id: Id of price grid that is being copied

Request Parameters None

Page 157: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 157

Remarks Request body remains empty

Sample Request Empty body.

Sample Response {

"response" : {

"status" : 0,

"data" : [{

"version" : 0,

"status" : "DRAFT",

"calculationDate" : null,

"targetDate" : null,

"label" : "Kopie von NEU",

"locale" : null,

"calculationMessages" : null,

"numberOfItems" : 0,

"keepManualOverrides" : false,

"writeOnlyChangedItems" : false,

"configuration" : <omitted for brevity>,

"nodeId" : null,

"approvalState" : null,

"description" : null,

"relativeTargetDateDays" : null,

"userGroupEdit" : null,

"userGroupViewDetails" : null,

"numberOfApprovedItems" : 0,

"numberOfOpenItems" : 0,

"updatedBy" : 5,

"updateDate" : "2013-12-05",

"typedId" : "40.PG",

"id" : 40

}

]

}

}

3.21 Data Change Request Manager

3.21.1 Delete

This command deletes an entire change request or specific items within a change request. If the DCR

is in a non-editable workflow state, this command will fail.

URL Syntax /pricefx/<partition>/dcrmanager.delete/<dcr id>

Example:

/pricefx/test/ dcrmanager.delete/4

URL Parameters dcr id: The id of the change request to work on

Request Parameters data.typedId(mandatory): Id of the change request or the change request

item to be deleted

Remarks N/A

Sample Request {

"data":{

"typedId":"7.DCR"

}

}

Page 158: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 158

Sample Response {

"response":{

"status":0,

"data":[

{

"version":1,

"createDate":"2014-02-19T09:01:49",

"lastUpdateDate":"2014-02-19T09:01:49",

"uniqueName":"DCR-7",

"label":"Auto generated",

"approvalState":null,

"approvalDate":null,

"lastUpdateByName":"Pricemanager",

"createdByName":"Pricemanager",

"submittedByName":null,

"approvedByName":null,

"workflowStatus":null,

"dcrTypeName":"ManualPL_DE",

"userGroupEdit":null,

"userGroupViewDetails":null,

"configuration":null,

"typedId":"7.DCR"

}

]

}

}

3.21.2 Fetch

This command fetches the items for a change request. This commands has two modes: full and

changesOnly. Every change request is linked to a change request configuration that essentially

specifies the underlying “source” (i.e. the data to be modified). In full mode this command returns a

blended result set of unmodified original items and changes of this change request. I.e. for an empty

change request (=no items) the full mode would return the current underlying source data.

In changesOnly mode this command only returns actual changes (i.e. changed items and new items)

and omits source items that are not touched.

URL Syntax /pricefx/<partition>/dcrmanager.fetch/<dcr id>/<changesOnly>

Example:

/pricefx/test/ dcrmanager.fetch/8

/pricefx/test/ dcrmanager.fetch/8/changesOnly

URL Parameters Dcr id: Id of the change request whose items will be fetched

changesOnly (optional): If this flag is set, only real change are returned

Request Parameters See 3.2.1

Note: startRow and endRow are mandatory for this request!

Remarks The

Sample Request {

"operationType":"fetch",

Page 159: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 159

"startRow":0,

"endRow":75,

"textMatchStyle":"exact",

"data":{

},

"oldValues":null

}

Sample Response See default datasource fetch operation

3.21.3 Update

This command updates change request items.

URL Syntax /pricefx/<partition>/dcrmanager.update/<dcr id>

Example:

/pricefx/test/dcrmanager.update/8

URL Parameters Dcr id: Id of the change request that contains the item

Request Parameters See 3.2.2

Remarks N/A

Sample Request See 3.2.2

Sample Response See 3.2.2

3.21.4 Add

This command adds items to a change request.

URL Syntax /pricefx/<partition>/dcrmanager.add<dcr id>

Example:

/pricefx/test/dcrmanager.add/8

URL Parameters Dcr id: Id of the change request

Request Parameters See 3.2.3

Remarks N/A

Sample Request See 3.2.3

Sample Response See 3.2.3

Page 160: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 160

3.21.5 Submit

This command submits a change request into the workflow for approval. The approval workflow is

determined by the standard workflow formula mechanisms. If no approver is required the DCR is

applied to the source data immediately, otherwise it is applied upon full approval.

URL Syntax /pricefx/<partition>/dcrmanager.submit/<dcr id>

Example:

/pricefx/test/dcrmanager.submit/8

URL Parameters Dcr id: Id of the change request

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"version":2,

"createDate":"2014-02-18T07:33:07",

"lastUpdateDate":"2014-04-22T08:23:34",

"uniqueName":"DCR-5",

"label":"Neue Preisanfrage",

"approvalState":"NOT_APPROVED",

"approvalDate":null,

"lastUpdateByName":"Pricemanager",

"createdByName":"Pricemanager",

"submittedByName":"admin",

"approvedByName":null,

"workflowStatus":"SUBMITTED",

"dcrTypeName":"ManualPL_FR",

"userGroupEdit":null,

"userGroupViewDetails":null,

"configuration":null,

"typedId":"5.DCR"

}

]

}

}

3.22 Dashboards

3.22.1 Fetch

This command fetches dashboards available for a user

URL Syntax /pricefx/<partition>/dashboard.fetch

Example:

/pricefx/test/dashboard.fetch

URL Parameters None

Page 161: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 161

Request Parameters N/A

Remarks N/A

Sample Request empty body

Sample Response {

"response" : {

"totalRows" : 2,

"status" : 0,

"data" : [{

"version" : 5,

"uniqueName" : "NewParts",

"label" : "New parts dashboard",

"configuration" : <omitted for brevity>,

"userGroupEdit" : "ProductManagement",

"userGroupViewDetails" : "ProductManagement",

"typedId" : "6.DB"

}, {

"version" : 3,

"uniqueName" : "SimulationOverviewDashboard",

"label" : "Simulation Overview Dashboard",

"configuration" : <omitted for brevity>,

"userGroupEdit" : "ProductManagement",

"userGroupViewDetails" : "ProductManagement",

"typedId" : "10.DB"

}

]

}

}

3.22.2 Execute

This command executes a specific dashboard and retuns the content to display.

URL Syntax /pricefx/<partition>/dashboard.execute/<dashboardUniqueName>

Example:

/pricefx/test/ dashboard.execute/SimulationOverview

URL Parameters dashboardUniqueName (mandatory): The unique name of the dashboard

to execute

Request Parameters Additional input parameters specified by the user

Remarks N/A

3.22.3 AddPortlets

This command extends a specific dashboard by a number of additional portlets (a.k.a. dashlets), i.e.

automatically adds new elements into the dashboard’s formula.

URL Syntax /pricefx/<partition>/dashboard.addportlets/<dashboardUniqueName>

Example:

Page 162: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 162

/pricefx/test/dashboard.addportlets/SimulationOverview

URL Parameters dashboardUniqueName (mandatory): The unique name of the dashboard

to execute

Request Parameters data.replace(optional): boolean indicating whether to replace existing

formula’s element in case of matching portletUniqueName or generate

surrogate uniqueName. Defaults to false, i.e. don’t replace.

data.portlets(mandatory): An array of complex objects representing the

portlets to add. The structure of the complex object is as follows:

data.portlets[x].portletUniqueName(mandatory): uniqueName of the

portlet (i.e. the Element Name of the upcoming element in the dashboard’s

formula)

data.portlets[x].portletLabel(optional): label for the portlet (i.e. a label of

the upcoming formula’s element)

data.portlets[x].portletFormulaExpression(mandatory): a groovy

expression defining the portlet itself

Remarks N/A

Sample Request {

"data":{

"replace":false,

"portlets":[

{

"portletUniqueName":"TO_by_Country",

"portletLabel":"TO by Country",

"portletFormulaExpression":"api.newChartBuilder()\n\t.newPie()\n\t\t.g

etOptions()\n\t\t\t.setHideLegend(false)\n\t\t\t.back()\n\t\t.addSerie

s()\n\t\t\t.setLabel(\"Turnover by

Country\")\n\t\t\t.setHideDataLabels(false)\n\t\t\t.setDatamart(\"prod

.datamart_transaction\")\n\t\t\t.setCurrency(\"EUR\")\n\t\t\t.setCateg

ories(\"Country\")\n\t\t\t.setSize(\"TurnOver\")\n\t\t\t\t.withTotal()

\n\t\t\t\t.back()\n\t\t\t.withSortByCategories(SortType.ASCENDING)\n\t

\t\t.back()\n\t\t.build()\n"

}

]

}

}

3.23 Help Manager

3.23.1 Fetch

This command fetches partition specific help texts for a given token/page

URL Syntax /pricefx/<partition>/helpmanager.fetch/<pageName>

Example:

/pricefx/test/helpmanager.fetch/productsPage

URL Parameters pageName (mandatory): The page name to retrievel help for

Page 163: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 163

Request Parameters N/A

Remarks N/A

Sample Request empty body

Sample Response For an empty / non-existing specific help text:

{"response":{"status":0,"data":null}}

For a page with specific help text:

{"response":{"status":0,"data":["This is my partition specific help

text:<br><br>Lorem lipsum...<br>"]}}

3.23.2 Update

Updates help page texts.

URL Syntax /pricefx/<partition>/helpmanager.update/<pageName>

Example:

/pricefx/test/helpmanager.update/productsPage

URL Parameters pageName (mandatory): The page name to retrievel help for

Request Parameters The request basically contains the full HTML blob of the help text in a single

JSON string. The format is :

{"data":{"value":"This is my partition specific help text"}}

To remove a help text for a page token, set the value to null.

Remarks N/A

Sample Request {"data":{"value":"This is my partition specific help

text:<br><br>Lorem lipsum...<br>"}}

Sample Response {"response":{"status":0,"data":null}}

3.24 ToDo Item Manager

3.24.1 Fetch

This command fetches all todos assigned to the current user

URL Syntax /pricefx/<partition>/todomanager.fetch

Example:

/pricefx/test/todomanager.fetch

URL Parameters None

Page 164: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 164

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response" : {

"endRow" : 4,

"totalRows" : 4,

"status" : 0,

"startRow" : 0,

"data" : [{

"version" : 1,

"createdByName" : "admin",

"assignedTo" : 2761,

"assignedToName" : "Lisa",

"targetObject" : null,

"targetPage" : null,

"targetPageComponent" : null,

"targetPageState" : null,

"description" : "Re-Price Parts ",

"dueDate" : "2013-11-11",

"completedDate" : "2013-11-27",

"status" : "DONE",

"typedId" : "4.TODO"

},

… many more …

]

}

}

3.24.2 Update

This command updates a todo item. Only “own” todos in a valid state can be updated.

URL Syntax /pricefx/<partition>/todomanager.update

Example:

/pricefx/test/todomanager.update

URL Parameters None

Request Parameters The fields to update. See 3.2.2

Remarks N/A

Sample Request {

"dataSource":"isc_MyToDosDataSource_0",

"operationType":"update",

"data":{

"typedId":"3.TODO",

"status":"DONE"

},

"oldValues":null

}

Sample Response {

"response" : {

"status" : 0,

"data" : [{

"version" : 1,

Page 165: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 165

"createdByName" : "admin",

"assignedTo" : 2761,

"assignedToName" : "Lisa",

"targetObject" : null,

"targetPage" : null,

"targetPageComponent" : null,

"targetPageState" : null,

"description" : "Re-Price ",

"dueDate" : "2013-11-17",

"completedDate" : "2013-12-05",

"status" : "DONE",

"typedId" : "3.TODO"

}

]

}

}

3.25 System commands

3.25.1 Host Info

This command returns information about the actual backend node. Note: Only available in system

partition.

URL Syntax /pricefx/system/system$hostinfo

URL Parameters N/A

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"infoName":"host.name",

"infoValue":"fxnode1.pricefx.net"

},

{

"infoName":"host.ip",

"infoValue":"85.25.35.58"

},

{

"infoName":"Specification-Title",

"infoValue":"Price f(x) Backend Server"

},

{

"infoName":"Specification-Version",

"infoValue":"1.0.0-SNAPSHOT"

},

{

"infoName":"Archiver-Version",

"infoValue":"Plexus Archiver"

},

{

"infoName":"Build-ID",

"infoValue":"2011-04-29_09-16-16"

}

]

}

Page 166: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 166

}

3.25.2 View Log

This command returns the latest records from the system log.

URL Syntax /pricefx/system/system$viewlog

URL Parameters N/A

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"level":"DEBUG",

"timestamp":"2012-07-23 17:58:35,590",

"details":"No authorization required for command class ",

"threadName":"qtp330932989-62",

"userName":"system/root",

"requestURI":"/pricefx/system/system$viewlog",

"clientIP":"80.136.112.149",

"marker":null

},

( … many more …)

{

"level":"INFO",

"timestamp":"2012-07-23 17:58:35,589",

"details":"Request uri: /pricefx/system/system$viewlog",

"threadName":"qtp330932989-62",

"userName":"system/root",

"requestURI":"/pricefx/system/system$viewlog",

"clientIP":"80.136.112.149",

"marker":"HTTP"

}

]

}

}

3.25.3 Log Level

This command gets and sets the logging level of the system’s log.

URL Syntax /pricefx/system/system$loglevel

URL Parameters N/A

Request Parameters In case of a change to a log level:

"data":{

"name":<logger name>,

"value":<new log level>

Page 167: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 167

},

"oldValues":{

"name":<logger name>,

"value":<old log level>

}

In case of a fetch, the body is empty

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"endRow":547,

"totalRows":548,

"status":0,

"startRow":0,

"data":[

{

"name":"ROOT",

"value":"INFO"

},

{

"name":"/pricefx",

"value":"INFO"

},

{

"name":"com",

"value":"INFO"

},

{

"name":"net.pricefx",

"value":"INFO"

}

]

}

}

3.26 Workflow Manager

3.26.1 Approve

This command approves one step inside given workflow. Workflow is moved to next defined step

after successful approval.

URL Syntax /pricefx/<partition>/ workflowsmanager.approve /<action token>

Example:

/pricefx/test/ workflowsmanager.approve /DMv0FEIPsvEIQVB

URL Parameters Action Token: Token identifying approval step inside a workflow. Token is

unique across all workflows.

Page 168: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 168

Request Parameters data.actionComment: Contains comment for the approve action of the

current step identified by action token.

Remarks N/A

Sample Request {

"data":{

"actionComment": "I hereby approve."

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"workflow":{

"id":"78f69352-123d-4703-9265-121f107a9e6d",

"workflowStatus":"SUBMITTED",

"approvableTypedId":"15.Q",

"submitterTypedId":"6.U",

"steps":[

{

"executionStatus":"EXECUTED_APPROVED",

"id":"e000e7c4-831a-4441-a0d0-cd6c80302fe6",

"reason":"Too costly",

"userTypedId":"6.U",

"userName":"Martin Wricke",

"lastAccess":"2013-04-03T18:07:35",

"comment":"I hearby approve.",

"uniqueName":"fistApproval"

},

{

"executionStatus":"PREEXECUTED",

"id":"8b0182cd-d1ff-4924-ad68-b28f17eee212",

"reason":"Head approval",

"userTypedId":"53.U",

"userName":"dusan skopik",

"lastAccess":"2013-04-03T18:00:26",

"comment":null,

"uniqueName":"secondApproval"

},

{

"executionStatus":"INITIALIZED",

"id":"69be8276-d6cb-4234-b245-6ef681a0871b",

"reason":"Admin approval",

"userTypedId":"5.U",

"userName":"admin",

"lastAccess":"2013-04-03T18:00:26",

"comment":null,

"uniqueName":"thirdApproval"

}

],

"type":"quote",

"currentStepId":"8b0182cd-d1ff-4924-ad68-b28f17eee212"

},

"resultType":"WORKFLOW"

}

]

}

Page 169: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 169

}

3.26.2 Deny

This command denies one step inside given workflow. Workflow execution is stopped.

URL Syntax /pricefx/<partition>/ workflowsmanager.deny /<action token>

Example:

/pricefx/test/ workflowsmanager.deny/DMv0FEIPsvEIQVB

URL Parameters Action Token: Token identifying approval step inside a workflow. Token is

unique across all workflows.

Request Parameters data.actionComment: Contains comment for the deny action of the current

step identified by action token.

Remarks N/A

Sample Request {

"data":{

"actionComment": "I hereby deny."

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"workflow":{

"id":"33a991cf-22c1-4376-8a48-bb348a50de86",

"workflowStatus":"DENIED",

"approvableTypedId":"15.Q",

"submitterTypedId":"6.U",

"steps":[

{

"executionStatus":"EXECUTED_DENIED",

"id":"15102b98-7fb0-48a6-8962-69f15b50f616",

"reason":"Too costly",

"userTypedId":"6.U",

"userName":"Martin Wricke",

"lastAccess":"2013-04-03T19:18:43",

"comment":"Denied.",

"uniqueName":"fistApproval"

},

{

"executionStatus":"INITIALIZED",

"id":"9184e14c-538a-4c95-a704-841e234822fe",

"reason":"Head approval",

"userTypedId":"53.U",

"userName":"dusan skopik",

"lastAccess":"2013-04-03T18:56:37",

"comment":null,

"uniqueName":"secondApproval"

},

{

Page 170: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 170

"executionStatus":"INITIALIZED",

"id":"87e95d85-c7e4-428c-8804-bd0869d0b906",

"reason":"Admin approval",

"userTypedId":"5.U",

"userName":"admin",

"lastAccess":"2013-04-03T18:56:37",

"comment":null,

"uniqueName":"thirdApproval"

}

],

"type":"quote",

"currentStepId":null

},

"resultType":"WORKFLOW"

}

]

}

}

3.26.3 Withdraw

This command withdraws entire workflow. Workflow execution is stopped.

URL Syntax /pricefx/<partition>/ workflowsmanager.withdraw /<action token>

Example:

/pricefx/test/ workflowsmanager.withdraw/DMv0FEIPsvEIQVB

URL Parameters Action Token: Token identifying approval step inside a workflow. Token is

unique across all workflows.

Request Parameters data.actionComment: Contains comment for the withdraw action of the

current step identified by action token.

Remarks N/A

Sample Request {

"data":{

"actionComment": "I hereby withdraw."

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"workflow":{

"id":"901b1bec-6e7f-45dc-a53b-cd5939eef4d7",

"workflowStatus":"WITHDRAWN",

"approvableTypedId":"15.Q",

"submitterTypedId":"6.U",

"steps":[

Page 171: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 171

{

"executionStatus":"EXECUTED_APPROVED",

"id":"245ba22d-311a-4c21-81f6-94d61993cba4",

"reason":"Too costly",

"userTypedId":"6.U",

"userName":"Martin Wricke",

"lastAccess":"2013-04-03T19:50:04",

"comment":"Approve comment text",

"uniqueName":"fistApproval"

},

{

"executionStatus":"EXECUTED_WITHDRAWN",

"id":"89bd8e09-de19-4dd3-884c-849b3aa9fdfa",

"reason":"Head approval",

"userTypedId":"53.U",

"userName":"dusan skopik",

"lastAccess":"2013-04-03T19:50:30",

"comment":"I hereby withdraw.",

"uniqueName":"secondApproval"

},

{

"executionStatus":"INITIALIZED",

"id":"30f43884-9701-48f4-93fb-48e357780ecc",

"reason":"Admin approval",

"userTypedId":"5.U",

"userName":"admin",

"lastAccess":"2013-04-03T19:49:34",

"comment":null,

"uniqueName":"thirdApproval"

}

],

"type":"quote",

"currentStepId":null

},

"resultType":"WORKFLOW"

}

]

}

}

3.26.4 Fetch

This command fetches workflow definitions available to the logged in user from the backend. A

special command is used instead the generic one, as this command filters workflows on per user

basis.

URL Syntax /pricefx/<partition>/ workflowsmanager.fetch /

Example:

/pricefx/test/ workflowsmanager.fetch

URL Parameters N/A

Request Parameters See 3.2.1

Remarks N/A

Sample Request See 3.2.1

Page 172: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 172

Sample Response {

"response":{

"endRow":48,

"totalRows":48,

"status":0,

"startRow":0,

"data":[

{

"version":3,

"uniqueName":"P-13-1",

"label":"P-13 (New Quote) jjj",

"approvableTypedId":"13.Q",

"approvableUniqueName":"P-13",

"workflowStatus":"SUBMITTED",

"typedId":"1.W"

},

{

"version":3,

"uniqueName":"P-17-2",

"label":"P-17 (New Quote)",

"approvableTypedId":"17.Q",

"approvableUniqueName":"P-17",

"workflowStatus":"WITHDRAWN",

"typedId":"2.W"

},

{

"version":2,

"uniqueName":"P-17-3",

"label":"P-17 (New Quote)",

"approvableTypedId":"17.Q",

"approvableUniqueName":"P-17",

"workflowStatus":"SUBMITTED",

"typedId":"3.W"

},

{

"version":2,

"uniqueName":"P-18-4",

"label":"P-18 (D)",

"approvableTypedId":"18.Q",

"approvableUniqueName":"P-18",

"workflowStatus":"SUBMITTED",

"typedId":"4.W"

},

{

"version":6,

"uniqueName":"P-22-8",

"label":"P-22 (DDD)",

"approvableTypedId":"22.Q",

"approvableUniqueName":"P-22",

"workflowStatus":"SUBMITTED",

"typedId":"8.W"

},

{

"version":2,

"uniqueName":"P-23-9",

"label":"P-23 (New Quote)",

"approvableTypedId":"23.Q",

"approvableUniqueName":"P-23",

"workflowStatus":"SUBMITTED",

"typedId":"9.W"

},

{

"version":2,

"uniqueName":"P-24-10",

"label":"P-24 (New Quote)",

"approvableTypedId":"24.Q",

"approvableUniqueName":"P-24",

"workflowStatus":"SUBMITTED",

Page 173: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 173

"typedId":"10.W"

},

{

"version":2,

"uniqueName":"P-25-11",

"label":"P-25 (New Quote)",

"approvableTypedId":"25.Q",

"approvableUniqueName":"P-25",

"workflowStatus":"SUBMITTED",

"typedId":"11.W"

},

{

"version":2,

"uniqueName":"P-26-12",

"label":"P-26 (New Quote)",

"approvableTypedId":"26.Q",

"approvableUniqueName":"P-26",

"workflowStatus":"SUBMITTED",

"typedId":"12.W"

},

{

"version":2,

"uniqueName":"P-27-13",

"label":"P-27 (New Quote)",

"approvableTypedId":"27.Q",

"approvableUniqueName":"P-27",

"workflowStatus":"SUBMITTED",

"typedId":"13.W"

},

{

"version":2,

"uniqueName":"P-28-14",

"label":"P-28 (New Quote)",

"approvableTypedId":"28.Q",

"approvableUniqueName":"P-28",

"workflowStatus":"SUBMITTED",

"typedId":"14.W"

},

{

"version":2,

"uniqueName":"P-29-15",

"label":"P-29 (New Quote)",

"approvableTypedId":"29.Q",

"approvableUniqueName":"P-29",

"workflowStatus":"SUBMITTED",

"typedId":"15.W"

}

]

}

}

3.26.5 Fetch Details

This command fetches details of given workflow.

URL Syntax /pricefx/<partition>/ workflowsmanager.fetchdetails /<workflow typed id>

Example:

/pricefx/test/ workflowsmanager.fetchdetails/1.W

URL Parameters Workflow TypedId: Typed-Id identifying workflow.

Page 174: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 174

Request Parameters N/A

Remarks N/A

Sample Request Empty Request.

Sample Response {

"response":{

"status":0,

"data":[

{

"workflow":{

"id":"29ee9e0c-f579-40b0-bcd9-d3f6804b1004",

"workflowStatus":"SUBMITTED",

"approvableTypedId":"13.Q",

"submitterTypedId":"6.U",

"steps":[

{

"executionStatus":"PREEXECUTED",

"id":"eae64b7e-a9ac-4fc3-b51c-6a0678bce4ed",

"reason":"Too costly",

"userTypedId":"6.U",

"userName":"Martin Wricke",

"lastAccess":"2013-02-20T11:37:52",

"comment":null,

"uniqueName":"fistApproval"

},

{

"executionStatus":"INITIALIZED",

"id":"766a63a4-ea95-466a-b808-9ec1f5acbea2",

"reason":"Head approval",

"userTypedId":"7.U",

"userName":"Sales",

"lastAccess":"2013-02-20T11:37:52",

"comment":null,

"uniqueName":"secondApproval"

},

{

"executionStatus":"INITIALIZED",

"id":"88eb7d09-9cd0-47ff-a95f-71d2c394d5a6",

"reason":"Admin approval",

"userTypedId":"5.U",

"userName":"admin",

"lastAccess":"2013-02-20T11:37:52",

"comment":null,

"uniqueName":"thirdApproval"

}

],

"type":"quote",

"currentStepId":"eae64b7e-a9ac-4fc3-b51c-6a0678bce4ed"

},

"resultType":"WORKFLOW"

}

]

}

}

3.26.6 Fetch Details Via Approvable

This command fetches details of active workflow that belongs to given approvable. “Approvable” in

this context means “business object” that is being processed in workflow engine. For instance a

quote.

Page 175: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 175

URL Syntax /pricefx/<partition>/

workflowsmanager.fetchdetailsviaapprovable/<approvable typed id>

Example:

/pricefx/test/ workflowsmanager. fetchdetailsviaapprovable /1.Q

URL Parameters Approvable TypedId: Typed-Id identifying the business object being

processed in workflow engine.

Request Parameters N/A

Remarks N/A

Sample Request Empty Request.

Sample Response {

"response":{

"status":0,

"data":[

{

"workflow":{

"id":"29ee9e0c-f579-40b0-bcd9-d3f6804b1004",

"workflowStatus":"SUBMITTED",

"approvableTypedId":"13.Q",

"submitterTypedId":"6.U",

"steps":[

{

"executionStatus":"PREEXECUTED",

"id":"eae64b7e-a9ac-4fc3-b51c-6a0678bce4ed",

"reason":"Too costly",

"userTypedId":"6.U",

"userName":"Martin Wricke",

"lastAccess":"2013-02-20T11:37:52",

"comment":null,

"uniqueName":"fistApproval"

},

{

"executionStatus":"INITIALIZED",

"id":"766a63a4-ea95-466a-b808-9ec1f5acbea2",

"reason":"Head approval",

"userTypedId":"7.U",

"userName":"Sales",

"lastAccess":"2013-02-20T11:37:52",

"comment":null,

"uniqueName":"secondApproval"

},

{

"executionStatus":"INITIALIZED",

"id":"88eb7d09-9cd0-47ff-a95f-71d2c394d5a6",

"reason":"Admin approval",

"userTypedId":"5.U",

"userName":"admin",

"lastAccess":"2013-02-20T11:37:52",

"comment":null,

"uniqueName":"thirdApproval"

}

],

"type":"quote",

"currentStepId":"eae64b7e-a9ac-4fc3-b51c-6a0678bce4ed"

},

"resultType":"WORKFLOW"

}

]

Page 176: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 176

}

}

3.27 Workflow Builder Manager

3.27.1 Check

This command performs a syntax check for the provided workflow formula fragment.

URL Syntax /pricefx/<partition>/ workflowbuildermanager.check

URL Parameters N/A

Request Parameters data.formulaExpression (mandatory): The expression string of the

fragment.

Remarks In case of invalid syntax a syntax check result message with HTTP 200 and

status 100 is sent back. In case of valid syntax an empty response is

returned.

Sample Request {

"data":{

"formulaExpression": "workflow.addApprovalStep(\"fistApproval\").withApprover(\"Pricemanage

r\").setReason(\"Too

costly\")\nworkflow.addApprovalStep(\"secondApproval\").withApprover(\

"dusantest\").setReason(\"Head

approval\")\nworkflow.addApprovalStep(\"thirdApproval\").withApprover(

\"admin\").setReason(\"Admin approval\")" }

}

Sample Response Success:

{"response":{"status":0,"data":null}}

Failure:

{

"response":{

"status":100,

"data":[

{

"message":"ERROR(@11): Undefinierte Variable A",

"startPosition":11,

"endPosition":12

}

]

}

}

3.27.2 Copy

This command creates a copy of the specified workflow formula. The validAfter value is set to today,

all other values and sub-elements are exact copies.

Page 177: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 177

URL Syntax /pricefx/<partition>/ workflowbuildermanager.copy/<workflow formula id>

Example:

/pricefx/test/ workflowbuildermanager.copy/4

URL Parameters Worfklow Formula id (mandatory): Id of workflow formula to copy (source

object)

Request Parameters N/A

Remarks Response contains details of the copied object (destination object)

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"validAfter":"2011-05-03",

"label":null,

"uniqueName":" quote ", "version":0,

"typedId":"5.WF"

}

]

}

}

3.27.3 Delete

This command deletes a workflow formula and all related sub-elements

URL Syntax /pricefx/<partition>/ workflowbuildermanager.delete/<workflow formula

id>

Example:

/pricefx/test/ workflowbuildermanager.delete/4

URL Parameters Formula id (mandatory): Id of workflow formula to delete

Request Parameters N/A

Remarks Response contains details of the deleted object

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"version":0,

"uniqueName":"quote",

"label":"test",

Page 178: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 178

"validAfter":"2013-04-03",

"status":"INACTIVE",

"simulationSet":"",

"userGroupEdit":null,

"userGroupViewDetails":null,

"formulaType":"WORKFLOW",

"typedId":"4.WF"

}

]

}

}

3.27.4 Fetch

This command retrieves a specific workflow formula from the backend. A special command is used

instead the generic one, as this command also returns the full data of the contained sub-elements.

URL Syntax /pricefx/<partition>/ workflowbuildermanager.fetch/<workflow formula

id>

Example:

/pricefx/test/ workflowbuildermanager.fetch/4

URL Parameters Workflow Formula id: Id of workflow formula to retrieve

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"version":7,

"uniqueName":"quote",

"label":"test",

"validAfter":"2013-02-01",

"status":"ACTIVE",

"simulationSet":"",

"elements":[

{

"version":4,

"formulaExpression":"workflow.addApprovalStep(\"fist

Approval\").withApprover(\"Pricemanager\").setReason(\"Too costly\")\n

workflow.addApprovalStep(\"secondApproval\").withApprover(\"dusantest\

").setReason(\"Head approval\")\nworkflow.addApprovalStep(\"thirdAppro

val\").withApprover(\"admin\").setReason(\"Admin approval\")\n

\n",

"elementName":"d",

"elementLabel":"d",

"elementDescription":null,

"hideWarnings":false,

"combinationType":"FUNCTION",

"compiledExpression":null,

"compiledClass":null,

"typedId":"8.WFE"

}

],

"userGroupEdit":null,

Page 179: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 179

"userGroupViewDetails":null,

"formulaType":"WORKFLOW",

"typedId":"3.WF"

}

]

}

}

3.27.5 Test Execute

This command executes a draft workflow formula for a given approvable and calculates the result.

This command is used to test a workflow formula during editing. Approvable in this context means

any business object that is eligible for workflow processing. For instance Quote.

URL Syntax /pricefx/<partition>/ workflowbuildermanager.testexec

URL Parameters N/A

Request Parameters data.targetDate (optional): Specifies the validity date of all objects used

(e.g formula, lookups, etc)

data.approvable (mandatory): TypedId of the business object eligible for

workflow processing.

data.testFormula (mandatory): JSON that represents the whole draft

workflow formula (same format as used for update command).

data.<formula parameter name> (optional): Formulas can have a number

of parameters that are user selectable. Every parameter in the data

structure that is not a named parameter from above is passed on into the

formula engine for evaluation

Remarks The response is a debug-style representation of the workflow formula

result. I.e. it contains a full trace of all elements and does not only contain

the elements that are marked as visible like in the normal execute

command.

Sample Request {

"data":{

"testFormula":{

"version":7,

"uniqueName":"quote",

"label":"test",

"validAfter":"2013-02-01",

"status":"ACTIVE",

"simulationSet":"",

"elements":[

{

"combinationType":"FUNCTION",

"elementName":"d",

"elementLabel":"d",

"elementDescription":null,

"displayType":null,

"formatType":null,

"elementSuffix":null,

"formulaExpression":"workflow.addApprovalStep(\"fistApp

roval\").withApprover(\"Pricemanager\").setReason(\"Too costly\")\nwor

kflow.addApprovalStep(\"secondApproval\").withApprover(\"dusantest\").

Page 180: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 180

setReason(\"Head approval\")\nworkflow.addApprovalStep(\"thirdApproval

\").withApprover(\"admin\").setReason(\"Admin approval\")\n

\n",

"typedId":"8.WFE",

"version":4,

"redAlert":null,

"yellowAlert":null,

"hideWarnings":false,

"allowOverride":false,

"summarize":false,

"hideOnNull":false,

"userGroup":null,

"cssProperties":null

}

],

"userGroupEdit":null,

"userGroupViewDetails":null,

"formulaType":"WORKFLOW",

"typedId":"3.WF"

},

"targetDate":"2013-04-03",

"approvable":"1.Q"

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"elementName":"d",

"elementLabel":"d",

"alertMessage":null,

"warnings":null,

"alertType":null,

"displayType":null,

"formatType":null,

"suffix":null,

"overridden":false,

"overridable":false,

"cssProperties":null,

"summarize":false,

"hideOnNull":false,

"userGroup":null,

"displayedInPriceshop":false,

"internal":false,

"integration":false,

"resultType":"SIMPLE",

"traceMessages":null,

"elementResult":"net.pricefx.server.dto.WorkflowDTO$Approv

alStepDTO@4346f8e9"

},

{

"elementName":"workflow",

"elementLabel":"workflow",

"alertMessage":null,

"warnings":null,

"alertType":null,

"displayType":"INTERNAL",

"formatType":null,

"suffix":null,

"overridden":false,

"overridable":false,

"cssProperties":null,

"summarize":false,

"hideOnNull":false,

"userGroup":null,

"displayedInPriceshop":false,

Page 181: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 181

"internal":true,

"integration":false,

"resultType":"WORKFLOW",

"traceMessages":null,

"elementResult":{

"workflow":{

"id":"f84d394d-9eb0-4e43-a5e9-59d4b67a937c",

"workflowStatus":"DRAFT",

"approvableTypedId":"1.Q",

"submitterTypedId":null,

"steps":[

{

"executionStatus":"INITIALIZED",

"id":"5ebd472f-4be9-462f-8b9a-c7524e498ba8",

"reason":"Too costly",

"userTypedId":"6.U",

"userName":"Martin Wricke",

"lastAccess":"2013-04-03T22:04:08",

"comment":null,

"uniqueName":"fistApproval"

},

{

"executionStatus":"INITIALIZED",

"id":"5697e509-0bd2-4b77-ace0-55a76f1aab7a",

"reason":"Head approval",

"userTypedId":"53.U",

"userName":"dusan skopik",

"lastAccess":"2013-04-03T22:04:08",

"comment":null,

"uniqueName":"secondApproval"

},

{

"executionStatus":"INITIALIZED",

"id":"239ae2da-c56d-4e1b-b6ab-3b958532095b",

"reason":"Admin approval",

"userTypedId":"5.U",

"userName":"admin",

"lastAccess":"2013-04-03T22:04:08",

"comment":null,

"uniqueName":"thirdApproval"

}

],

"type":"quote",

"currentStepId":"5ebd472f-4be9-462f-8b9a-

c7524e498ba8"

},

"resultType":"WORKFLOW"

}

}

]

}

}

3.27.6 Update

This command updates the given workflow formula and the contained sub-elements.

URL Syntax /pricefx/<partition>/ workflowbuildermanager.update/<workflow formula

id>

Example:

/pricefx/test/ workflowbuildermanager.update/4

Page 182: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 182

URL Parameters Workflow Formula id (mandatory): Id of workflow formula to update

Request Parameters data: Contains all necessary fields of the formula object. Especially the

elements field that contains a collection of all sub-elements and alert sub-

objects.

Remarks N/A

Sample Request {

"data":{

"version":7,

"uniqueName":"quote",

"label":"test",

"validAfter":"2013-02-01",

"status":"ACTIVE",

"simulationSet":"",

"elements":[

{

"combinationType":"FUNCTION",

"elementName":"d",

"elementLabel":"d",

"elementDescription":null,

"displayType":null,

"formatType":null,

"elementSuffix":null,

"formulaExpression":"workflow.addApprovalStep(\"fistApprov

al\").withApprover(\"Pricemanager\").setReason(\"Too costly\")\nworkfl

ow.addApprovalStep(\"secondApproval\").withApprover(\"dusantest\").set

Reason(\"Head approval\")\nworkflow.addApprovalStep(\"thirdApproval\")

.withApprover(\"admin\").setReason(\"Admin approval\")\n

\n",

"typedId":"8.WFE",

"version":4,

"redAlert":null,

"yellowAlert":null,

"hideWarnings":false,

"allowOverride":false,

"summarize":false,

"hideOnNull":false,

"userGroup":null,

"cssProperties":null

}

],

"userGroupEdit":null,

"userGroupViewDetails":null,

"formulaType":"WORKFLOW",

"typedId":"3.WF"

}

}

Sample Response {

"response":{

"status":0,

"data":[

{

"version":8,

"uniqueName":"quote",

"label":"test",

"validAfter":"2013-02-01",

"status":"ACTIVE",

"simulationSet":"",

"userGroupEdit":null,

"userGroupViewDetails":null,

"formulaType":"WORKFLOW",

"typedId":"3.WF"

}

Page 183: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 183

]

}

}

3.28 I18N manager

The i18n manager service provides management and access to custom UI labels. I.e. the entire web-

client is localizable. Default strings are provided but can be overridden or changed by partition if

desired.

3.28.1 Fetch

This command fetches the current full set of labels for the web-client. The response contains a large

list of name-value pairs that are effectively the labels and their id tokens. The command merges the

default labels for the requested language with partition-specific overrides for the labels (by token).

URL Syntax /pricefx/<partition>/ i18nmanager.fetch

Example:

/pricefx/test/ i18nmanager.fetch

URL Parameters N/A

Request Parameters N/A

Remarks The language that is returned is determined by the standard server request

locale determination in this order:

Explicit setting in request Browser language System default

A specific locale can be forced by the URL parameter “dataLocale”. E.g:

dataLocale=en

Sample Request Empty body

Sample Response {

"response":{

"status":0,

"data":[

{

"localeLanguage":"en",

"keyValuesMap":{

"common_copyPrefix":"Copy_Of",

"common_fieldInvalid":"Field invalid :",

"common_noWhitespace":"Whitespaces not allowed",

"common_notEmpty":"Cannot be empty",

"common_noDupes":"No duplicates",

"common_reservedWord":"Reserved word ",

"common_stringType":"String",

"common_realType":"Real",

…. Many more …..

}

}

]

}

}

Page 184: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 184

3.28.2 Save

This command saves label overrides

URL Syntax /pricefx/<partition>/ i18nmanager.save

Example:

/pricefx/test/ i18nmanager.save

URL Parameters N/A

Request Parameters N/A

Remarks The language that is returned is determined by the standard server request

locale determination in this order:

Explicit setting in request Browser language System default

A specific locale can be forced by the URL parameter “dataLocale”. E.g:

dataLocale=en

The request contains an array of arrays. The inner array basically contains

the token and the label override value.

Sample Request {

"data":{

"messages":{

"messages":[

[

"common_copyPrefix",

"Copy__OF"

]

],

"partitionWideOverride":true

}

}

}

Sample Response {"response":{"status":0,"data":null}}

3.29 Contract Manager

3.29.1 Add Items

This command extends a discount by a number of additional discount types (i.e. object types which

link a formula and specific parameters’ values and so define a unique type of calculation). In the

backend the discount types are added and the discount is recalculated.

URL Syntax /pricefx/<partition>/contractmanager.additems/

Examples:

Page 185: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 185

/pricefx/test/contractmanager.additems

URL Parameters N/A

Request Parameters contract (mandatory): A complex data structure that describes the current

content of the contract. The command will return the updated structure of

that contract in the same format in the data block.

contractTypes (mandatory): A JSON array of Strings of the names of the

contract types to add. If types aren’t found they will be ignored.

parent (optional): A node id of the part tree within the contract object. The

contract types will be added in the specified subfolder

Remarks N/A

Sample Request {"data":{

"contract":{

"lineItems":[

],

"inputs":[

{

"name":"CustomerGroup",

"label":"Customer(s)",

"lookupTableId":null,

"url":null,

"type":"CUSTOMERGROUP",

"value":null,

"valueHint":null,

"valueOptions":null,

"filter":null,

"parameterGroup":null,

"parameterConfig":{

}

},

{

"name":"ProductGroup",

"label":"Product(s)",

"lookupTableId":null,

"url":null,

"type":"PRODUCTGROUP",

"value":null,

"valueHint":null,

"valueOptions":null,

"filter":null,

"parameterGroup":null,

"parameterConfig":{

}

}

],

"outputs":[

],

"label":"New Contract",

"startDate":"2014-10-09",

"endDate":"2014-10-10",

"targetDate":"2014-10-09",

"dirty":true,

"nodeId":0

},

"parent":"ROOT",

"contractTypes":[

"dt1"

]

}}

Sample Response {

"response": {

"status": 0,

"data": [

{

"version": null,

Page 186: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 186

"createDate": "2014-10-09T18:01:36",

"lastUpdateDate": "2014-10-09T18:01:36",

"uniqueName": null,

"label": "New Contract",

"lineItems": [

{

"version": null,

"createDate": "2014-10-09T18:01:36",

"lastUpdateDate": "2014-10-09T18:01:36",

"inputs": [],

"outputs": [

{

"resultName": "el",

"resultLabel": "el",

"result": 20,

"warnings": null,

"alertMessage": null,

"alertType": null,

"displayOptions": 16,

"formatType": null,

"suffix": null,

"resultType": "SIMPLE",

"cssProperties": null,

"userGroup": null,

"overridable": false,

"overridden": false

}

],

"dirty": false,

"lineId": "cC4eKU92fyVdmOW",

"parentId": null,

"calculationStatus": 0,

"label": "gerg",

"startDate": null,

"endDate": null,

"customerGroup": null,

"productGroup": null,

"folder": false,

"treeLabel": "gerg",

"typedId": "null.DLI",

"contractType": "dt1"

}

],

"targetDate": "2014-10-09",

"workflowStatus": null,

"headerText": null,

"inputs": [

{

"name": "CustomerGroup",

"label": "Customer(s)",

"lookupTableId": null,

"url": null,

"type": "CUSTOMERGROUP",

"value": null,

"valueHint": null,

"valueOptions": null,

"filter": null,

"parameterGroup": null,

"parameterConfig": {}

},

{

"name": "ProductGroup",

"label": "Product(s)",

"lookupTableId": null,

"url": null,

"type": "PRODUCTGROUP",

"value": null,

"valueHint": null,

"valueOptions": null,

"filter": null,

"parameterGroup": null,

"parameterConfig": {}

}

],

"viewState": null,

"outputs": [],

"lastUpdateByName": null,

"createdByName": null,

Page 187: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 187

"submittedByName": null,

"approvedByName": null,

"calculationStatus": 0,

"dirty": false,

"refreshInputs": false,

"nodeId": 0,

"userGroupEdit": null,

"userGroupViewDetails": null,

"serverMessages": [

"Contracts calculated successfully"

],

"additionalInfo1": null,

"additionalInfo2": null,

"additionalInfo3": null,

"additionalInfo4": null,

"customerGroup": null,

"productGroup": null,

"externalRef": null,

"contractStatus": "DRAFT",

"startDate": "2014-10-09",

"endDate": "2014-10-10",

"hasWorkflowHistory": false,

"typedId": "null.D"

}

]

}

}

3.29.2 Copy

Copy an existing contract and put the copy into draft status. Returns the header info of the copy.

URL Syntax /pricefx/<partition>/contractmanager.copy/<contract uniqueName>

Examples:

/pricefx/test/contractmanager.copy/C-26

URL Parameters Contract UniqueName (mandatory): The uniqueName of the contract to

copy

Request Parameters N/A

Remarks

Sample Request Empty request body

Sample Response {

"response": {

"status": 0,

"data": [

{

"version": 3,

"createDate": "2014-10-09T18:08:36",

"lastUpdateDate": "2014-10-09T18:08:36",

"uniqueName": "D-2",

"label": "New Contract",

"targetDate": "2014-10-09",

"workflowStatus": "DRAFT",

"inputs": [

{

"name": "CustomerGroup",

"label": "Customer(s)",

"lookupTableId": null,

"url": null,

Page 188: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 188

"type": "CUSTOMERGROUP",

"value": null,

"valueHint": null,

"valueOptions": null,

"filter": null,

"parameterGroup": null,

"parameterConfig": {}

},

{

"name": "ProductGroup",

"label": "Product(s)",

"lookupTableId": null,

"url": null,

"type": "PRODUCTGROUP",

"value": null,

"valueHint": null,

"valueOptions": null,

"filter": null,

"parameterGroup": null,

"parameterConfig": {}

}

],

"outputs": [],

"lastUpdateByName": "admin",

"createdByName": "admin",

"submittedByName": null,

"approvedByName": null,

"calculationStatus": 0,

"dirty": true,

"refreshInputs": true,

"nodeId": 0,

"userGroupEdit": null,

"userGroupViewDetails": null,

"serverMessages": null,

"additionalInfo1": null,

"additionalInfo2": null,

"additionalInfo3": null,

"additionalInfo4": null,

"customerGroup": null,

"productGroup": null,

"externalRef": null,

"contractStatus": "DRAFT",

"startDate": "2014-10-09",

"endDate": "2014-10-10",

"typedId": "2.D"

}

]

}

}

3.29.3 Fetch

Fetches the details of the specified contract.

URL Syntax /pricefx/<partition>/contractmanager.fetch/<contract uniqueName>

Examples:

/pricefx/test/contractmanager.fetch/C-26

URL Parameters Contract UniqueName (mandatory): The uniqueName of the contract to

fetch

Page 189: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 189

Request Parameters N/A

Remarks

Sample Request Empty request body

Sample Response See response of additems command

3.29.4 FetchXls

This command returns the specified contract in Excel format. It uses an existing partition-defined

Excel template (or an empty Excel sheet if no template is defined) and just adds the contract data.

URL Syntax /pricefx/<partition>/contractmanager.fetchxls/

Examples:

/pricefx/test/contractmanager.fetchxls/C-26

URL Parameters Contract UniqueName (mandatory): The uniqueName of the contract to

fetch

Request Parameters N/A

Remarks

Sample Request Empty request body

Sample Response The binary Excel file

3.29.5 Preview

Returns the to-be workflow based on the current contract.

URL Syntax /pricefx/<partition>/contractmanager.preview/

Examples:

/pricefx/test/contractmanager.preview

URL Parameters N/A

Request Parameters contract (mandatory): A complex data structure that describes the current

content of the contract.

Remarks The workflow displayed is just a temporary snapshot. The effective

workflow will be generated as part of the submit command

Sample Request See request of additems command

Sample Response {

"response":{

"status":0,

Page 190: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 190

"data":[

{

"workflow":{

"id":"c04af1ef-4122-4733-b2cf-d7e8ae2b3110",

"workflowStatus":"DRAFT",

"approvableTypedId":"null.C",

"submitterTypedId":null,

"steps":[

{

"executionStatus":"INITIALIZED",

"id":"1cdf0e4a-456f-41eb-9fba-d2eb6be83b1b",

"reason":"Too costly",

"userTypedId":"6.U",

"userName":"Martin Wricke",

"lastAccess":"2013-04-03T22:26:40",

"comment":null,

"uniqueName":"fistApproval"

},

{

"executionStatus":"INITIALIZED",

"id":"e2f63ad8-2529-409f-a435-25239c0a206e",

"reason":"Head approval",

"userTypedId":"53.U",

"userName":"Dusan Skopik",

"lastAccess":"2013-04-03T22:26:40",

"comment":null,

"uniqueName":"secondApproval"

},

{

"executionStatus":"INITIALIZED",

"id":"60a2690b-8c91-45fb-8f53-bb4427b05e18",

"reason":"Admin approval",

"userTypedId":"5.U",

"userName":"admin",

"lastAccess":"2013-04-03T22:26:40",

"comment":null,

"uniqueName":"thirdApproval"

}

],

"type":"contract",

"currentStepId":"1cdf0e4a-456f-41eb-9fba-d2eb6be83b1b"

},

"resultType":"WORKFLOW"

}

]

}

}

3.29.6 Calculate

Recalculate the entire contract. This is a on-the-fly recalculation. No data is persisted.

URL Syntax /pricefx/<partition>/contractmanager.calculate/

Examples:

/pricefx/test/contractmanager.calculate

URL Parameters N/A

Request Parameters contract (mandatory): A complex data structure that describes the current

content of the contract. The command will return the updated structure of

Page 191: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 191

that contract in the same format in the data block.

Remarks

Sample Request See request of additems command

Sample Response See response of additems command

3.29.7 Save

Saves (create or update) the contract to the database. If it is a new contract a new uniqueName will

be assigned.

URL Syntax /pricefx/<partition>/contractmanager.save/

Examples:

/pricefx/test/contractmanager.save

URL Parameters N/A

Request Parameters contract (mandatory): A complex data structure that describes the current

content of the contract. The command will return the updated structure of

that contract in the same format in the data block.

Remarks

Sample Request See request of additems command

Sample Response See response of additems command

3.29.8 Submit

Submit the contract into the workflow process. The contract will be recalculated and saved. A

workflow will be calculated based on the latest contract configuration and the workflow process is

started.

URL Syntax /pricefx/<partition>/contractmanager.submit/

Examples:

/pricefx/test/contractmanager.submit

URL Parameters N/A

Request Parameters Contract (mandatory): A complex data structure that describes the current

contract of the quote. The command will return the updated structure of

that contract in the same format in the data block.

Remarks

Page 192: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 192

Sample Request See request of additems command

Sample Response See response of additems command

3.30 Other commands

3.30.1 Direct Action

This command is linked internally to a specific action and once the URL is called this action is

executed. The URL contains a secret one-time token to execute the action. The URL is typically

system generated. This is the only command that can be executed without authentication!

URL Syntax /pricefx/<partition>/directaction/<action key>/<action token>

Example:

/pricefx/test/directaction/deny/JMv0FEIPsvEIQVB

URL Parameters Action Key: A human readable description of the action

Action Token: The one-time token

Request Parameters N/A

Remarks N/A

Sample Request Empty body

Sample Response A HTML page that displays confirmation of the action

4 Outbound events The Price f(x) backend server is primarily request driven. That means it acts upon a received request.

But for some longer running operations or based on certain user activity an external system may

have to be notified – without constant polling.

For this purpose the server may be configured (by partition) to send so-called “events” or “event

notifications” to an external system. The event transport can be either by a specified http(s) URI with

a JSON payload (POST data) and/or an email address which receives the same payload as plain text

email.

4.1 Types of events

The system generates events for various things. This is the list of all current event types:

CALCULATION_COMPLETED_PL, // 1

CALCULATION_COMPLETED_SIM, // 2

CALCULATION_COMPLETED_CFS, // 4

CALCULATION_COMPLETED_PG, // 8

Page 193: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 193

CALCULATION_COMPLETED_RC, // 16

ITEM_APPROVED_CT, // 32

ITEM_APPROVED_PGI, // 64

ITEM_APPROVED_PL, // 128

ITEM_APPROVED_Q, // 256

ITEM_APPROVED_RR, // 512

ITEM_APPROVED_DCR, // 1024

ITEM_UPDATE_RR, // 2048

ITEM_UPDATE_PR, // 4096

ITEM_UPDATE_PGI, // 8192

ITEM_UPDATE_MPLI, // 16384

CHANGE_NOTIFICATION_CA, // 32768

CHANGE_NOTIFICATION_MPL, // 65536

WORKFLOW_MESSAGE, // 131072

READ_ONLY_MODE_TOGGLED // 262144

The numbers at the right specify the numeric value of the event type, although external systems

always see the textual representation.

Valid operations (null value is also valid):

UPDATE

DELETE

ADD

ITEMCHANGE

4.2 Event message

The payload of an event consists of a JSON message/object with this general format:

{

"eventType" : "CHANGE_NOTIFICATION_MPL",

"operation" : "ITEMCHANGE",

"data" : [{

"version" : 11,

"uniqueName" : "0815",

"label" : "A label",

"validAfter" : "2014-01-01",

"status" : "ACTIVE",

"nodeId" : 27,

"userGroupEdit" : "Preiscontrolling",

"userGroupViewDetails" : null,

"linkedCFStypedId" : "270.CFS",

"typedId" : "239.MPL",

"createDate" : "2014-11-20T09:02:55",

"lastUpdateDate" : "2015-03-04T15:32:16"

}

]

}

The payload contains the event type, the operation (if applicable) and a data object. The data object

is context sensitive and contains information about the object/task that triggered the event.

In case of background job related events (like “calculation complete”), there is also a field “trackerId”

part of the event message. This field contains an id that was assigned when the job was created. If

the external system initaiated that task (and stored the trackerId), it can associate the completion

event with the original request.

Page 194: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 194

5 Field reference for major objects

5.1 Abstract field sets

5.1.1 General Fields

These fields are part in every object.

typedId A unique identifier. Assigned by price f(x).

String

version A number representing the version of the record. Used to track and prevent

concurrent updates. Version field needs to be sent as part of an update

request

5.1.2 Named object fields

Named objects contain all general fields.

uniqueName A unique business key value

String

label A description string

5.1.3 Timed object fields

Timed object contain all named object fields.

validAfter A validity date. A string represented in the format: YYYY-MM-DD

5.2 Actual objects

5.2.1 Product

A product record contains all general fields and

sku The product id. String

label A description string

unitOfMeasure A string value describing the unit of measure

currency The base currency code for that product

attribute1

attribute30

Content of the freely definable product attributes. Can be of String or

numeric value

5.2.2 Product Competition

A product competition record contains all general fields and

Page 195: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 195

sku The product id of the own product this product is competing with

label A description string of the competing product

competitiorSku The product id of the competing product

competitor The name of the copetitior

price The copeting product’s price. Numeric

priceType An arbitrary descriptor of the competition’s type of price

competitionType An arbitrary descriptor of the type competition

infoDate A date string (YYYY-MM-DD) to denominate the age of the competition

information

priority A number to rank the competition

comment A free text string

5.2.3 Customer

A product record contains all general fields and

customerId The customer id. String

name The customer name

attribute1

attribute30

Content of the freely definable product attributes. Can be of String or

numeric value

5.2.4 Lookup Table

A lookup table contains timed object fields and

type The type of the Lookup Table. Can be SIMPLE, RANGE, MATRIX, etc

valueType Denominates the type of the value’s value (INT, STRING, REAL)

hideWarnings Indicator if calculation warnings (i.e. keys not found) should be hidden)

5.2.5 Lookup Table Value

A lookup table value contains all general fields and

name The key

value If the containing table type is SIMPLE. This field contains the value

Page 196: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 196

lowerBound If the containing table type is RANGE. This field contains the lower end of

the range.

upperBound If the containing table type is RANGE. This field contains the lower end of

the range.

5.2.6 Price Lists

A price list contains all general fields and

label Description of pricelist

status Status code of pricelist

numerOfItems Number of pricelist items in that list

calculationDate Date the pricelist was calculated last

targetDate Date that determines the date to lookup all relevant pricing parameters

5.2.7 Price List Item

A price list contains all general fields and

pricelistId Id of the pricelist, this item is part of

sku The product id this pricelist item refers to. String

label A product description string

unitOfMeasure A string value describing the unit of measure

currency The currency code

attribute1

attribute30

Content of the freely definable pricelist result attributes. Numeric

calculatedResultPrice System calculated result price

manualResultPrice Manual price override value

resultPrice Either system price or (if overridden) manual price

previousPrice If this pricelist is a revised pricelist, contains the previous result price of that

sku from the revised pricelist

priceChange If previousPrice is set, the absolute price change value

priceChangePct If previousPrice is set, the percentual price change value

alerts A JSON string containing generated alerts

Page 197: API Reference Manual - Price f(x Reference Manual.pdf · API Reference Manual Documentation of the interface of the Price f(x) backend service ... 3.1.3 Token (v2 only) ... and auth-session

Price ƒ(x) / API Reference Manual

Content Proprietary and Confidential © by Price f(x) AG / 2015 197

warnings A JSON string containing generated warnings

approvalState NOT_APPROVED or APPROVED

approvalDate Date of approval (if approved)