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

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 をご覧ください。

リクエスト

リクエストを行うには、次の 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
  • 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 では、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,
    ]
    }
  ]
}