एपीआई कॉल के कोटे के अलावा, Merchant Center संसाधनों पर अन्य सीमाएं भी लागू करता है. इन सीमाओं को अक्सर एपीआई कोटा के साथ भ्रमित किया जाता है, लेकिन ये Merchant Center की सीमाओं का हिस्सा हैं. ज़्यादा जानकारी के लिए, Google Merchant Center में कोटा से जुड़ी सीमाओं के बारे में जानकारी लेख पढ़ें.
प्रॉडक्ट की सीमाएं
प्रॉडक्ट की सीमाएं देखने के लिए, accounts.limits.get और accounts.limits.list तरीकों का इस्तेमाल करें.
किसी प्रॉडक्ट की सीमा को वापस पाने के लिए, उदाहरण के लिए, किसी खाते के लिए ईईए में विज्ञापन दिखाने का कोटा पाने के लिए, आपको accounts.limits.get को कॉल करते समय, खाता आईडी और सीमा आईडी डालना होगा.
सीमा आईडी, सीमा के टाइप और स्कोप का कॉम्बिनेशन होता है. उदाहरण के लिए,
products~ADS_EEA ईईए में विज्ञापन दिखाने के लिए टारगेट किए गए प्रॉडक्ट के लिए और
products~ADS_NON_EEA ईईए के बाहर विज्ञापन दिखाने के लिए टारगेट किए गए प्रॉडक्ट के लिए.
यहां किसी खाते के लिए products~ADS_EEA की सीमा पाने का अनुरोध करने का उदाहरण दिया गया है:
GET https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/limits/products~ADS_EEA
यहां दिए गए उदाहरण में, किसी खाते की सीमा को वापस पाने का तरीका बताया गया है:
Java
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.quota.v1.AccountLimit;
import com.google.shopping.merchant.quota.v1.AccountLimitsServiceClient;
import com.google.shopping.merchant.quota.v1.AccountLimitsServiceSettings;
import com.google.shopping.merchant.quota.v1.GetAccountLimitRequest;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;
/**
* This class demonstrates how to get a single account limit for a given Merchant Center account.
*/
public class GetAccountLimitSample {
public static void getAccountLimit(String accountId, String limitId) throws Exception {
GoogleCredentials credential = new Authenticator().authenticate();
AccountLimitsServiceSettings accountLimitsServiceSettings =
AccountLimitsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
try (AccountLimitsServiceClient accountLimitsServiceClient =
AccountLimitsServiceClient.create(accountLimitsServiceSettings)) {
GetAccountLimitRequest request =
GetAccountLimitRequest.newBuilder()
.setName(String.format("accounts/%s/limits/%s", accountId, limitId))
.build();
System.out.println("Sending get account limit request:");
AccountLimit response = accountLimitsServiceClient.getAccountLimit(request);
System.out.println("Retrieved account limit below");
System.out.println(response);
} catch (Exception e) {
System.out.println("Failed to get account limit.");
System.out.println(e);
}
}
public static void main(String[] args) throws Exception {
Config config = Config.load();
// The limit ID is a combination of the limit type and the scope, for example:
// `products~ADS_NON_EEA`
getAccountLimit(config.getAccountId().toString(), "products~ADS_EEA");
}
}
अपने खाते के लिए उपलब्ध सीमा आईडी के बारे में जानने के लिए, accounts.limits.list का इस्तेमाल करें. साथ ही, type="products" के लिए फ़िल्टर का इस्तेमाल करें:
GET https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/limits?filter=type%3D%22products%22
यहां दिए गए उदाहरण में, खाते की सीमाओं को दिखाने का तरीका बताया गया है:
Java
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.quota.v1.AccountLimit;
import com.google.shopping.merchant.quota.v1.AccountLimitsServiceClient;
import com.google.shopping.merchant.quota.v1.AccountLimitsServiceClient.ListAccountLimitsPagedResponse;
import com.google.shopping.merchant.quota.v1.AccountLimitsServiceSettings;
import com.google.shopping.merchant.quota.v1.ListAccountLimitsRequest;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;
/** This class demonstrates how to list account limits for a given Merchant Center account. */
public class ListAccountLimitsSample {
public static void listAccountLimits(String accountId) throws Exception {
GoogleCredentials credential = new Authenticator().authenticate();
AccountLimitsServiceSettings accountLimitsServiceSettings =
AccountLimitsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
try (AccountLimitsServiceClient accountLimitsServiceClient =
AccountLimitsServiceClient.create(accountLimitsServiceSettings)) {
ListAccountLimitsRequest request =
ListAccountLimitsRequest.newBuilder()
.setParent(String.format("accounts/%s", accountId))
.setFilter("type = \"products\"")
.build();
System.out.println("Sending list account limits request:");
ListAccountLimitsPagedResponse response =
accountLimitsServiceClient.listAccountLimits(request);
int count = 0;
// Iterates over all rows in all pages and prints the account limit in each row.
// Automatically uses the `nextPageToken` if returned to fetch all pages of data.
for (AccountLimit accountLimit : response.iterateAll()) {
System.out.println(accountLimit);
count++;
}
System.out.print("The following count of account limits were returned: ");
System.out.println(count);
} catch (Exception e) {
System.out.println("Failed to list account limits.");
System.out.println(e);
}
}
public static void main(String[] args) throws Exception {
Config config = Config.load();
listAccountLimits(config.getAccountId().toString());
}
}
संसाधन दिखाए जाने से जुड़ी सीमाएं
यहां दी गई सीमाओं में, Merchant API में इस्तेमाल किए जाने वाले संसाधन दिखाने से जुड़ी कुछ स्ट्रिंग वैल्यू और कलेक्शन फ़ील्ड के लिए खास पाबंदियों के बारे में बताया गया है. ये सीमाएं, Merchant API और Merchant Center में मौजूद उससे जुड़ी सुविधा, दोनों के लिए एक जैसी हैं.
| संसाधन | फ़ील्ड | सीमा |
|---|---|---|
shippingsettings |
हर देश के हिसाब से शिपिंग सेवाएं ( हर शिपिंग सेवा के हिसाब से शिपिंग ग्रुप ( हर शिपिंग ग्रुप के हिसाब से लेबल ( हर शिपिंग ग्रुप के हिसाब से सबटेबल ( किसी एक रेट टेबल में पंक्ति या कॉलम की संख्या. शिपिंग के लेबल की लंबाई. |
20 20 30 100 150 100 |
रेट टेबल में पंक्ति या कॉलम की संख्या से, इन कलेक्शन फ़ील्ड पर असर पड़ता है:
rowHeadersयाcolumnHeadersमें मौजूद कलेक्शन फ़ील्ड:prices[]weights[]numberOfItems[]postalCodeGroupNames[]locations[]rows[]cells[]