EntityView sample – Order Summary

Version: 10.3

Properties added, provided by the Orders plugin:

RequestResponse
OrderConfirmationId<=order.OrderConfirmationId
OrderPlacedDate<=order.OrderPlacedDate
DateUpdated<=order.DateUpdated
Status<=order.Status
PaymentStatus<=order.PaymentStatus
ShopName<=order.ShopName
CustomerEmail<=order.GetComponent<ContactComponent>().Email
OrderSubTotal<=order.Totals.SubTotal
OrderAdjustmentsTotal<=order.Totals.AdjustmentsTotal
OrderGrandTotal<=order.Totals.GrandTotal
OrderPaymentsTotal<=order.Totals.PaymentsTotal

Provided by the GiftCards plugin, for example, if the order involves a gift card purchase:

RequestResponse
GiftCardPurchased<=line.GetComponent<GiftCardComponent>().GiftCardCode
GiftCardAmount<=line.GetComponent<GiftCardComponent>().GiftCardAmount

Provided by the AdventureWorks plugin. This is a sample customization where the order uses a coupon:

RequestResponse
CouponUsed<=line.GetComponent<CartCouponsComponent>().Name

Sample call to retrieve EntityView:

RequestResponse
http://{{ServiceHost}}/{{ShopsApi}}/GetEntityView()

Body:

RequestResponse
{
    "entityId":"{006fa25e-d3ca-4e05-97fb-55afd8568e2e}",
    "viewName":"Summary",
    "forAction":""
}

Sample results from the call:

RequestResponse
{
  "@odata.context": "http://localhost:5000/Api/$metadata#Sitecore.Commerce.EntityViews.EntityView",
  "@odata.type": "#Sitecore.Commerce.EntityViews.EntityView",
  "Name": "Summary",
  "Policies": [],
  "DisplayName": "Summary",
  "EntityId": "{006fa25e-d3ca-4e05-97fb-55afd8568e2e}",
  "Action": "",
  "ItemId": "",
  "Properties": [
    {
      "Name": "OrderConfirmationId",
      "Policies": [],
      "DisplayName": "Order Confirmation Id",
      "Value": "{006fa25e-d3ca-4e05-97fb-55afd8568e2e}",
      "IsHidden": false,
      "OriginalType": "String",
      "IsReadOnly": true,
      "UiType": ""
    },
    {
      "Name": "OrderPlacedDate",
      "Policies": [],
      "DisplayName": "Placed Date",
      "Value": "8/19/2016 9:52:02 PM",
      "IsHidden": false,
      "OriginalType": "DateTime",
      "IsReadOnly": true,
      "UiType": ""
    },
    {
      "Name": "DateUpdated",
      "Policies": [],
      "DisplayName": "Date Updated",
      "Value": "8/19/2016 9:52:09 PM",
      "IsHidden": false,
      "OriginalType": "DateTime",
      "IsReadOnly": true,
      "UiType": ""
    },
    {
      "Name": "Status",
      "Policies": [],
      "DisplayName": "Status",
      "Value": "Completed",
      "IsHidden": false,
      "OriginalType": "String",
      "IsReadOnly": true,
      "UiType": ""
    },
    {
      "Name": "PaymentStatus",
      "Policies": [],
      "DisplayName": "Payment Status",
      "Value": "Paid",
      "IsHidden": false,
      "OriginalType": "String",
      "IsReadOnly": true,
      "UiType": ""
    },
    {
      "Name": "ShopName",
      "Policies": [],
      "DisplayName": "Shop Name",
      "Value": "Storefront",
      "IsHidden": false,
      "OriginalType": "String",
      "IsReadOnly": true,
      "UiType": ""
    },
    {
      "Name": "CustomerEmail",
      "Policies": [],
      "DisplayName": "Customer Email",
      "Value": "[email protected]",
      "IsHidden": false,
      "OriginalType": "String",
      "IsReadOnly": true,
      "UiType": ""
    },
    {
      "Name": "OrderSubTotal",
      "Policies": [],
      "DisplayName": "Order Sub Total",
      "Value": "USD940.00",
      "IsHidden": false,
      "OriginalType": "Money",
      "IsReadOnly": true,
      "UiType": ""
    },
    {
      "Name": "OrderAdjustmentsTotal",
      "Policies": [],
      "DisplayName": "Order Adjustments Total",
      "Value": "USD94.00",
      "IsHidden": false,
      "OriginalType": "Money",
      "IsReadOnly": true,
      "UiType": ""
    },
    {
      "Name": "OrderGrandTotal",
      "Policies": [],
      "DisplayName": "Order Grand Total",
      "Value": "USD1,034.00",
      "IsHidden": false,
      "OriginalType": "Money",
      "IsReadOnly": true,
      "UiType": ""
    },
    {
      "Name": "OrderPaymentsTotal",
      "Policies": [],
      "DisplayName": "Order Payments Total",
      "Value": "USD413.60",
      "IsHidden": false,
      "OriginalType": "Money",
      "IsReadOnly": true,
      "UiType": ""
    }
  ],
  "ChildViews": [],
  "DisplayRank": 500,
  "UiHint": "Flat"
}

Do you have some feedback for us?

If you have suggestions for improving this article,