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

Requisitions

Describes the Requisitions API handler in Optimizely Configured Commerce.

HTTP Verb – GET

URL – /api/v1/requisitions

Description – Returns all order lines for a customer order marked with requisition status

Base – HandlerBase<GetRequisitionCollectionParameter, GetRequisitionCollectionResult>

Handlers –

OrderHandlerDescription
500GetRequisitionOrderRetrieves a getRequisitionOrderResult using RequisitionPipeline. The result is stored in the RequisitionOrder property on the result object.
550GetRequisitionRealTimeInventoryIf InventoryService is set to RealTime, retrieves all products from RequisitionOrder's order lines. Uses GetRealTimeInventoryHandler to ensure that all of the inventory for all of the products is gotten in one request and cached in case the cache expires.
600GetOrderLinesRetrieves a order line list for the RequisitionOrder. If RequisitionId property of the parameter object isn't empty, filters the order line list by RequisitionId. The result is stored in the OrderLines property on the result object.
700ApplyPagingApplies paging to the OrderLines property on the result object. 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.
800GetProductCollectionRetrieves all product ids from OrderLines property on the result object. Uses GetProductCollectionHandler to get product collection by the product id list. The result is stored in the ProductDtos property on the result object.
900CreateGetRequisitionResultsIterates over Requisitions result and call CreateGetCartLineResult cart pipeline per each requisition. If GetRequisitionLines parameter is false, then execute next handler, otherwise iterates over RequisitionLines and adds lines to the Requisition. The result is stored in the GetRequisitionResults property on the result object.

HTTP Verb – GET

URL – /api/v1/requisitions/{requisitionid}

Description – Return a single order line from a customer order marked with requisition status

Base – HandlerBase<GetRequisitionParameter, GetRequisitionResult>

Handlers –

OrderHandlerDescription
500GetRequisitionRetrieves a requisition using the GetRequisitionCollection handler chain. The requisition and requisition line collection are stored in the Requisition and RequisitionLineCollection properties in the result object.

HTTP Verb – GET

URL – /api/v1/requisitions/{requisitionid}/requisitionlines

Description – Return a collection of requisition order lines

Base – HandlerBase<GetRequisitionLineCollectionParameter, GetRequisitionLineCollectionResult>

Handlers –

OrderHandlerDescription
500GetRequisitionRetrieves a requisition using the GetRequisitionOrder pipeline. The requisition is stored in the Requisition property in the result object.
600GetRequisitionLinesQueryCreates the initial requisitions query. The query is stored in the RequisitionLineQuery property in the result object.
700ApplyFilteringApplies filter by Requisition.Id to the RequisitionLineQuery.
800ApplyPagingApplies paging to the RequisitionLineQuery. 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. If the PageSize property has no value, the default page size will be used (configured using the "Number of items that display per page by default." setting).
900CreateGetRequisitionLineResultsExecutes the RequisitionLineQuery after the query has been filtered and paged. The result is stored in the GetRequisitionLineResults property in the result object.

HTTP Verb – GET

URL – /api/v1/requisitions/{requisitionid}/requisitionlines/{requisitionlineid}

Description – Return a single requisition order line

Base – HandlerBase<GetRequisitionLineParameter, GetRequisitionLineResult>

Handlers –

OrderHandlerDescription
500GetRequisitionLineRetrieves a requisition line using the GetRequisitionOrder pipeline. The requisition line is stored in the RequisitionLine property in the result object.

HTTP Verb – PATCH

URL – /api/v1/requisitions/{requisitionid}/requisitionlines/{requisitionlineid}

Description – Updates a single requisition order line

Base – HandlerBase<UpdateRequisitionLineParameter, UpdateRequisitionLineResult>

Handlers –

OrderHandlerDescription
500GetRequisitionLineRetrieves a requisition line using the GetRequisitionOrder pipeline. The requisition line is stored in the RequisitionLine property in the result object.
600UpdateRequisitionLine

Updates order line QtyOrdered property (RequisitionLine.OrderLine.QtyOrdered). If QtyOrdered parameter is equal to 0, then remove requisition line. Otherwise set requisition line QtyOrdered value to the QtyOrdered parameter value.

If order line QtyOrdered less or equal to 0, then remove the order line from cart using the RemoveCartLine pipeline. Otherwise recalculates the cart price using the GetCartPricing pipeline and retrieves the requisition using the GetRequisitionHandler handler chain. The GetRequisitionHandler handler chain result is stored in the GetRequisitionResult property in the result object.

HTTP Verb – DELETE

URL – /api/v1/requisitions/{requisitionid}/requisitionlines/{requisitionlineid}

Description – Deletes a single requisition order line

Base – HandlerBase<RemoveRequisitionLineParameter, RemoveRequisitionLineResult>

Handlers –

OrderHandlerDescription
500GetRequisitionLineRetrieves a requisition line using the GetRequisitionOrder pipeline. The requisition line is stored in the RequisitionLine property in the result object.
600RemoveRequisitionLineUpdates order line QtyOrdered property (RequisitionLine.OrderLine.QtyOrdered). Removes the requisition line. If order line QtyOrdered less or equal to 0, then remove the order line from cart using the RemoveCartLine pipeline. Otherwise recalculates the cart price using the GetCartPricing pipeline and retrieves the requisition using the GetRequisitionHandler handler chain. The GetRequisitionHandler handler chain result is stored in the GetRequisitionResult property in the result object.