Quote API handlers
Describes how to add a collection of quote lines for the found cart/customer order.
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 –
Order | Handler | Description |
---|---|---|
500 | AddQuoteHandler | Calls UpdateQuoteHandler…with a status of QuoteRequestedStatus |
Order | Handler | Description |
---|---|---|
500 | AddQuote | Add 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 –
Order | Handler | Description |
---|---|---|
500 | AddQuoteMessage | Add 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 –
Order | Handler | Description |
---|---|---|
500 | GetQuoteCollectionHandler | Gets all the current customer orders with quote statuses on them using the passed in filters. |
Order | Handler | Description |
---|---|---|
500 | CreateQuery | Retrieves 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. |
600 | ApplyFiltering | 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 |
700 | ExecuteQuery | Executes the QuotesQuery after the query has been filtered and expanded. The result is stored in the QuoteCollection property on the result object. |
800 | ApplySort | Applies a sort to the QuoteCollection. The quotes that require action and are more urgent will display first. |
900 | ApplyPaging | Applies 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. |
1000 | GetSalespersons | If 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 –
Order | Handler | Description |
---|---|---|
500 | GetQuoteHandler | If user cannot view quotes, then RfqAccessDenied error result is returned. Gets the cart for the matching quoteid, if a cart is not found then a CartServiceCartNotFound error result is returned. Gets all the quote lines for the found cart/cart lines. |
Order | Handler | Description |
---|---|---|
500 | GetCart | Retrieves 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. |
600 | CreateGetQuoteResult | Maps GetCartResult property to the result object. Sets IsEditable property in the result object. |
700 | GetMessageCollection | Retrieves a messages using the GetMessageCollectionHandler handler chain. The messages are stored in the MessageCollection property in the result object. |
800 | GetCalculationMethods | If 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. |
900 | GetQuoteLineResults | Maps CartLineResults to the quote line results. The quote line results are stored in the QuoteLineResults property in the result object. |
1000 | CreatePricingRfqs | If 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 –
Order | Handler | Description |
---|---|---|
500 | GetQuoteLineHandler | If user cannot view quotes, then RfqAccessDenied error result is returned. Gets the quote line found from the passed in quotelineid parameter. |
500 | GetQuoteLine | Retrieves 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 –
Order | Handler | Description |
---|---|---|
500 | UpdateQuoteHandler | If parameter status is QuoteRequested, QuoteProposed or JobAccpeted, then calls the next handler. Otherwise, gets the quote based on the quoteid, if no cart/customer order is found for that quoteid, then Not Found error result is returned. Otherwise, the quote is updated with the passed in values, then next handler is called. |
550 | UpdateQuoteStatusHandler | If parameter status is QuoteRequested, QuoteProposed or JobAccpeted, then the cart/customer order is updated with the quote parameter values. Otherwise, next handler is called. |
600 | UpdateQuoteSendEmailHandler | If the parameter has no status value, then the next handler is called. If quote doesn't exist or user profile does not exist, then RfqServiceQuoteNotFound error result is returned. Otherwise and email is sent with the found quote information. |
650 | UpdateQuoteAddMessageHandler | If the parameter has no status value, then the next handler is called. If quote doesn't exist or user profile does not exist, then RfqServiceQuoteNotFound error result is returned. If the status is not "requested", "proposed", "declined", or "submitted" then next handler is called. Otherwise, adds a new Message for the quote. |
700 | UpdateQuotePricesHandler | If there is no calculation method or percent parameter, then next handler is called. Gets the salesperson associated to the user, if no salesperson exists, then calls next handler. Salesperson pricing/discount values are checked against the parameter values, if they don't validate then an RfqServiceInvalidDiscount error result is returned. Otherwise new quoted prices are added/updated for each found order line. |
Order | Handler | Description |
---|---|---|
500 | UpdateQuote | If 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. |
600 | UpdateStatus | If 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. |
700 | UpdateExpirationDate | If ExpirationDate parameter has a value, then updates QuoteExpirationDate quote property to ExpirationDate parameter value. |
800 | PopulateEmailModel | If 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. |
900 | SendEmail | If Status parameter is blank or EmailModel property has no value, then bypasses this handler. Sends the email. |
1000 | CalculatePrices | If 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. |
1100 | AddMessage | If 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 –
Order | Handler | Description |
---|---|---|
500 | UpdateQuoteLineHandler | If user cannot view quotes, then RfqAccessDenied error result is returned. If no quote line is found, then returns RfqServiceQuoteLineNotFound. Updates the quote line found from the passed in quotelineid parameter. |
Order | Handler | Description |
---|---|---|
500 | GetQuoteLine | Retrieves 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. |
600 | UpdateQtyOrdered | If 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. |
700 | CalculatePrices | If 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 –
Order | Handler | Description |
---|---|---|
500 | GetQuote | Retrieves a quote using the GetQuoteHandlerhandler chain. The quote object is stored in the GetQuoteResult property in the result object. |
600 | RemoveQuote | If IsSalesperson property in GetQuoteResult object is false, returns an access denied error. Otherwise removes the quote. |
Updated over 1 year ago