You can use Merchant API to
- Manage how your business and products appear on Google.
- Get programmatic access to data, insights, and unique capabilities.
- Grow your business and reach more customers on Google.
Merchant API can manage large or complex Merchant Center accounts. Typical use cases include the following:
- Automated account management
- Automated product management
- Automated inventory management
- Automated report management on performance and market insights
Merchant API lets you create and manage multiple data sources, enabling better organization of information about products, promotions, and reviews. With Merchant API, you can manage products in a way that complements other product data upload methods like files and autofeed. Merchant API also lets you run multiple individual requests in parallel.
The Merchant API is a redesign of the Content API for Shopping. It comprises multiple sub-APIs.
What's new in Merchant API
Here are some reasons to upgrade to the Merchant API:
Better management of inventories data with the introduction of the following new methods:
Enables management of supplemental data sources through creation and retrieval of supplemental data sources, and by linking supplemental data sources to primary data sources.
Enables notifications for changes to your product data, eliminating the need for a periodic fetch by notifying you when a product status changes.
Introduces the
accounts.autofeedSettings
resource and methods to retrieve and update autofeed settings.Introduces upload of product reviews and merchant reviews.
Introduces the
accounts.productInputs
resource to simplify theaccounts.products
resource.Enables the update of product data in conjunction with other data upload methods like files.
New
NonProductPerformanceView
table for non-product performance data, such as information about incoming traffic to a retailer's websiteModular design with isolated and more frequent feature improvements
Updated documentation and code samples
Better alignment with Google's API improvement proposals
Improved support and communication for developers through Developer Registration.
Updated documentation and code samples.
Improved support and communication for developers through Developer Registration.
Before you start
To run a Merchant API request, you must have the following:
A Merchant Center account: This is the account you will be querying, updating, and uploading data to. Make sure that you have the necessary permissions to manage products and inventories on this account.
A Google Cloud project: Use the project to gain API access to your account.
A link from your Merchant Center account to the Google Cloud project. Create the link by calling the Developer Registration method. You will use this account and these users for communication regarding the API integration, surveys and opportunities.
- Link your Merchant Center account to the Google Cloud project by registering as a developer. The users with the API developer role will receive API communications, including mandatory service announcements, developer surveys, and opportunities.
Authentication with Merchant API
You can use the following options for authentication:
- You can generate an OAuth 2.0 client ID and secret for your app. The ID and secret can then be used to generate the OAuth 2.0 credentials needed in API calls to the Merchant Center account.
- You can create a service account and download its private key to make API calls.
Account and product identifiers
Merchant API uses resource names instead of IDs for
identification. An example resource name for a product can be
accounts/123456/products/en~US~sku123
, where 123456
is the unique
identifier of the account and en~US~sku123
is the unique identifier of
the product.
Request URL format
To operate on a resource, send requests to URLs in the following format:
https://merchantapi.googleapis.com/{SUB_API}/{VERSION}/{RESOURCE_NAME}:{METHOD}
The :{METHOD}
part is omitted for standard methods like list and get.
For example, the following request deletes the regional inventory:
DELETE https://merchantapi.googleapis.com/inventories/v1/accounts/123456/products/online~en~US~sku123/regionalInventories/456
To create a resource, use the resource name of the parent resource and this URL:
POST https://merchantapi.googleapis.com/{SUB_API}/{VERSION}/{RESOURCE_NAME_OF_PARENT}/{RESOURCE}
For example, the following request shows how you can create a
region for
accounts/123456
:
POST https://merchantapi.googleapis.com/accounts/v1/accounts/123456/regions?regionId=WA HTTP/1.1
{
"displayName": "Washington",
"name": "Washington",
"postalCodeArea": {
"postalCodes": [
{
"begin": "98039",
"end": "98118"
}
],
"regionCode": "US"
}
}
For more details about specific services, see the Merchant API reference documentation.
Get started with using the Merchant API
To quickly see how Merchant API works and try uploading a sample product, see Get started with Merchant API.
Use gRPC or REST
The Merchant API supports gRPC and REST. Here are the two ways to make Merchant API calls:
gRPC (recommended) | REST |
---|---|
|
|
Use client libraries and code samples
Each sub-API has client libraries to help you get started. Code samples can help you get started with writing code in Java, PHP, and Python. For more information, see Samples for Merchant API.
Get help
For information about getting support, see Get help with Merchant API.
Give feedback
To provide feedback, submit one of the following:
- API features: Select the Send Feedback option under What is the Issue/Question? section of the feedback form.
- Documentation: Use the in-page thumb ratings and Send feedback button.
- Samples and libraries: Create an issue on the GitHub repository for the code samples.
What's next
For information about backward compatibility, Content API for Shopping compatibility.
To know more about the key features of Merchant API, see the guides in the left navigation menu.
For information about the available resources and services, see the Reference documentation.