你可以使用免費產品資訊的
checkoutSettings
屬性,提供連結讓消費者直接前往結帳頁面。詳情請參閱「將結帳連結加入免費產品資訊」。
你必須提供商家和產品的特定資訊,才能加入結帳計畫。如要使用 checkoutSettings,必須符合下列條件:
- 在 Google Merchant Center 中擁有有效的產品動態饋給。
- 商家帳戶必須加入免費產品資訊計畫。
請檢查 Google Merchant Center 使用者介面,確認你是否已加入免費產品資訊計畫。如未註冊,請完成免費產品資訊新手上路步驟。結帳網址格式如下所示:
https://mystore.com/path-to-product/{id}
消費者點按免費產品資訊中的結帳網址時,系統會自動將 {id} 替換為產品的 offerId。
新增結帳網址
你可以使用
freelistingsprogram.checkoutsettings.insert新增或更新結帳網址範本。這項呼叫會在帳戶層級更新結帳網址範本,並為所有有效商品啟用結帳功能。
POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/freelistingsprogram/checkoutsettings
範例如下:
{
uri_settings: {
checkout_uri_template: "https://domain_name.com/custom_path/{id}"
}
}
查看目前的結帳網址
你可以使用
freelistingsprogram.checkoutsettings.get
查看現有的結帳網址。get 為唯讀,且需要您的merchantId。get 方法會傳回對應的 checkout 資源。
GET https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/freelistingsprogram/checkoutsettings
移除結帳網址
你可以使用 freelistingsprogram.checkoutsettings.delete 移除結帳網址。這會讓所有商品停用結帳功能。
DELETE https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/freelistingsprogram/checkoutsettings