---
title: "EntityViewサンプル – 注文プレビュー"
slug: "entityview-sample---order-preview"
abstract: "Order preview Entity Viewの作業のためのコードサンプルを提供します。"
---
# EntityViewサンプル – 注文プレビュー

Ordersプラグインによって提供されたプロパティが追加されました:

OrderConfirmationId<=order.OrderConfirmationId
OrderPlacedDate<=order.OrderPlacedDate
Status<=order.Status
PaymentStatus<=order.PaymentStatus
ShopName<=order.ShopName
CustomerEmail<=order.GetComponent<ContactComponent>().Email
OrderTotal<=order.Totals.GrandTotal

EntityViewを取得するためのサンプル呼び出し:

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

本文:

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

電話会議のサンプル結果:

{
 "@odata.context": "http://localhost:5000/Api/$metadata#Sitecore.Commerce.EntityViews.EntityView",
 "@odata.type": "#Sitecore.Commerce.EntityViews.EntityView",
 "Name": "Preview",
 "Policies": ,
 "DisplayName": "Preview",
 "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": false,
 "UiType": ""
 },
 {
 "Name": "OrderPlacedDate",
 "Policies": ,
 "DisplayName": "Placed Date",
 "Value": "8/19/2016 \`9:52\`:02 PM",
 "IsHidden": false,
 "OriginalType": "DateTime",
 "IsReadOnly": false,
 "UiType": ""
 },
 {
 "Name": "Status",
 "Policies": ,
 "DisplayName": "Status",
 "Value": "Completed",
 "IsHidden": false,
 "OriginalType": "String",
 "IsReadOnly": false,
 "UiType": ""
 },
 {
 "Name": "PaymentStatus",
 "Policies": ,
 "DisplayName": "Payment Status",
 "Value": "Paid",
 "IsHidden": false,
 "OriginalType": "String",
 "IsReadOnly": false,
 "UiType": ""
 },
 {
 "Name": "ShopName",
 "Policies": ,
 "DisplayName": "Shop Name",
 "Value": "Storefront",
 "IsHidden": false,
 "OriginalType": "String",
 "IsReadOnly": false,
 "UiType": ""
 },
 {
 "Name": "OrderTotal",
 "Policies": ,
 "DisplayName": "Order Total",
 "Value": "USD1,034.00",
 "IsHidden": false,
 "OriginalType": "Money",
 "IsReadOnly": false,
 "UiType": ""
 },
 {
 "Name": "CustomerEmail",
 "Policies": ,
 "DisplayName": "Customer Email",
 "Value": "email@domain.com",
 "IsHidden": false,
 "OriginalType": "String",
 "IsReadOnly": false,
 "UiType": ""
 }
 ,
 "ChildViews": ,
 "DisplayRank": 500,
 "UiHint": "Flat"
}