ลิงก์ 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