HomeGuides
Submit Documentation FeedbackJoin Developer CommunityLog In

Job Quotes API handler

This topic describes how to use the JobQuote API handler to return a collection job quotes.

HTTP Verb: GET

URL: /api/v1/jobquotes

Description: Return a collection job quotes

Base: HandlerBase<GetJobQuoteCollectionParameter, GetJobQuoteCollectionResult>

Handlers:

OrderHandlerDescription
500GetJobQuoteCollectionHandlerGets a collection of current job quotes by either the current user or if the current user is a salesperson, then by that salesperson for the current bill to customer.
OrderHandlerDescription
500ValidateContextIf UserProfile object has no value, a forbidden error is returned.
600CreateQueryCreates the job quotes query. Applies filters and expands. The query is stored in the JobQuotesQuery property in the result object.
700CreateGetJobQuoteResultsExecutes the JobQuotesQuery, map result to the GetJobQuoteResult objects and stores it in the GetJobQuoteResults property in the result object.

HTTP Verb: GET

URL: /api/v1/jobquotes/{jobQuoteId}

Description: Return a single job quote record

Base: HandlerBase<GetJobQuoteParameter, GetJobQuoteResult>

Handlers:

OrderHandlerDescription
500GetJobQuoteHandlerIf user cannot view quote, then JobQuoteAccessDenied error result is returned, otherwise gets the job quote for the jobQuoteId.
OrderHandlerDescription
500GetCartRetrieves a cart using the GetCartHandler handler chain. If access to the cart is denied, an access denied error is returned. The cart is stored in the GetCartResult property in the result object.
600CreateGetJobQuoteResultMaps GetCartResult to the result object. Updates result properties. Maps GetCartResult.CartLineResults to the GetJobQuoteLineResult objects and stores it in the JobQuoteLineResults property in the result object.
700GetOrderLineQtySoldIf cart status equal "JobAccepted", then retrieves sold quantity for each order line and stores it in the OrderLineQtySold property in the result object.

HTTP Verb: PATCH

URL: /api/v1/jobquotes/{jobQuoteId}

Description: Update a single job quote record

Base: HandlerBase<UpdateJobQuoteParameter, UpdateJobQuoteResult>

Handlers:

OrderHandlerDescription
500UpdateJobQuoteHandlerIf order quantities are not valid, then JobQuoteServiceJobQuoteNotFound error result is returned, otherwise updates the job quote for the jobQuoteId.
OrderHandlerDescription
500ValidateContextRetrieves a job quote using the GetJobQuote handler chain. The job quote is stored in the GetJobQuoteResult property in the result object. Validates job quote quantities. If quantities are incorrect, an error is returned.
600CreateNewOrderCreates a new customer order by GetJobQuoteResult.Cart property, maps it to the GetCartResult object and stores it in the GetCartResult property in the result object.
700CopyOrderLinesCreates a copies of the GetJobQuoteResult.Cart.OrderLines objects. Sets QtyOrdered, UnitOfMeasure and QtyShipped properties to it. Adds a copies of order lines to the cart using AddCartLine pipeline.
800CopyOrderLineRfqsCreates a copies of the OrderLineRfq objects from GetJobQuoteResult.Cart.OrderLines. Inserts it to the database.

Did this page help you?