プロダクト管理を移行する

Merchant API を使用すると、商品をプログラムでアップロードして管理できます。accounts.products リソースを使用すると、商品とオファーのリストであるオンライン ショップ カタログを作成できます。Merchant API を使用して商品をアップロードして管理する方法については、Merchant Products API の概要をご覧ください。

リソースの変更

Content API の products リソースと productstatuses リソースは、productInputs リソースと products リソースに置き換えられます。

Merchant API の productInputs リソースを使用して、商品情報をアップロードできます。Merchant API の product リソースを使用すると、ステータスを含む処理済み商品を取得できます。

データソースの要件

Merchant API では、商品をアップロードする際に、対象データソースを指定する必要があります。これは、メイン データソースまたは補助データソースのいずれかです。既存のデータソースを取得するには dataSources.list を使用し、新しいデータソースを作成するには dataSources.create を使用します。

また、Merchant Center の管理画面を使用してデータソースを管理することもできます。

データソースとその作成方法と管理方法の詳細については、Merchant Data sources API の概要をご覧ください。

識別子の変更

Merchant API は、name を使用して商品を識別します。プロダクトの名前は accounts/{account}/products/{product} 形式で、{product}channel~language~feedLabel~offerId 形式です。

Content API リソースは、ID channel:language:feedLabel:offerId の各値の間に ~ ではなく : を使用していました。

すべての Merchant API 呼び出しは、ID の値の間に ~ が挿入された新しい形式を返します。レスポンスから新しい name フィールドを保存し、今後の呼び出しで使用することをおすすめします。

メソッド

Content API for Shopping と Merchant Products API の products メソッドの比較を次に示します。

リクエスト

Content API メソッド Content API for Shopping の URL Merchant Products API の URL Content API の識別子 Merchant Products API の ID
products.insert POST https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/products POST https://merchantapi.googleapis.com/products/v1beta/{PARENT}/productsInputs:insert?dataSource=accounts/{MERCHANT_ID}/dataSources/{DATASOURCE_ID} MERCHANT_ID PARENT=accounts/{MERCHANT_ID}
products.update PATCH https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/products/{PRODUCT_ID} 利用不可
products.delete DELETE https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/products/{PRODUCT_ID} DELETE https://merchantapi.googleapis.com/products/v1beta/{NAME}?dataSource=accounts/{MERCHANT_ID}/dataSources/{DATASOURCE_ID} MERCHANT_IDPRODUCT_ID NAME=accounts/{MERCHANT_ID}/productInputs/{PRODUCT_ID_WITH_TILDES}
products.get GET https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/products/{PRODUCT_ID} GET https://merchantapi.googleapis.com/products/v1beta/{NAME} MERCHANT_IDPRODUCT_ID NAME=accounts/{MERCHANT_ID}/products/{PRODUCT_ID_WITH_TILDES}
products.list GET https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/products GET https://merchantapi.googleapis.com/products/v1beta/{PARENT}/products MERCHANT_ID PARENT=accounts/{MERCHANT_ID}
productstatuses.get GET https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/productstatuses/{PRODUCT_ID} GET https://merchantapi.googleapis.com/products/v1beta/{NAME} MERCHANT_IDPRODUCT_ID NAME=accounts/{MERCHANT_ID}/products/{PRODUCT_ID_WITH_TILDES}
productstatuses.list GET https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/productstatuses GET https://merchantapi.googleapis.com/products/v1beta/{PARENT}/products MERCHANT_ID PARENT=accounts/{MERCHANT_ID}