इस गाइड में एक भौगोलिक क्षेत्र के बारे में बताया गया है. इसका इस्तेमाल, accounts.products.regionalInventories
संसाधन से जुड़ी सेवा को टारगेट करने के लिए किया जा सकता है. इलाकों को पिन कोड के कलेक्शन के तौर पर या कुछ देशों में, पहले से तय किए गए जियोटारगेट का इस्तेमाल करके तय किया जा सकता है. ज़्यादा जानकारी के लिए, देश/इलाके सेट अप करना लेख पढ़ें.
क्षेत्र बनाने और अपडेट करने के लिए, इन तरीकों का इस्तेमाल किया जा सकता है:
किसी इलाके की जानकारी पाना
अपने Merchant Center खाते में तय किए गए इलाके को वापस पाने के लिए, accounts.regions.get
वाला तरीका अपनाएं.
अनुरोध का सैंपल यहां दिया गया है:
GET https://merchantapi.googleapis.com/accounts/v1beta/accounts/125222396/regions/234567?key=[YOUR_API_KEY]
यहां किसी कॉल के सही तरीके से पूरा होने पर मिलने वाले जवाब का सैंपल दिया गया है:
HTTP/1.1 200
{
"name": "accounts/125222396/regions/234567",
"displayName": "Canada",
"postalCodeArea": {
"regionCode": "CA",
"postalCodes": [
{
"begin": "L6A"
}
]
}
सभी इलाकों की सूची बनाना
अपने Merchant Center खाते में क्षेत्रों की सूची बनाने के लिए, accounts.regions.list
वाला तरीका अपनाएं.
अनुरोध का सैंपल यहां दिया गया है:
GET https://merchantapi.googleapis.com/accounts/v1beta/accounts/125222396/regions?pageSize=100&key=[YOUR_API_KEY]
यहां किसी कॉल के सही तरीके से पूरा होने पर मिलने वाले जवाब का सैंपल दिया गया है:
HTTP/1.1 200
{
"regions": [
{
"name": "accounts/125222396/regions/234567",
"displayName": "Canada",
"postalCodeArea": {
"regionCode": "CA",
"postalCodes": [
{
"begin": "L6A"
}
]
},
"regionalInventoryEligible": true,
"shippingEligible": true
},
{
"name": "accounts/125222396/regions/Inline region",
"displayName": "Inline region",
"postalCodeArea": {
"regionCode": "CA",
"postalCodes": [
{
"begin": "M7B"
}
]
},
"regionalInventoryEligible": false,
"shippingEligible": true
},
]
}
कोई क्षेत्र डालना
अपने Merchant Center खाते में क्षेत्र की जानकारी डालने के लिए, accounts.regions.create
वाला तरीका अपनाएं. यह तरीका अपनाने के लिए, आपके पास एडमिन ऐक्सेस होना ज़रूरी है.
अनुरोध का सैंपल यहां दिया गया है:
POST https://merchantapi.googleapis.com/accounts/v1beta/accounts/102959835/regions?regionId=987654&key=[YOUR_API_KEY]
{
"displayName": "TestRegion",
"name": "987654",
"postalCodeArea": {
"postalCodes": [
{
"begin": "98109"
}
],
"regionCode": "US"
}
}
यहां किसी कॉल के सफल होने पर मिलने वाले जवाब का सैंपल दिया गया है:
{
"name": "accounts/102959835/regions/987654",
"displayName": "TestRegion",
"postalCodeArea": {
"regionCode": "US",
"postalCodes": [
{
"begin": "98109"
}
]
},
"regionalInventoryEligible": true,
"shippingEligible": true
}
AreaCode
के साथ नया क्षेत्र बनाने के लिए:
अनुरोध का सैंपल यहां दिया गया है:
POST https://merchantapi.googleapis.com/accounts/v1beta/accounts/102959835/regions?regionId=168888&key=[YOUR_API_KEY] HTTP/1.1
{
"displayName": "WA_test",
"name": "168888",
"geotargetArea": {
"geotargetCriteriaIds": [
20101
]
}
}
यहां किसी कॉल के सफल होने पर मिलने वाले जवाब का सैंपल दिया गया है:
{
"name": "accounts/102959835/regions/168888",
"displayName": "WA_test",
"geotargetArea": {
"geotargetCriteriaIds": [
"20101"
]
},
"regionalInventoryEligible": true,
"shippingEligible": false
}
बनाए गए क्षेत्र के लिए displayName
और GeoTargetCriteriaIds
को अपडेट करने के लिए:
अनुरोध का सैंपल यहां दिया गया है:
PATCH https://merchantapi.googleapis.com/accounts/v1beta/accounts/102959835/regions/168888?updateMask=displayName%2CgeotargetArea&key=[YOUR_API_KEY] HTTP/1.1
{
"displayName": "BR_test",
"geotargetArea": {
"geotargetCriteriaIds": [
20100
]
}
}
यहां किसी कॉल के सही तरीके से पूरा होने पर मिलने वाले जवाब का सैंपल दिया गया है:
HTTP/1.1 200
{
"name": "accounts/102959835/regions/168888",
"displayName": "BR_test",
"geotargetArea": {
"geotargetCriteriaIds": [
"20100"
]
},
"regionalInventoryEligible": true,
"shippingEligible": false
}
किसी इलाके की जानकारी अपडेट करना
अपने Merchant Center खाते में किसी इलाके की जानकारी अपडेट करने के लिए, accounts.regions.patch
वाला तरीका अपनाएं. यह तरीका अपनाने के लिए, आपके पास एडमिन ऐक्सेस होना ज़रूरी है.
अनुरोध का सैंपल यहां दिया गया है:
PATCH https://merchantapi.googleapis.com/accounts/v1beta/accounts/102959835/regions/987654?updateMask=displayName%2CpostalCodeArea&key=[YOUR_API_KEY] HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json
{
"displayName": "Test",
"postalCodeArea": {
"postalCodes": [
{
"begin": "98108"
}
],
"regionCode": "US"
}
}
यहां किसी कॉल के सफल होने पर मिलने वाले जवाब का सैंपल दिया गया है:
{
"name": "accounts/102959835/regions/987654",
"displayName": "Test",
"postalCodeArea": {
"regionCode": "US",
"postalCodes": [
{
"begin": "98108"
}
]
},
"regionalInventoryEligible": true,
"shippingEligible": true
}
किसी इलाके की जानकारी मिटाना
अपने Merchant Center खाते से किसी इलाके की जानकारी मिटाने के लिए, accounts.regions.delete
वाला तरीका अपनाएं. यह तरीका अपनाने के लिए, आपके पास एडमिन ऐक्सेस होना ज़रूरी है.
अनुरोध का सैंपल यहां दिया गया है:
DELETE https://merchantapi.googleapis.com/accounts/v1beta/accounts/102959835/regions/987654?key=[YOUR_API_KEY] HTTP/1.1
यहां किसी कॉल के सही तरीके से पूरा होने पर मिलने वाले जवाब का सैंपल दिया गया है:
HTTP/1.1 200
{}