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

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 Promotions API のプロモーションの変更点を示します。

参考例については、accounts.promotions をご覧ください。

Content API for Shopping Merchant API 説明
(未対応) custom_attributes カスタム(ユーザー指定)属性のリスト。
また、フィード仕様の属性を一般的な形式で送信するためにも使用できます。

次に例を示します。
{
  "name": "size type", "value": "regular"
}
これは、API によって明示的に公開されていない属性を送信する場合に便利です。
サポート対象外 data_source プロモーションを作成するには、既存のデータソースが必要です。
サポート対象外 attributes プロモーション固有の属性(
long_tile、promotion_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
}
プロモーション ステータスが変更されました。
より詳細な情報は、問題で確認できます。
promotionStatus = {
  destinationStatuses = [
     {
     reportingContext = Enum
     status = Enum
     },
  ],
  itemLevelIssues = [
    {
    code = String
    severity = Enum
    resolution = String
    reportingContext = Enum
    description = String
    detail = String
    documentation = String applicableCountries = [
      String,
    ]
    }
  ]
}