您可以使用 MerchantPromotion API 建立及管理 Google 上的促銷活動。您可以使用 accounts.promotions 資源,對在 Google 上銷售的產品顯示特價優惠。詳情請參閱 MerchantPromotions API 總覽。
要求
如要提出要求,請使用下列網址。
POST https://merchantapi.googleapis.com/promotions/v1beta/{account_name}/promotions
從 Content API for Shopping 遷移
以下將比較 Content API for Shopping 和 MerchantPromotion API 用於促銷活動相關要求。
網址
在 Content API for Shopping 中:
https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/promotions
會變成:
https://merchantapi.googleapis.com/promotions/v1beta/{parent=accounts/*}/promotions
ID
在 Content API for Shopping 中:
{merchantId}/promotions/{promotionId}
會變成:
{name}
方法
Merchant API 支援下列促銷活動方法:
- 插入促銷活動
- 取得促銷活動
- 列出促銷活動
以下比較 Content API for Shopping 及 Merchant API 中的促銷活動方式供應情形:
方法 | Content API for Shopping | 商家 API |
---|---|---|
insert | 是 | 是 |
取得 | 是 | 是 |
清單 | 是 | 是 |
customBatch | 否 | 否 |
刪除 | 否 | (待定) |
資源名稱
下表列出 MerchantPromotion API 中的促銷活動異動。
如要查看參考範例,請參閱店面商品目錄資料一文。
Content API for Shopping | 商家 API | 說明 |
---|---|---|
(不支援) | custom_attributes |
自訂 (商家提供) 屬性的清單。此外, 也可以使用這項屬性提交動態饋給 規格的所有屬性,並使用一般格式提交這些屬性。 例如: { "name": "size type", "value": "regular" }如要提交 API 未明確公開 的屬性,就很適合使用這個選項。 |
無權限 | data_source | 必須有現有資料來源,才能建立促銷活動。 |
無權限 | 屬性 |
促銷活動專用屬性 (例如 long_tile、promotion_effective_timeperiod 和 等) 屬於屬性訊息。 |
item_id | item_id_inclusion |
促銷活動套用的 項目 ID 清單已重新命名。 |
store_id | store_id_inclusion |
套用促銷活動適用的商店 ID 清單已重新命名。 |
prduct_type | product_type_inclusion |
促銷活動適用的 產品類型清單已重新命名。 |
item_group_id | item_group_id_inclusion |
促銷活動套用於 的商品群組 ID 清單已重新命名。 |
brand | brand_inclusion |
適用於促銷活動 的品牌清單已重新命名。 |
store_code | store_codes_inclusion |
適用於促銷活動的 適用的商店代碼清單已重新命名。 |
price: { object (Price) } |
price: { object (Price) } |
Price 的定義已變更。
在 Content API for Shopping 中,價格
「價格」金額現在會以微量 (
amount 欄位名稱已從值變更為
currency 欄位名稱已變更為 |
order_limit | (不支援) | 不支援 order_limit 屬性。 |
shippingServiceNames [運送服務名稱] | (不支援) | 不支援 shippingServiceNames[]。 |
money_budget | (不支援) | 不支援 money_budget。 |
promotion_destination_ids | promotion_destinations | promotionDestinationIds 已重新命名。 |
促銷活動狀態
{ "destinationStatuses": [ { "destination": string, "status": enum (State) } ], "promotionIssue": [ { "code": string, "detail": string } ], "creationDate": string, "lastUpdateDate": string } |
促銷活動狀態已變更。 問題中會提供更詳細的詳細資料。 promotionStatus = { destinationStatuses = [ { reportingContext = Enum status = Enum }, ], itemLevelIssues = [ { code = String severity = Enum resolution = String reportingContext = Enum description = String detail = String documentation = String applicableCountries = [ String, ] } ] } |