プロモーション管理を移行する

Merchant Promotions API を使用すると、Google でプロモーションを作成して管理できます。 accounts.promotions リソースを使用すると、Google で販売する商品のスペシャルオファーを表示できます。 詳しくは、Merchant プロモーション API の概要をご覧ください。

Content API for Shopping から Merchant API への変更の概要

大きな違いは、Content API for Shopping では最初のプロモーションの挿入時にデータソースが自動的に作成されるのに対し、Merchant API では作成されないことです。Merchant API を使用してプロモーションを挿入するには、まず プロモーション データソースを作成する必要があります。 accounts.dataSources リソースの promotionDataSource オブジェクトのフィールドについては、PromotionDataSource をご覧ください。

リクエスト

リクエストを行うには、次の URL を使用します。

POST https://merchantapi.googleapis.com/promotions/v1/{ACCOUNT_NAME}/promotions

Content API for Shopping から移行する

以下に、プロモーション関連のリクエストについて、Content API for Shopping と Merchant Promotions API を比較します。

URL

Content API for Shopping の場合:

https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/promotions

Merchant API では次のようになります。

https://merchantapi.googleapis.com/promotions/v1/{parent=accounts/*}/promotions

識別子

Content API for Shopping の場合:

{MERCHANT_ID}/promotions/{PROMOTION_ID}

Merchant API では次のようになります。

{NAME}

メソッド

Merchant API では、プロモーションに対して次のメソッドがサポートされています。

  • プロモーションを挿入する
  • プロモーションを取得する
  • プロモーションを一覧表示する

Content API for Shopping と Merchant API で使用できるプロモーション メソッドを比較した表を以下に示します。

機能 Content API for Shopping Merchant API
URL https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/promotions https://merchantapi.googleapis.com/promotions/v1/{parent=accounts/*}/promotions
識別子 {MERCHANT_ID}/promotions/{PROMOTION_ID} {NAME}
メソッド
  • insert
  • get
  • list
  • customBatch
  • delete
  • insert
  • get
  • list
  • delete

フィールドの変更

次の表に、Merchant Promotions API でプロモーションがどのように変更されるかを示します。

参考として例を確認するには、ローカル 在庫をご覧ください。

Content API for Shopping Merchant API 説明
(対象外) custom_attributes カスタム(ユーザー指定)属性のリスト。フィード仕様の任意の属性を汎用形式で登録する場合にも使用できます。


例:
{
  "name": "size type", "value": "regular"
}
これは、API で明示的に公開されていない属性を登録する場合に便利です。
サポート対象外 data_source プロモーションを作成するには、既存のデータソースが必要です。
サポート対象外 attributes プロモーション固有の属性(long_tilepromotion_effective_timeperiodなど)は、属性メッセージの一部です。

item_id item_id_inclusion プロモーションが適用される商品 ID のリストの名前が変更されました。
store_id store_id_inclusion プロモーションが適用される店舗 ID のリストの名前が変更されました。
product_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)
  }
価格 の定義が変更されました。

Content API for Shopping では、価格
は文字列形式の 10 進数でした。

価格 の金額はマイクロ秒単位で記録されるようになりました。100 万マイクロ秒が通貨の標準単位に相当します。

amount フィールドの名前が value から
amountMicros に変更されました。

currency フィールドの名前が currencyCode に変更されました。
形式は
ISO 4217のままです。(Wikipedia)

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,
    ]
    }
  ]
}