ลิงก์ Business Profile

หากต้องการระบุสินค้าคงคลังในร้านให้กับ 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