You can use the Merchant API to upload and manage your products
programmatically. The
accounts.products
resource lets you create an online store catalog, that is a list of products and
offers. For more information about uploading and managing your products using
Merchant API, see
Overview of Merchant Products API.
Resource changes
The products
and
productstatuses
resources of Content API are replaced by
productInputs
and products
resources.
You can use the productInputs
resource of Merchant API to upload your product
information. The product
resource of Merchant API can be used to retrieve your processed products
including statuses and can only be retrieved a few minutes after productInputs
is inserted.
Data source requirement
In Merchant API, you must specify the target data source when uploading
products. This can either be a primary data source or a supplemental data
source. You can retrieve your existing data sources using
dataSources.list
or create a new data source using
dataSources.create
.
Alternatively, you can use the Merchant Center UI to manage your data sources.
For more information about data sources and how to create and manage them, see Overview of Merchant Data sources API.
Identifier changes
Merchant API uses
name to identify
the product. The name of the product will follow the
accounts/{account}/products/{product}
format, where {product}
has the
channel~language~feedLabel~offerId
format.
Content API resources used :
instead of ~
between each value in the ID:
channel:language:feedLabel:offerId
.
All Merchant API calls return the new format with ~
between the values of the
ID. We recommend storing the new name
field from the response and using it in
your future calls.
Methods
Here's a comparison of the products methods in the Content API for Shopping and the Merchant Products API:
Content API for Shopping | Merchant Products API |
---|---|
products.custombatch | Not available, use a batch request instead. |
products.insert | productInputs.insert |
products.update | productInputs.patch |
products.delete | productInputs.delete |
products.get | products.get |
products.list | products.list |
productstatuses.custombatch | Not available, use a batch request instead. |
productstatuses.get | products.get |
productstatuses.list | products.list |
Requests
Content API Method | URL in Content API for Shopping | URL in Merchant Products API |
---|---|---|
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} |
products.update |
PATCH https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/products/ {PRODUCT_ID} |
PATCH https://merchantapi.googleapis.com/products/v1beta/ {productInput.name=accounts/*/productInputs/*} |
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} |
products.get |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/products/ {PRODUCT_ID} |
GET https://merchantapi.googleapis.com/products/v1beta/ {NAME} |
products.list |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/products |
GET https://merchantapi.googleapis.com/products/v1beta/ {PARENT}/products |
productstatuses.get |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/productstatuses/ {PRODUCT_ID} |
GET https://merchantapi.googleapis.com/products/v1beta/ {NAME} |
productstatuses.list |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/productstatuses |
GET https://merchantapi.googleapis.com/products/v1beta/ {PARENT}/products |
Identifiers
Methods | Identifier in Content API | Identifier in Merchant Products API |
---|---|---|
products.insert |
MERCHANT_ID | accounts/{ACCOUNT_ID} |
products.delete |
MERCHANT_ID, PRODUCT_ID | accounts/{ACCOUNT_ID}/productInputs/{PRODUCT_ID_WITH_TILDES} |
products.get |
MERCHANT_ID, PRODUCT_ID | accounts/{ACCOUNT_ID}/products/{PRODUCT_ID_WITH_TILDES} |
products.list |
MERCHANT_ID | accounts/{ACCOUNT_ID} |