区分点餐和外卖操作链接

入门级集成合作伙伴可以将不同的 action_link_type 与其 action_link 相关联。action_link_type 有助于识别当用户通过该链接重定向至合作伙伴网站时可以执行什么操作。

  • 每个 action_link 只能与一个 action_link_type 相关联。

订餐时,用户可以请求执行以下两项操作之一:

  • 要求从餐馆取餐(订餐)
  • 请求将食物送到特定地点(订餐外卖)

我们建议所有参与 Food Actions 的合作伙伴使用 action_linkaction_link_type = ACTION_LINK_TYPE_ORDER_FOOD 向我们发送 action_link,建议您更新 Feed,使其与当前方法一致。

支持订餐外卖自提的商家

商家

{
  "merchant": [
    {
      "merchant_id": "merch10",
      "name": "Sample Restaurant",
      "telephone": "+1-650-123-4567",
      "url": "https://www.restaurantsamplewebsite.com",
      "category": "restaurant",
      "geo": {
        "address": {
          "street_address": "803 11th Avenue",
          "locality": "Sunnyvale",
          "region": "CA",
          "country": "USA",
          "postal_code": "94089"
        }
      },
      "action_link": [
        {
          "url": "https://www.partnerwebsite.com/foodtakeout/merch34",
          "action_link_type": "ACTION_LINK_TYPE_ORDER_FOOD_TAKEOUT",
          "language": "en",
          "platform": "ACTION_PLATFORM_WEB_APPLICATION"
        }
      ]
    }
  ]
}

支持订餐的商家

商家

{
 "merchant": [
    {
      "merchant_id": "merch10",
      "name": "Sample Restaurant",
      "telephone": "+1-650-123-4567",
      "url": "https://www.restaurantsamplewebsite.com",
      "category": "restaurant",
      "geo": {
        "address": {
          "street_address": "803 11th Avenue",
          "locality": "Sunnyvale",
          "region": "CA",
          "country": "USA",
          "postal_code": "94089"
        }
      },
      "action_link": [
        {
          "url": "https://www.partnerwebsite.com/fooddelivery/merch34",
          "action_link_type": "ACTION_LINK_TYPE_ORDER_FOOD_DELIVERY",
          "language": "en",
          "platform": "ACTION_PLATFORM_WEB_APPLICATION"
        }
      ]
    }
  ]
}

支持外卖自提和送餐的商家

如果商家同时支持“点餐送餐”和“订餐”功能,建议您提供两个单独的 action_link 并将其与相应的操作相关联。

商家

{
  "merchant": [
    {
      "merchant_id": "merch10",
      "name": "Sample Restaurant",
      "telephone": "+1-650-123-4567",
      "url": "https://www.restaurantsamplewebsite.com",
      "category": "restaurant",
      "geo": {
        "address": {
          "street_address": "803 11th Avenue",
          "locality": "Sunnyvale",
          "region": "CA",
          "country": "USA",
          "postal_code": "94089"
        }
      },
      "action_link": [
        {
          "url": "https://www.partnerwebsite.com/foodtakeout/merch34",
          "action_link_type": "ACTION_LINK_TYPE_ORDER_FOOD_TAKEOUT",
          "language": "en",
          "platform": "ACTION_PLATFORM_WEB_APPLICATION"
        },
        {
          "url": "https://www.partnerwebsite.com/fooddelivery/merch34",
          "action_link_type": "ACTION_LINK_TYPE_ORDER_FOOD_DELIVERY",
          "language": "en",
          "platform": "ACTION_PLATFORM_WEB_APPLICATION"
        }
      ]
    }
  ]
}

通过单个网址支持这两项操作的商家

例如,如果 action_link 提供指向餐厅的一般点餐页面的深层链接,用户在该点上需要在送餐服务取餐服务之间进行选择,我们建议采取以下做法:

提交 action_link 网址两次,将每个实例与适当的 action_link_type 相关联,如下文所述:

  • 对于第一个实例,使用 action_link_type = ACTION_LINK_TYPE_ORDER_FOOD_DELIVERY 标记 action_link
  • 对于第二个实例,使用 action_link_type = ACTION_LINK_TYPE_ORDER_FOOD_TAKEOUT 标记 action_link

商家

{
  "merchant": [
    {
      "merchant_id": "merch10",
      "name": "Sample Restaurant",
      "telephone": "+1-650-123-4567",
      "url": "https://www.restaurantsamplewebsite.com",
      "category": "restaurant",
      "geo": {
        "address": {
          "street_address": "803 11th Avenue",
          "locality": "Sunnyvale",
          "region": "CA",
          "country": "USA",
          "postal_code": "94089"
        }
      },
      "action_link": [
        {
          "url": "https://www.partnerwebsite.com/foodtakeout+delivery/merch34",
          "action_link_type": "ACTION_LINK_TYPE_ORDER_FOOD_DELIVERY",
          "language": "en",
          "platform": "ACTION_PLATFORM_WEB_APPLICATION"
        },
        {
          "url": "https://www.partnerwebsite.com/foodtakeout+delivery/merch34",
          "action_link_type": "ACTION_LINK_TYPE_ORDER_FOOD_TAKEOUT",
          "language": "en",
          "platform": "ACTION_PLATFORM_WEB_APPLICATION"
        }

      ]
    }
  ]
}