Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback


**HTTP Verb** – GET

**URL** – /api/v1/orders/{orderid}

**Description** –Return a single order record

**Base** – HandlerBase\<GetOrderParameter, GetOrderResult>

**Handlers**

OrderHandlerDescription
500GetSettingsPopulate IsRealTime, ReturnReasons and GetOrderLines properties of the result object
600GetRealTimeJobDefinitionGets real time order historydetail integration job and sets its parameters, if IsRealTime equals "true".
700ExecuteRealTimeJobExecutes real time order history detail integration job and save result dataset to RealTimeDataSet property on the result object, if IsRealTime equals "true".
800MapRealTimeDataSetParses OrderHistory and OrderHistoryLine dataset's tables and creates OrderHistory and OrderHistoryLine lists, which are saved as OrderHistory property, if IsRealTime equals "true".
900GetStoredOrderHistoryGets OrderHistory with OrderHistoryLine by OrderNumber and current customer number, save it to OrderHistory property and populate ShipViaDescription if OrderHistory has ShipCode, if IsRealTime equals "false".
1000GetLinesIf GetOrderLines property of the parameter object equals "true", maps OrderHistoryLines to GetOrderLineResults property on the result object and populates CanAddToCart, CanAddAllToCart, ShowTaxAndShipping properties of the result object.
1100GetShipmentsIf GetShipments property of the parameter object equals "true", populates Shipments property of the result object by order history ErpOrderNumber or WebOrderNumber using shipmentService.
1200GetCurrencyPopulate Currency property on the result object by OrderHistory's CurrencyCode.
1300GetStatusMappingPopulate OrderStatusMapping property on the result object by OrderHistory's Status.
1400CopyCustomPropertiesToResultCopy order history custom properties and order history lines custom properties to the result object.

**HTTP Verb** – GET

**URL** – /api/v1/orders

**Description** – Return a collection of orders

**Base** – HandlerBase\<GetOrderCollectionParameter, GetOrderCollectionResult>

**Handlers**

<table class="TableStyle-Borders" style="margin-left: 0; margin-right: auto; width: 100%;" data-cellspacing="0"> <thead> <tr class="header TableStyle-Borders-Head-Header1"> <th class="TableStyle-Borders-HeadE-Regular-Header1">Order</th> <th class="TableStyle-Borders-HeadE-Regular-Header1">Handler</th> <th class="TableStyle-Borders-HeadD-Regular-Header1">Description</th> </tr> </thead> <tbody> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">500</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetSettings</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Populate IsRealTime, ShowErpOrderNumber and GetOrderLines property of the result object</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">600</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetRealTimeJobDefinition</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Gets real time order history integration job and sets its parameters, if IsRealTime equals "true".</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">700</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ExecuteRealTimeJob</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Executes real time order history integration job and save result dataset into RealTimeDataSet property of the result object, if IsRealTime equals "true".</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">800</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">MapRealTimeDataSet</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Parses OrderHistory and OrderHistoryLine dataset's tables and creates OrderHistory and OrderHistoryLine lists, which are saved as OrdersQuery property, if IsRealTime equals "true".</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">900</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetStoredCollectionQuery</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Gets all OrderHistories with OrderHistoryLines, which belong to current customer, and save them to OrdersQuery, if IsRealTime equals "false".</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1000</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ApplyFilteringToStoredCollectionQuery</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>Filters the OrdersQuery, if specified in the parameter and IsRealTime equals "false".</p> if StatusCollection property has any statuses, returns OrderHistories if StatusCollection contains their statusif OrderNumberproperty has value, returns OrderHistories if their order number equals OrderNumber propertyif OrderNumber property has value, returns OrderHistories if their order number equals OrderNumber propertyif CustomerPO property has value, returns OrderHistories if their CustomerPO equals CustomerPO propertyif CustomerSequence property doesn't equal "-1", returns OrderHistories if their CustomerSequence equals CustomerSequence property or emptyif ToDate property has value, returns OrderHistories if their OrderDate less or equals ToDate propertyif FromDate property has value, returns OrderHistories if their OrderDate more or equals FromDate propertyif OrderTotalOperator property has value, returns OrderHistories if their OrderTotal meets OrderTotalOperator propertyif Search property has value, returns OrderHistories if their properties contain Search property</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ApplySort</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Applies a sort to the OrdersQuery. The query is sorted using the Sort property on the parameter object (in ascending order), otherwise the query is sorted by OrderDate (in descending order).</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1200</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ApplyPaging</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Applies paging to the OrdersQuery. 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.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1300</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ExecuteQuery</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Executes the OrdersQuery after the query has been filtered, sorted, and paged. The result is stored in the OrderHistoryCollection property on the result object.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyB-Regular-Row1">1400</td> <td class="TableStyle-Borders-BodyB-Regular-Row1">CreateGetOrderResults</td> <td class="TableStyle-Borders-BodyA-Regular-Row1">If OrderHistoryCollection property on the result object has values, they are transformed into a collection of OrderHistoryCollection objects using the GetOrderHandler handler. The result is stored in the GetOrderResults property on the result object.</td> </tr> </tbody> </table>

**HTTP Verb** – GET

**URL** – /api/v1/orders/{orderid}?expand=shipments

**Description** – Gets the shipments for the order.

**Base** – HandlerBase\<GetShipmentCollectionParameter, GetShipmentCollectionResult>

**Handlers**

OrderHandlerDescription
500GetShipmentQueryCreates the shipment query that returns list of shipments by WebOrderNumber or ErpOrderNumber. The query is stored in the ShipmentQuery property on the result object.
600ApplySortApplies sorting to the ShipmentQuery property on the result object. If the Sort property on the parameter object has a value, the query will be sorted with that value. If the Sort property is empty, the query will be sorted by the ShipmentNumber property.
700ApplyPagingApplies paging to the ShipmentQuery. 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.
800ExecuteQueryExecutes the ShipmentQuery after the query has been expanded, filtered, sorted, and paged. The result is stored in the Shipments property on the result object.
900CreateShipmentDtosIf the Shipments property has values on the result object, they are transformed into a collection of getShipmentResult objects using the shipmentService. The result is stored in the ShipmentDtos property on the result object.

**HTTP Verb** – PATCH

**URL** – /api/v1/orders/{orderid}

**Description** – Updates a single order

**Base** – HandlerBase\<UpdateOrderParameter, UpdateOrderResult>

**Handlers**

OrderHandlerDescription
500UpdateOrderRetrieves an order using the OrderNumber property on the parameter object. If a order is not found, an error is returned. If parameter object has Status property, updates order status. Retrieves OrderStatusMapping according to the status. The order is stored in the OrderResult property on the result object.

**HTTP Verb** – POST

**URL** – /api/v1/orders/{orderid}/returns

**Description** – Creates and sends an RMA request email

**Base** – HandlerBase\<AddRmaParameter, AddRmaResult>

**Handlers**

OrderHandlerDescription
500ValidateContextValidates UserProfileDto or Customer is not null in site context, otherwise return NotFound
600ValidateRmaValidates each RMA line quantity and also reasonCode, if code is required.
700PopulateEmailModelPopulates EmailModel property on the result object by order's and orderLines' information.
800SendEmailSends "Request RMA" email using email service.