सेलर की समीक्षाएं, लोगों को ऐसे कारोबारों को खोजने में मदद करती हैं जो ग्राहकों को बेहतर अनुभव देते हैं. इन समीक्षाओं से, लोगों का भरोसा जीतने और खरीदारी के बारे में सोच-समझकर फ़ैसला लेने में मदद मिलती है. इसलिए, दुकान की रेटिंग से कारोबारों को विज्ञापनों और ऑर्गैनिक लिस्टिंग की परफ़ॉर्मेंस बेहतर बनाने में मदद मिल सकती है. साथ ही, अपने लैंडिंग पेजों पर ज़्यादा संभावित ग्राहकों को लाने में भी मदद मिलती है.
इस पेज पर, Merchant API का इस्तेमाल करके सेलर की समीक्षाएं मैनेज करने का तरीका बताया गया है.
ज़रूरी शर्तें
Google को आपसे कुछ खास जानकारी चाहिए. आपके पास ये चीज़ें होनी चाहिए:
- Google Merchant Center में कारोबारी या कंपनी की समीक्षाओं का ऐक्टिव डेटा सोर्स.
- आपका खाता, स्टोर रेटिंग प्रोग्राम में रजिस्टर होना चाहिए. अगर आपको पक्का नहीं है कि आपने पहले से रजिस्टर किया है या नहीं, तो Merchant Center देखें. अगर आपने रजिस्टर नहीं किया है, तो अनुरोध फ़ॉर्म सबमिट करें.
डेटा स्रोत बनाएं
कारोबारी या कंपनी की समीक्षाओं का डेटा सोर्स बनाने के लिए, accounts.dataSources.create तरीके का इस्तेमाल करें. अगर कारोबारी या कंपनी की समीक्षाओं का कोई मौजूदा डेटा सोर्स उपलब्ध है, तो accounts.dataSources.list का इस्तेमाल करके accounts.dataSources.name फ़ील्ड फ़ेच करें.
हमारा सुझाव है कि आप अपने स्थानीय डेटाबेस में बनाए गए डेटा सोर्स के लिए accounts.dataSources.name सेव करें, ताकि आने वाले समय में एपीआई कॉल में सीधे तौर पर उनका इस्तेमाल किया जा सके. अपने मौजूदा डेटा सोर्स के लिए, उनके नामों के साथ अपने लोकल डेटाबेस को एक बार बैकफ़िल करें.
अनुरोध का फ़ॉर्म इस तरह से है:
POST https://merchantapi.googleapis.com/datasources/v1/accounts/{ACCOUNT_ID}/dataSources/{DATASOURCE_ID}
उदाहरण
इस उदाहरण में, अनुरोध और जवाब दिखाया गया है.
अनुरोध
POST https://merchantapi.googleapis.com/datasources/v1/accounts/123/dataSources {"displayName": "test api data source", "merchantReviewDataSource":{} }
जवाब
{
"name": "accounts/123/dataSources/1000000573361824",
"dataSourceId": "1000000573361824",
"displayName": "test api data source",
"merchantReviewDataSource": {},
"input": "API"
}
ज़्यादा जानकारी के लिए, प्रॉडक्ट की समीक्षा का डेटा सोर्स बनाना लेख पढ़ें.
कारोबारी या कंपनी की समीक्षा करना
सेलर की समीक्षा बनाने या उसे अपडेट करने के लिए, accounts.merchantReviews.insert तरीके का इस्तेमाल किया जा सकता है. accounts.merchantReviews.insert तरीके में, merchantreview संसाधन और डेटा सोर्स का नाम इनपुट के तौर पर लिया जाता है. अगर समीक्षा पूरी हो जाती है, तो यह नई या अपडेट की गई कारोबारी या कंपनी की समीक्षा दिखाता है. कारोबारी या कंपनी की समीक्षा बनाने के लिए, accounts.dataSources.name की ज़रूरत होती है.
अनुरोध किस तरह का है:
POST https://merchantapi.googleapis.com/reviews/v1alpha/{parent=accounts/*/}merchantReviews:insert
रेफ़रंस के लिए, कारोबारी या कंपनी की समीक्षा का यह सैंपल देखें.
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'
}
कारोबारी या कंपनी की समीक्षा बनाने के बाद, इसे दिखने में कुछ मिनट लग सकते हैं.
कारोबारी या कंपनी को मिली समीक्षाएं देखना
कारोबारी या कंपनी की समीक्षा देखने के लिए, accounts.merchantReviews.get का इस्तेमाल करें.
इसे सिर्फ़ पढ़ा जा सकता है. इसके लिए, नाम वाले फ़ील्ड में आपको merchantId और कारोबारी या कंपनी की समीक्षा का आईडी देना होगा. get तरीके से, कारोबारी या कंपनी की समीक्षा से जुड़ा संसाधन मिलता है.
उदाहरण के लिए:
GET https://merchantapi.googleapis.com/reviews/v1alpha/{name=accounts/*/merchantReviews/*}
किसी Merchant Center खाते के लिए एक प्रॉडक्ट वापस पाने के लिए, google.shopping.merchant.accounts.v1.GetProductRequest तरीके का इस्तेमाल किया जा सकता है. इसका उदाहरण यहां दिया गया है.
Java
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.common.io.BaseEncoding;
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 java.nio.charset.StandardCharsets;
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 {
// Base64Url encoder/decoder without padding
private static final BaseEncoding BASE64URL_NOPADDING = BaseEncoding.base64Url().omitPadding();
// Encodes a string to base64url without padding
public static String encodeProductId(String productId) {
return BASE64URL_NOPADDING.encode(productId.getBytes(StandardCharsets.UTF_8));
}
public static Product getProduct(Config config, String accountId, String productId)
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();
try (ProductsServiceClient productsServiceClient =
ProductsServiceClient.create(productsServiceSettings)) {
// The name has the format: accounts/{account}/products/{productId}
String name = "accounts/" + accountId + "/products/" + productId;
// The name has the format: accounts/{account}/products/{productId}
GetProductRequest request = GetProductRequest.newBuilder().setName(name).build();
System.out.println("Sending get product request:");
Product response = productsServiceClient.getProduct(request);
System.out.println("Retrieved Product below");
System.out.println(response);
return response;
}
}
public static void main(String[] args) throws Exception {
Config config = Config.load();
String accountId = config.getAccountId().toString();
// 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 productId = "en~GB~sku123"; // Replace with your actual product ID
// Uncomment the following line if the product name contains special characters (such as forward
// slashes) and needs base64url encoding.
// productId = encodeProductId(productId);
getProduct(config, accountId, productId);
}
}
कारोबारी या कंपनी को मिली समीक्षाएं लिस्ट करना
कारोबारी या कंपनी की सभी समीक्षाएं देखने के लिए, accounts.merchantReviews.list तरीके का इस्तेमाल करें.
GET https://merchantapi.googleapis.com/reviews/v1alpha/accounts/{ACCOUNT_ID}/merchantReviews
कारोबारी या कंपनी को मिली समीक्षाएं मिटाना
कारोबारी या कंपनी की समीक्षा मिटाने के लिए, accounts.merchantReviews.delete का इस्तेमाल करें.
accounts.merchantReviews.get तरीके की तरह ही, इस तरीके के लिए भी कारोबारी या कंपनी की समीक्षा का नाम फ़ील्ड ज़रूरी होता है. यह फ़ील्ड, समीक्षा बनाते समय दिखता है.
उदाहरण के लिए:
DELETE https://merchantapi.googleapis.com/reviews/v1alpha/{name=accounts/*/merchantReviews/*}
कारोबारी या कंपनी को मिली समीक्षा का स्टेटस
कारोबारी या कंपनी की समीक्षा करने वाले संसाधन में, अन्य एपीआई की तरह ही स्टेटस होता है. यह संसाधन का अहम हिस्सा होता है और इसमें समस्या और डेस्टिनेशन का स्ट्रक्चर एक जैसा होता है.