Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Quote

Describes the Quote API handler in Optimizely Configured Commerce.

HTTP Verb – POST

URL – /api/v1/quotes

Description – Add a collection of quote lines for the found cart/customer order

Base – HandlerBase<AddQuoteParameter, AddQuoteResult>

Handlers –

OrderHandlerDescription
500AddQuoteAdd a quote using the UpdateQuoteHandlerhandler chain. The added quote is stored in the GetQuoteResult property in the result object.

HTTP Verb – POST

URL – /api/v1/quotes/{quoteId}/messages

Description – Posts the specified RFQ message parameter.

Base – HandlerBase<AddQuoteMessageParameter, AddQuoteMessageResult>

Handlers –

OrderHandlerDescription
500AddQuoteMessageAdd a quote message using the AddMessageHandlerhandler chain. The added message is stored in the MessageAudit property on the result object. This will be obsolete as of version 4.5 and will be moved to the Messages handler.

HTTP Verb – GET

URL – /api/v1/quotes

Description – Returns all customer orders with quote statuses

Base – HandlerBase<GetQuoteCollectionParameter, GetQuoteCollectionResult>

Handlers –

OrderHandlerDescription
500CreateQueryRetrieves a salesperson by current user profile id and stored it in the CurrentSalesperson property on the result object. Creates the initial quotes query that returns quotes (CustomerOrder) and applies filtering by quote Type and Status. The query is stored in the QuotesQuery property in the result object.
600ApplyFiltering

Applies additional filters to the QuotesQuery.

If QuoteNumber parameter has a value, then filter QuotesQuery by QuoteNumber parameterFilter QuotesQuery by SalespersonId propertyFilter QuotesQuery by PlacedByUserProfileId property (should equal UserProfileId if this parameter is not empty, otherwise should equal the current user id if CurrentSalesperson result property has no value)Filter QuotesQuery by CustomerId property (should equal CustomerId if this parameter is not empty, otherwise should equal the current BillTo id if CurrentSalesperson result property has no value)If FromDate parameter has a value, then filter QuotesQuery by FromDate parameterIf ToDate parameter has a value, then filter QuotesQuery by ToDate parameterIf ExpireFromDate parameter has a value, then filter QuotesQuery by ExpireFromDate parameter, otherwise by current dateIf ExpireToDate parameter has a value, then filter QuotesQuery by ExpireToDate parameter
700ExecuteQueryExecutes the QuotesQuery after the query has been filtered and expanded. The result is stored in the QuoteCollection property on the result object.
800ApplySortApplies a sort to the QuoteCollection. The quotes that require action and are more urgent will display first.
900ApplyPagingApplies paging to the QuoteCollection. If the PageSize property on the parameter object has a value, the query is paged using the PageSize and Page properties on the parameter object.
1000GetSalespersonsIf CurrentSalesperson property from result object has a value and GetSalespersonList parameter is true, retrieves a salespersons where SalesManagerId equal the id from CurrentSalesperson property. The result is stored in the SalespersonList property on the result object.

HTTP Verb – GET

URL – /api/v1/quotes/{quoteid:guid}

Description – Return a collection of quote lines for the found cart/customer order

Base – HandlerBase<GetQuoteParameter, GetQuoteResult>

Handlers –

OrderHandlerDescription
500GetCartRetrieves a cart using the GetCartHandler handler chain. If a cart is not found or cart has a type not equal "Quote" or "Job", a not found error is returned. If access to cart is denied, an access denied error is returned. The cart is stored in the GetCartResult property in the result object.
600CreateGetQuoteResultMaps GetCartResult property to the result object. Sets IsEditable property in the result object.
700GetMessageCollectionRetrieves a messages using the GetMessageCollectionHandler handler chain. The messages are stored in the MessageCollection property in the result object.
800GetCalculationMethodsIf salesperson has a value returns calculation methods according to RFQ settings ("Display List Price", "Display Customer Price", "Display Unit Cost"). The calculation methods are stored in the CalculationMethods property in the result object.
900GetQuoteLineResultsMaps CartLineResults to the quote line results. The quote line results are stored in the QuoteLineResults property in the result object.
1000CreatePricingRfqsIf CalculationMethods property has a value, retrieves a pricing for each quote line result using the GetPricingRfq pipeline.

HTTP Verb – GET

URL – /api/v1/quotes/{quotelineid:guid}

Description – Returns a single quote line

Base – HandlerBase<GetQuoteLineParameter, GetQuoteLineResult>

Handlers –

OrderHandlerDescription
500GetQuoteLineRetrieves a quote using the GetQuoteHandlerhandler chain and then retrieves a quote line from this quote by QuoteLineId parameter. The qoute line is stored in the result object.

HTTP Verb – PATCH

URL – /api/v1/quotes/{quoteid:guid}

Description – Updates a quote for the found cart/customer order

Base – HandlerBase<UpdateQuoteParameter, UpdateQuoteResult>

Handlers –

OrderHandlerDescription
500UpdateQuoteIf Status parameter is not equal to "QuoteRequested", "QuoteProposed" and "JobAccepted", then retrieves a quote using the GetQuoteHandlerhandler chain. If the quote was not found, an error is returned. Updates Status, Type and CustomerReference1 properties in the quote object.  The quote object is stored in the GetQuoteResult property in the result object.
600UpdateStatusIf Status parameter is equal to "QuoteRequested", "QuoteProposed" or "JobAccepted", then updates a quote using the UpdateCartHandlerhandler chain. Then retrieves a quote using the GetQuoteHandler handler chain. The quote object is stored in the GetQuoteResult property in the result object.
700UpdateExpirationDateIf ExpirationDate parameter has a value, then updates QuoteExpirationDate quote property to ExpirationDate  parameter value.
800PopulateEmailModelIf Status parameter is blank, then bypasses this handler. If PlacedByUserProfile quote property has no value, then a not found error is returned. Otherwise populate an email model. The email model object is stored in the EmailModel property in the result object.
900SendEmailIf Status parameter is blank or EmailModel property has no value, then bypasses this handler. Sends the email.
1000CalculatePricesIf CalculationMethod or Percent parameters has no values, then bypasses this handler. Retrieves a salesperson. If salesperson was not found, then bypasses this handler. Calculates and updates quote lines prices. Retrieves a quote using the GetQuoteHandlerhandler chain. The quote object is stored in the GetQuoteResult property in the result object.
1100AddMessageIf Status parameter is blank, then bypasses this handler. If PlacedByUserProfile quote property has no value, then a not found error is returned. Retrieves a user to add message. Adds a quote message using the AddQuoteMessageHandlerhandler chain.

HTTP Verb – PATCH

URL – /api/v1/quotes/{quotelineid:guid}

Description – Updates a single quote line

Base – HandlerBase<UpdateQuoteLineParameter, UpdateQuoteLineResult>

Handlers –

OrderHandlerDescription
500GetQuoteLineRetrieves a quote line using QuoteLineDto.OrderLineId parameter. If the quote line was not found, a not found error is returned. The quote line entity is stored in the QuoteLine property in the result object. Then retrieves a quote line using the GetQuoteLineHandler handler chain. This quote line object is stored in the GetQuoteLineResult property in the result object.
600UpdateQtyOrderedIf QtyOrdered parameter has no value, then bypasses this handler. If rounded quantity is greater then MaxQty, then an error is returned. Updates the quote line quantity ordered. Recalculates a quote line pricing using GetCartPricing pipeline.
700CalculatePricesIf PricingRfq parameter has no value, then bypasses this handler. Retrieves a salesperson. If salesperson was not found, then bypasses this handler. If any price from PricingRfq.PriceBreaks parameter is less then MinimumPriceAllowed, then an error is returned. Creates OrderLineRfq entity if it doesn't exists in QuoteLine property in the result object. Calculate quote line pricing using GetCartPricing pipeline. Retrieves a quote line using the GetQuoteLineHandler handler chain. The quote line object is stored in the GetQuoteLineResult property in the result object.

HTTP Verb – DELETE

URL – /api/v1/quotes/{quoteId}

Description – Deletes the quote for the specified quote identifier.

Base – HandlerBase<RemoveQuoteParameter, RemoveQuoteResult>

Handlers –

OrderHandlerDescription
500GetQuoteRetrieves a quote using the GetQuoteHandlerhandler chain. The quote object is stored in the GetQuoteResult property in the result object.
600RemoveQuoteIf IsSalesperson property in GetQuoteResult object is false, returns an access denied error. Otherwise removes the quote.