Sunteți pe pagina 1din 37

Tech Note

PPSS Sales Optimizer REST APIs


Applies to versions: 3.25 Date :
Introduction ......................................................................................................... 43 Account Type........................................................................................................ 43 Account Type REST APIs ........................................................................................... 43 Creating an Account Type ....................................................................................... 43 Retrieving Account Types ......................................................................................... 54 Updating an Account Type ...................................................................................... 76 Deleting an Account Type ....................................................................................... 76 Retrieving Opportunity Types .................................................................................... 76 Account Type Field Definition ............................................................................... 87 Retrieve Account Type field definitions ....................................................................... 87 Opportunity Type ................................................................................................. 98 Opportunity Type REST APIs ................................................................................... 98 Creating an Opportunity Type ................................................................................ 109 Retrieving Opportunity Types .................................................................................. 109 Updating an Opportunity Type .............................................................................. 1110 Deleting an Opportunity Type ............................................................................... 1211 Opportunity Type Field Definition ..................................................................... 1211 Retrieve Opportunity Type field definitions ............................................................... 1211 Account ............................................................................................................ 1312 Account REST APIs ............................................................................................ 1312 Creating an Account .......................................................................................... 1413 Retrieving Account ............................................................................................. 1514 Updating an Account ......................................................................................... 1716 Deleting an Account Type ................................................................................... 1817 Account Field.................................................................................................... 1817 Account Field REST APIs ..................................................................................... 1817 Retrieving Account Field Values ............................................................................ 1918 Updating an Account field value........................................................................... 2019 Opportunity ...................................................................................................... 2019 Opportunity REST APIs ....................................................................................... 2019 Creating an Opportunity ...................................................................................... 2120 Retrieving Opportunity......................................................................................... 2221

REST APIs

Updating an Opportunity ..................................................................................... 2322 Deleting an Opportunity ...................................................................................... 2322 Opportunity Alternative ................................................................................... 2423 Opportunity Alternative REST APIs .......................................................................... 2423 Creating an Opportunity Alternative ...................................................................... 2423 Retrieving Opportunity Alternative ......................................................................... 2524 Updating an Opportunity Alternative ..................................................................... 2625 Deleting an Alternative ........................................................................................ 2625 Opportunity Alternative Fields ......................................................................... 2726 Opportunity Alternative Field REST APIs ............................................................... 2726 Retrieving Opportunity Alternative Field Values ........................................................ 2726 Updating an Opportunity Alternative field value ....................................................... 2928 Opportunity Alternative Items ......................................................................... 2928 Opportunity Alternative Item REST APIs ............................................................... 2928 Retrieving Opportunity Alternative Item .................................................................. 3029 Updating an Opportunity Alternative Item ............................................................... 3231 Deleting an Opportunity Alternative Item ................................................................ 3332 Opportunity Alternative Transition ................................................................... 3433 Opportunity Alternative Transition REST APIs ........................................................ 3433 Taking transition on an Alternative ......................................................................... 3433 Agreement ....................................................................................................... 3433 Agreement REST APIs ........................................................................................ 3433 Retrieving an Agreement ..................................................................................... 3433 Retrieving all Attribute Values................................................................................ 3534 Retrieving all Pricing Decisions ............................................................................... 3534 Error Handling for REST APIs ........................................................................... 3635 Introduction ........................................................................................................... 3 Account Type.......................................................................................................... 3 Account Type REST APIs .............................................................................................3 Creating an Account Type .........................................................................................3 Retrieving Account Types ...........................................................................................4 Updating an Account Type ........................................................................................6 Deleting an Account Type .........................................................................................6 Account Type Field Definition ................................................................................. 6 Retrieve Account Type field definitions .........................................................................7 Opportunity Type ................................................................................................... 7 Opportunity Type REST APIs .....................................................................................7 Creating an Opportunity Type ....................................................................................8 Retrieving Opportunity Types ......................................................................................8 Updating an Opportunity Type ....................................................................................9 Deleting an Opportunity Type ................................................................................... 10 Opportunity Type Field Definition ......................................................................... 10 Retrieve Opportunity Type field definitions ................................................................... 10 Account ................................................................................................................ 11 Account REST APIs ................................................................................................ 11 Creating an Account .............................................................................................. 12 Retrieving Account ................................................................................................. 13
Copyright <2013> PROS 2

REST APIs

Updating an Account ............................................................................................. 15 Deleting an Account Type ....................................................................................... 16 Account Field........................................................................................................ 16 Account Field REST APIs ......................................................................................... 16 Retrieving Account Field Values ................................................................................ 17 Updating an Account field value............................................................................... 18 Opportunity .......................................................................................................... 18 Opportunity REST APIs ........................................................................................... 18 Creating an Opportunity.......................................................................................... 19 Retrieving Opportunity............................................................................................. 20 Updating an Opportunity ......................................................................................... 21 Deleting an Opportunity .......................................................................................... 21 Opportunity Alternative ....................................................................................... 22 Opportunity Alternative REST APIs .............................................................................. 22 Creating an Opportunity Alternative .......................................................................... 22 Retrieving Opportunity Alternative ............................................................................. 23 Updating an Opportunity Alternative ......................................................................... 24 Deleting an Alternative ............................................................................................ 24 Opportunity Alternative Fields ............................................................................. 25 Opportunity Alternative Field REST APIs ................................................................... 25 Retrieving Opportunity Alternative Field Values ............................................................ 25 Updating an Opportunity Alternative field value ........................................................... 27 Opportunity Alternative Items ............................................................................. 27 Opportunity Alternative Item REST APIs ................................................................... 27 Retrieving Opportunity Alternative Item ...................................................................... 28 Updating an Opportunity Alternative Item ................................................................... 30 Deleting an Opportunity Alternative Item .................................................................... 31 Opportunity Alternative Transition ....................................................................... 32 Opportunity Alternative Transition REST APIs ............................................................ 32 Taking transition on an Alternative ............................................................................. 32 Agreement ........................................................................................................... 32 Agreement REST APIs ............................................................................................ 32 Retrieving an Agreement ......................................................................................... 32 Retrieving all Attribute Values.................................................................................... 33 Retrieving all Pricing Decisions ................................................................................... 33 Error Handling for REST APIs ............................................................................... 34

Copyright <2013> PROS

REST APIs

Introduction
Documents summarizes the REST APIs that will be provided in PPSS Sales Optimizer 3.25. The REST APIs will be able to support a workflow where a quote can be generated and published with appropriate pricing and terms and conditions. Following section of the document briefly describes different entities in Sales Optimizer followed by REST APIs support for those entities.

Account Type
Configuration created by system configuration person that drives the definition of the account. Dimensions used to define an account, dimensional restrictions, fields, will all be driven by the account type.

Account Type REST APIs


POST /salesoptimizer/accounttype: Adds an account type GET /salesoptimizer/accounttype: Retrieves the account type collection GET /salesoptimizer/accounttype/{accountTypeId}: Retrieves an account type by Id PUT /salesoptimizer/accounttype/{accountTypeId}: Updates the given account type DELETE /salesoptimizer/accounttype/{accountTypeId}: Deletes an account type by Id

Account Type Properties Field Id I/O (read only) Description The id of the account type is auto generated by system. The KeyDimensions is a set of dimension name and level pairs. This defines account type definition. The name for account type. The note for an account type.

KeyDimensions required Name Note required optional

Creating an Account Type


A new account type can be created by doing a POST on following URI: /salesoptimizer/accounttype/ This operation will create a new account type in the system. Method: POST
Copyright <2013> PROS

REST APIs

URI: /salesoptimizer/accounttype Request Header:


Content-Type: application/json

Body:
{ "Name": "National Account Type", "Note": "", "KeyDimensions": [ { "DimensionName": "CUSTOMER", "DimensionLevel": "CUSTOMER_ID" } ] }

Response:
Response: 201

Retrieving Account Types


Account types can be retrieved by doing a GET on following URI: /salesoptimizer/accounttype/ This operation will return the collection of account type. Method: GET URI: /salesoptimizer/accounttype Request Header:
Content-Type: application/json

Response:

Copyright <2013> PROS

REST APIs

{ "AccountTypes": [ { "Name": "National Account Type", "Note": "", "KeyDimensions": [ { "DimensionName": "CUSTOMER", "DimensionLevel": "CUSTOMER_ID" } ], "Id": 1111 }, { "Name": "Regional Account Type", "Note": "", "KeyDimensions": [ { "DimensionName": "CUSTOMER", "DimensionLevel": "CUSTOMER_ID" } ], "Id": 1112 } ] }

Doing a GET on following URI will return account type with given account type id: /salesoptimizer/accounttype/{accountTypeId} Where {accountTypeId} is the Id of the account type that needs to be retrieved. Method: GET URI: /salesoptimizer/accounttype/{accountTypeId} Request Header:
Content-Type: application/json

Response:
{ "Name": "Regional Account Type", "Note": "", "KeyDimensions": [ { "DimensionName": "CUSTOMER", "DimensionLevel": "CUSTOMER_ID" } ], "Id": 1112 }

Copyright <2013> PROS

REST APIs

Updating an Account Type


An account type can be updated by doing a PUT on following URI: /salesoptimizer/accounttype/{accountTypeId} This operation will update the given account type, where {accountTypeId} is the id of the account type. Method: PUT URI: /salesoptimizer/accounttype/{accountTypeId} Request Header:
Content-Type: application/json

Body:
{ "Name": "National Account Types", "Note": "Updated Notes", "KeyDimensions": [ { "DimensionName": "CUSTOMER", "DimensionLevel": "CUSTOMER_ID" } ] }

Response:
Response: 200

Deleting an Account Type


An account type can be deleted by doing a DELETE on following URI: /salesoptimizer/accounttype/{accountTypeId} Where {accountTypeId} is the id of account type that needs to be deleted. Method: DELETE URI: /salesoptimizer/accounttype/{accountTypeId} Request Header:
Accept: application/json

Response:
Response: 204

Retrieving Opportunity Types


All the opportunity types for a specified account type can be retrieve with the following URI: /salesoptimizer/accounttype/{accountTypeId}/opportunitytype Where {accountTypeId} is the id of account type that holds all the opportunity types to retrieve.
Copyright <2013> PROS 7

REST APIs

Method: GET URI: /salesoptimizer/accounttype/{accountTypeId}/opportunitytype Request Header:


Accept: application/json

Response:
{ "OpportunityTypes": [ { "AccountTypeId": 504, "Name": "Customer Bid Pricing", "Note": "The workflow for customer bid pricing.", "Id": 6001 }, { "AccountTypeId": 504, "Name": "Contract Workflow", "Note": "Customer contract workflow", "Id": 55015 } ] }

Account Type Field Definition


Account type field are definition of the attributes of an account. Account type field can be text , number, date or a dimension. For e.g Addresses, Last Years Revenue, Start Date, Customer Segment respectively.

Retrieve Account Type field definitions


An account type field definitions can be retrieved by doing a GET on following URI: /salesoptimizer/accounttype/{accountTypeId}/field Where {accountTypeId} is the id of an account type for which field definitions needs to be retrieved. Method: GET URI: /salesoptimizer/accounttype/{accountTypeId}/field Request Header:
Accept: application/json

Response:

Copyright <2013> PROS

REST APIs

{ "FieldDefinitions": [ { "Name": "Address", "Id": 1222, "Label": "Company Address", "Editable" : true, "Required" : false }, { "Name": "Phone Number", "Id": 1223, "Label": "Contact Number", "Editable" : true, "Required": false } ] }

Response:
Response: 200

Opportunity Type
Configuration created by system configuration person that drives the definition of the opportunity.

Opportunity Type REST APIs


GET /salesoptimizer/accounttype/{accounttypeId}/opportunitytype: Retrieves the opportunity type collection under an account type GET /salesoptimizer/opportunitytype/{opportunityTypeId}: Retrieves an opportunity type by Id POST /salesoptimizer/opportunitytype: Adds an opportunity type PUT /salesoptimizer/opportunitytype/{opportunityTypeId}: Updates the given opportunity type DELETE /salesoptimizer/opportunitytype/{opportunityTypeId}: Deletes an opportunity type by Id

Opportunity Type Properties Field I/O Description The Id of the account type for which opportunity type is defined. The id of the opportunity type is auto generated by system.

AccountTypeId required Id read only

Copyright <2013> PROS

REST APIs

Name Note

required optional

The name of opportunity type. The note for an opportunity type.

Creating an Opportunity Type


A new opportunity type can be created by doing a POST on following URI: /salesoptimizer/opportunitytype/ This operation will create a new opportunity type in the system. Method: POST URI: /salesoptimizer/opportunitytype Request Header:
Content-Type: application/json

Body:
{ "Name": "Price Change Request ", AccountTypeId: 1111, "Note": "" }

Response:
Response: 201

Retrieving Opportunity Types


Opportunity types of an account type can be retrieved by doing a GET on following URI: /salesoptimizer/accounttype/{accountTypeId}/opportunitytype This operation will return the collection of opportunity type for given account type, where {accountTypeId} is the id of the account type for which opportunity needs to be retrieved. Method: GET URI: /salesoptimizer/accounttype/{accountTypeId}/opportunitytype Request Header:
Content-Type: application/json

Response:

Copyright <2013> PROS

10

REST APIs

{ "OpportunityTypes": [ { "Name": "Price Change Request", "Note": "", AccountTypeID: 1111, "Id": 2222 }, { "Name": "Bid Response", "Note": "", AccountTypeID: 1111, "Id": 2223 } ] }

Doing a GET on following URI will return an opportunity type by id: /salesoptimizer/opportunitytype/{opportunityTypeId} Where {opportunityTypeId} is the Id of the opportunity type that needs to be retrieved. Method: GET URI: /salesoptimizer/opportunitytype/{opportunityTypeId} Request Header:
Content-Type: application/json

Response:
{ "Name": "Price Change Request ", "Note": "", AccountTypeId: 1111, "Id": 2222 }

Updating an Opportunity Type


An opportunity type can be updated by doing a PUT on following URI: /salesoptimizer/opportunitytype/{opportunityTypeId} This operation will update the given opportunity type. Where {opportunityTypeId} is the id of the opportunity type which needs to be updated. Method: PUT URI: /salesoptimizer/opportunitytype/{opportunitytypeId} Request Header:
Content-Type: application/json

Body:
Copyright <2013> PROS 11

REST APIs

{ "Name": "Price Change Request ", "Note": "Updated Notes", "AccountTypeId": 1111, "Id : 2222 }

Response:
Response: 200

Deleting an Opportunity Type


An opportunity type can be deleted by doing a DELETE on following URI: /salesoptimizer/opportunitytype/{opportunityTypeId} Where {opportunityTypeId} is the id of opportunity type that needs to be deleted. Method: DELETE URI: /salesoptimizer/opportunitytype/{opportunityTypeId} Request Header:
Content-Type: application/json

Response:
Response: 204

Opportunity Type Field Definition


Opportunity type field are definition of the attributes of an opportunity. Opportunity field can be a text, number, date or a dimension. For e.g Contact Person, Total Revenue, Start Date, Location respectively.

Retrieve Opportunity Type field definitions


An opportunity type field definitions can be retrieved by doing a GET on following URI: /salesoptimizer/opportunitytype/{opportunitytypeId}/field Where {opportunitytypeId} is the id of opportunity type for which field definitions needs to be retrieved. Method: GET URI: /salesoptimizer/opportunitytype/{opportunitytypeId}/field Request Header:
Content-Type: application/json

Response:

Copyright <2013> PROS

12

REST APIs

{ "Fields" [ { "Name": "Effective Start Date", "Id": 2111, "Label": "Start Date", "Editable" : true, "Required" : true }, { "Name": "Effective End Date ", "Id": 2112, "Label": "End Date", "Editable" : true, "Required": true }, { "Name": "Contact Person", "Id": 2113, "Editable" : true, "Required": true }, { "Name": "Total Revenue", "Id": 2114, "Editable" : true, "Required": true } ] }

Account
The organizational entity that the sales representative manages and sets prices on. In some PPSS applications this may be a particular customer, but it may be defined by combinations of dimensional values as specified in the account type key dimensions.

Account REST APIs


GET /salesoptimizer/accounttype/{accountTypeId}/account: Retrieves all account for given account type GET /salesoptimizer/account?{param}: Retrieves an account for given parameters POST /salesoptimizer/account: Adds an account to the system PUT /salesoptimizer/account/{accountId}: Updates the given account DELETE /salesoptimizer/account/{accountd}: Deletes an account by Id

Account Properties

Copyright <2013> PROS

13

REST APIs

Field

I/O

Description An account number which can uniquely identify the account in the system. This can be an alphanumeric string. The id of the account type to which this account belongs to. The id of the account auto generated by system. The KeyDimensions is a set of value for dimension name and level pairs. The name for account. The note for an account.

AccountNumber Required AccountTypeId Id KeyDimensions Name Note Required read only Required Required optional

Creating an Account
A new account can be created by doing a POST on following URI: /salesoptimizer/account/ This operation will create a new account in the system. Method: POST URI: /salesoptimizer/account Request Header:
Content-Type: application/json

Body:
{ "AccountTypeId": 1111, "Name": "Memorial Hospital", "AccountNumber": "MH34234438", "KeyDimensions": [ { "DimensionRole": "CUSTOMER", "DimensionLevel": "CUSTOMER_ID", "DimensionValue": "3439332" } ], "AccountNote": "Account for memorial hospital.", }

Response:
Response: 201

Copyright <2013> PROS

14

REST APIs

Retrieving Account
Accounts under an account type can be retrieved by doing a GET on following URI: /salesoptimizer/accounttype/{accountTypeId}/account This operation will return the collection of accounts under an account type. Method: GET URI: /salesoptimizer/accounttype/{accountTypeId}/account Request Header:
Content-Type: application/json

Response:
{ "Accounts": [ { "AccountTypeId": 1111, "Name": " Memorial Hospital ", "AccountNumber": " MH34234438", "KeyDimensions": [ { "DimensionRole": "CUSTOMER", "DimensionLevel": "CUSTOMER_ID", "DimensionValue": "3439332" } ], "AccountNote": " Account for memorial hospital.", "Id": 3331 }, { "AccountTypeId": 1111, "Name": "Sam Houston Hospital ", "AccountNumber": "SHH3584833", "KeyDimensions": [ { "DimensionRole": "CUSTOMER", "DimensionLevel": "CUSTOMER_ID", "DimensionValue": "23453432" } ], "Id": 3332 } ] }

Doing a get on following URI will return an account with given key param: /salesoptimizer/account/?{keyParam} Where {keyParam} can uniquely identify an account in the system. It could be:
Copyright <2013> PROS 15

REST APIs

number={AccountNumber} name={AccountName}&accountTypeName={AccountTypeName} name={AccountName}&accountTypeId={AccountTypeId}

Method: GET URI: /salesoptimizer/account?{keyParams} e.g: /salesoptimizer/account?number=MH34234438 Request Header:


Content-Type: application/json

Response:
{ "AccountTypeId": 1111, "Name": " Memorial Hospital ", "AccountNumber": " MH34234438", "KeyDimensions": [ { "DimensionRole": "CUSTOMER", "DimensionLevel": "CUSTOMER_ID", "DimensionValue": "3439332" } ], "AccountNote": " Account for memorial hospital.", "Id": 3331 }

Doing a GET on following URI will return accounts matching search criteria: /salesoptimizer/account?{searchParam} Where {searchParam} is the matching criteria for finding an account. It could be: find={Partial name of an account (case insensitive)} find={Partial number of an account (case insensitive)}

Method: GET URI: /salesoptimizer/account?{searchParams} e.g: /salesoptimizer/account?find=hospital Request Header:


Content-Type: application/json

Response:

Copyright <2013> PROS

16

REST APIs

{ "Accounts": [ { "AccountTypeId": 1111, "Name": " Memorial Hospital ", "AccountNumber": " MH34234438", "KeyDimensions": [ { "DimensionRole": "CUSTOMER", "DimensionLevel": "CUSTOMER_ID", "DimensionValue": "3439332" } ], "AccountNote": " Account for memorial hospital.", "Id": 3331 }, { "AccountTypeId": 1111, "Name": "Sam Houston Hospital ", "AccountNumber": "SHH3584833", "KeyDimensions": [ { "DimensionRole": "CUSTOMER", "DimensionLevel": "CUSTOMER_ID", "DimensionValue": "23453432" } ], "Id": 3332 } ] }

Updating an Account
An account can be created by doing a PUT on following URI: /salesoptimizer/account/{accountId} This operation will update the given account. Where accountId is the id of the account that needs to be updated. Method: PUT URI: /salesoptimizer/account/{accountId} Request Header:
Content-Type: application/json

Body:

Copyright <2013> PROS

17

REST APIs

{ "AccountTypeId": 1111, "Name": " Memorial Hospital ", "AccountNumber": " MH34234438", "KeyDimensions": [ { "DimensionRole": "CUSTOMER", "DimensionLevel": "CUSTOMER_ID", "DimensionValue": "3439332" } ], "AccountNote": "Account for memorial hospital.", "Id": 3331 }

Response:
Response: 200

Deleting an Account Type


An account can be deleted by doing a DELETE on following URI: /salesoptimizer/account/{accountId} Where accountId is the id of account that needs to be deleted. Method: DELETE URI: /salesoptimizer/account/{accountId} Request Header:
Content-Type: application/json

Response:
Status Code: 204

Account Field
Account fields are the attributes of an account. Account field can be a text, number, date or a dimension. Field definitions are defined in an account type and accounts can have their own values for those fields.

Account Field REST APIs


GET /salesoptimizer/account/{accountId}/field: Retrieves the field values for all account fields GET /salesoptimizer/account/{accountId}/field/{fieldld}: Retrieves the field value for given account field PUT /salesoptimizer/account/{accountId}/field/{fieldId}: Updates the given account field value
18

Copyright <2013> PROS

REST APIs

Account Field Properties Field Name I/O Requiredreadonly Requiredreadonly Description The name for account field. The FieldId is the id of the field definition defined in an account type for this account.

FieldId

Value

The value of an account field. Value should be numeric for a number field. For a date field value should be in format optionalRequired yyyymmdd. Value for a dimension field should be a valid dimension value in PPSS. Value of a text field can be a string, null or an empty string.

Retrieving Account Field Values


Account field values can be retrieved by doing a get following URI: /salesoptimizer/account/{accountId}/field/ Where {accountId} the id of the account for which all field needs to be retrieved. Method: GET URI: /salesoptimizer/account/{accountId}/field/ Request Header:
Content-Type: application/json

Response:
{ "Fields": [ { "Name": "Address", "FieldId": 1222, "Value": "12000 Richmond Ave, Houston TX, 77082" }, { "Name": "Phone Number", "FieldId": 1223, "Value": "713-713-1111" } ] }

An individual account field value can be retrieved by doing a GET on following URI: /salesoptimizer/account/{accountId}/field/{fieldId}
Copyright <2013> PROS 19

REST APIs

Where {fieldId} is the id of the field and {accountId} is the id of the account for which field value needs to be retrieved. Method: GET URI: / salesoptimizer/account/{accountId}/field/{fieldId} Request Header:
Content-Type: application/json

Response:
{ "Name": "Address", "FieldId": 1222, "Value": "12000 Richmond Ave, Houston TX, 77082" }

Updating an Account field value


An account field value can be updated by doing a PUT on following URI: /salesoptimizer/account/{accountId}/field/{fieldId} Where {fieldId} is the id of the field whose value needs to be updated and {accountId} is the id of the account to which field belongs. Method: PUT URI: / salesoptimizer/account/{accountId}/field/{fieldId} Request Header:
Content-Type: application/json

Body:
{ "Name": "Phone Number", "FieldId": 1223, "Value": "281-281-2222" }

Response:
Response: 200

Opportunity
Opportunity is a vehicle to change pricing within an account. A sales rep can create an opportunity and use it to negotiate pricing with a customer.

Opportunity REST APIs


GET /salesoptimizer/account/{accountId}/opportunity: Retrieves all opportunities within an account
20

Copyright <2013> PROS

REST APIs

GET /salesoptimizer/opportunity/{opportunityId}: Retrieves an opportunity by Id POST / salesoptimizer/opportunity: Adds an opportunity to the system PUT / salesoptimizer/opportunity{opportunityId}: Updates the given opportunity DELETE / salesoptimizer/opportunity{opportunityId}: Deletes an opportunity by Id

Opportunity Properties Field AccountId I/O required Description The note for an account type. The BidResponsePreference is to decide the preference for doing bid matching. The id of the opportunity auto generated by system. The name of the opportunity. The note of an opportunity. The id of the opportunity type which defines this opportunity. The name of the stage in which opportunity is currently in its lifecycle.

BidResponsePreference optional Id Name Note OpportunityTypeId read only required optional required

StageName

read only

Creating an Opportunity
A new opportunity can be created by doing a POST on following URI: /salesoptimizer/opportunity This operation will create a new opportunity in the system. Method: POST URI: / salesoptimizer/opportunity Request Header:
Content-Type: application/json

Body:
{ "OpportunityTypeId": 2222, "Name: "1st Quarter Opportunity, "AccountId": 3331, "Note": "opportunity notes", } Copyright <2013> PROS 21

REST APIs

Response:
Response: 201

Retrieving Opportunity
Opportunities can be retrieved by doing a GET on following URI: /salesoptimizer/account/{accountId}/opportunity This operation will return all the opportunities for given account. Where {accountId} is the id of the account for which opportunities needs to be retrieved. Method: GET URI: /salesoptimizer/account/{accountId}/opportunity Request Header:
Content-Type: application/json

Response:
{ "Opportunities": [ { "OpportunityTypeId": 2222, "Name": "1st Quarter Opportunity, "AccountId": 3331, "StageName": "Created", "BidResponsePreference": 0, "Note": "opportunity notes", "Id": 4441 }, { "OpportunityTypeId": 2222, "Name": "2nd Quarter Opportunity, "AccountId": 3331, "StageName": "Created", "BidResponsePreference": 0, "Note": "opportunity notes", "Id": 4442 } ] }

Response:
Status Code: 200 OK

Doing a get on following URI will return an opportunity by id: /salesoptimizer/opportunity/{opportunityId} Where {opportunityId} is the Id of the opportunity that needs to be retrieved. Method: GET URI: /salesoptimizer/opportunity/{opportunityId}
Copyright <2013> PROS

22

REST APIs

Request Header:
Content-Type: application/json

Response:
{ "OpportunityTypeId": 2222, "Name": "1st Quarter Opportunity, "AccountId": 3331, "StageName": "Created", "BidResponsePreference": 0, "Id": 4441 }

Response:
Status Code: 200 OK

Updating an Opportunity
An opportunity can be updated by doing a put on following URI: /salesoptimizer/opportunity/{opportunityId} Where {opportunityId} is the id of the opportunity that needs to be updated. Method: PUT URI: /salesoptimizer/opportunity/{opportunityId} Request Header:
Content-Type: application/json

Body:
{ "OpportunityTypeId": 2222, "Name": "1st Quarter Opportunity, "Note": 3331, "Id": 4441 }

Response:
Response: 200

Deleting an Opportunity
An opportunity can be deleted by doing a DELETE on following URI: /salesoptimizer/opportunity/{opportunityId} Where {opportunityId} is the id of opportunity that needs to be deleted. Method: DELETE URI: /salesoptimizer/opportunity/{opportunityId} Request Header:
Copyright <2013> PROS 23

REST APIs

Content-Type: application/json

Response:
Response: 204

Opportunity Alternative
An opportunity alternative is one potential version of pricing for a particular opportunity. Multiple alternatives for an opportunity may be created to analyze the profitability by doing applying different pricing.

Opportunity Alternative REST APIs


GET /salesoptimizer/opportunity/{opportunityId}/alternative: Retrieves all alternatives within an opportunity GET /salesoptimizer/alternative/{alternativeId}: Retrieves an alternative by Id POST /salesoptimizer/opportunity/{opportunityId}/alternative: Adds an alternative to the opportunity PUT /salesoptimizer/alternative/{alternativeId}: Updates the given alternative DELETE /salesoptimizer/alternative/{alternativeId}: Deletes an alternative by Id

Opportunity Alternative Properties Field Active Id Name OpportunityId I/O optional read only required required Description The flag which indicates if alternative is active or not. The id of the opportunity auto generated by system. The name of an alternative. The Id of the opportunity to which this alternative belongs to.

Creating an Opportunity Alternative


A new alternative can be created by doing a POST on following URI: /salesoptimizer/opportunity/{opportunityId}/alternative Where {opportunityId} is the id of the opportunity to which alternative needs to be added. Method: POST URI: /salesoptimizer/opportunity/{opportunityId}/alternative Request Header:
Copyright <2013> PROS 24

REST APIs

Content-Type: application/json

Body:
{ "OpportunityId": 4441, "Name": "Default" }

Response:
Response: 201

Retrieving Opportunity Alternative


An opportunity alternatives can be retrieved by doing a GET on following URI: /salesoptimizer/opportunity/{opportunityId}/alternative Where {opportunityId} is the id of the opportunity for which all alternatives needs to be retrieved. Method: GET URI: /salesoptimizer/opportunity/{opportunityId}/alternative Request Header:
Content-Type: application/json

Response:
{ "Alternatives": [ { "OpportunityId": 4441, "Name": "Default", "Active": true, "Id": 5551 }, { "OpportunityId": 4441, "Name": "Stretch Discount", "Active": true, "Id": 5552 } ] }

Doing a get on following URI will return an alternative by given id: /salesoptimizer/alternative/{alternativeId} Where {alternativeId} is the Id of the alternative that needs to be retrieved. Method: GET URI: /salesoptimizer/alternative/{alternativeId} Request Header:
Copyright <2013> PROS 25

REST APIs

Content-Type: application/json

Response:
{ "OpportunityId": 4441, "Name": "Default", "Active": true, "Id": 5551 }

Updating an Opportunity Alternative


An opportunity alternative can be updated by doing a PUT on following URI: /salesoptimizer/alternative/{alternativeId} Where {alternativeId} is the id of the alternative which needs to be updated. Method: PUT URI: /salesoptimizer/alternative/{alternativeId} Request Header:
Content-Type: application/json

Body:
{ "OpportunityId": 4441, "Name": "Default", "Active": true }

Response:
Response: 200

Deleting an Alternative
An alternative can be deleted by doing a DELETE on following URI: /salesoptimizer/alternative/{alternativeId} Where {alternativeId} is the id of alternative that needs to be deleted. Method: DELETE URI: /salesoptimizer/alternative/{alternativeId} Request Header:
Content-Type: application/json

Response:
Status Code: 204

Copyright <2013> PROS

26

REST APIs

Opportunity Alternative Fields


Opportunity alternative fields are the header attributes of an opportunity alternative. An opportunity alternative field can be a text, number, date or a dimension. Field definitions and their formula to calculate the default value are defined in the opportunity type.

Opportunity Alternative Field REST APIs


GET /salesoptimizer/alternative/{alternativeId}/field: Retrieves all field values of an alternative GET /salesoptimizer/alternative/{alternativeId}/field/{fieldIdparam}: Retrieves the field value for given alternative field PUT /salesoptimizer/alternative/{alternativeId}/field/{fieldId}: Updates the given alternative field value

Account Opportunity Alternative Field Properties Field Name I/O Requiredreadonly Requiredreadonly Description The name for alternative field. The FieldId is the id of the field definition defined in the opportunity type. The value of an alternative field. Value should be numeric for a number field. For a date field value should be in format yyyymmdd. Value for a dimension field should a valid dimension value in PPSS. Value of a text field can be a string, null or an empty string. Value By default field values are evaluated based on formula optionalRequired configured in field definition. If value of a field needs to be overridden that can be done via PUT action. If an overridden value needs to be cleared and value should be recalculated based on field formula PUT operation can pass the null value and system would reset the overridden value field value will be recalculated based on its formula. For a text field both null and empty string would reset the value of the field.

FieldId

Retrieving Opportunity Alternative Field Values


Alternative field values can be retrieved by doing a GET on following URI: /salesoptimizer/alternative/{alternativeId}/field/ Where {alternativeId} is id of the alternative for which all field needs to be retrieved.
Copyright <2013> PROS 27

REST APIs

Method: GET URI: /salesoptimizer/alternative/{alternativeId}/field/ Request Header:


Content-Type: application/json

Response:
{ "Fields": [ { "Name": "Effective Start Date", "FieldId": 2111, "Value": "20130101" }, { "Name": "Effective End Date ", "FieldId": 2112, "Value": "20131231" }, { "Name": "Contact Person", "FieldId": 2113, "Value": "James Smith" }, { "Name": "Total Revenue", "FieldId": 2114, "Value": 1,000,000 } ] }

An individual alternative field value can be retrieved by doing a GET on following URI: /salesoptimizer/alternative/{alternativeId}/field/{fieldIdparam} Where {fieldIdparam} is the id of the field or the field name, and {alternativeId} is the id of the alternative for which field value needs to be retrieved. Method: GET URI: / salesoptimizer/alternative/{alternativeId}/field/{fieldId} Request Header:
Content-Type: application/json

Response:
{ "Name": "Contact Person", "FieldId": 2113, "Value": "James Smith" }

Copyright <2013> PROS

28

REST APIs

Updating an Opportunity Alternative field value


An alternative field value can be updated by doing a PUT on following URI: /salesoptimizer/alternative/{alternativeId}/field/{fieldId} Where {fieldId} is the id of the field whose value needs to be updated and {alternativeId} is the id of the alternative to which field belongs. Method: PUT URI: /salesoptimizer/alternative/{alternativeId}/field/{fieldId} Request Header:
Content-Type: application/json

Body:
{ "Name": "Contact Person", "FieldId": 2113, "Value": "Adam Jones" }

Response:
Response: 200

Opportunity Alternative Items


An item is defined by the dimensional values. Items may also contain a unit of measure, volume, and values for elements corresponding to the profit model template association.

Opportunity Alternative Item REST APIs


GET /salesoptimizer/alternative/{alternativeId}/item: Retrieves all items of an alternative GET /salesoptimizer/alternative/{alternativeId}/item/{itemId}: Retrieves an item by Id PATCH /salesoptimizer/alternative/{alternativeId}/item/{itemId}: Updates an item with given properties and values for the properties which are not provided as part of request remains same after PATCH action as they were before PATCH. DELETE/salesoptimizer/alternative/{alternativeId}/item/{itemId}: Deletes an item by Id

Opportunity Alternative Item Field Properties Field I/O Description

Copyright <2013> PROS

29

REST APIs

This list of columns for an item. The columns list is consist of items as a name value pair object. Where name is the name of the element and value is the value for that element. For example an element can be: Score, Price, Discount, Volume etc. And an element can be of type number of string. The value of an element should be numeric for a number element. Columns optional By default value of elements are evaluated based on formula configured in item profit model. If value of an element needs to be overridden that can be done via PATCH action. If an overridden value needs to be cleared and value should be recalculated based on formula, PATCH operation can pass the null value and system would reset the overridden value for that element and will be recalculated value based on formula in item profit model. For a string element both null and empty string would reset the value of the field. The Id of the item auto generated by system. The value of dimensions that define an item. The tag is a string property on the item. Can be uses to identify items of same scope to be uniquely defined for profitability calculations. The warning message given detail if item is duplicate, had evaluation issue.

Id KeyDimensions

read only required

tag

optional

WarningMessage read only

Retrieving Opportunity Alternative Item


Alternative items can be retrieved by doing a GET on following URI: /salesoptimizer/alternative/{alternativeId}/item/ Where {alternativeId} is id of the alternative for which all items needs to be retrieved. Method: GET URI: /salesoptimizer/alternative/{alternativeId}/item/ Request Header:
Content-Type: application/json

Response:

Copyright <2013> PROS

30

REST APIs

{ "Items": [ { "KeyDimensions": [ { "DimensionRole": "PRODUCT", "DimensionLevel": "PRODUCT_ID", "DimensionValue": "MDS-9124-PWR" } ], "Columns": [ { "Name": "Volume", "Value": 70 }, { "Name": "Price", "Value": 100.50 } ], "Id": 8111, }, { "KeyDimensions": [ { "DimensionRole": "PRODUCT", "DimensionLevel": "CATEGORY_ID", "DimensionValue": "CX3-10C-FD" } ], "Columns": [ { "Name": "Volume", "Value": 70 }, { "Name": "Price", "Value": } ], "Id": 8112, "WarningMessage": "Item has evaluation error.", "tag": "CategoryItem" } ] }

An individual alternative item can be retrieved by doing a GET on following URI: /salesoptimizer/alternative/{alternativeId}/item/{itemId} Where {itemId} is the id of the item and {alternativeId} is the id of the alternative for which item needs to be retrieved.
Copyright <2013> PROS 31

REST APIs

Method: GET URI: / salesoptimizer/alternative/{alternativeId}/item/{itemId} Request Header:


Content-Type: application/json

Response:
{ "KeyDimensions": [ { "DimensionRole": "PRODUCT", "DimensionLevel": "PRODUCT_ID", "DimensionValue": "MDS-9124-PWR" } ], "Columns": [ { "Name": "Volume", "Value": 70 }, { "Name": "Price", "Value": 100.50 } ], "Id": 8111 }

Updating an Opportunity Alternative Item


An alternative item column value can be updated by doing a PATCH on following URI: /salesoptimizer/alternative/{alternativeId}/item/{itemId} Where {itemId} is the id of the item which needs to be updated and {alternativeId} is the id of the alternative to which item belongs. Method: PATCH URI: /salesoptimizer/alternative/{alternativeId}/item/{itemId} Request Header:
Content-Type: application/json

Body:

Copyright <2013> PROS

32

REST APIs

{ "Columns": [ { "Name": "Volume", "Value": 80 } ], "Id": 8111 }

Response:
{ "KeyDimensions": [ { "DimensionRole": "PRODUCT", "DimensionLevel": "PRODUCT_ID", "DimensionValue": "MDS-9124-PWR" } ], "Columns": [ { "Name": "Volume", "Value": 80 }, { "Name": "Price", "Value": 100.50 } ], "Id": 8111 }

Deleting an Opportunity Alternative Item


An alternative item can be deleted by doing a DELETE on following URI: /salesoptimizer/alternative/{alternativeId}/item/{itemId} Where {itemId} is the id of item that needs to be deleted and {alternativeId} is the id of the alternative to which item belongs. Method: DELETE URI: /salesoptimizer/alternative/{alternativeId}/item/{itemId} Request Header:
Content-Type: application/json

Response:
Status Code: 204

Copyright <2013> PROS

33

REST APIs

Opportunity Alternative Transition


An opportunity can be configured to have lifecycle. Lifecycle of an opportunity includes stages and opportunity can be moved into different stages in a lifecycle. An opportunity can be moved into different stage by updating stage for an alternative. When a stage is set on an alternative whole opportunity including all alternatives goes into new stage.

Opportunity Alternative Transition REST APIs


PUT /salesoptimizer/alternative/{alternativeId}/stage: Moves the opportunity into given stage

Taking transition on an Alternative


An opportunity can be moved into new stage by doing following PUT: /salesoptimizer/alternative/{alternativeId}/stage Where {alternativeId} is the id of alternative which needs to be moved into new stage. Method: PUT URI: /salesoptimizer/alternative/{alternativeId}/stage Request Header:
Content-Type: application/json

Body:
{ "StageName": "Published" }

Response:
Response: 200

Agreement
An agreement is a published opportunity.

Agreement REST APIs


GET /salesoptimizer/agreement/{agreementId} GET /salesoptimizer/agreement/{agreementId}/attribute GET /salesoptimizer/agreement/{agreementId}/pricingdecision?componentType= {componentTypeUploadCode}&priceLevel={priceLevelUploadCode}

Retrieving an Agreement
An agreement can be retrieved by doing a GET on following URI: /salesoptimizer/agreement/{agreementId}
Copyright <2013> PROS 34

REST APIs

Where {agreementId} is the id of the published opportunity. Method: GET URI: /salesoptimizer/agreement/{agreementId} Response:
{ "AgreementStructureId": 2001, "Name": "501", "AgreementId": "1000798608", "Version": 2, "AgreementRecordId": 501 }

Retrieving all Attribute Values


The attribute values of an agreement can be retrieved by doing a GET on following URI: /salesoptimizer/agreement/{agreementId}/attribute Where {agreementId} is the id of the published opportunity. Method: GET URI: /salesoptimizer/agreement/{agreementId}/attribute Response:
[ { "Name": "Contact", "Value": "John Smith" } ]

Retrieving all Pricing Decisions


The pricing decisions of an agreement can be retrieved by doing a GET on following URI: /salesoptimizer/agreement/{agreementId}/pricingdecision?componentType={componentTypeU ploadCode}&priceLevel={priceLevelUploadCode} Where {agreementId} is the id of the published opportunity, {componentTypeUploadCode} and {priceLevelUploadCode} is the upload codes, of the component type and of the pricing level upload code respectively. Method: GET URI:/salesoptimizer/agreement/{agreementId}/pricingdecision?componentType={componentTy peUploadCode}&priceLevel={priceLevelUploadCode} Response:

Copyright <2013> PROS

35

REST APIs

[ { "Name": "Contact", "Value": "John Smith" } ]


Formatted: Body

Error Handling for REST APIs


If REST APIs encounters an error, system will send error information in response. For example an if alternative transition fails because there are errors in items you will get a message like: Response:
{ "Status" : 4500, "Message" : "Unable take opportunity transition, alternative item has errors" }

Copyright <2013> PROS

36

REST APIs

Contacting PROS
Please report any product questions or incidents on PROSConnect, our self-service customer support portal.
PROS Customer Support Web Address https://connect.prospricing.com

PROS Product Information Phone Fax Web Address 713-335-5151 713-335-8144 http://www.prospricing.com

PROS 3100 Main Street, Suite 900, Houston, TX 77002-9312 USA

Copyright 2013 PROS Revenue Management, L.P. All information contained within this document is the confidential property of PROS. It is submitted with the understanding that it shall not be disclosed to any third party either in whole or in part without the prior written consent of PROS. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of PROS. PROS makes no representations or warranties with respect to the contents hereof and specifically disclaims any implied warranties of merchantability for any particular purpose. Furthermore, PROS reserves the right to revise this publication and to make changes in content hereof without obligation of PROS to notify any person of such revision. Trademarks All other brands and their products are trademarks or registered trademarks of their respective holders and should be noted as such. This product includes software developed by the Apache Software Foundation (http://www.apache.org/).

Copyright <2013> PROS

37

S-ar putea să vă placă și