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

Requisitions API handler

Return all order lines for a customer order marked with requisition status.

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
500GetRequisitionCollectionHandlerIf website configuration setting, "Requisitions_Enabled" is not set to "true", then returns Not enabled error message. If there is no logged-in user or that user is not set as an Administrator, then Forbidden error result is returned. Otherwise, gets a collection of order lines for a customer order for the current bill to and ship to that is marked with a requisition order status.
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
500GetRequisitionHandlerIf website configuration setting, "Requisitions_Enabled" is not set to "true", then returns Not enabled error message. If there is no logged-in user or that user is not set as an Administrator, then Forbidden error result is returned. Otherwise, gets an order line of for a requisition for the matching requisitionid. If no order line is found, then Forbidden error result is returned.
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
500GetRequisitionLineCollectionHandlerIf website configuration setting, "Requisitions_Enabled" is not set to "true", then returns Not enabled error message. If there is no logged-in user or that user is not set as an Administrator, then Forbidden error result is returned. Otherwise, gets a collection of requisition order lines for a requisition for the matching requisitionid.
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
500GetRequisitionLineHandlerIf website configuration setting, "Requisitions_Enabled" is not set to "true", then returns Not enabled error message. If there is no logged-in user or that user is not set as an Administrator, then Forbidden error result is returned. If no order is found matching the requisitionid or requisitionlineid, then Forbidden error result is returned. Otherwise, gets a requisition order line for a requisition for the matching requisitionid and requisitionlineid.
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
500UpdateRequisitionLineHandlerIf website configuration setting, "Requisitions_Enabled" is not set to "true", then returns Not enabled error message. If there is no logged-in user or that user is not set as an Administrator, then Forbidden error result is returned. If no order is found matching the requisitionid or requisitionlineid, then Forbidden error result is returned. Otherwise, gets a requisition order line for a requisition for the matching requisitionid and requisitionlineid. If the passed in qty ordered value is 0, then the OrderLineRequisition is deleted. If the qty ordered on the OrderLine is 0 or less, then that associated OrderLine is removed.
OrderHandlerDescription
500GetRequisitionLineRetrieves a requisition line using the GetRequisitionOrder pipeline. The requisition line is stored in the RequisitionLine property in the result object.
600UpdateRequisitionLineUpdates 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
500RemoveRequisitionLineHandlerIf website configuration setting, "Requisitions_Enabled" is not set to "true", then returns Not enabled error message. If there is no logged-in user or that user is not set as an Administrator, then Forbidden error result is returned. If no order is found matching the requisitionid or requisitionlineid, then Forbidden error result is returned. Otherwise, gets a requisition order line for a requisition for the matching requisitionid and requisitionlineid. The OrderLineRequisition is deleted. If the qty ordered on the OrderLine is 0 or less, then that associated OrderLine is removed.
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.