

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 为 Amazon Connect Customer Profiles 中标准订单的对象类型映射
<a name="object-type-mapping-standard-order"></a>

此部分中的主题提供了标准订单定义，以及从外部应用程序到标准订单的对象类型映射。

**Topics**
+ [亚马逊 AppIntegrations 访问要求](standard-order-appintegrations-requirements.md)
+ [亚马逊 EventBridge 访问要求](standard-order-eventbridge-requirements.md)
+ [标准订单定义](standard-order-definition.md)
+ [映射 Shopify 对象](mapping-shopify-objects-standard-order.html.md)

# 亚马逊 AppIntegrations 访问要求
<a name="standard-order-appintegrations-requirements"></a>

使用以下亚马逊 AppIntegrations 访问要求创建和删除 Shopify 与 Amazon Connect 客户资料的集成：
+ 应用程序集成：GetEventIntegration
+ 应用程序集成：ListEventIntegrationAssociations
+ 应用程序集成：CreateEventIntegrationAssociation
+ 应用程序集成：DeleteEventIntegrationAssociation

# 亚马逊 EventBridge 访问要求
<a name="standard-order-eventbridge-requirements"></a>

使用以下亚马逊 EventBridge 访问要求创建和删除 Shopify 与 Amazon Connect 客户资料的集成：
+ `events:ListTargetsByRule`
+ `events:PutRule`
+ `events:PutTargets`
+ `events:DeleteRule`
+ `events:RemoveTargets`

# Customer Profiles 标准订单对象字段
<a name="standard-order-definition"></a>

下表列出了 Customer Profiles 标准订单对象中的所有字段。


| 标准订单字段 | 数据类型 | 描述 | 
| --- | --- | --- | 
| OrderId | 字符串 | 标准订单的唯一标识符。 | 
| CustomerEmail | 字符串 | 客户的电子邮件地址。 | 
| CustomerPhone | 字符串 | 客户的电话号码。 | 
| CreatedDate | 字符串 | 订单的创建日期。 | 
| UpdatedDate | 字符串 | 订单的更新日期。 | 
| ProcessedDate | 字符串 | 订单的处理日期。 | 
| ClosedDate | 字符串 | 订单的关闭日期。 | 
| CancelledDate | 字符串 | 订单的取消日期。 | 
| CancelReason | 字符串 | 订单的取消原因。 | 
| Name | 字符串 | 订单的名称。 | 
| AdditionalInformation | 字符串 | 与订单相关的任何其它信息。 | 
| 网关 | 字符串 | 订单的支付网关。 | 
| Status | 字符串 | 订单的状态。 | 
| StatusCode | 字符串 | 订单的状态代码。有效值：DRAFT \$1 ACTIVATED | 
| StatusUrl | 字符串 | 订单的状态 URL。 | 
| CreditCardNumber | 字符串 | 客户的信用卡最后四位数字。 | 
| CreditCardCompany | 字符串 | 客户的信用卡公司。 | 
| FulfillmentStatus | 字符串 | 订单的履约状态。 | 
| TotalPrice | 字符串 | 订单的总价格。 | 
| TotalTax | 字符串 | 订单的税金总额。 | 
| TotalDiscounts | 字符串 | 订单的总折扣。 | 
| TotalItemsPrice | 字符串 | 订单的总商品价格。 | 
| TotalShippingPrice | 字符串 | 订单的总运费。 | 
| TotalTipReceived | 字符串 | 订单收到的小费总额。 | 
| 货币 | 字符串 | 订单的货币。 | 
| TotalWeight | 字符串 | 订单的总重量。 | 
| BillingAddress | OrderAddress | 客户的账单地址。 | 
| ShippingAddress | OrderAddress | 客户的配送地址。 | 
| OrderItems | OrderItem 清单 | 订单的商品。 | 
| 属性 | String-to-string 地图 | 标准订单的属性的键值对。 | 

标准订单对象按下表中的密钥建立索引。


| 标准索引名称 | 标准订单字段 | 
| --- | --- | 
| \$1orderId | OrderId | 

例如，您可以在 [SearchProfiles API](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_SearchProfiles.html) 中使用`_orderId`作为密钥名称来查找顺序与搜索值 OrderId 匹配的个人资料。您可以使用 [ListProfileObjects API](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_ListProfileObjects.html) 将`ProfileId`和`ObjectTypeName`设置为来查找与特定配置文件关联的标准订单对象`_order`。

## OrderAddress 数据类型
<a name="orderaddress-data-type"></a>


| 标准订单字段 | 数据类型 | 描述 | 
| --- | --- | --- | 
| 名称 | 字符串 | 与订单地址关联的名称。 | 
| Address1 | 字符串 | 订单地址的第一行。 | 
| Address2 | 字符串 | 订单地址的第二行。 | 
| Address3 | 字符串 | 订单地址的第三行。 | 
| Address4 | 字符串 | 订单地址的第四行。 | 
| City | 字符串 | 订单地址所在的城市。 | 
| County | 字符串 | 订单地址所在的县。 | 
| 州 | 字符串 | 订单地址所在的州。 | 
| Province | 字符串 | 订单地址所在的省。 | 
| Country | 字符串 | 订单地址所在的国家/地区。 | 
| PostalCode | 字符串 | 订单地址的邮政编码。 | 

## OrderItem 数据类型
<a name="orderitem-data-type"></a>


| 标准订单字段 | 数据类型 | 说明 | 
| --- | --- | --- | 
| 标题 | 字符串 | 订单商品的标题。 | 
| Price | 字符串 | 订单商品的价格。 | 
| Quantity | 字符串 | 订单商品的数量。 | 

# 将 Shopify 对象映射到 Amazon Connect Customer Profiles 中的标准订单
<a name="mapping-shopify-objects-standard-order.html"></a>

本主题列出了 Shopify 对象中的哪些字段映射到 Customer Profiles 中标准订单对象中的字段。

## Shopify DraftOrder -
<a name="shopify-draftorder-object.html"></a>

有关 Shopify DraftOrder 对象中所有字段的列表，请参阅 Shopify 文档中的[ DraftOrder 对象](https://shopify.dev/api/admin-rest/2021-10/resources/draftorder#resource_object)。

## 将 Shopify DraftOrder 对象映射到标准订单
<a name="shopify-draftorder-object-standardorder.html"></a>

Shopify DraftOrder 对象中字段的子集映射到客户资料中的标准订单对象。

下表列出了哪些字段可以从 Shopify DraftOrder 对象映射到标准订单。

 如果源中存在 `order_status_url`，则 `StatusCode` 为 `ACTIVATED`。否则 `StatusCode` 为 `DRAFT`。


|  Shopify-DraftOrder 来源字  |  标准订单目标字段  | 
| --- | --- | 
| id | 属性。 ShopifyOrderId | 
| customer.id | 属性。 ShopifyCustomerId | 
| note | AdditionalInformation | 
| 电子邮件 | CustomerEmail | 
| currency | 货币 | 
| created\$1at | CreatedDate | 
| updated\$1at | UpdatedDate | 
| name | Name | 
| status | Status | 
| order\$1status\$1url | StatusCode | 
| billing\$1address.address1 | BillingAddress.Address1 | 
| billing\$1address.address2 | BillingAddress.Address2 | 
| billing\$1address.city | BillingAddress.City | 
| billing\$1address.zip | BillingAddress.PostalCode | 
| billing\$1address.province | BillingAddress.省 | 
| billing\$1address.country | BillingAddress. 国家 | 
| billing\$1address.name | BillingAddress.Name | 
| shipping\$1address.address1 | ShippingAddress.Address1 | 
| shipping\$1address.address2 | ShippingAddress.Address2 | 
| shipping\$1address.city | ShippingAddress.City | 
| shipping\$1address.zip | ShippingAddress.PostalCode | 
| shipping\$1address.province | ShippingAddress.省 | 
| shipping\$1address.country | ShippingAddress. 国家 | 
| shipping\$1address.name | ShippingAddress.Name | 
| invoice\$1url | StatusUrl | 
| total\$1price | TotalPrice | 
| total\$1tax | TotalTax | 
| line\$1items[].title | OrderItems[]. 标题 | 
| line\$1items[].price | OrderItems[] .Price | 
| line\$1items[].quantity | OrderItems[]. 数量 | 

### 示例
<a name="example-shopify-draftorder-object-standardorder.html"></a>

以下示例介绍了如何将源字段映射到目标字段。

```
"shopifyOrderId": {
    "Source": "_source.detail.event.detail.payload.id",
    "Target": "_order.Attributes.ShopifyOrderId"
}
```

来自 Shopify 对象的 Shopify DraftOrder 客户数据使用以下索引与 Amazon Connect 标准订单相关联。


| 标准索引名称  | Shopify-DraftOrder 来源字  | 
| --- | --- | 
| \$1shopifyOrderId | id | 

例如，您可以在 [ListProfileObjects](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_ListProfileObjects.html)API 中`ObjectFilter.KeyName`使用 `_shopifyOrderId` as 来查找标准订单。您可以通过使用`ProfileId`和`ObjectTypeName`设置为的 [ListProfileObjects](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_ListProfileObjects.html)API 来查找与特定个人资料关联的 Shopify DraftOrder 对象`Shopify-DraftOrder`。

## Shopify-Order 对象
<a name="shopify-order-object.html"></a>

有关 Shopify-Order 对象中所有字段的列表，请参阅 Shopify 文档中的[订单对象](https://shopify.dev/api/admin-rest/2021-10/resources/order#resource_object)。

## 将 Shopify-Order 对象映射到标准订单
<a name="mapping-shopify-order-object-standarorder.html"></a>

Shopify-Order 对象中的字段子集映射到 Customer Profiles 中的标准订单对象。

下表列出了哪些字段可以从 Shopify-Order 对象映射到标准订单。

如果源中存在 `order_status_url`，则 `StatusCode` 为 `ACTIVATED`。否则 `StatusCode` 为 `DRAFT`。


| Shopify-Order 源字段 | 标准订单目标字段 | 
| --- | --- | 
| id | 属性。 ShopifyOrderId | 
| customer.id | 属性。 ShopifyCustomerId | 
| cancelled\$1at | CancelledDate | 
| cancel\$1reason | CancelReason | 
| closed\$1at | ClosedDate | 
| created\$1at | CreatedDate | 
| currency | 货币 | 
| 电子邮件 | CustomerEmail | 
| financial\$1status | Status | 
| order\$1status\$1url | StatusCode | 
| fulfillment\$1status | FulfillmentStatus | 
| 网关 | 网关 | 
| name | Name | 
| note | AdditionalInformation | 
| order\$1status\$1url | StatusUrl | 
| phone | CustomerPhone | 
| processed\$1at | ProcessedDate | 
| total\$1discounts | TotalDiscounts | 
| total\$1line\$1items\$1price | TotalItemsPrice | 
| total\$1price | TotalPrice | 
| total\$1shipping\$1price\$1set.shop\$1money.amount | TotalShippingPrice | 
| total\$1tax | TotalTax | 
| total\$1tip\$1received | TotalTipReceived | 
| total\$1weight | TotalWeight | 
| updated\$1at | UpdatedDate | 
| billing\$1address.address1 | BillingAddress.Address1 | 
| billing\$1address.address2 | BillingAddress.Address2 | 
| billing\$1address.city | BillingAddress.City | 
| billing\$1address.zip | BillingAddress.PostalCode | 
| billing\$1address.province | BillingAddress.省 | 
| billing\$1address.country | BillingAddress. 国家 | 
| billing\$1address.name | BillingAddress.Name | 
| payment\$1details.credit\$1card\$1number | CreditCardNumber | 
| payment\$1details.credit\$1card\$1company | CreditCardCompany | 
| shipping\$1address.address1 | ShippingAddress.Address1 | 
| shipping\$1address.address2 | ShippingAddress.Address2 | 
| shipping\$1address.city | ShippingAddress.City | 
| shipping\$1address.zip | ShippingAddress.PostalCode | 
| shipping\$1address.province | ShippingAddress.省 | 
| shipping\$1address.country | ShippingAddress. 国家 | 
| shipping\$1address.name | ShippingAddress.Name | 
| line\$1items[].title | OrderItems[]. 标题 | 
| line\$1items[].price | OrderItems[] .Price | 
| line\$1items[].quantity | OrderItems[]. 数量 | 

### 示例
<a name="example-shopify-draftorder-object-standardorder.html"></a>

以下示例介绍了如何将源字段映射到目标字段。

```
"shopifyOrderId": {
    "Source": "_source.detail.event.detail.payload.id",
    "Target": "_order.Attributes.ShopifyOrderId"
}
```

来自 Shopify 对象中的 Shopify-Order 客户数据使用以下索引与 Amazon Connect 标准订单相关联。


| 标准索引名称 | Shopify-Order 源字段 | 
| --- | --- | 
| \$1shopifyOrderId | id | 

例如，您可以在 [ListProfileObjects](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_ListProfileObjects.html)API 中`ObjectFilter.KeyName`使用 `_shopifyOrderId` as 来查找标准订单。你可以使用将和设置为的 [ListProfileObjects](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_ListProfileObjects.html)API 来查找与特定配置文件关联的 Shopify-Order `ProfileId` 对象。`ObjectTypeName` `Shopify-Order`