अपने खाते और उससे जुड़े सभी उप-खातों में मौजूद सभी प्रॉडक्ट के लिए, शिपिंग की सेटिंग मैनेज करने के लिए, Accounts sub-API का इस्तेमाल करें.
शिपिंग की सेटिंग में किए गए बदलाव, सभी प्रॉडक्ट पर लागू होंगे. अलग-अलग प्रॉडक्ट के लिए शिपिंग की जानकारी अपडेट करने के लिए, Merchant Products API का इस्तेमाल करें.
ज़्यादा जानकारी के लिए, शिपिंग की सेटिंग सेट अप करना लेख पढ़ें.
शिपिंग की सेटिंग के बारे में खास जानकारी
accounts.shippingSettings
रिसॉर्स की मदद से, ऐडवांस खाते और उससे जुड़े सभी उप-खातों की शिपिंग सेटिंग को वापस पाया जा सकता है और उन्हें अपडेट किया जा सकता है.
ऐडवांस खातों का इस्तेमाल आम तौर पर इंटिग्रेटर, एग्रीगेटर, और चैनल पार्टनर करते हैं. ये लोग या कंपनियां, कई कारोबारों के लिए ऑनलाइन स्टोर और एपीआई सेवाएं मैनेज करती हैं. जिन कारोबारों के एक से ज़्यादा ऑनलाइन स्टोर होते हैं या जिनके ब्रैंड अलग-अलग वेबसाइटों पर बेचे जाते हैं वे भी एक ऐडवांस खाते के तहत उप-खाते बना सकते हैं.
Google, कुछ प्रॉडक्ट के लिए डिलीवरी में लगने वाले समय के अनुमान को अपने-आप अपडेट कर सकता है.
शिपिंग की सेटिंग जोड़ना
अपने खाते के लिए शिपिंग की सेटिंग जोड़ने या अपडेट करने के लिए, accounts.shippingSettings.insert
तरीके का इस्तेमाल करें.
यहां दिए गए अनुरोध के सैंपल में, शिपिंग के लिए खरीदार से लिया जाने वाला शुल्क, लॉयल्टी प्रोग्राम (जिनके लिए यह शिपिंग सेवा उपलब्ध है), और मुद्रा कोड सेट किया गया है.
HTTP
POST https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/shippingSettings:insert
{
"etag": "",
"name": "accounts/ACCOUNT_ID/shippingSetting",
"services": [
{
"deliveryCountries": [
"COUNTRY_CODE"
],
"serviceName": "SERVICE_NAME",
"active": false,
"deliveryTime": {},
"loyaltyPrograms": [
{
"programLabel": "PROGRAM_LABEL"
}
],
"minimumOrderValue": {
"amountMicros": PRICE,
"currencyCode": "CURRENCY_CODE"
},
"currencyCode": "USD",
"rateGroups": [
{
"applicableShippingLabels": [
"SHIPPING_LABEL"
],
"singleValue": {
"flatRate": {
"amountMicros": 10000000,
"currencyCode": "USD"
}
}
}
]
}
]
}
cURL
curl --request POST \
'https://merchantapi.googleapis.com/accounts/v1/accounts/ACCOUNT_ID/shippingSettings:insert' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"name":"SHIPPING_SETTING_NAME","services":[{"serviceName":"SERVICE_NAME","currencyCode":"CURRENCY_CODE","rateGroups":[{"applicableShippingLabels":["SHIPPING_LABEL"],"carrierRates":[{"name":"new","carrier":"CARRIER_NAME","carrierService":"CARRIER_SERVICE","originPostalCode":"ZIPCODE"}],"singleValue":{"flatRate":{"amountMicros":10000000,"currencyCode":"USD"}}}],"deliveryCountries":["COUNTRY_CODE"],"deliveryTime":{"maxHandlingDays":2,"minHandlingDays":1},"minimumOrderValue":{"amountMicros":50000000,"currencyCode":"USD"},"active":false}]}' \
--compressed
इनकी जगह ये डालें:
- ACCOUNT_ID: यह आपके Merchant Center खाते का यूनीक आइडेंटिफ़ायर होता है.
- COUNTRY_CODE: यह उस देश का CLDR (कॉमन लोकल डेटा रिपॉज़िटरी) कोड है जहां यह सेवा लागू होती है. यह दर, रेट ग्रुप में मौजूद दरों से मेल खानी चाहिए.
- SERVICE_NAME: सेवा का नाम.
- CARRIER_NAME: कैरियर का नाम. उदाहरण के लिए, UPS और Fedex.
- CARRIER_SERVICE: कैरियर के लिए उपलब्ध सेवा.
कैरियर की सेवाओं की पूरी सूची देखने के लिए, कैरियर के हिसाब से दर (सिर्फ़ ऑस्ट्रेलिया, जर्मनी, यूनाइटेड किंगडम, और अमेरिका के लिए) देखें.
- PROGRAM_LABEL: Merchant Center में लॉयल्टी प्रोग्राम की सेटिंग में लॉयल्टी प्रोग्राम के लिए तय किया गया लेबल.
- SHIPPING_LABEL: शिपिंग के लेबल की सूची. इससे उन प्रॉडक्ट के बारे में पता चलता है जिन पर यह दर ग्रुप लागू होता है.
- PRICE: कीमत को माइक्रो में संख्या के तौर पर दिखाया जाता है. उदाहरण के लिए, 1 डॉलर = 10,00,000 माइक्रोज़.
- CURRENCY_CODE: कीमत की मुद्रा, तीन अक्षरों वाले संक्षिप्त नाम का इस्तेमाल करके दी जाती है.
चुनिंदा फ़ील्ड के बारे में ज़्यादा जानने के लिए, रेफ़रंस दस्तावेज़ देखें.
अनुरोध के मुख्य हिस्से में, accounts.shippingSettings
संसाधन का पूरा मुख्य हिस्सा शामिल होना चाहिए. भले ही, आपको सिर्फ़ एक एट्रिब्यूट अपडेट करना हो. ऐसा इसलिए, क्योंकि अनुरोध के मुख्य हिस्से में मौजूद NULL या छूटी हुई वैल्यू की वजह से, मौजूदा वैल्यू मिट जाती हैं.
यहां कॉल के पूरा होने पर मिलने वाले जवाब का एक उदाहरण दिया गया है:
{
"name": "accounts/ACCOUNT_ID/shippingSettings",
"services": [
{
"serviceName": "SERVICE_NAME",
"active": false,
"deliveryCountries": [
"COUNTRY_CODE"
],
"currencyCode": "CURRENCY_CODE",
"rateGroups": [
{
"applicableShippingLabels": [
"SHIPPING_LABEL"
],
"singleValue": {
"flatRate": {
"amountMicros": "PRICE",
"currencyCode": "CURRENCY_CODE"
}
}
}
],
"shipmentType": "LOCAL_DELIVERY",
"storeConfig": {
"storeServiceType": "ALL_STORES",
"cutoffConfig": {
"localCutoffTime": {
"hour": "7",
"minute": "40"
},
"noDeliveryPostCutoff": false
},
"serviceRadius": {
"value": "40",
"unit": "KILOMETERS"
}
}
}
],
"etag": "OAJCTQgBEAAaRwoEdGVzdBIEIgJVUxoDVVNEIggiBggHECgoACoeCAESDwoNCAESCU9WRVJTSVpFRBoJIgcIAhCAwtcvWAWSAQCaAQQIAhAo"
}
यहां एक उदाहरण दिया गया है. इसका इस्तेमाल करके, क्लाइंट लाइब्रेरी की मदद से किसी खाते के लिए शिपिंग की सेटिंग अपडेट की जा सकती हैं:
Java
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.accounts.v1.DeliveryTime;
import com.google.shopping.merchant.accounts.v1.InsertShippingSettingsRequest;
import com.google.shopping.merchant.accounts.v1.RateGroup;
import com.google.shopping.merchant.accounts.v1.Service;
import com.google.shopping.merchant.accounts.v1.Service.ShipmentType;
import com.google.shopping.merchant.accounts.v1.ShippingSettings;
import com.google.shopping.merchant.accounts.v1.ShippingSettingsServiceClient;
import com.google.shopping.merchant.accounts.v1.ShippingSettingsServiceSettings;
import com.google.shopping.merchant.accounts.v1.Value;
import com.google.shopping.type.Price;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;
/** This class demonstrates how to insert a ShippingSettings for a Merchant Center account. */
public class InsertShippingSettingsSample {
private static String getParent(String accountId) {
return String.format("accounts/%s", accountId);
}
public static void insertShippingSettings(Config config) throws Exception {
// Obtains OAuth token based on the user's configuration.
GoogleCredentials credential = new Authenticator().authenticate();
// Creates service settings using the credentials retrieved above.
ShippingSettingsServiceSettings shippingSettingsServiceSettings =
ShippingSettingsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
// Creates parent to identify where to insert the shippingsettings.
String parent = getParent(config.getAccountId().toString());
// Calls the API and catches and prints any network failures/errors.
try (ShippingSettingsServiceClient shippingSettingsServiceClient =
ShippingSettingsServiceClient.create(shippingSettingsServiceSettings)) {
InsertShippingSettingsRequest request =
InsertShippingSettingsRequest.newBuilder()
.setParent(parent)
.setShippingSetting(
ShippingSettings.newBuilder()
// Etag needs to be an empty string on initial insert
// On future inserts, call GET first to get the Etag
// Then use the retrieved Etag on future inserts.
// NOTE THAT ON THE INITIAL INSERT, YOUR SHIPPING SETTINGS WILL
// NOT BE STORED, YOU HAVE TO CALL INSERT AGAIN WITH YOUR
// RETRIEVED ETAG.
// .setEtag("")
.setEtag("PPa=")
.addServices(
Service.newBuilder()
.setServiceName("Canadian Postal Service")
.setActive(true)
.addDeliveryCountries("CA")
.setCurrencyCode("CAD")
.setDeliveryTime(
DeliveryTime.newBuilder()
.setMinTransitDays(0)
.setMaxTransitDays(3)
.setMinHandlingDays(0)
.setMaxHandlingDays(3)
.build())
.addRateGroups(
RateGroup.newBuilder()
.addApplicableShippingLabels("Oversized")
.addApplicableShippingLabels("Perishable")
.setSingleValue(Value.newBuilder().setPricePercentage("5.4"))
.setName("Oversized and Perishable items")
.build())
.setShipmentType(ShipmentType.DELIVERY)
.setMinimumOrderValue(
Price.newBuilder()
.setAmountMicros(10000000)
.setCurrencyCode("CAD")
.build())
.build())
.build())
.build();
System.out.println("Sending insert ShippingSettings request");
ShippingSettings response = shippingSettingsServiceClient.insertShippingSettings(request);
System.out.println("Inserted ShippingSettings Name below");
System.out.println(response.getName());
// You can apply ShippingSettings to specific products by using the `shippingLabel` field
// on the product.
} catch (Exception e) {
System.out.println(e);
}
}
public static void main(String[] args) throws Exception {
Config config = Config.load();
insertShippingSettings(config);
}
}
PHP
use Google\ApiCore\ApiException;
use Google\Shopping\Merchant\Accounts\V1\Client\ShippingSettingsServiceClient;
use Google\Shopping\Merchant\Accounts\V1\DeliveryTime;
use Google\Shopping\Merchant\Accounts\V1\InsertShippingSettingsRequest;
use Google\Shopping\Merchant\Accounts\V1\RateGroup;
use Google\Shopping\Merchant\Accounts\V1\Service;
use Google\Shopping\Merchant\Accounts\V1\Service\ShipmentType;
use Google\Shopping\Merchant\Accounts\V1\ShippingSettings;
use Google\Shopping\Merchant\Accounts\V1\Value;
use Google\Shopping\Type\Price;
/**
* This class demonstrates how to insert a ShippingSettings for a Merchant Center account.
*/
class InsertShippingSettings
{
/**
* A helper function to create the parent string.
*
* @param string $accountId The account ID.
* @return string The parent in the format "accounts/{accountId}".
*/
private static function getParent(string $accountId): string
{
return sprintf("accounts/%s", $accountId);
}
/**
* Inserts shipping settings for the specified Merchant Center account.
*
* @param array $config The configuration data containing the account ID.
* @return void
*/
public static function insertShippingSettings($config)
{
// Gets the OAuth credentials to make the request.
$credentials = Authentication::useServiceAccountOrTokenFile();
// Creates options config containing credentials for the client to use.
$options = ['credentials' => $credentials];
// Creates a client.
$shippingSettingsServiceClient = new ShippingSettingsServiceClient($options);
// Creates parent to identify where to insert the shippingsettings.
$parent = self::getParent($config['accountId']);
// Calls the API and catches and prints any network failures/errors.
try {
$request = (new InsertShippingSettingsRequest())
->setParent($parent)
->setShippingSetting(
(new ShippingSettings())
// Etag needs to be an empty string on initial insert
// On future inserts, call GET first to get the Etag
// Then use the retrieved Etag on future inserts.
// NOTE THAT ON THE INITIAL INSERT, YOUR SHIPPING SETTINGS WILL
// NOT BE STORED, YOU HAVE TO CALL INSERT AGAIN WITH YOUR
// RETRIEVED ETAG.
->setEtag("")
->setServices([
(new Service())
->setServiceName("Canadian Postal Service")
->setActive(true)
->setDeliveryCountries(["CA"])
->setCurrencyCode("CAD")
->setDeliveryTime(
(new DeliveryTime())
->setMinTransitDays(0)
->setMaxTransitDays(3)
->setMinHandlingDays(0)
->setMaxHandlingDays(3)
)
->setRateGroups(
[(new RateGroup())
->setApplicableShippingLabels(["Oversized","Perishable"])
->setSingleValue((new Value())->setPricePercentage("5.4"))
->setName("Oversized and Perishable items")]
)
->setShipmentType(ShipmentType::DELIVERY)
->setMinimumOrderValue(
(new Price())
->setAmountMicros(10000000)
->setCurrencyCode("CAD")
)
])
);
print "Sending insert ShippingSettings request" . PHP_EOL;
$response = $shippingSettingsServiceClient->insertShippingSettings($request);
print "Inserted ShippingSettings below" . PHP_EOL;
print_r($response);
// You can apply ShippingSettings to specific products by using the `shippingLabel` field
// on the product.
} catch (ApiException $e) {
print $e->getMessage();
}
}
/**
* Helper to execute the sample.
*
* @return void
*/
public function callSample(): void
{
$config = Config::generateConfig();
// Makes the call to insert shipping settings for the MC account.
self::insertShippingSettings($config);
}
}
// Run the script
$sample = new InsertShippingSettings();
$sample->callSample();
Python
from examples.authentication import configuration
from examples.authentication import generate_user_credentials
from google.shopping.merchant_accounts_v1 import DeliveryTime
from google.shopping.merchant_accounts_v1 import InsertShippingSettingsRequest
from google.shopping.merchant_accounts_v1 import RateGroup
from google.shopping.merchant_accounts_v1 import Service
from google.shopping.merchant_accounts_v1 import ShippingSettings
from google.shopping.merchant_accounts_v1 import ShippingSettingsServiceClient
from google.shopping.merchant_accounts_v1 import Value
_ACCOUNT = configuration.Configuration().read_merchant_info()
_PARENT = f"accounts/{_ACCOUNT}"
def insert_shipping_settings():
"""Inserts a ShippingSettings for a Merchant Center account."""
# Gets OAuth Credentials.
credentials = generate_user_credentials.main()
# Creates a client.
client = ShippingSettingsServiceClient(credentials=credentials)
# Creates the request.
request = InsertShippingSettingsRequest(
parent=_PARENT,
shipping_setting=ShippingSettings(
# Etag needs to be an empty string on initial insert
# On future inserts, call GET first to get the Etag
# Then use the retrieved Etag on future inserts.
# NOTE THAT ON THE INITIAL INSERT, YOUR SHIPPING SETTINGS WILL
# NOT BE STORED, YOU HAVE TO CALL INSERT AGAIN WITH YOUR
# RETRIEVED ETAG.
etag="",
services=[
Service(
service_name="Canadian Postal Service",
active=True,
delivery_countries=["CA"],
currency_code="CAD",
delivery_time=DeliveryTime(
min_transit_days=0,
max_transit_days=3,
min_handling_days=0,
max_handling_days=3,
),
rate_groups=[
RateGroup(
applicable_shipping_labels=[
"Oversized",
"Perishable",
],
single_value=Value(price_percentage="5.4"),
name="Oversized and Perishable items",
)
],
shipment_type=Service.ShipmentType.DELIVERY,
minimum_order_value={
"amount_micros": 10000000,
"currency_code": "CAD",
},
)
],
),
)
# Makes the request and prints the inserted ShippingSettings name.
try:
response = client.insert_shipping_settings(request=request)
print("Inserted ShippingSettings below")
print(response)
# You can apply ShippingSettings to specific products by using the
# `shippingLabel` field on the product.
except RuntimeError as e:
print(e)
if __name__ == "__main__":
insert_shipping_settings()
शिपिंग की सेटिंग फिर से हासिल करना
यहां दिए गए अनुरोधों से पता चलता है कि Merchant Center खाते की शिपिंग सेटिंग कैसे वापस पाई जा सकती हैं:
HTTP
GET https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/shippingSettings
cURL
curl \
'https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/shippingSettings' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
क्लाइंट लाइब्रेरी का इस्तेमाल करके, किसी खाते के लिए शिपिंग की सेटिंग की जानकारी पाने का उदाहरण यहां दिया गया है:
Java
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.accounts.v1.GetShippingSettingsRequest;
import com.google.shopping.merchant.accounts.v1.ShippingSettings;
import com.google.shopping.merchant.accounts.v1.ShippingSettingsName;
import com.google.shopping.merchant.accounts.v1.ShippingSettingsServiceClient;
import com.google.shopping.merchant.accounts.v1.ShippingSettingsServiceSettings;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;
/** This class demonstrates how to get the ShippingSettings for a given Merchant Center account. */
public class GetShippingSettingsSample {
public static void getShippingSettings(Config config) throws Exception {
// Obtains OAuth token based on the user's configuration.
GoogleCredentials credential = new Authenticator().authenticate();
// Creates service settings using the credentials retrieved above.
ShippingSettingsServiceSettings shippingSettingsServiceSettings =
ShippingSettingsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
// Creates ShippingSettings name to identify ShippingSettings.
String name =
ShippingSettingsName.newBuilder()
.setAccount(config.getAccountId().toString())
.build()
.toString();
// Calls the API and catches and prints any network failures/errors.
try (ShippingSettingsServiceClient shippingSettingsServiceClient =
ShippingSettingsServiceClient.create(shippingSettingsServiceSettings)) {
// The name has the format: accounts/{account}/shippingSettings
GetShippingSettingsRequest request =
GetShippingSettingsRequest.newBuilder().setName(name).build();
System.out.println("Sending Get ShippingSettings request:");
ShippingSettings response = shippingSettingsServiceClient.getShippingSettings(request);
System.out.println("Retrieved ShippingSettings below");
System.out.println(response);
} catch (Exception e) {
System.out.println(e);
}
}
public static void main(String[] args) throws Exception {
Config config = Config.load();
getShippingSettings(config);
}
}
PHP
use Google\ApiCore\ApiException;
use Google\Shopping\Merchant\Accounts\V1\Client\ShippingSettingsServiceClient;
use Google\Shopping\Merchant\Accounts\V1\GetShippingSettingsRequest;
/**
* This class demonstrates how to get the ShippingSettings for a given Merchant Center account.
*/
class GetShippingSettings
{
/**
* Retrieves the shipping settings for the specified Merchant Center account.
*
* @param array $config The configuration data containing the account ID.
* @return void
*/
public static function getShippingSettings($config)
{
// Gets the OAuth credentials to make the request.
$credentials = Authentication::useServiceAccountOrTokenFile();
// Creates options config containing credentials for the client to use.
$options = ['credentials' => $credentials];
// Creates a client.
$shippingSettingsServiceClient = new ShippingSettingsServiceClient($options);
// Creates ShippingSettings name to identify ShippingSettings.
// The name has the format: accounts/{account}/shippingSettings
$name = "accounts/" . $config['accountId'] . "/shippingSettings";
// Calls the API and catches and prints any network failures/errors.
try {
$request = (new GetShippingSettingsRequest())
->setName($name);
print "Sending Get ShippingSettings request:" . PHP_EOL;
$response = $shippingSettingsServiceClient->getShippingSettings($request);
print "Retrieved ShippingSettings below" . PHP_EOL;
print_r($response);
} catch (ApiException $e) {
print $e->getMessage();
}
}
/**
* Helper to execute the sample.
*
* @return void
*/
public function callSample(): void
{
$config = Config::generateConfig();
// Makes the call to get shipping settings for the MC account.
self::getShippingSettings($config);
}
}
// Run the script
$sample = new GetShippingSettings();
$sample->callSample();
Python
from examples.authentication import configuration
from examples.authentication import generate_user_credentials
from google.shopping.merchant_accounts_v1 import GetShippingSettingsRequest
from google.shopping.merchant_accounts_v1 import ShippingSettingsServiceClient
_ACCOUNT = configuration.Configuration().read_merchant_info()
_PARENT = f"accounts/{_ACCOUNT}"
def get_shipping_settings():
"""Gets the ShippingSettings for a given Merchant Center account."""
# Gets OAuth Credentials.
credentials = generate_user_credentials.main()
# Creates a client.
client = ShippingSettingsServiceClient(credentials=credentials)
# Creates the Shipping Settings name
name = _PARENT + "/shippingSettings"
# Creates the request.
request = GetShippingSettingsRequest(name=name)
# Makes the request and prints the retrieved ShippingSettings.
try:
response = client.get_shipping_settings(request=request)
print("Retrieved ShippingSettings below")
print(response)
except RuntimeError as e:
print(e)
if __name__ == "__main__":
get_shipping_settings()
वेयरहाउस की सेटिंग जोड़ना
अपने खाते के लिए इन्वेंट्री को स्टोर और मैनेज करने वाली वेयरहाउस सेटिंग जोड़ने या अपडेट करने के लिए, accounts.shippingSettings.insert
तरीके का इस्तेमाल करें.
अपने गोदामों को मैनेज करने के लिए, Merchant API का इस्तेमाल करने का तरीका यहां बताया गया है:
अपनी सभी मौजूदा
shippingsettings
औरwarehouses
वापस पाने के लिए,accounts.shippingSettings.getShippingSettings
तरीके का इस्तेमाल करकेGET
का अनुरोध करें.account.shippingSettings.insert
तरीके का इस्तेमाल करके अनुरोध बनाएं.shippingsettings
संसाधन कोshippingsettings
अनुरोध के जवाब से, insert अनुरोध में कॉपी करें.GET
Insert कॉल का इस्तेमाल करके, गोदामों के बारे में जानकारी जोड़ने के लिए, अनुरोध के मुख्य हिस्से में मौजूद
warehouses
संसाधन में गोदामों के बारे में जानकारी भरें.डेटा डालने का अनुरोध चलाएं.
यहां दिए गए अनुरोध के सैंपल में, आपके खाते के लिए गोदाम की सेटिंग अपडेट करने के लिए accounts.shippingSettings.insert
तरीके का इस्तेमाल करने का तरीका बताया गया है. इस अनुरोध से, ऑर्डर स्वीकार करने का समय, ऑर्डर प्रोसेस करने में लगने वाले दिन, हैंडलिंग के दिन, और शिपिंग का पता सेट किया जाता है.
POST https://merchantapi.googleapis.com/accounts/v1/accounts/ACCOUNT_ID/shippingSettings:insert
{
"etag": "",
"name": "accounts/ACCOUNT_ID/shippingSetting",
"warehouses": [
{
"cutoffTime": {
"hour": 7,
"minute": 50
},
"handlingDays": 7,
"name": "WAREHOUSE_NAME",
"shippingAddress": {
"streetAddress": "ADDRESS",
"administrativeArea": "CA",
"city": "CITY_NAME",
"postalCode": "POSTAL_CODE",
"regionCode": "REGION_CODE"
}
}
]
}
इनकी जगह ये डालें:
- ACCOUNT_ID: यह आपके Merchant Center खाते का यूनीक आइडेंटिफ़ायर होता है.
- WAREHOUSE_NAME: वेयरहाउस का नाम.
- ADDRESS: गोदाम का शिपिंग पता.
- CITY_NAME: शहर, कस्बा या कम्यून. इसमें आश्रित इलाके या उप-इलाके भी शामिल हो सकते हैं. उदाहरण के लिए, आस-पास के इलाके या शहर के बाहरी इलाके.
- POSTAL_CODE: पिन कोड. उदाहरण के लिए, 94043.
- REGION_CODE: देश का CLDR कोड. उदाहरण के लिए, "US".
यहां कॉल के पूरा होने पर मिलने वाले जवाब का एक उदाहरण दिया गया है:
{
"name": "accounts/ACCOUNT_ID/shippingSettings",
"warehouses": [
{
"name": "WAREHOUSE_NAME",
"shippingAddress": {
"streetAddress": "ADDRESS",
"city": "CITY_NAME",
"administrativeArea": "CA",
"postalCode": "POSTAL_CODE",
"regionCode": "REGION_CODE"
},
"cutoffTime": {
"hour": 7,
"minute": 50
},
"handlingDays": "7",
"businessDayConfig": {
"businessDays": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY"
]
}
}
],
"etag": "OAJiUAjB0au+FBABGgR0ZXN0Ii4KAlVTGgJDQSoKQ2FsaWZvcm5pYWIFOTQwNDNyETExMXcgMzFzdCBTdHJlZXQuKgQIBxAyMAc4ATgCOAM4BDgF"
}
पिन कोड ग्रुप सेट करना
Merchant Center खाते के लिए, क्षेत्रों को मैनेज करने के लिए Accounts sub-API का इस्तेमाल करें. इन क्षेत्रों को postalCodeGroups कहा जाता है.
postalCodeGroups संसाधन, ग्रुपिंग की एक सूची है. इसमें हर ग्रुपिंग, एक जैसे शिपिंग पते वाले कई पिन कोड की सूची होती है.
Merchant API का इस्तेमाल करके, अपने postalCodeGroups को इस तरह मैनेज करें:
अपनी सभी shippingsettings और postalCodeGroups को वापस पाने के लिए, get कॉल करें.
get कॉल से shippingsettings को update कॉल में कॉपी करें.
अगर शिपिंग सेवा में ट्रांज़िट समय के लेबल का इस्तेमाल नहीं किया जाता है, तो अनुरोध के मुख्य हिस्से से यह एंट्री हटाएं.
"transitTimeLabels": [ "all other labels" ],
update कॉल के लिए, postalCodeGroups सेक्शन में वे इलाके डालें जिनका इस्तेमाल करना है.
shippingsettings और postalCodeGroups संसाधनों के साथ update कॉल करें.
ऑर्डर वाले दिन प्रॉडक्ट डिलीवर करने की सुविधा जोड़ना
अगर आपके पास स्थानीय इन्वेंट्री है, तो Merchant API का इस्तेमाल करके, ऑर्डर वाले दिन डिलीवरी करने की सुविधा देने वाली शिपिंग सेवाएं कॉन्फ़िगर की जा सकती हैं. स्थानीय प्रॉडक्ट के लिए स्टोर में मौजूद इन्वेंट्री की जानकारी जोड़ना (addlocalinventory) लेख पढ़ें.
ऑर्डर वाले दिन डिलीवरी की सुविधा देने वाली शिपिंग सेवाओं के लिए, shipmentType एट्रिब्यूट की वैल्यू local_delivery होती है.
इन बातों का ध्यान रखें:
- local_delivery एट्रिब्यूट की सभी शिपिंग सेवाओं को, ऑर्डर वाले दिन डिलीवरी करने की सुविधा माना जाता है.
- स्थानीय डिलीवरी के लिए, deliveryTime की जानकारी नहीं बदली जा सकती.
स्थानीय इन्वेंट्री में मौजूद प्रॉडक्ट के लिए, ऑर्डर वाले दिन डिलीवरी करने की सुविधा सेट अप करने के लिए, accounts.shippingSettings.insert
तरीके का इस्तेमाल करें.
यहां अनुरोध का एक सैंपल दिया गया है. इसमें शिपमेंट का टाइप, storeConfig
(उन स्टोर की सूची जहां से आपके प्रॉडक्ट डिलीवर किए जाते हैं), और दर के ग्रुप सेट किए गए हैं.
POST https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/shippingSettings:insert
{
"etag": "",
"name": "accounts/ACCOUNT_ID/shippingSetting",
"services": [
{
"deliveryCountries": [
"COUNTRY_CODE"
],
"serviceName": "SERVICE_NAME",
"active": false,
"currencyCode": "CURRENCY_CODE",
"shipmentType": "SHIPMENT_TYPE",
"storeConfig": {
"cutoffConfig": {
"localCutoffTime": {
"hour": 7,
"minute": 40
}
},
"serviceRadius": {
"unit": "KILOMETERS",
"value": 40
},
"storeCodes": [],
"storeServiceType": "ALL_STORES"
},
"rateGroups": [
{
"applicableShippingLabels": [
"SHIPPING_LABEL"
],
"singleValue": {
"flatRate": {
"amountMicros": PRICE,
"currencyCode": "CURRENCY_CODE"
}
}
}
]
}
]
}
इनकी जगह ये डालें:
- SHIPMENT_TYPE: इस सेवा के ज़रिए, इन जगहों पर ऑर्डर शिप किए जाते हैं:
SHIPMENT_TYPE_UNSPECIFIED
DELIVERY
LOCAL_DELIVERY
COLLECTION_POINT
- SHIPPING_LABEL: शिपिंग के लेबल की सूची. इससे उन प्रॉडक्ट के बारे में पता चलता है जिन पर यह दर ग्रुप लागू होता है.
यहां कॉल के पूरा होने पर मिलने वाले जवाब का एक उदाहरण दिया गया है:
{
"name": "accounts/ACCOUNT_ID/shippingSettings",
"services": [
{
"serviceName": "SERVICE_NAME",
"active": false,
"deliveryCountries": [
"COUNTRY_CODE"
],
"currencyCode": "CURRENCY_CODE",
"rateGroups": [
{
"applicableShippingLabels": [
"SHIPPING_LABEL"
],
"singleValue": {
"flatRate": {
"amountMicros": "PRICE",
"currencyCode": "CURRENCY_CODE"
}
}
}
],
"shipmentType": "SHIPMENT_TYPE",
"storeConfig": {
"storeServiceType": "ALL_STORES",
"cutoffConfig": {
"localCutoffTime": {
"hour": "7",
"minute": "40"
},
"noDeliveryPostCutoff": false
},
"serviceRadius": {
"value": "40",
"unit": "KILOMETERS"
}
}
}
],
"etag": "OAJCTQgBEAAaRwoEdGVzdBIEIgJVUxoDVVNEIggiBggHECgoACoeCAESDwoNCAESCU9WRVJTSVpFRBoJIgcIAhCAwtcvWAWSAQCaAQQIAhAo"
}
अगले दिन डिलीवरी करने की सुविधा जोड़ना
ऑर्डर वाले दिन डिलीवरी करने की सुविधा के लिए तय किए गए कटऑफ़ समय के बाद किए गए ऑर्डर, डिफ़ॉल्ट रूप से अगले दिन डिलीवरी करने के लिए शेड्यूल किए जाते हैं.
अगले दिन डिलीवरी की सुविधा बंद करने के लिए, no_delivery_post_cutoff को true पर सेट करें.
अगले दिन डिलीवरी करने की सुविधा बंद करने पर, आपकी शिपिंग सेवाएं हर दिन सिर्फ़ कटऑफ़ समय से पहले दिखती हैं.
अगले दिन डिलीवरी की सुविधा सिर्फ़ तब उपलब्ध होती है, जब shipmentType एट्रिब्यूट की वैल्यू local_delivery के तौर पर सेट की गई हो.
सामान लौटाने की नीति जोड़ना
अगर आपने शॉपिंग विज्ञापनों या ऑर्गैनिक लिस्टिंग के ज़रिए प्रॉडक्ट लिस्ट किए हैं, तो returnpolicyonline एट्रिब्यूट का इस्तेमाल करके, ऑनलाइन सामान लौटाने की नीतियां बनाई जा सकती हैं. साथ ही, उन्हें देखा, बदला या मिटाया जा सकता है. इसके लिए, आपको इन एट्रिब्यूट का इस्तेमाल करना होगा:
- टारगेट किए गए देश. इसके लिए, शॉपिंग विज्ञापनों और मुफ़्त में दिखाई जाने वाली लिस्टिंग के लिए, सामान लौटाने की नीतियां सेट अप करना लेख पढ़ें.
- रीस्टॉकिंग शुल्क (प्रॉडक्ट लौटाने पर लगने वाला शुल्क)
- सामान लौटाने के तरीके
- लौटाए गए सामान की स्थिति
- सामान लौटाने की वजह की कैटगरी
- सामान लौटाने की नीति के यूआरएल. इसके लिए, शॉपिंग विज्ञापनों और मुफ़्त में दिखाई जाने वाली लिस्टिंग के लिए, सामान लौटाने की नीतियां सेट अप करना लेख पढ़ें.
शॉपिंग विज्ञापनों या ऑर्गैनिक लिस्टिंग के ज़रिए बेचे गए प्रॉडक्ट के लिए, खरीदार को सामान लौटाने का पता देने की ज़रूरत नहीं होती.
ज़्यादा जानकारी के लिए, शॉपिंग विज्ञापनों और ऑर्गैनिक लिस्टिंग के लिए, सामान लौटाने की नीतियां सेट अप करना लेख पढ़ें.
सामान लौटाने की नीति जोड़ने के लिए, returnpolicyonline.create का इस्तेमाल किया जा सकता है. जवाब में, अपडेट की गई नीति शामिल है.
POST https://merchantapi.googleapis.com/v1/{ACCOUNT_ID}/returnpolicyonline