Download PDF
Download page Creating and Editing Quotes.
Creating and Editing Quotes
This use case describes how to create and edit quotes, which is a formal statement of promise that lists the products and services to be sold to a customer at a defined price. Quote creation involves configuring products and services, pricing them, and generating quotes based on predefined rules. Implementation teams can use these APIs to build quoting functionalities necessary to prepare a quote by providing relevant details.
Creating a Quote
You can create one or more quotes by providing the quote name, price list ID, and price list name in the request. Provide other relevant quote details as it is a good practice to pass as many fields in the request body as are needed to pre-populate the quote. For example, it is recommended to populate the Account related fields.
Prerequisite
You must gather the following details to create a quote.
- Price List ID
- Price List Name
You can use the GET/price-lists
API to retrieve all price lists in the system. For more information, see Pricing Setup APIs.
Example 1
The following table lists the API method, endpoint, and path as well as a sample request and response for creating a quote.
Method | POST |
---|---|
Endpoint | /quotes |
Request URL | https://<URL_of_the_Instance>/api/quote/v1/quotes |
Request | The following sample request creates a quote named Tier_1, with AutoQuoteRLP_QuotePL pricelist.
CODE
|
Response | The API returns the structure of the newly created quote, which includes all associated field values that are populated by default or overridden based on the request body. Response Body
CODE
|
Example 2
The following table list the API method, endpoints, and sample codes for request and responses to create more than one quote:
Method | POST |
---|---|
Endpoint | /quotes |
Request URL | https://<URL_of_the_Instance>/api/quote/v1/quotes |
Request | The following sample code creates quotes with the following names with AutoQuoteRLP_QuotePL pricelist.
CODE
|
Response | The API returns the structure of the newly created quotes. Response Body
CODE
|
Retrieving List of Quotes
You can retrieve all quotes with their details where the requester is the creator, owner of, or has access to the quote. Retrieving quotes helps you explore the quote as it moves through the quote life cycle.
Prerequisite
You must have existing quotes in the system which you have created or that you own or have access to.
Example
The following table lists the API method, endpoints, and sample codes for request and response, to retrieve a quote:
Method | GET | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Endpoint | /quotes | ||||||||||
Request Parameters | The following URL parameters are used to narrow down the search result to specifically retrieve quote names containing the string "Tier".
| ||||||||||
Request URL |
| ||||||||||
Response | The API returns all details associated with the retrieved quotes. Response Body
CODE
|
Retrieving Quote Details (header information)
You can retrieve the details of a specific quote by passing the quote ID. The API returns the quote header fields, pricing, and quote line items among other details.
Prerequisite
You must gather the following details to create a quote.
- Quote ID
You can create a new quote and extract the quote ID from the response, create a quote using POST/quotes
, or retrieve existing quotes using GET/quotes
. For more information, see the "Creating a Quote" and "Retrieving List of Quotes" sections or see Quoting APIs.
Example
The following table lists the API method, endpoints, and sample codes for request and response, to retrieve the details of a quote:
Method | GET | ||||
---|---|---|---|---|---|
Endpoint | /quotes/{quoteId} | ||||
Request Parameters | The following URL parameter is used to pass the quote ID. You can use the value 'items' in the includes parameter to proposal line items associated with the given quote. For this example, only the ID of the quote is passed.
This quote was generated in the "Create a quote" section, using the | ||||
Request URL | https://<URL_of_the_Instance>/api/quote/v1/quotes/8cae6d8a-2a3b-4c1c-bf64-8ddef14dc863 | ||||
Response | The API retrieves the structure of the quote. Response Body
CODE
|
Editing Quote
You can update one or more quotes by passing the updates in the request body. You can update the quote header field details of any quote that is not in the accepted state.
Prerequisite
You must gather the following details to create a quote.
- Quote ID
- Quote object details
You can retrieve existing quotes using the GET/quotes
API and extract quote ID from the response. In case you have Quote ID, you can also extract the quote object details using the GET/quotes/{quoteId}
API For more information, see the "Retrieving List of Quotes" or "Retrieving Quote Details (header information)" sections or see Quoting APIs.
Example 1
The following table lists the API method, endpoints, and sample codes for requests and responses, to update quotes:
Method | PATCH |
---|---|
Endpoint | /quotes |
Request URL | https://<URL_of_the_Instance>/api/quote/v1/quotes |
Request Body | The below sample code updates the pricelist associated with the quotes with the following IDs, which were generated in the section Creating quotes.
CODE
|
Response | The API returns the structure of the updated quotes. Response Body
CODE
|
Example 2
The following table list the API method, endpoints, and sample codes for requests and responses, to update a specific quote:
Method | PATCH | ||||
---|---|---|---|---|---|
Endpoint | quotes/{quoteId} | ||||
Request Parameter | The following URL parameter is used to pass the quote ID. This quote was generated previously using the POST/quotes API and its ID was retrieved using the GET/quotes API.
| ||||
Request URL |
| ||||
Request Body | The below sample code updates the Billing To Account field associated with the quote named Tier_1 with 75723d17-937e-4213-89f8-41a8f2c81594 ID, which was generated in the section Creating Quotes. To update a single quote, you must pass the entire object with updated fields where required. In this example, Billing To Account field is changed from null to the following values:
CODE
Request Body
CODE
| ||||
Response | The API returns the updated quote object. |