rocket
ขอแนะนำ
Merchant API
ซึ่งเป็นเวอร์ชันต่อไปอย่างเป็นทางการของ Content API for Shopping
update
รับข้อมูลล่าสุด
เกี่ยวกับฟีเจอร์ใหม่ การแก้ไขข้อบกพร่อง และการอัปเดตของ Merchant API
add_alert
หมายเหตุ: Content API for Shopping จะหยุดให้บริการในวันที่ 18 สิงหาคม 2026
ลิงก์ 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
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-13 UTC
[null,null,["อัปเดตล่าสุด 2025-08-13 UTC"],[[["\u003cp\u003eThe Merchant API is the new version of the Content API for Shopping and its future.\u003c/p\u003e\n"],["\u003cp\u003eTo provide local inventory, you must first link your Merchant Center to your Business Profile.\u003c/p\u003e\n"],["\u003cp\u003eAccess to the Business Profile is requested via the \u003ccode\u003eliasettings.requestgmbaccess\u003c/code\u003e method and granted by the Business Profile administrator.\u003c/p\u003e\n"],["\u003cp\u003eAfter access is granted, you can specify the business group for your Merchant Center and submit local product and inventory data.\u003c/p\u003e\n"]]],["The Merchant API beta, a new version of the Content API for Shopping, is introduced. To provide local inventory, first request Business Profile access via the `liasettings.requestgmbaccess` method, specifying the administrator's email. Once granted, use `liasettings.getaccessiblegmbaccounts` to list available business groups. Associate the Merchant Center account with a business group by setting the `googleMyBusinessLink` field via `Accounts.update`. Finally, submit local product and inventory data using methods like `products.insert`, specifying the \"local\" channel.\n"],null,["# Link your Business Profile\n\nTo provide local inventory to the Merchant Center, you must first specify which\nbusinesses the Merchant Center will be responsible for. You can get the list of\npossible business groups from the Business Profile via the Content API, but you'll need\nto request access to the Business Profile first.\n\nRequest access to a Business Profile\n------------------------------------\n\nTo request access to your Business Profile, use the\n[`liasettings.requestgmbaccess`](/shopping-content/reference/rest/v2.1/liasettings/requestgmbaccess)\nmethod: \n\n POST https://shoppingcontent.googleapis.com/content/v2.1/12345/liasettings/67890/requestgmbaccess?gmbEmail=admin@example.com\n\nAs this example shows, the `gmbEmail` query parameter specifies the email\naddress of the administrator for the Business Profile.\n\nAfter you call this method, the specified administrator will receive an email\nasking them to accept or reject the access request. This request expires after\n7 days if no action is taken by the administrator.\n\nList the available business groups\n----------------------------------\n\nOnce access has been permitted, you can see which businesses are available by\ncalling the\n[`liasettings.getaccessiblegmbaccounts`](/shopping-content/reference/rest/v2.1/liasettings/getaccessiblegmbaccounts)\nmethod: \n\n GET https://shoppingcontent.googleapis.com/content/v2.1/12345/liasettings/67890/accessiblegmbaccounts\n\n Response:\n 200 OK\n {\n \"kind\": \"content#liasettingsGetAccessibleGmbAccountsResponse\",\n \"accountId\": 67890,\n \"gmbAccounts\": [{\n \"type\" : \"user\",\n \"email\" : \"admin@example.com\",\n \"name\" : \"admin@example.com\",\n \"listingCount\": 82\n },\n {\n \"type\" : \"business\",\n \"email\" : \"california@example.com\",\n \"name\" : \"Golden-State\",\n \"listingCount\" : 20\n },\n {\n \"type\" : \"business\",\n \"email\" : \"florida@example.com\",\n \"name\" : \"Sunshine-State\",\n \"listingCount\" : 15\n },\n {\n \"type\" : \"business\",\n \"email\" : \"newyork@example.com\",\n \"name\" : \"Empire-State\",\n \"listingCount\" : 25\n }]\n }\n\nSpecify the business group for the Merchant Center account\n----------------------------------------------------------\n\nNow that you have a list of possible business groups, you need to set the\n`googleMyBusinessLink` field in the\n[`Accounts`](/shopping-content/reference/rest/v2.1/accounts) resource associated\nwith the Merchant Center account to the desired one. For example, if Merchant\nCenter 67890 will contain products for California-based businesses, you can use\n[`Accounts.update`](/shopping-content/reference/rest/v2.1/accounts/update) to set that\ninformation: \n\n PUT https://shoppingcontent.googleapis.com/content/v2/12345/accounts/67890\n {\n \"googleMyBusinessLink\" : {\n \"gmbEmail\": \"california@example.com\"\n }\n }\n\n Response:\n 200 OK\n {\n \"kind\": \"content#account\",\n \"id\": 67890,\n \"googleMyBusinessLink\" : {\n \"gmbEmail\": \"california@example.com\",\n \"status\" : \"active\"\n }\n }\n\nSetting the `googleMyBusinessLink` field does not require any manual\nverification, so the status of the link will be reflected immediately.\n\nSubmit product and inventory data\n---------------------------------\n\nNow that the Merchant Center is associated with a business group, you can\nprovide local product and local product inventory data for those businesses.\nFor this, you use the same methods, such as\n[`products.insert`](/shopping-content/reference/rest/v2.1/products/insert) that you\nuse to upload online products and inventory data.\nFor `products.insert`, you'll specify a channel of `local` instead of `online`.\n| **Note:** There are separate requirements for [local product feeds](https://support.google.com/merchants/answer/3061198) and [local product inventory feeds](https://support.google.com/merchants/answer/3061342), so make sure you're providing all the necessary information."]]