ShippingSettings
संसाधन की मदद से, अपने खाते की शिपिंग सेटिंग को वापस पाया और अपडेट किया जा सकता है.
Google, कुछ प्रॉडक्ट के लिए डिलीवरी में लगने वाले समय का अनुमान अपने-आप अपडेट कर सकता है. ज़्यादा जानकारी के लिए, अपने-आप होने वाले सुधारों की सुविधा चालू करना लेख पढ़ें.
शिपिंग की सेटिंग को पढ़ना, उनमें बदलाव करना या उन्हें अपडेट करना
Merchant API की शिपिंग सेवा का इस्तेमाल करने के लिए, यह तरीका अपनाएं:
- अपने खाते की शिपिंग की पूरी सेटिंग वापस पाने के लिए,
GET
अनुरोध करें. - शिपिंग की सेटिंग में बदलाव करें.
- शिपिंग की बदली गई सेटिंग के साथ
INSERT
अनुरोध करें.
Etag
Etag एक कोड में बदला गया टोकन है, ताकि एक साथ कई अपडेट न हो पाएं. शिपिंग की सेटिंग के किसी भी डेटा में बदलाव होने पर, ईटैग बदल जाता है. उपयोगकर्ताओं को GET
अनुरोध से मिले ईटीएग को कॉपी करके, INSERT
अनुरोध के मुख्य हिस्से में चिपकाना होगा.
अगर GET
अनुरोध और INSERT
अनुरोध के बीच शिपिंग सेटिंग का डेटा बदल जाता है, तो आपको गड़बड़ी का एक मैसेज मिलता है. इसमें, सबसे नया ईटीएग टोकन पाने के लिए, GET
अनुरोध करने के लिए कहा जाता है. आपको नया ईटीएग टोकन पाने के लिए, GET
अनुरोध को कॉल करना होगा. साथ ही, नए ईटीएग टोकन को INSERT
अनुरोध के मुख्य हिस्से में कॉपी करना होगा.
शिपिंग की सेटिंग जोड़ना
अपने खाते के लिए शिपिंग की सेटिंग जोड़ने या अपडेट करने के लिए, shippingsettings.insert
का इस्तेमाल करें. यहां एक अनुरोध का सैंपल दिया गया है. इसमें खाते के 10 नंबर के तहत, GSA Shipping - Free Ship Over $49.99 नाम की शिपिंग सेवा के लिए, maxTransitDays
को 7 पर अपडेट किया गया है.
POST https://merchantapi.googleapis.com/accounts/v1beta/accounts/{accountId}/shippingSettings/
{
"services": [
{
"name": "FedEx",
"active": true,
"deliveryCountries": ["US"],
"currencyCode": "USD",
"deliveryTime": {
"minTransitDays": 4,
"maxTransitDays": 6,
"minHandlingDays": 0,
"maxHandlingDays": 0
},
"rateGroups": [
{
"singleValue": {
"flatRate": {
"amountMicros": 5990000,
"currencyCode": "USD"
}
},
"name": "All products"
}
]
},
{
"name": "GSA Shipping - Free Ship Over $49.99",
"active": true,
"deliveryCountries": "US",
"currencyCode": "USD",
"deliveryTime": {
"minTransitDays": 3,
"maxTransitDays": 7,
"minHandlingDays": 1,
"maxHandlingDays": 2
},
"rateGroups": [
{
"mainTable": {
"rowHeaders": {
"prices": [
{
"amountMicros": 49990000,
"currencyCode": "USD"
},
{
"amountMicros": -1,
"currencyCode": "USD"
}
]
},
"rows": [
{
"cells": [
{
"flatRate": {
"amountMicros": 6990000,
"currencyCode": "USD"
}
}
]
},
{
"cells": [
{
"flatRate": {
"amountMicros": 0,
"currencyCode": "USD"
}
}
]
}
]
},
"name": "Free Ship Over $49.99"
}
]
}
]
}
शिपिंग की सेटिंग डालने के लिए, यहां एक सैंपल दिया गया है:
Python
from examples.authentication import configuration
from examples.authentication import generate_user_credentials
from google.shopping.merchant_accounts_v1beta import GetShippingSettingsRequest
from google.shopping.merchant_accounts_v1beta 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()
वेयरहाउस सेट करना
यहां दिए गए JSON सैंपल में बताया गया है कि अपने Merchant Center खाते के लिए, वेयरहाउस की जानकारी मैनेज करने के लिए, Merchant Center की शिपिंग सेटिंग की सेवा का इस्तेमाल कैसे किया जा सकता है:
"warehouses": [
{
"name": "warehouse 1",
"shippingAddress": {
"streetAddress": {street_address},
"city": {city},
"administrativeArea": {administrative_area},
"postalCode": {postal_code},
"regionCode": {region_code}
},
"cutoffTime": {
"minutes": {minutes}
},
"handlingDays": {handling_days},
"businessDaysConfig": {
"businessDays": [
"MONDAY", "SUNDAY"
]
}
}
]
इनकी जगह ये डालें:
- {street_address}: वेयरहाउस के पते का सड़क-लेवल वाला हिस्सा.
- {city}: वह शहर, कस्बा या कम्यून जहां गोदाम मौजूद है.
- {administrative_area}: देश का प्रशासनिक उप-विभाग. उदाहरण के लिए, कोई राज्य.
- {postal_code}: पिन कोड या ज़िप कोड.
- {region_code}: स्ट्रिंग में देश का कोड.
- {minutes}: कट-ऑफ़ समय के मिनट वाला हिस्सा. इस समय से पहले ऑर्डर देने पर, वे उसी दिन वेयरहाउस में प्रोसेस हो जाते हैं.
- {handling_days}: इस गोदाम को किसी आइटम को पैक और शिप करने में जितने दिन लगते हैं.
warehouses
संसाधन, गोदामों की सूची है. हर वेयरहाउस के लिए, शिपिंग सेवा के वेयरहाउस के हिसाब से डिलीवरी में लगने वाले समय की जानकारी warehouse.name
एट्रिब्यूट की मदद से दी जा सकती है.
अपने वेयरहाउस मैनेज करना
अपने वेयरहाउस मैनेज करने के लिए, Merchant API का इस्तेमाल करने का तरीका यहां बताया गया है:
- अपने सभी मौजूदा
shippingsettings
और गोदामों को वापस पाने के लिए,GET
अनुरोध करें. GET
अनुरोध सेshippingsettings
को कॉपी करके,UPDATE
अनुरोध में चिपकाएं.अगर आपको
INSERT
अनुरोध के लिए,warehouses
सेक्शन में वेयरहाउस का इस्तेमाल करना है, तो वेयरहाउस की जानकारी डालें.UPDATE
का ऐसा अनुरोध करें जिसमेंshippingsettings
औरwarehouses
के रिसॉर्स शामिल हों.
यहां वेयरहाउस 1 के लिए वेयरहाउस के साथ INSERT
अनुरोध बॉडी का सैंपल दिया गया है. इसमें, न्यूयॉर्क से माउंटेन व्यू में अपडेट किया गया है:
{
"services": [
{
"name": "Standard Shipping",
"active": true,
"deliveryCountries": ["US", "UK"],
"currencyCode": "USD",
"deliveryTime": {
"minHandlingDays": 0,
"maxHandlingDays": 1,
"warehouseBasedDeliveryTimes": [
{"carrier": "Fedex"
"carrierService": "ground"
"warehouse": "Warehouse 1"
},
{"carrier": "Fedex"
"carrierService": "2 days"
"warehouse": "Warehouse 2"
}
]
},
"rateGroups": [
{
"singleValue": {
"flatRate": {
"amountMicros": 0,
"currencyCode": "USD"
}
},
"name": "Standard Shipping"
}
],
},
{
"name": "Expedited",
"flatRate": {
"amountMicros": 9990000,
"currencyCode": "USD"
}
},
"name": "Expedited"
}
],
}
],
"warehouses": [
{
"name": "Warehouse1",
"shippingAddress": [
{
"streetAddress": "1111 shoreline street"
"city": "Mountain View",
"administrativeArea": "CA"
}
]
},
{
"name": "Warehouse 2",
"country": "US",
"postalCodeRanges": [
{
"streetAddress": "1111 5th avenue"
"city": "New York",
"administrativeArea": "NY"
}
]
}
]
}
ऑर्डर वाले दिन डिलीवरी करने की सुविधा जोड़ना
अगर आपके पास स्थानीय इन्वेंट्री है, तो Content API for Shopping का इस्तेमाल करके, ऑर्डर वाले दिन डिलीवरी करने की सुविधा वाली शिपिंग सेवाओं को कॉन्फ़िगर किया जा सकता है. ऑर्डर वाले दिन डिलीवरी करने वाली शिपिंग सेवाओं के लिए, shipment_type
के तौर पर local_delivery
का इस्तेमाल किया जाता है. फ़िलहाल, local_delivery
शिपिंग सेवाओं को ऑर्डर वाले दिन डिलीवरी करने वाली सेवाओं के तौर पर माना जाता है.
स्थानीय डिलीवरी के लिए, delivery_time
की जानकारी नहीं बदली जा सकती. स्थानीय इन्वेंट्री के प्रॉडक्ट के लिए, ऑर्डर वाले दिन डिलीवरी करने की सुविधा सेट अप करने के लिए, shippingsettings.insert
का इस्तेमाल करें.
यहां अनुरोध के मुख्य हिस्से का एक सैंपल दिया गया है. इससे आपके खाते के सभी स्टोर में, ऑर्डर वाले दिन डिलीवरी करने की सेवा जोड़ी जाती है:
{
"name": "accounts/accountId/shippingSettings",
"services": [
{
"name": "Local Delivery",
"active": true,
"shipmentType": "local_delivery",
"deliveryCountries": "US",
"currencyCode": "USD",
"rateGroups": [
{
"singleValue": {
"flatRate": {
"amountMicros": 0,
"currencyCode": "USD"
}
}
}
],
"storeConfig": {
"storeServiceType": "all stores",
"storeCodes": [],
"cutoffConfig": {
"storeCloseOffsetHours": 2,
"noDeliveryPostCutoff": true
},
"serviceRadius": {
"value": 4,
"unit": "Miles"
}
}
}
]
}
अगले दिन डिलीवरी की सुविधा जोड़ना
ऑर्डर वाले दिन डिलीवरी करने के लिए तय किए गए कट-ऑफ़ समय के बाद किए गए ऑर्डर, डिफ़ॉल्ट रूप से अगले दिन डिलीवरी के लिए शेड्यूल किए जाते हैं. अगले दिन डिलीवरी की सुविधा बंद करने के लिए, no_delivery_post_cutoff
फ़ील्ड को 'सही' पर सेट करें. अगले दिन डिलीवरी करने की सुविधा बंद करने पर, आपकी शिपिंग सेवाएं हर दिन कटऑफ़ समय से पहले ही दिखेंगी.
अगले दिन डिलीवरी की सुविधा सिर्फ़ तब उपलब्ध होती है, जब shipment_type
की वैल्यू local_delivery
हो.
ज़्यादा जानें
Content API for Shopping से माइग्रेट करने के बारे में जानने के लिए, शिपिंग की सेटिंग मैनेज करने की सुविधा को माइग्रेट करना लेख पढ़ें.