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

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

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

大きな違いは、Content API for Shopping では最初のプロモーションを挿入するとデータソースが自動的に作成されるのに対し、Merchant API ではそうならないことです。Merchant API を使用してプロモーションを挿入するには、まずプロモーション データソースを作成する必要があります。

accounts.dataSources リソースの promotionDataSource オブジェクトのフィールドについては、PromotionDataSource をご覧ください。

既存のデータソース

既存のデータソースで accounts.dataSources.name がわからない場合は、dataSources.list を使用して取得します。

また、accounts.promotions.get メソッドを使用して、アカウント内の既存のプロモーションのレスポンスで dataSource フィールドを調べ、各プロモーションのデータソースを特定することもできます。

今後の API 呼び出しで直接参照できるように、プロモーションごとに accounts.dataSources.name をローカル データベースに保存することを強くおすすめします。

リクエスト

リクエストを行うには、次の 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
ID {MERCHANT_ID}/promotions/{PROMOTION_ID} {NAME}
メソッド
  • insert
  • get
  • list
  • customBatch
  • delete
  • insert
  • get
  • list

フィールドの変更

次の表は、Merchant プロモーション API のプロモーションの変更点を示しています。

参考として例をご覧になるには、accounts.promotions をご覧ください。

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 では、Price
は文字列形式の 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
}
Promotion Status が変更されました。
より詳細な情報は、問題で確認できます。
promotionStatus = {
  destinationStatuses = [
     {
     reportingContext = Enum
     status = Enum
     },
  ],
  itemLevelIssues = [
    {
    code = String
    severity = Enum
    resolution = String
    reportingContext = Enum
    description = String
    detail = String
    documentation = String applicableCountries = [
      String,
    ]
    }
  ]
}