This page explains how you can upload and manage your products programmatically. Using the Merchant Products API, you can insert or update a product in a data source, retrieve a product from your account, and delete a product from a data source.
You can use the
products
resource to create an online store catalog, that is a list of products that are available on Shopping ads. You can use the products
resource
once you have created your Merchant Center account, and are ready to upload an
initial set of products through the API.
You are responsible for complying with the Shopping ads and free listings policies. Shopping ads reserves the right to enforce these policies and respond appropriately if we find content or behavior that violates these policies.
The products
resource uploads product information to the Shopping Merchant
Center database. It also provides a number of methods that let you
access, update, or delete product information one at a time, or many at a time
in batch mode.
The productInput
resource represents the input data you submit for a product. A productInput
resource must have the following fields:
channel
: The channel of the product.offerId
: The unique identifier for the product. This value is the same for the product input and the processed product.contentLanguage
: The two-letter ISO 639-1 language code for the product.feedLabel
: The feed label for the product.
Although merchants have the ability to load products using a file called a Primary Feed, there are several advantages of creating and deleting products using the Merchant API. These advantages include faster response time and the ability to update multiple products in real time, without the need to manage multiple supplemental feeds. It may take up to several hours for product changes made by API calls to show in the Shopping Merchant Center database.
Google can help maintain certain attributes of your products automatically. For more information, see Enable automatic improvements.
Prerequisites
If you don't have a data source, create a data source using the Merchant Data sources API or the Merchant Center.
If you already have a data source that you created either using the Merchant Center UI or using the API, then you can use the Merchant Products API to add your products. If you are using the Content API for Shopping to add products, refer to the migration guide to understand how to get started with the Merchant Products API.
Upload a product input into your account
To upload a product input into your account, use the
accounts.productInputs.insert
method. You must pass the
unique identifier of the primary or supplemental data source for inserting a
product using the Merchant Products API.
Retrieve a processed product from your account
To retrieve a processed product from your account, use the
accounts.products.get
method. It can take several minutes for
the processed product to appear after insertion.
Delete a product input from your account
To delete a product input from your account, use the
accounts.productInputs.delete
method. You must pass the
unique identifier of the primary or supplemental data source that the product
belongs to for deleting a product using the Merchant Products API.
List products from your account
To list the processed products in your account, use the accounts.products.list
method.