Review sellers using Merchant API

Seller reviews help people find businesses that offer high-quality customer experiences, helping to build trust and enabling more informed purchasing decisions. As a result, shop ratings can help businesses improve the performance of ads and organic listings and drive more qualified customers to their landing pages.

This page explains how you can manage seller reviews using Merchant API.

Prerequisites

Google needs you to provide specific information. You must have the following:

  • An active merchant review data source in the Google Merchant Center.
  • Your account must be enrolled into the store ratings program . If you are unsure whether you are already enrolled, check the Merchant Center. If you aren't enrolled, submit the request form .

Create a data source

Use the accounts.dataSources.create method to create a merchant reviews feed. If an existing merchant reviews feed is available, use accounts.dataSources.get to fetch the dataSource.name field.

The form of the request is as follows:

  POST https://merchantapi.googleapis.com/datasources/v1/accounts/ {ACCOUNT_ID} 
/dataSources/ {DATASOURCE_ID} 
 
 

Example

The example shows a typical request and response.

Request

  POST https://merchantapi.googleapis.com/datasources/v1/accounts/123/dataSources {"displayName": "test api feed", "merchantReviewDataSource":{} } 
 

Response

  { 
  
 "name" 
 : 
  
 "accounts/123/dataSources/1000000573361824" 
 , 
  
 "dataSourceId" 
 : 
  
 "1000000573361824" 
 , 
  
 "displayName" 
 : 
  
 "test api feed" 
 , 
  
 "merchantReviewDataSource" 
 : 
  
 {}, 
  
 "input" 
 : 
  
 "API" 
 } 
 

For more information, see Create a product review data source .

Create merchant review

You can use the accounts.merchantReviews.insert method to create or update a seller review. The accounts.merchantReviews.insert method takes a merchantreview resource and a data source name as input. It returns the new or updated merchant review, if successful. Creating a merchant review requires datasource.name .

The form of the request:

  POST https://merchantapi.googleapis.com/reviews/v1alpha/{parent=accounts/*/}merchantReviews:insert 
 

Study the following sample merchant review for reference.

  POST https://merchantapi.googleapis.com/reviews/v1alpha/accounts/ {ACCOUNT_ID} 
/merchantReviews:insert?dataSource=accounts/ {ACCOUNT_ID} 
/dataSources/ {DATASOURCE_ID} 
 
 merchantReviewId = 'my_own_review' 
 merchantReviewAttributes { 
 merchantId = 'merchant_id' 
 merchantDisplayName = 'merchant_display_name' 
 merchantLink = 'publisher_name' 
 merchantRatingLink = 'https://www.google.com' 
 minRating = 1 
 maxRating = 10 
 rating = 7.9 
 title = 'Amazing Merchant' 
 content = 'This is an incredible merchant' 
 reviewerId = 'reviewer_id' 
 reviewerUsername = 'reviewer_username' 
 isAnonymous = false 
 collectionMethod = 'AFTER_FULFILLMENT' 
 reviewTime = '2024-04-01T00:00:00Z' 
 reviewLanguage = 'en' 
 reviewCountry = 'US' 
 } 
 

After merchant review creation, it may take a few minutes for the review to propagate.

View merchant reviews

To view a merchant review, use accounts.merchantReviews.get . This is read-only. It requires your merchantId and the ID of the merchant review as part of the name field. The get method returns the corresponding merchant review resource.

For example:

  GET https://merchantapi.googleapis.com/reviews/v1alpha/{name=accounts/*/merchantReviews/*} 
 

To retrieve a single product for a given Merchant Center account, you can use the google.shopping.merchant.accounts.v1.GetProductRequest method, as shown in the following sample.

Java

  import 
  
 com.google.api.gax.core.FixedCredentialsProvider 
 ; 
 import 
  
 com.google.auth.oauth2.GoogleCredentials 
 ; 
 import 
  
 com.google.shopping.merchant.products.v1.GetProductRequest 
 ; 
 import 
  
 com.google.shopping.merchant.products.v1.Product 
 ; 
 import 
  
 com.google.shopping.merchant.products.v1.ProductsServiceClient 
 ; 
 import 
  
 com.google.shopping.merchant.products.v1.ProductsServiceSettings 
 ; 
 import 
  
 shopping.merchant.samples.utils.Authenticator 
 ; 
 import 
  
 shopping.merchant.samples.utils.Config 
 ; 
 /** This class demonstrates how to get a single product for a given Merchant Center account */ 
 public 
  
 class 
 GetProductSample 
  
 { 
  
 public 
  
 static 
  
 void 
  
 getProduct 
 ( 
 Config 
  
 config 
 , 
  
 String 
  
 product 
 ) 
  
 throws 
  
 Exception 
  
 { 
  
 // Obtains OAuth token based on the user's configuration. 
  
 GoogleCredentials 
  
 credential 
  
 = 
  
 new 
  
 Authenticator 
 (). 
 authenticate 
 (); 
  
 // Creates service settings using the credentials retrieved above. 
  
 ProductsServiceSettings 
  
 productsServiceSettings 
  
 = 
  
 ProductsServiceSettings 
 . 
 newBuilder 
 () 
  
 . 
 setCredentialsProvider 
 ( 
 FixedCredentialsProvider 
 . 
 create 
 ( 
 credential 
 )) 
  
 . 
 build 
 (); 
  
 // Calls the API and catches and prints any network failures/errors. 
  
 try 
  
 ( 
 ProductsServiceClient 
  
 productsServiceClient 
  
 = 
  
 ProductsServiceClient 
 . 
 create 
 ( 
 productsServiceSettings 
 )) 
  
 { 
  
 // The name has the format: accounts/{account}/products/{productId} 
  
 GetProductRequest 
  
 request 
  
 = 
  
 GetProductRequest 
 . 
 newBuilder 
 (). 
 setName 
 ( 
 product 
 ). 
 build 
 (); 
  
 System 
 . 
 out 
 . 
 println 
 ( 
 "Sending get product request:" 
 ); 
  
 Product 
  
 response 
  
 = 
  
 productsServiceClient 
 . 
 getProduct 
 ( 
 request 
 ); 
  
 System 
 . 
 out 
 . 
 println 
 ( 
 "Retrieved Product below" 
 ); 
  
 System 
 . 
 out 
 . 
 println 
 ( 
 response 
 ); 
  
 } 
  
 catch 
  
 ( 
 Exception 
  
 e 
 ) 
  
 { 
  
 System 
 . 
 out 
 . 
 println 
 ( 
 e 
 ); 
  
 } 
  
 } 
  
 public 
  
 static 
  
 void 
  
 main 
 ( 
 String 
 [] 
  
 args 
 ) 
  
 throws 
  
 Exception 
  
 { 
  
 Config 
  
 config 
  
 = 
  
 Config 
 . 
 load 
 (); 
  
 // The name of the `product`, returned after a `Product.insert` request. We recommend 
  
 // having stored this value in your database to use for all future requests. 
  
 String 
  
 product 
  
 = 
  
 "accounts/{datasource}/products/{productId}" 
 ; 
  
 getProduct 
 ( 
 config 
 , 
  
 product 
 ); 
  
 } 
 } 
  
 

List merchant reviews

You can use the accounts.merchantReviews.list method to view all created merchant reviews.

  GET https://merchantapi.googleapis.com/reviews/v1alpha/accounts/ {ACCOUNT_ID} 
/merchantReviews 
 

Delete merchant reviews

To delete a merchant review, use accounts.merchantReviews.delete . Similar to the accounts.merchantReviews.get method, this method requires the name field of the merchant review returned during creation.

For example:

  DELETE https://merchantapi.googleapis.com/reviews/v1alpha/{name=accounts/*/merchantReviews/*} 
 

Merchant review status

The merchant review resource contains the status similar to other APIs, which is the integral part of the resource and follows the same issue & destination structure.

Design a Mobile Site
View Site in Mobile | Classic
Share by: