หากต้องการระบุสินค้าคงคลังในร้านให้กับ Merchant Center คุณต้องระบุธุรกิจที่ Merchant Center จะรับผิดชอบก่อน คุณดูรายการกลุ่มสถานที่ตั้งธุรกิจที่เป็นไปได้จาก Business Profile ผ่าน Content API ได้ แต่จะต้องขอสิทธิ์เข้าถึง Business Profile ก่อน
ขอสิทธิ์เข้าถึง Business Profile
หากต้องการขอสิทธิ์เข้าถึง Business Profile ให้ใช้วิธี
liasettings.requestgmbaccess
ต่อไปนี้
POST https://shoppingcontent.googleapis.com/content/v2.1/12345/liasettings/67890/requestgmbaccess?gmbEmail=admin@example.com
ดังตัวอย่างนี้ gmbEmail
พารามิเตอร์การค้นหาจะระบุอีเมล
ของผู้ดูแลระบบสำหรับ Business Profile
หลังจากเรียกใช้เมธอดนี้ ผู้ดูแลระบบที่ระบุจะได้รับอีเมล ขอให้ยอมรับหรือปฏิเสธคำขอเข้าถึง คำขอนี้จะหมดอายุหลังจากผ่านไป 7 วัน หากผู้ดูแลระบบไม่ดำเนินการใดๆ
แสดงรายการกลุ่มสถานที่ตั้งธุรกิจที่ใช้ได้
เมื่อได้รับอนุญาตให้เข้าถึงแล้ว คุณจะดูธุรกิจที่พร้อมให้บริการได้โดยการเรียกใช้เมธอด
liasettings.getaccessiblegmbaccounts
GET https://shoppingcontent.googleapis.com/content/v2.1/12345/liasettings/67890/accessiblegmbaccounts
Response:
200 OK
{
"kind": "content#liasettingsGetAccessibleGmbAccountsResponse",
"accountId": 67890,
"gmbAccounts": [{
"type" : "user",
"email" : "admin@example.com",
"name" : "admin@example.com",
"listingCount": 82
},
{
"type" : "business",
"email" : "california@example.com",
"name" : "Golden-State",
"listingCount" : 20
},
{
"type" : "business",
"email" : "florida@example.com",
"name" : "Sunshine-State",
"listingCount" : 15
},
{
"type" : "business",
"email" : "newyork@example.com",
"name" : "Empire-State",
"listingCount" : 25
}]
}
ระบุกลุ่มสถานที่ตั้งธุรกิจสำหรับบัญชี Merchant Center
ตอนนี้คุณมีรายชื่อกลุ่มสถานที่ตั้งธุรกิจที่เป็นไปได้แล้ว คุณต้องตั้งค่าฟิลด์
googleMyBusinessLink
ในแหล่งข้อมูล
Accounts
ที่เชื่อมโยง
กับบัญชี Merchant Center เป็นกลุ่มที่ต้องการ ตัวอย่างเช่น หาก Merchant
Center 67890 มีผลิตภัณฑ์สำหรับธุรกิจที่อยู่ในแคลิฟอร์เนีย คุณสามารถใช้
Accounts.update
เพื่อตั้งค่า
ข้อมูลดังกล่าวได้
PUT https://shoppingcontent.googleapis.com/content/v2/12345/accounts/67890
{
"googleMyBusinessLink" : {
"gmbEmail": "california@example.com"
}
}
Response:
200 OK
{
"kind": "content#account",
"id": 67890,
"googleMyBusinessLink" : {
"gmbEmail": "california@example.com",
"status" : "active"
}
}
การตั้งค่าฟิลด์ googleMyBusinessLink
ไม่ต้องมีการยืนยันด้วยตนเอง
สถานะของลิงก์จึงจะมีผลทันที
ส่งข้อมูลผลิตภัณฑ์และสินค้าคงคลัง
เมื่อเชื่อมโยง Merchant Center กับกลุ่มสถานที่ตั้งธุรกิจแล้ว คุณจะระบุข้อมูลผลิตภัณฑ์ในร้านและข้อมูลสินค้าคงคลังของผลิตภัณฑ์ในร้านสำหรับธุรกิจเหล่านั้นได้
โดยคุณใช้วิธีการเดียวกัน เช่น products.insert
ที่ใช้ในการอัปโหลดข้อมูลผลิตภัณฑ์และสินค้าคงคลังออนไลน์
สำหรับ products.insert
คุณจะระบุช่องทางของ local
แทน online