[Video](https://www.youtube.com/watch?v=TBvYUQb0xs0)

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](https://developers.google.com/merchant/api/guides/data-sources/overview),
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](https://developers.google.com/merchant/api/guides/data-sources/overview#auto-management).
Merchant API also lets you [run multiple individual requests in parallel](https://developers.google.com/merchant/api/guides/send-multiple-requests).

The Merchant API is a [redesign](https://developers.google.com/merchant/api/design) of the
[Content API for Shopping](https://developers.google.com/shopping-content). It comprises multiple
[sub-APIs](https://developers.google.com/merchant/api/design#sub-apis).

> [!NOTE]
> **Note:** Retailers are responsible for complying with the [Shopping ads](https://support.google.com/merchants/answer/6149970) and [free listings](https://support.google.com/merchants/answer/9261529) policies. Google Shopping reserves the right to enforce these policies and respond appropriately if we find content or behavior that violates these policies.

## 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:

  - [`accounts.products.localInventories.delete`](https://developers.google.com/merchant/api/reference/rest/inventories_v1/accounts.products.localInventories/delete)
  - [`accounts.products.localInventories.list`](https://developers.google.com/merchant/api/reference/rest/inventories_v1/accounts.products.localInventories/list)
  - [`accounts.products.regionalInventories.delete`](https://developers.google.com/merchant/api/reference/rest/inventories_v1/accounts.products.regionalInventories/delete)
  - [`accounts.products.regionalInventories.list`](https://developers.google.com/merchant/api/reference/rest/inventories_v1/accounts.products.regionalInventories/list)
- Enables management of supplemental data sources through creation and
  retrieval of supplemental data sources, and by [linking supplemental data sources to primary data sources](https://developers.google.com/merchant/api/guides/data-sources/overview#link-data-sources).

- Enables [push notifications for product and account changes](https://developers.google.com/merchant/api/guides/notifications/overview),
  eliminating the need for periodic fetches by notifying you in real time
  when data changes.

- Introduces the [`accounts.autofeedSettings`](https://developers.google.com/merchant/api/reference/rest/accounts_v1/accounts.autofeedSettings)
  resource and methods to retrieve and update autofeed settings.

- Introduces upload of [product reviews](https://developers.google.com/merchant/api/guides/reviews/products)
  and [merchant reviews](https://developers.google.com/merchant/api/guides/reviews/merchants).

- Introduces the [`accounts.productInputs`](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.productInputs)
  resource to simplify the
  [`accounts.products`](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.products)
  resource.

- Enables the update of product data in conjunction with other data upload
  methods like files.

- New [`NonProductPerformanceView`](https://developers.google.com/merchant/api/reference/rest/reports_v1/accounts.reports#NonProductPerformanceView)
  table for non-product performance data, such as information about incoming
  traffic to a retailer's website

- Modular design with isolated and more frequent feature improvements

- Updated documentation and [code samples](https://github.com/google/merchant-api-samples/tree/main)

- Better alignment with Google's [API improvement proposals](https://google.aip.dev/)

- Improved support and communication for developers through [Developer Registration](https://developers.google.com/merchant/api/guides/quickstart).

## Before you start

To run a Merchant API request, you must have the following:

- A [Merchant Center account](https://developers.google.com/merchant/api/guides/accounts/create-and-configure):
  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.

> [!NOTE]
> **Note:** If you are a partner and don't have a Merchant Center account, you will need to [Create and set up a merchant account](https://developers.google.com/merchant/api/guides/accounts/create-and-configure), including adding at least one API Developer user, who is the primary person responsible for the integration.

- Link your Merchant Center account to the Google Cloud project by [registering as a developer](https://developers.google.com/merchant/api/guides/quickstart#register_as_a_developer). The users with the API developer role will receive API communications, including mandatory service announcements, developer surveys, and opportunities.

> [!NOTE]
> **Note:** If you are a partner and don't have a Merchant Center account, you will need to [Create and set up a merchant account](https://developers.google.com/merchant/api/guides/accounts/create-and-configure), including adding at least one API Developer User during the registration process that is the primary responsible for the integration.

## Authentication with Merchant API

You can use the following options for authentication:

- You can generate an [OAuth 2.0 client ID and secret](https://developers.google.com/merchant/api/guides/authorization/access-client-accounts) 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](https://developers.google.com/merchant/api/guides/authorization/access-your-account) and download its private key to make API calls.

## Account and product identifiers

Merchant API uses [resource names](https://google.aip.dev/122) 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/en~US~sku123/regionalInventories/456

To create a resource, use the [resource name](https://google.aip.dev/122) 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](https://developers.google.com/merchant/api/reference/rest/accounts_v1/accounts.regions/create) 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](https://developers.google.com/merchant/api/reference/rest).

## 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](https://developers.google.com/merchant/api/guides/quickstart).

### Use gRPC or REST

The Merchant API supports [gRPC](https://grpc.io/docs/guides/) and
[REST](https://en.wikipedia.org/wiki/Representational_state_transfer). Here are the
two ways to make Merchant API calls:

| gRPC (recommended) | REST |
|---|---|
| 1. Create the body of the request as a protocol buffer. 2. Send the request body to the server with HTTP/2. 3. Deserialize the response to a protocol buffer. 4. Interpret the results. | 1. Create the body of request as a JSON object. 2. Send it to the server using HTTP 1.1. 3. Deserialize the response as a JSON object. 4. Interpret the results. |

> [!NOTE]
> **Note:** If you use a client library, the default transport mechanism is gRPC. In most cases you don't need to do anything other than call the Merchant API endpoints to use gRPC.

### Use client libraries and code samples

Each sub-API has [client libraries](https://developers.google.com/merchant/api/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](https://github.com/google/merchant-api-samples/tree/main).

## Get help

For information about getting support, see [Get help with Merchant API](https://developers.google.com/merchant/api/support/get-help).

## 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](https://support.google.com/merchants/contact/shopping_api_support_form).
- **Documentation:** Use the in-page thumb ratings and **Send feedback** button.
- **Samples and libraries:** [Create an issue](https://github.com/google/merchant-api-samples/issues/new?template=Blank+issue) on the GitHub repository for the code samples.

## What's next

- For information about backward compatibility, [Content API for Shopping compatibility](https://developers.google.com/merchant/api/guides/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](https://developers.google.com/merchant/api/reference/rest).